@sixbell-telco/sdk 0.1.0
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/_index.scss +137 -0
- package/assets/fonts/Poppins-Black.ttf +0 -0
- package/assets/fonts/Poppins-BlackItalic.ttf +0 -0
- package/assets/fonts/Poppins-Bold.ttf +0 -0
- package/assets/fonts/Poppins-BoldItalic.ttf +0 -0
- package/assets/fonts/Poppins-ExtraBold.ttf +0 -0
- package/assets/fonts/Poppins-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Poppins-ExtraLight.ttf +0 -0
- package/assets/fonts/Poppins-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Poppins-Italic.ttf +0 -0
- package/assets/fonts/Poppins-Light.ttf +0 -0
- package/assets/fonts/Poppins-LightItalic.ttf +0 -0
- package/assets/fonts/Poppins-Medium.ttf +0 -0
- package/assets/fonts/Poppins-MediumItalic.ttf +0 -0
- package/assets/fonts/Poppins-Regular.ttf +0 -0
- package/assets/fonts/Poppins-SemiBold.ttf +0 -0
- package/assets/fonts/Poppins-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Poppins-Thin.ttf +0 -0
- package/assets/fonts/Poppins-ThinItalic.ttf +0 -0
- package/assets/icons/icons.svg +1021 -0
- package/assets/styles/combobox.scss +449 -0
- package/assets/styles/fonts.scss +85 -0
- package/assets/styles/toast.scss +55 -0
- package/components/accordion/accordion-item/accordion-item.component.d.ts +19 -0
- package/components/accordion/index.d.ts +5 -0
- package/components/accordion/public-api.d.ts +2 -0
- package/components/accordion/src/accordion.component.d.ts +7 -0
- package/components/avatar/index.d.ts +5 -0
- package/components/avatar/public-api.d.ts +1 -0
- package/components/avatar/src/avatar.component.d.ts +30 -0
- package/components/button/index.d.ts +5 -0
- package/components/button/public-api.d.ts +1 -0
- package/components/button/src/button.component.d.ts +35 -0
- package/components/card/index.d.ts +5 -0
- package/components/card/public-api.d.ts +1 -0
- package/components/card/src/card.component.d.ts +16 -0
- package/components/countdown/index.d.ts +5 -0
- package/components/countdown/public-api.d.ts +1 -0
- package/components/countdown/src/countdown.component.d.ts +30 -0
- package/components/dropdown/index.d.ts +5 -0
- package/components/dropdown/public-api.d.ts +1 -0
- package/components/dropdown/src/dropdown.component.d.ts +39 -0
- package/components/dual-list/index.d.ts +5 -0
- package/components/dual-list/public-api.d.ts +1 -0
- package/components/dual-list/src/dual-list.component.d.ts +82 -0
- package/components/file-upload/file-dropzone/index.d.ts +5 -0
- package/components/file-upload/file-dropzone/public-api.d.ts +1 -0
- package/components/file-upload/file-dropzone/src/file-dropzone.component.d.ts +14 -0
- package/components/file-upload/file-uploader/index.d.ts +5 -0
- package/components/file-upload/file-uploader/public-api.d.ts +1 -0
- package/components/file-upload/file-uploader/src/file-uploader.component.d.ts +43 -0
- package/components/forms/checkbox/index.d.ts +5 -0
- package/components/forms/checkbox/public-api.d.ts +1 -0
- package/components/forms/checkbox/src/checkbox.component.d.ts +29 -0
- package/components/forms/combobox/index.d.ts +5 -0
- package/components/forms/combobox/public-api.d.ts +1 -0
- package/components/forms/combobox/src/combobox.component.d.ts +53 -0
- package/components/forms/datepicker/index.d.ts +5 -0
- package/components/forms/datepicker/public-api.d.ts +2 -0
- package/components/forms/datepicker/src/datepicker-format-month.pipe.d.ts +10 -0
- package/components/forms/datepicker/src/datepicker.component.d.ts +52 -0
- package/components/forms/form-error/index.d.ts +5 -0
- package/components/forms/form-error/public-api.d.ts +1 -0
- package/components/forms/form-error/src/form-error.component.d.ts +17 -0
- package/components/forms/input/index.d.ts +5 -0
- package/components/forms/input/public-api.d.ts +1 -0
- package/components/forms/input/src/input.component.d.ts +51 -0
- package/components/forms/radio/index.d.ts +5 -0
- package/components/forms/radio/public-api.d.ts +1 -0
- package/components/forms/radio/src/radio.component.d.ts +20 -0
- package/components/forms/range/index.d.ts +5 -0
- package/components/forms/range/public-api.d.ts +1 -0
- package/components/forms/range/src/range.component.d.ts +37 -0
- package/components/forms/select/index.d.ts +5 -0
- package/components/forms/select/public-api.d.ts +1 -0
- package/components/forms/select/src/select.component.d.ts +43 -0
- package/components/forms/switch/index.d.ts +5 -0
- package/components/forms/switch/public-api.d.ts +1 -0
- package/components/forms/switch/src/switch.component.d.ts +29 -0
- package/components/forms/textarea/index.d.ts +5 -0
- package/components/forms/textarea/public-api.d.ts +1 -0
- package/components/forms/textarea/src/textarea.component.d.ts +49 -0
- package/components/forms/toggle/index.d.ts +5 -0
- package/components/forms/toggle/public-api.d.ts +1 -0
- package/components/forms/toggle/src/toggle.component.d.ts +27 -0
- package/components/icon/index.d.ts +5 -0
- package/components/icon/public-api.d.ts +2 -0
- package/components/icon/src/icon.component.d.ts +17 -0
- package/components/icon/src/icon.d.ts +1 -0
- package/components/link/index.d.ts +5 -0
- package/components/link/public-api.d.ts +1 -0
- package/components/link/src/link.component.d.ts +49 -0
- package/components/modal/index.d.ts +5 -0
- package/components/modal/public-api.d.ts +1 -0
- package/components/modal/src/modal.component.d.ts +25 -0
- package/components/notification/index.d.ts +5 -0
- package/components/notification/public-api.d.ts +1 -0
- package/components/notification/src/notification.component.d.ts +20 -0
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +20 -0
- package/components/paginator/index.d.ts +5 -0
- package/components/paginator/public-api.d.ts +2 -0
- package/components/paginator/src/paginator.component.d.ts +18 -0
- package/components/product-card/directives/product-card-actions.directive.d.ts +7 -0
- package/components/product-card/directives/product-card-content.directive.d.ts +7 -0
- package/components/product-card/directives/product-card-header.directive.d.ts +7 -0
- package/components/product-card/index.d.ts +5 -0
- package/components/product-card/public-api.d.ts +4 -0
- package/components/product-card/src/product-card.component.d.ts +46 -0
- package/components/progress/index.d.ts +5 -0
- package/components/progress/public-api.d.ts +1 -0
- package/components/progress/src/progress.component.d.ts +17 -0
- package/components/tab/directives/tab-content/tab-content.directive.d.ts +18 -0
- package/components/tab/directives/tab-header/tab-header.directive.d.ts +20 -0
- package/components/tab/index.d.ts +5 -0
- package/components/tab/public-api.d.ts +3 -0
- package/components/tab/src/tab.component.d.ts +22 -0
- package/components/table/index.d.ts +5 -0
- package/components/table/public-api.d.ts +3 -0
- package/components/table/src/table.component.d.ts +55 -0
- package/components/table/table-header-checkbox/table-header-checkbox.component.d.ts +12 -0
- package/components/table/table-row-checkbox/table-row-checkbox.component.d.ts +13 -0
- package/components/toast/index.d.ts +5 -0
- package/components/toast/public-api.d.ts +3 -0
- package/components/toast/services/toast.service.d.ts +33 -0
- package/components/toast/toast-message/toast-message.component.d.ts +22 -0
- package/components/toast/toasts-container/toasts-container.component.d.ts +19 -0
- package/components/tooltip/index.d.ts +5 -0
- package/components/tooltip/public-api.d.ts +1 -0
- package/components/tooltip/src/tooltip.component.d.ts +15 -0
- package/components/wizard/index.d.ts +5 -0
- package/components/wizard/public-api.d.ts +5 -0
- package/components/wizard/wizard-content/wizard-content.component.d.ts +18 -0
- package/components/wizard/wizard-marker/wizard-marker.component.d.ts +9 -0
- package/components/wizard/wizard-step/wizard-step.component.d.ts +15 -0
- package/components/wizard/wizard-sub-step/wizard-sub-step.component.d.ts +13 -0
- package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +23 -0
- package/directives/typography/index.d.ts +5 -0
- package/directives/typography/public-api.d.ts +1 -0
- package/directives/typography/src/typography.directive.d.ts +19 -0
- package/esm2022/components/accordion/accordion-item/accordion-item.component.mjs +44 -0
- package/esm2022/components/accordion/public-api.mjs +3 -0
- package/esm2022/components/accordion/sixbell-telco-sdk-components-accordion.mjs +5 -0
- package/esm2022/components/accordion/src/accordion.component.mjs +13 -0
- package/esm2022/components/avatar/public-api.mjs +2 -0
- package/esm2022/components/avatar/sixbell-telco-sdk-components-avatar.mjs +5 -0
- package/esm2022/components/avatar/src/avatar.component.mjs +73 -0
- package/esm2022/components/button/public-api.mjs +2 -0
- package/esm2022/components/button/sixbell-telco-sdk-components-button.mjs +5 -0
- package/esm2022/components/button/src/button.component.mjs +146 -0
- package/esm2022/components/card/public-api.mjs +2 -0
- package/esm2022/components/card/sixbell-telco-sdk-components-card.mjs +5 -0
- package/esm2022/components/card/src/card.component.mjs +54 -0
- package/esm2022/components/countdown/public-api.mjs +2 -0
- package/esm2022/components/countdown/sixbell-telco-sdk-components-countdown.mjs +5 -0
- package/esm2022/components/countdown/src/countdown.component.mjs +53 -0
- package/esm2022/components/dropdown/public-api.mjs +2 -0
- package/esm2022/components/dropdown/sixbell-telco-sdk-components-dropdown.mjs +5 -0
- package/esm2022/components/dropdown/src/dropdown.component.mjs +147 -0
- package/esm2022/components/dual-list/public-api.mjs +2 -0
- package/esm2022/components/dual-list/sixbell-telco-sdk-components-dual-list.mjs +5 -0
- package/esm2022/components/dual-list/src/dual-list.component.mjs +206 -0
- package/esm2022/components/file-upload/file-dropzone/public-api.mjs +2 -0
- package/esm2022/components/file-upload/file-dropzone/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +5 -0
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +36 -0
- package/esm2022/components/file-upload/file-uploader/public-api.mjs +2 -0
- package/esm2022/components/file-upload/file-uploader/sixbell-telco-sdk-components-file-upload-file-uploader.mjs +5 -0
- package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +116 -0
- package/esm2022/components/forms/checkbox/public-api.mjs +2 -0
- package/esm2022/components/forms/checkbox/sixbell-telco-sdk-components-forms-checkbox.mjs +5 -0
- package/esm2022/components/forms/checkbox/src/checkbox.component.mjs +91 -0
- package/esm2022/components/forms/combobox/public-api.mjs +2 -0
- package/esm2022/components/forms/combobox/sixbell-telco-sdk-components-forms-combobox.mjs +5 -0
- package/esm2022/components/forms/combobox/src/combobox.component.mjs +164 -0
- package/esm2022/components/forms/datepicker/public-api.mjs +3 -0
- package/esm2022/components/forms/datepicker/sixbell-telco-sdk-components-forms-datepicker.mjs +5 -0
- package/esm2022/components/forms/datepicker/src/datepicker-format-month.pipe.mjs +20 -0
- package/esm2022/components/forms/datepicker/src/datepicker.component.mjs +187 -0
- package/esm2022/components/forms/form-error/public-api.mjs +2 -0
- package/esm2022/components/forms/form-error/sixbell-telco-sdk-components-forms-form-error.mjs +5 -0
- package/esm2022/components/forms/form-error/src/form-error.component.mjs +32 -0
- package/esm2022/components/forms/input/public-api.mjs +2 -0
- package/esm2022/components/forms/input/sixbell-telco-sdk-components-forms-input.mjs +5 -0
- package/esm2022/components/forms/input/src/input.component.mjs +188 -0
- package/esm2022/components/forms/radio/public-api.mjs +2 -0
- package/esm2022/components/forms/radio/sixbell-telco-sdk-components-forms-radio.mjs +5 -0
- package/esm2022/components/forms/radio/src/radio.component.mjs +60 -0
- package/esm2022/components/forms/range/public-api.mjs +2 -0
- package/esm2022/components/forms/range/sixbell-telco-sdk-components-forms-range.mjs +5 -0
- package/esm2022/components/forms/range/src/range.component.mjs +102 -0
- package/esm2022/components/forms/select/public-api.mjs +2 -0
- package/esm2022/components/forms/select/sixbell-telco-sdk-components-forms-select.mjs +5 -0
- package/esm2022/components/forms/select/src/select.component.mjs +147 -0
- package/esm2022/components/forms/switch/public-api.mjs +2 -0
- package/esm2022/components/forms/switch/sixbell-telco-sdk-components-forms-switch.mjs +5 -0
- package/esm2022/components/forms/switch/src/switch.component.mjs +107 -0
- package/esm2022/components/forms/textarea/public-api.mjs +2 -0
- package/esm2022/components/forms/textarea/sixbell-telco-sdk-components-forms-textarea.mjs +5 -0
- package/esm2022/components/forms/textarea/src/textarea.component.mjs +181 -0
- package/esm2022/components/forms/toggle/public-api.mjs +2 -0
- package/esm2022/components/forms/toggle/sixbell-telco-sdk-components-forms-toggle.mjs +5 -0
- package/esm2022/components/forms/toggle/src/toggle.component.mjs +381 -0
- package/esm2022/components/icon/public-api.mjs +3 -0
- package/esm2022/components/icon/sixbell-telco-sdk-components-icon.mjs +5 -0
- package/esm2022/components/icon/src/icon.component.mjs +42 -0
- package/esm2022/components/icon/src/icon.mjs +2 -0
- package/esm2022/components/link/public-api.mjs +2 -0
- package/esm2022/components/link/sixbell-telco-sdk-components-link.mjs +5 -0
- package/esm2022/components/link/src/link.component.mjs +210 -0
- package/esm2022/components/modal/public-api.mjs +2 -0
- package/esm2022/components/modal/sixbell-telco-sdk-components-modal.mjs +5 -0
- package/esm2022/components/modal/src/modal.component.mjs +71 -0
- package/esm2022/components/notification/public-api.mjs +2 -0
- package/esm2022/components/notification/sixbell-telco-sdk-components-notification.mjs +5 -0
- package/esm2022/components/notification/src/notification.component.mjs +55 -0
- package/esm2022/components/paginator/components/pagination-item/pagination-item.component.mjs +109 -0
- package/esm2022/components/paginator/public-api.mjs +3 -0
- package/esm2022/components/paginator/sixbell-telco-sdk-components-paginator.mjs +5 -0
- package/esm2022/components/paginator/src/paginator.component.mjs +47 -0
- package/esm2022/components/product-card/directives/product-card-actions.directive.mjs +15 -0
- package/esm2022/components/product-card/directives/product-card-content.directive.mjs +15 -0
- package/esm2022/components/product-card/directives/product-card-header.directive.mjs +15 -0
- package/esm2022/components/product-card/public-api.mjs +5 -0
- package/esm2022/components/product-card/sixbell-telco-sdk-components-product-card.mjs +5 -0
- package/esm2022/components/product-card/src/product-card.component.mjs +141 -0
- package/esm2022/components/progress/public-api.mjs +2 -0
- package/esm2022/components/progress/sixbell-telco-sdk-components-progress.mjs +5 -0
- package/esm2022/components/progress/src/progress.component.mjs +43 -0
- package/esm2022/components/tab/directives/tab-content/tab-content.directive.mjs +45 -0
- package/esm2022/components/tab/directives/tab-header/tab-header.directive.mjs +54 -0
- package/esm2022/components/tab/public-api.mjs +4 -0
- package/esm2022/components/tab/sixbell-telco-sdk-components-tab.mjs +5 -0
- package/esm2022/components/tab/src/tab.component.mjs +42 -0
- package/esm2022/components/table/public-api.mjs +4 -0
- package/esm2022/components/table/sixbell-telco-sdk-components-table.mjs +5 -0
- package/esm2022/components/table/src/table.component.mjs +141 -0
- package/esm2022/components/table/table-header-checkbox/table-header-checkbox.component.mjs +24 -0
- package/esm2022/components/table/table-row-checkbox/table-row-checkbox.component.mjs +25 -0
- package/esm2022/components/toast/public-api.mjs +4 -0
- package/esm2022/components/toast/services/toast.service.mjs +77 -0
- package/esm2022/components/toast/sixbell-telco-sdk-components-toast.mjs +5 -0
- package/esm2022/components/toast/toast-message/toast-message.component.mjs +71 -0
- package/esm2022/components/toast/toasts-container/toasts-container.component.mjs +49 -0
- package/esm2022/components/tooltip/public-api.mjs +2 -0
- package/esm2022/components/tooltip/sixbell-telco-sdk-components-tooltip.mjs +5 -0
- package/esm2022/components/tooltip/src/tooltip.component.mjs +45 -0
- package/esm2022/components/wizard/public-api.mjs +6 -0
- package/esm2022/components/wizard/sixbell-telco-sdk-components-wizard.mjs +5 -0
- package/esm2022/components/wizard/wizard-content/wizard-content.component.mjs +30 -0
- package/esm2022/components/wizard/wizard-marker/wizard-marker.component.mjs +24 -0
- package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +43 -0
- package/esm2022/components/wizard/wizard-sub-step/wizard-sub-step.component.mjs +34 -0
- package/esm2022/components/wizard/wizard-wrapper/wizard-wrapper.component.mjs +94 -0
- package/esm2022/directives/typography/public-api.mjs +2 -0
- package/esm2022/directives/typography/sixbell-telco-sdk-directives-typography.mjs +5 -0
- package/esm2022/directives/typography/src/typography.directive.mjs +57 -0
- package/esm2022/public_api.mjs +2 -0
- package/esm2022/sixbell-telco-sdk.mjs +5 -0
- package/esm2022/utils/cn/public-api.mjs +2 -0
- package/esm2022/utils/cn/sixbell-telco-sdk-utils-cn.mjs +5 -0
- package/esm2022/utils/cn/src/cn.mjs +6 -0
- package/esm2022/utils/generators/uuid/public-api.mjs +2 -0
- package/esm2022/utils/generators/uuid/sixbell-telco-sdk-utils-generators-uuid.mjs +5 -0
- package/esm2022/utils/generators/uuid/src/uuid.mjs +5 -0
- package/esm2022/utils/pipes/extract-extension/public-api.mjs +2 -0
- package/esm2022/utils/pipes/extract-extension/sixbell-telco-sdk-utils-pipes-extract-extension.mjs +5 -0
- package/esm2022/utils/pipes/extract-extension/src/extract-extension.mjs +30 -0
- package/esm2022/utils/pipes/to-bytes-extesion/public-api.mjs +2 -0
- package/esm2022/utils/pipes/to-bytes-extesion/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +5 -0
- package/esm2022/utils/pipes/to-bytes-extesion/src/to-bytes.pipe.mjs +29 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +61 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +79 -0
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +153 -0
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +61 -0
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs +60 -0
- package/fesm2022/sixbell-telco-sdk-components-countdown.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +154 -0
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +213 -0
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +43 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs +123 -0
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +98 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +171 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +209 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +39 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +195 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +67 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +109 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +154 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +114 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +188 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +388 -0
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +49 -0
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +217 -0
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs +78 -0
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +62 -0
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +160 -0
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +184 -0
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +50 -0
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +140 -0
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +187 -0
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +196 -0
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +52 -0
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +212 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +64 -0
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-cn.mjs +13 -0
- package/fesm2022/sixbell-telco-sdk-utils-cn.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-generators-uuid.mjs +12 -0
- package/fesm2022/sixbell-telco-sdk-utils-generators-uuid.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-pipes-extract-extension.mjs +37 -0
- package/fesm2022/sixbell-telco-sdk-utils-pipes-extract-extension.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs +36 -0
- package/fesm2022/sixbell-telco-sdk-utils-pipes-to-bytes-extesion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk.mjs +8 -0
- package/fesm2022/sixbell-telco-sdk.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +273 -0
- package/public_api.d.ts +1 -0
- package/utils/cn/index.d.ts +5 -0
- package/utils/cn/public-api.d.ts +1 -0
- package/utils/cn/src/cn.d.ts +2 -0
- package/utils/generators/uuid/index.d.ts +5 -0
- package/utils/generators/uuid/public-api.d.ts +1 -0
- package/utils/generators/uuid/src/uuid.d.ts +1 -0
- package/utils/pipes/extract-extension/index.d.ts +5 -0
- package/utils/pipes/extract-extension/public-api.d.ts +1 -0
- package/utils/pipes/extract-extension/src/extract-extension.d.ts +8 -0
- package/utils/pipes/to-bytes-extesion/index.d.ts +5 -0
- package/utils/pipes/to-bytes-extesion/public-api.d.ts +1 -0
- package/utils/pipes/to-bytes-extesion/src/to-bytes.pipe.d.ts +8 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { NgClass } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, model, computed, output, effect, Component } from '@angular/core';
|
|
4
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
import * as i1 from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
7
|
+
import { FormErrorsComponent } from '@sixbell-telco/sdk/components/forms/form-error';
|
|
8
|
+
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
9
|
+
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
10
|
+
import { cva } from 'class-variance-authority';
|
|
11
|
+
import { Subject, switchMap, skip, debounceTime, distinctUntilChanged } from 'rxjs';
|
|
12
|
+
|
|
13
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
|
+
const textarea = cva(['font-body', 'text-base', 'transition', 'duration-300', 'ease-ease-out-back', 'w-full'], {
|
|
15
|
+
variants: {
|
|
16
|
+
variant: {
|
|
17
|
+
primary: ['textarea', 'textarea-primary'],
|
|
18
|
+
secondary: ['textarea', 'textarea-secondary'],
|
|
19
|
+
success: ['textarea', 'textarea-success'],
|
|
20
|
+
error: ['textarea', 'textarea-error'],
|
|
21
|
+
warning: ['textarea', 'textarea-warning'],
|
|
22
|
+
},
|
|
23
|
+
shape: {
|
|
24
|
+
'round-none': ['rounded-none'],
|
|
25
|
+
'round-sm': ['rounded-btn-sm'],
|
|
26
|
+
'round-md': ['rounded-btn-md'],
|
|
27
|
+
'round-lg': ['rounded-btn-lg'],
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
sm: ['min-h-10', 'h-10'],
|
|
31
|
+
md: ['min-h-11', 'h-11'],
|
|
32
|
+
lg: ['min-h-12', 'h-12'],
|
|
33
|
+
xl: ['min-h-14', 'h-14'],
|
|
34
|
+
'2xl': ['min-h-16', 'h-16'],
|
|
35
|
+
'3xl': ['min-h-20', 'h-20'],
|
|
36
|
+
'4xl': ['min-h-24', 'h-24'],
|
|
37
|
+
},
|
|
38
|
+
padding: {
|
|
39
|
+
sm: ['px-4'],
|
|
40
|
+
md: ['px-6'],
|
|
41
|
+
lg: ['px-8'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
compoundVariants: [],
|
|
45
|
+
defaultVariants: {
|
|
46
|
+
variant: 'secondary',
|
|
47
|
+
shape: 'round-sm',
|
|
48
|
+
size: 'md',
|
|
49
|
+
padding: 'md',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
class TextareaComponent {
|
|
53
|
+
// Base input properties
|
|
54
|
+
variants = input({ variant: 'secondary', shape: 'round-sm', size: 'md', padding: 'md' });
|
|
55
|
+
class = input('');
|
|
56
|
+
label = input('');
|
|
57
|
+
name = input(null);
|
|
58
|
+
placeholder = input('');
|
|
59
|
+
rows = input(3);
|
|
60
|
+
// Textarea value model
|
|
61
|
+
value = model('');
|
|
62
|
+
// Textarea counter properties
|
|
63
|
+
maxCharacters = input(0);
|
|
64
|
+
invalidMaxCharacters = computed(() => this.value().length > this.maxCharacters());
|
|
65
|
+
// Form control properties
|
|
66
|
+
parentForm = input(null);
|
|
67
|
+
formControlName = input('');
|
|
68
|
+
get formField() {
|
|
69
|
+
if (!this.parentForm())
|
|
70
|
+
return null;
|
|
71
|
+
return this.parentForm()?.get(this.formControlName());
|
|
72
|
+
}
|
|
73
|
+
// ControlValueAccessor attributes
|
|
74
|
+
onControlChange = () => { };
|
|
75
|
+
onControlTouch = () => { };
|
|
76
|
+
disabled = model(false);
|
|
77
|
+
// ControlValueAccessor methods
|
|
78
|
+
writeValue(obj) {
|
|
79
|
+
this.value.set(obj);
|
|
80
|
+
}
|
|
81
|
+
registerOnChange(fn) {
|
|
82
|
+
this.onControlChange = fn;
|
|
83
|
+
}
|
|
84
|
+
registerOnTouched(fn) {
|
|
85
|
+
this.onControlTouch = fn;
|
|
86
|
+
}
|
|
87
|
+
setDisabledState(isDisabled) {
|
|
88
|
+
this.disabled.set(isDisabled);
|
|
89
|
+
}
|
|
90
|
+
// Change handler
|
|
91
|
+
handleChange() {
|
|
92
|
+
this.onControlChange(this.value());
|
|
93
|
+
}
|
|
94
|
+
// Enter handler
|
|
95
|
+
onEnter = output();
|
|
96
|
+
handleEnter() {
|
|
97
|
+
this.onEnter.emit(this.value());
|
|
98
|
+
this.onControlChange(this.value());
|
|
99
|
+
}
|
|
100
|
+
// Blur handler
|
|
101
|
+
handleBlur() {
|
|
102
|
+
this.onControlTouch();
|
|
103
|
+
}
|
|
104
|
+
// Debounce
|
|
105
|
+
onDebounceChange = output();
|
|
106
|
+
debounceTime = input(500);
|
|
107
|
+
debounceAction$ = new Subject();
|
|
108
|
+
debounceTimeEffect = effect(() => {
|
|
109
|
+
this.debounceAction$.next(this.debounceTime());
|
|
110
|
+
});
|
|
111
|
+
value$ = toObservable(this.value);
|
|
112
|
+
constructor() {
|
|
113
|
+
this.debounceAction$
|
|
114
|
+
.pipe(switchMap((time) => this.value$.pipe(skip(1), // skip 1 to avoid initial value being automatically emitted
|
|
115
|
+
debounceTime(time), distinctUntilChanged())), takeUntilDestroyed())
|
|
116
|
+
.subscribe((value) => {
|
|
117
|
+
this.onDebounceChange.emit(`${value}`);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
get classes() {
|
|
121
|
+
const variants = this.variants();
|
|
122
|
+
return cn(textarea({
|
|
123
|
+
variant: variants.variant,
|
|
124
|
+
shape: variants.shape,
|
|
125
|
+
size: variants.size,
|
|
126
|
+
padding: variants.padding,
|
|
127
|
+
class: this.class(),
|
|
128
|
+
}));
|
|
129
|
+
}
|
|
130
|
+
get errorClasses() {
|
|
131
|
+
const variants = this.variants();
|
|
132
|
+
return cn(textarea({
|
|
133
|
+
variant: 'error',
|
|
134
|
+
shape: variants.shape,
|
|
135
|
+
size: variants.size,
|
|
136
|
+
padding: variants.padding,
|
|
137
|
+
class: this.class(),
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
get successClasses() {
|
|
141
|
+
const variants = this.variants();
|
|
142
|
+
return cn(textarea({
|
|
143
|
+
variant: 'success',
|
|
144
|
+
shape: variants.shape,
|
|
145
|
+
size: variants.size,
|
|
146
|
+
padding: variants.padding,
|
|
147
|
+
class: this.class(),
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
|
+
get validationClasses() {
|
|
151
|
+
if (!this.formField)
|
|
152
|
+
return this.classes;
|
|
153
|
+
if (this.formField.dirty || this.formField.touched) {
|
|
154
|
+
if (this.formField.invalid) {
|
|
155
|
+
return this.errorClasses;
|
|
156
|
+
}
|
|
157
|
+
else if (this.formField.valid) {
|
|
158
|
+
return this.successClasses;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return this.classes;
|
|
162
|
+
}
|
|
163
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TextareaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
164
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.8", type: TextareaComponent, isStandalone: true, selector: "app-textarea", inputs: { variants: { classPropertyName: "variants", publicName: "variants", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, parentForm: { classPropertyName: "parentForm", publicName: "parentForm", isSignal: true, isRequired: false, transformFunction: null }, formControlName: { classPropertyName: "formControlName", publicName: "formControlName", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, debounceTime: { classPropertyName: "debounceTime", publicName: "debounceTime", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", onEnter: "onEnter", onDebounceChange: "onDebounceChange" }, providers: [
|
|
165
|
+
{
|
|
166
|
+
provide: NG_VALUE_ACCESSOR,
|
|
167
|
+
useExisting: TextareaComponent,
|
|
168
|
+
multi: true,
|
|
169
|
+
},
|
|
170
|
+
], ngImport: i0, template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span [typography]=\"{ variant: 'body', color: 'black' }\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<textarea\n\t\t[class]=\"validationClasses\"\n\t\t[attr.rows]=\"rows()\"\n\t\t[attr.name]=\"name()\"\n\t\t[attr.placeholder]=\"placeholder()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t></textarea>\n\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t@if (maxCharacters()) {\n\t\t\t<p\n\t\t\t\t[typography]=\"{ variant: 'body-xs', fontWeight: 'normal' }\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'text-neutral transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === false,\n\t\t\t\t\t'text-error transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === true,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ value().length }} de {{ maxCharacters() }} caracteres\n\t\t\t</p>\n\t\t}\n\t</div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["typography", "class"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
171
|
+
}
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: TextareaComponent, decorators: [{
|
|
173
|
+
type: Component,
|
|
174
|
+
args: [{ selector: 'app-textarea', standalone: true, imports: [FormsModule, TypographyDirective, FormErrorsComponent, NgClass], providers: [
|
|
175
|
+
{
|
|
176
|
+
provide: NG_VALUE_ACCESSOR,
|
|
177
|
+
useExisting: TextareaComponent,
|
|
178
|
+
multi: true,
|
|
179
|
+
},
|
|
180
|
+
], template: "<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span [typography]=\"{ variant: 'body', color: 'black' }\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<textarea\n\t\t[class]=\"validationClasses\"\n\t\t[attr.rows]=\"rows()\"\n\t\t[attr.name]=\"name()\"\n\t\t[attr.placeholder]=\"placeholder()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t></textarea>\n\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t@if (maxCharacters()) {\n\t\t\t<p\n\t\t\t\t[typography]=\"{ variant: 'body-xs', fontWeight: 'normal' }\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'text-neutral transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === false,\n\t\t\t\t\t'text-error transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === true,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ value().length }} de {{ maxCharacters() }} caracteres\n\t\t\t</p>\n\t\t}\n\t</div>\n</div>\n" }]
|
|
181
|
+
}], ctorParameters: () => [] });
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Generated bundle index. Do not edit.
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
export { TextareaComponent };
|
|
188
|
+
//# sourceMappingURL=sixbell-telco-sdk-components-forms-textarea.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sixbell-telco-sdk-components-forms-textarea.mjs","sources":["../../../projects/sdk/components/forms/textarea/src/textarea.component.ts","../../../projects/sdk/components/forms/textarea/src/textarea.component.html","../../../projects/sdk/components/forms/textarea/sixbell-telco-sdk-components-forms-textarea.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { NgClass } from '@angular/common';\nimport { Component, computed, effect, input, model, output } from '@angular/core';\nimport { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';\nimport { FormControl, FormGroup, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { FormErrorsComponent } from '@sixbell-telco/sdk/components/forms/form-error';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva, VariantProps } from 'class-variance-authority';\nimport { debounceTime, distinctUntilChanged, skip, Subject, switchMap } from 'rxjs';\n\nconst textarea = cva(['font-body', 'text-base', 'transition', 'duration-300', 'ease-ease-out-back', 'w-full'], {\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: ['textarea', 'textarea-primary'],\n\t\t\tsecondary: ['textarea', 'textarea-secondary'],\n\t\t\tsuccess: ['textarea', 'textarea-success'],\n\t\t\terror: ['textarea', 'textarea-error'],\n\t\t\twarning: ['textarea', 'textarea-warning'],\n\t\t},\n\t\tshape: {\n\t\t\t'round-none': ['rounded-none'],\n\t\t\t'round-sm': ['rounded-btn-sm'],\n\t\t\t'round-md': ['rounded-btn-md'],\n\t\t\t'round-lg': ['rounded-btn-lg'],\n\t\t},\n\t\tsize: {\n\t\t\tsm: ['min-h-10', 'h-10'],\n\t\t\tmd: ['min-h-11', 'h-11'],\n\t\t\tlg: ['min-h-12', 'h-12'],\n\t\t\txl: ['min-h-14', 'h-14'],\n\t\t\t'2xl': ['min-h-16', 'h-16'],\n\t\t\t'3xl': ['min-h-20', 'h-20'],\n\t\t\t'4xl': ['min-h-24', 'h-24'],\n\t\t},\n\t\tpadding: {\n\t\t\tsm: ['px-4'],\n\t\t\tmd: ['px-6'],\n\t\t\tlg: ['px-8'],\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'secondary',\n\t\tshape: 'round-sm',\n\t\tsize: 'md',\n\t\tpadding: 'md',\n\t},\n});\n\nexport type textareaVariantProps = VariantProps<typeof textarea>;\n\n@Component({\n\tselector: 'app-textarea',\n\tstandalone: true,\n\timports: [FormsModule, TypographyDirective, FormErrorsComponent, NgClass],\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: TextareaComponent,\n\t\t\tmulti: true,\n\t\t},\n\t],\n\ttemplateUrl: './textarea.component.html',\n})\nexport class TextareaComponent {\n\t// Base input properties\n\tvariants = input<textareaVariantProps>({ variant: 'secondary', shape: 'round-sm', size: 'md', padding: 'md' });\n\tclass = input<string>('');\n\tlabel = input<string>('');\n\tname = input<string | null>(null);\n\tplaceholder = input<string>('');\n\trows = input<string | number>(3);\n\n\t// Textarea value model\n\tvalue = model<string>('');\n\n\t// Textarea counter properties\n\tmaxCharacters = input<number>(0);\n\tinvalidMaxCharacters = computed<boolean>(() => this.value().length > this.maxCharacters());\n\n\t// Form control properties\n\tparentForm = input<FormGroup | null>(null);\n\tformControlName = input<string>('');\n\n\tget formField(): FormControl | null {\n\t\tif (!this.parentForm()) return null;\n\t\treturn this.parentForm()?.get(this.formControlName()) as FormControl;\n\t}\n\n\t// ControlValueAccessor attributes\n\tprivate onControlChange: any = () => {};\n\tprivate onControlTouch: any = () => {};\n\tdisabled = model<boolean>(false);\n\n\t// ControlValueAccessor methods\n\twriteValue(obj: any): void {\n\t\tthis.value.set(obj);\n\t}\n\n\tregisterOnChange(fn: any): void {\n\t\tthis.onControlChange = fn;\n\t}\n\n\tregisterOnTouched(fn: any): void {\n\t\tthis.onControlTouch = fn;\n\t}\n\n\tsetDisabledState?(isDisabled: boolean): void {\n\t\tthis.disabled.set(isDisabled);\n\t}\n\n\t// Change handler\n\thandleChange() {\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t// Enter handler\n\tonEnter = output<string>();\n\thandleEnter() {\n\t\tthis.onEnter.emit(this.value());\n\t\tthis.onControlChange(this.value());\n\t}\n\n\t// Blur handler\n\thandleBlur() {\n\t\tthis.onControlTouch();\n\t}\n\n\t// Debounce\n\tonDebounceChange = output<string>();\n\tdebounceTime = input(500);\n\tdebounceAction$ = new Subject<number>();\n\n\tdebounceTimeEffect = effect(() => {\n\t\tthis.debounceAction$.next(this.debounceTime());\n\t});\n\n\tvalue$ = toObservable(this.value);\n\n\tconstructor() {\n\t\tthis.debounceAction$\n\t\t\t.pipe(\n\t\t\t\tswitchMap((time: number) =>\n\t\t\t\t\tthis.value$.pipe(\n\t\t\t\t\t\tskip(1), // skip 1 to avoid initial value being automatically emitted\n\t\t\t\t\t\tdebounceTime(time),\n\t\t\t\t\t\tdistinctUntilChanged(),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttakeUntilDestroyed(),\n\t\t\t)\n\t\t\t.subscribe((value) => {\n\t\t\t\tthis.onDebounceChange.emit(`${value}`);\n\t\t\t});\n\t}\n\n\tget classes() {\n\t\tconst variants = this.variants();\n\t\treturn cn(\n\t\t\ttextarea({\n\t\t\t\tvariant: variants.variant,\n\t\t\t\tshape: variants.shape,\n\t\t\t\tsize: variants.size,\n\t\t\t\tpadding: variants.padding,\n\t\t\t\tclass: this.class(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget errorClasses() {\n\t\tconst variants = this.variants();\n\t\treturn cn(\n\t\t\ttextarea({\n\t\t\t\tvariant: 'error',\n\t\t\t\tshape: variants.shape,\n\t\t\t\tsize: variants.size,\n\t\t\t\tpadding: variants.padding,\n\t\t\t\tclass: this.class(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget successClasses() {\n\t\tconst variants = this.variants();\n\t\treturn cn(\n\t\t\ttextarea({\n\t\t\t\tvariant: 'success',\n\t\t\t\tshape: variants.shape,\n\t\t\t\tsize: variants.size,\n\t\t\t\tpadding: variants.padding,\n\t\t\t\tclass: this.class(),\n\t\t\t}),\n\t\t);\n\t}\n\n\tget validationClasses() {\n\t\tif (!this.formField) return this.classes;\n\n\t\tif (this.formField.dirty || this.formField.touched) {\n\t\t\tif (this.formField.invalid) {\n\t\t\t\treturn this.errorClasses;\n\t\t\t} else if (this.formField.valid) {\n\t\t\t\treturn this.successClasses;\n\t\t\t}\n\t\t}\n\n\t\treturn this.classes;\n\t}\n}\n","<div class=\"flex flex-col gap-1\">\n\t@if (label()) {\n\t\t<label [for]=\"this.name()\">\n\t\t\t<span [typography]=\"{ variant: 'body', color: 'black' }\">{{ label() }}</span></label\n\t\t>\n\t}\n\n\t<textarea\n\t\t[class]=\"validationClasses\"\n\t\t[attr.rows]=\"rows()\"\n\t\t[attr.name]=\"name()\"\n\t\t[attr.placeholder]=\"placeholder()\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabled()\"\n\t\t(ngModelChange)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t></textarea>\n\n\t<div class=\"flex justify-between\">\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t@if (maxCharacters()) {\n\t\t\t<p\n\t\t\t\t[typography]=\"{ variant: 'body-xs', fontWeight: 'normal' }\"\n\t\t\t\t[ngClass]=\"{\n\t\t\t\t\t'text-neutral transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === false,\n\t\t\t\t\t'text-error transition-colors duration-300 ease-ease-out-back': invalidMaxCharacters() === true,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{ value().length }} de {{ maxCharacters() }} caracteres\n\t\t\t</p>\n\t\t}\n\t</div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAWA,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE;AAC9G,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;AACR,YAAA,OAAO,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC;AACzC,YAAA,SAAS,EAAE,CAAC,UAAU,EAAE,oBAAoB,CAAC;AAC7C,YAAA,OAAO,EAAE,CAAC,UAAU,EAAE,kBAAkB,CAAC;AACzC,YAAA,KAA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C1B,4BAAA,WAAW,EAAmB,iBAAA;AAC9B,4BAAA,KAAK,EAAE,IAAI;AACX,yBAAA;AACD,qBAAA,EAAA,QAAA,EAAA,2iCAAA,EAAA,CAAA;;;AE9DF;;AAEG;;;;"}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, model, output, Component, ChangeDetectionStrategy } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/forms';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
5
|
+
import { InputComponent } from '@sixbell-telco/sdk/components/forms/input';
|
|
6
|
+
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
7
|
+
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
8
|
+
import { cva } from 'class-variance-authority';
|
|
9
|
+
|
|
10
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11
|
+
const toggleBase = cva([
|
|
12
|
+
'grid',
|
|
13
|
+
'place-content-center',
|
|
14
|
+
'rounded-full',
|
|
15
|
+
'border-[1px]',
|
|
16
|
+
'border-solid',
|
|
17
|
+
'transition-colors',
|
|
18
|
+
'focus-visible:outline',
|
|
19
|
+
'focus-visible:outline-2',
|
|
20
|
+
'focus-visible:outline-offset-2',
|
|
21
|
+
'hover:bg-opacity-40',
|
|
22
|
+
'active:transition-all',
|
|
23
|
+
'active:hover:scale-95',
|
|
24
|
+
'active:hover:animate-pop',
|
|
25
|
+
'active:hover:ease-out',
|
|
26
|
+
'active:hover:animate-duration-0',
|
|
27
|
+
'active:hover:animate-fill-mode-backwards',
|
|
28
|
+
'active:focus:scale-95',
|
|
29
|
+
'active:focus:animate-pop',
|
|
30
|
+
'active:focus:ease-out',
|
|
31
|
+
'active:focus:animate-duration-0',
|
|
32
|
+
'active:focus:animate-fill-mode-backwards',
|
|
33
|
+
'hover:active:bg-opacity-100',
|
|
34
|
+
], {
|
|
35
|
+
variants: {
|
|
36
|
+
variant: {
|
|
37
|
+
primary: [
|
|
38
|
+
'border-secondary',
|
|
39
|
+
'text-neutral',
|
|
40
|
+
'hover:border-primary',
|
|
41
|
+
'hover:bg-primary',
|
|
42
|
+
'hover:text-neutral',
|
|
43
|
+
'hover:active:bg-primary',
|
|
44
|
+
'focus-visible:outline-secondary',
|
|
45
|
+
'hover:focus-visible:outline-primary',
|
|
46
|
+
'hover:active:focus-visible:outline-primary',
|
|
47
|
+
'hover:active:text-primary-content',
|
|
48
|
+
],
|
|
49
|
+
'primary-toggled': ['bg-primary', 'border-primary', 'text-neutral-content'],
|
|
50
|
+
'primary-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
51
|
+
secondary: [
|
|
52
|
+
'border-secondary',
|
|
53
|
+
'text-neutral',
|
|
54
|
+
'hover:border-secondary',
|
|
55
|
+
'hover:bg-secondary',
|
|
56
|
+
'hover:text-neutral',
|
|
57
|
+
'hover:active:bg-secondary',
|
|
58
|
+
'focus-visible:outline-secondary',
|
|
59
|
+
'hover:focus-visible:outline-secondary',
|
|
60
|
+
'hover:active:focus-visible:outline-secondary',
|
|
61
|
+
'hover:active:text-secondary-content',
|
|
62
|
+
],
|
|
63
|
+
'secondary-toggled': ['bg-secondary', 'border-secondary', 'text-neutral'],
|
|
64
|
+
'secondary-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
65
|
+
success: [
|
|
66
|
+
'border-secondary',
|
|
67
|
+
'text-neutral',
|
|
68
|
+
'hover:border-success',
|
|
69
|
+
'hover:bg-success',
|
|
70
|
+
'hover:text-neutral',
|
|
71
|
+
'hover:active:bg-success',
|
|
72
|
+
'focus-visible:outline-secondary',
|
|
73
|
+
'hover:focus-visible:outline-success',
|
|
74
|
+
'hover:active:focus-visible:outline-success',
|
|
75
|
+
'hover:active:text-success-content',
|
|
76
|
+
],
|
|
77
|
+
'success-toggled': ['bg-success', 'border-success', 'text-neutral-content'],
|
|
78
|
+
'success-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
79
|
+
error: [
|
|
80
|
+
'border-secondary',
|
|
81
|
+
'text-neutral',
|
|
82
|
+
'hover:border-error',
|
|
83
|
+
'hover:bg-error',
|
|
84
|
+
'hover:text-neutral',
|
|
85
|
+
'hover:active:bg-error',
|
|
86
|
+
'focus-visible:outline-secondary',
|
|
87
|
+
'hover:focus-visible:outline-error',
|
|
88
|
+
'hover:active:focus-visible:outline-error',
|
|
89
|
+
'hover:active:text-error-content',
|
|
90
|
+
],
|
|
91
|
+
'error-toggled': ['bg-error', 'border-error', 'text-neutral-content'],
|
|
92
|
+
'error-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
93
|
+
warning: [
|
|
94
|
+
'border-secondary',
|
|
95
|
+
'text-neutral',
|
|
96
|
+
'hover:border-warning',
|
|
97
|
+
'hover:bg-warning',
|
|
98
|
+
'hover:text-neutral',
|
|
99
|
+
'hover:active:bg-warning',
|
|
100
|
+
'focus-visible:outline-secondary',
|
|
101
|
+
'hover:focus-visible:outline-warning',
|
|
102
|
+
'hover:active:focus-visible:outline-warning',
|
|
103
|
+
'hover:active:text-warning-content',
|
|
104
|
+
],
|
|
105
|
+
'warning-toggled': ['bg-warning', 'border-warning', 'text-neutral-content'],
|
|
106
|
+
'warning-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
107
|
+
info: [
|
|
108
|
+
'border-secondary',
|
|
109
|
+
'text-neutral',
|
|
110
|
+
'hover:border-info',
|
|
111
|
+
'hover:bg-info',
|
|
112
|
+
'hover:text-neutral',
|
|
113
|
+
'hover:active:bg-info',
|
|
114
|
+
'focus-visible:outline-secondary',
|
|
115
|
+
'hover:focus-visible:outline-info',
|
|
116
|
+
'hover:active:focus-visible:outline-info',
|
|
117
|
+
'hover:active:text-primary-content',
|
|
118
|
+
],
|
|
119
|
+
'info-toggled': ['bg-info', 'border-info', 'text-neutral-content'],
|
|
120
|
+
'info-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
121
|
+
accent: [
|
|
122
|
+
'border-secondary',
|
|
123
|
+
'text-neutral',
|
|
124
|
+
'hover:border-accent',
|
|
125
|
+
'hover:bg-accent',
|
|
126
|
+
'hover:text-neutral',
|
|
127
|
+
'hover:active:bg-accent',
|
|
128
|
+
'focus-visible:outline-secondary',
|
|
129
|
+
'hover:focus-visible:outline-accent',
|
|
130
|
+
'hover:active:focus-visible:outline-accent',
|
|
131
|
+
'hover:active:text-accent-content',
|
|
132
|
+
],
|
|
133
|
+
'accent-toggled': ['bg-accent', 'border-accent', 'text-neutral-content'],
|
|
134
|
+
'accent-disabled': ['border-secondary', 'border-opacity-50', 'text-neutral', 'text-opacity-50'],
|
|
135
|
+
},
|
|
136
|
+
size: {
|
|
137
|
+
sm: ['h-10', 'w-10'],
|
|
138
|
+
md: ['h-11', 'w-11'],
|
|
139
|
+
lg: ['h-12', 'w-12'],
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
compoundVariants: [],
|
|
143
|
+
defaultVariants: {
|
|
144
|
+
variant: 'primary',
|
|
145
|
+
size: 'md',
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
class ToggleComponent {
|
|
149
|
+
// Base checkbox properties
|
|
150
|
+
variants = input();
|
|
151
|
+
baseClass = input('');
|
|
152
|
+
label = input('');
|
|
153
|
+
name = input(null);
|
|
154
|
+
value = model(false);
|
|
155
|
+
// ControlValueAccessor attributes
|
|
156
|
+
onControlChange = () => { };
|
|
157
|
+
onControlTouch = () => { };
|
|
158
|
+
disabled = model(false);
|
|
159
|
+
// ControlValueAccessor methods
|
|
160
|
+
writeValue(obj) {
|
|
161
|
+
this.value.set(obj);
|
|
162
|
+
}
|
|
163
|
+
registerOnChange(fn) {
|
|
164
|
+
this.onControlChange = fn;
|
|
165
|
+
}
|
|
166
|
+
registerOnTouched(fn) {
|
|
167
|
+
this.onControlTouch = fn;
|
|
168
|
+
}
|
|
169
|
+
handleToggle() {
|
|
170
|
+
this.value.set(!this.value());
|
|
171
|
+
this.handleChange();
|
|
172
|
+
}
|
|
173
|
+
// Change handler
|
|
174
|
+
onChange = output();
|
|
175
|
+
handleChange() {
|
|
176
|
+
this.onControlChange(this.value());
|
|
177
|
+
this.onChange.emit(this.value());
|
|
178
|
+
}
|
|
179
|
+
// Blur handler
|
|
180
|
+
handleBlur() {
|
|
181
|
+
this.onControlTouch();
|
|
182
|
+
}
|
|
183
|
+
// classes
|
|
184
|
+
get baseClasses() {
|
|
185
|
+
const variant = this.variants()?.variant;
|
|
186
|
+
if (variant === 'primary') {
|
|
187
|
+
if (this.disabled()) {
|
|
188
|
+
return cn(toggleBase({
|
|
189
|
+
variant: 'primary-disabled',
|
|
190
|
+
size: this.variants()?.size,
|
|
191
|
+
}), this.baseClass());
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
if (this.value()) {
|
|
195
|
+
return cn(toggleBase({
|
|
196
|
+
variant: 'primary-toggled',
|
|
197
|
+
size: this.variants()?.size,
|
|
198
|
+
}), this.baseClass());
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return cn(toggleBase({
|
|
202
|
+
variant: 'primary',
|
|
203
|
+
size: this.variants()?.size,
|
|
204
|
+
}), this.baseClass());
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else if (variant === 'secondary') {
|
|
209
|
+
if (this.disabled()) {
|
|
210
|
+
return cn(toggleBase({
|
|
211
|
+
variant: 'secondary-disabled',
|
|
212
|
+
size: this.variants()?.size,
|
|
213
|
+
}), this.baseClass());
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
if (this.value()) {
|
|
217
|
+
return cn(toggleBase({
|
|
218
|
+
variant: 'secondary-toggled',
|
|
219
|
+
size: this.variants()?.size,
|
|
220
|
+
}), this.baseClass());
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
return cn(toggleBase({
|
|
224
|
+
variant: 'secondary',
|
|
225
|
+
size: this.variants()?.size,
|
|
226
|
+
}), this.baseClass());
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
else if (variant === 'success') {
|
|
231
|
+
if (this.disabled()) {
|
|
232
|
+
return cn(toggleBase({
|
|
233
|
+
variant: 'success-disabled',
|
|
234
|
+
size: this.variants()?.size,
|
|
235
|
+
}), this.baseClass());
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
if (this.value()) {
|
|
239
|
+
return cn(toggleBase({
|
|
240
|
+
variant: 'success-toggled',
|
|
241
|
+
size: this.variants()?.size,
|
|
242
|
+
}), this.baseClass());
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
return cn(toggleBase({
|
|
246
|
+
variant: 'success',
|
|
247
|
+
size: this.variants()?.size,
|
|
248
|
+
}), this.baseClass());
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
else if (variant === 'warning') {
|
|
253
|
+
if (this.disabled()) {
|
|
254
|
+
return cn(toggleBase({
|
|
255
|
+
variant: 'warning-disabled',
|
|
256
|
+
size: this.variants()?.size,
|
|
257
|
+
}), this.baseClass());
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
if (this.value()) {
|
|
261
|
+
return cn(toggleBase({
|
|
262
|
+
variant: 'warning-toggled',
|
|
263
|
+
size: this.variants()?.size,
|
|
264
|
+
}), this.baseClass());
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
return cn(toggleBase({
|
|
268
|
+
variant: 'warning',
|
|
269
|
+
size: this.variants()?.size,
|
|
270
|
+
}), this.baseClass());
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
else if (variant === 'error') {
|
|
275
|
+
if (this.disabled()) {
|
|
276
|
+
return cn(toggleBase({
|
|
277
|
+
variant: 'error-disabled',
|
|
278
|
+
size: this.variants()?.size,
|
|
279
|
+
}), this.baseClass());
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
if (this.value()) {
|
|
283
|
+
return cn(toggleBase({
|
|
284
|
+
variant: 'error-toggled',
|
|
285
|
+
size: this.variants()?.size,
|
|
286
|
+
}), this.baseClass());
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
return cn(toggleBase({
|
|
290
|
+
variant: 'error',
|
|
291
|
+
size: this.variants()?.size,
|
|
292
|
+
}), this.baseClass());
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
else if (variant === 'accent') {
|
|
297
|
+
if (this.disabled()) {
|
|
298
|
+
return cn(toggleBase({
|
|
299
|
+
variant: 'accent-disabled',
|
|
300
|
+
size: this.variants()?.size,
|
|
301
|
+
}), this.baseClass());
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
if (this.value()) {
|
|
305
|
+
return cn(toggleBase({
|
|
306
|
+
variant: 'accent-toggled',
|
|
307
|
+
size: this.variants()?.size,
|
|
308
|
+
}), this.baseClass());
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
return cn(toggleBase({
|
|
312
|
+
variant: 'accent',
|
|
313
|
+
size: this.variants()?.size,
|
|
314
|
+
}), this.baseClass());
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
else if (variant === 'info') {
|
|
319
|
+
if (this.disabled()) {
|
|
320
|
+
return cn(toggleBase({
|
|
321
|
+
variant: 'info-disabled',
|
|
322
|
+
size: this.variants()?.size,
|
|
323
|
+
}), this.baseClass());
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
if (this.value()) {
|
|
327
|
+
return cn(toggleBase({
|
|
328
|
+
variant: 'info-toggled',
|
|
329
|
+
size: this.variants()?.size,
|
|
330
|
+
}), this.baseClass());
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
return cn(toggleBase({
|
|
334
|
+
variant: 'info',
|
|
335
|
+
size: this.variants()?.size,
|
|
336
|
+
}), this.baseClass());
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
if (this.disabled()) {
|
|
342
|
+
return cn(toggleBase({
|
|
343
|
+
variant: 'primary-disabled',
|
|
344
|
+
size: this.variants()?.size,
|
|
345
|
+
}), this.baseClass());
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
if (this.value()) {
|
|
349
|
+
return cn(toggleBase({
|
|
350
|
+
variant: 'primary-toggled',
|
|
351
|
+
size: this.variants()?.size,
|
|
352
|
+
}), this.baseClass());
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
return cn(toggleBase({
|
|
356
|
+
variant: 'primary',
|
|
357
|
+
size: this.variants()?.size,
|
|
358
|
+
}), this.baseClass());
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
364
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.8", type: ToggleComponent, isStandalone: true, selector: "app-toggle", inputs: { variants: { classPropertyName: "variants", publicName: "variants", isSignal: true, isRequired: false, transformFunction: null }, baseClass: { classPropertyName: "baseClass", publicName: "baseClass", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", disabled: "disabledChange", onChange: "onChange" }, providers: [
|
|
365
|
+
{
|
|
366
|
+
provide: NG_VALUE_ACCESSOR,
|
|
367
|
+
useExisting: ToggleComponent,
|
|
368
|
+
multi: true,
|
|
369
|
+
},
|
|
370
|
+
], ngImport: i0, template: "@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button [class]=\"baseClasses\" (click)=\"handleToggle()\" [disabled]=\"disabledVar\">\n\t\t<span [typography]=\"{ variant: 'body', color: 'inherit' }\">\n\t\t\t{{ label() }}\n\t\t</span>\n\t</button>\n</label>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["typography", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
371
|
+
}
|
|
372
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.8", ngImport: i0, type: ToggleComponent, decorators: [{
|
|
373
|
+
type: Component,
|
|
374
|
+
args: [{ selector: 'app-toggle', standalone: true, imports: [FormsModule, TypographyDirective, InputComponent], providers: [
|
|
375
|
+
{
|
|
376
|
+
provide: NG_VALUE_ACCESSOR,
|
|
377
|
+
useExisting: ToggleComponent,
|
|
378
|
+
multi: true,
|
|
379
|
+
},
|
|
380
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let disabledVar = disabled();\n<label class=\"flex cursor-pointer items-center justify-start gap-4\">\n\t<input\n\t\tclass=\"hidden\"\n\t\ttype=\"checkbox\"\n\t\t[(ngModel)]=\"value\"\n\t\t[disabled]=\"disabledVar\"\n\t\t[attr.name]=\"name()\"\n\t\t(change)=\"handleChange()\"\n\t\t(blur)=\"handleBlur()\"\n\t/>\n\t<button [class]=\"baseClasses\" (click)=\"handleToggle()\" [disabled]=\"disabledVar\">\n\t\t<span [typography]=\"{ variant: 'body', color: 'inherit' }\">\n\t\t\t{{ label() }}\n\t\t</span>\n\t</button>\n</label>\n" }]
|
|
381
|
+
}] });
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Generated bundle index. Do not edit.
|
|
385
|
+
*/
|
|
386
|
+
|
|
387
|
+
export { ToggleComponent, toggleBase };
|
|
388
|
+
//# sourceMappingURL=sixbell-telco-sdk-components-forms-toggle.mjs.map
|