@wlcm/angular 17.3.4 → 17.4.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/dist/README.md +62 -0
- package/dist/button/.npmignore +2 -0
- package/dist/core/.npmignore +2 -0
- package/dist/date-range-picker/.npmignore +2 -0
- package/dist/filters/.npmignore +2 -0
- package/dist/forms/.npmignore +2 -0
- package/dist/package.json +92 -0
- package/dist/phone-input/.npmignore +2 -0
- package/dist/phone-input/esm2022/lib/components/country-code-select/country-code-select.component.mjs +32 -0
- package/dist/phone-input/esm2022/lib/components/phone-input-container/phone-input-container.component.mjs +103 -0
- package/dist/phone-input/esm2022/lib/directives/phone-input.directive.mjs +124 -0
- package/{phone-input → dist/phone-input}/fesm2022/wlcm-angular-phone-input.mjs +19 -8
- package/dist/phone-input/fesm2022/wlcm-angular-phone-input.mjs.map +1 -0
- package/{phone-input → dist/phone-input}/lib/components/country-code-select/country-code-select.component.d.ts +3 -0
- package/dist/search-field/.npmignore +2 -0
- package/dist/stepper/.npmignore +2 -0
- package/dist/stepper/README.md +7 -0
- package/dist/stepper/esm2022/index.mjs +11 -0
- package/dist/stepper/esm2022/lib/components/step/step.component.mjs +53 -0
- package/dist/stepper/esm2022/lib/components/step-header/step-header.component.mjs +79 -0
- package/dist/stepper/esm2022/lib/components/stepper/stepper.component.mjs +15 -0
- package/dist/stepper/esm2022/lib/components/stepper-header/stepper-header.component.mjs +16 -0
- package/dist/stepper/esm2022/lib/constants/step.constants.mjs +9 -0
- package/dist/stepper/esm2022/lib/constants/stepper.stepper.mjs +3 -0
- package/dist/stepper/esm2022/lib/directives/load-on-active-step.directive.mjs +51 -0
- package/dist/stepper/esm2022/lib/models/step.models.mjs +60 -0
- package/dist/stepper/esm2022/lib/models/stepper.models.mjs +114 -0
- package/dist/stepper/esm2022/lib/stepper.module.mjs +34 -0
- package/dist/stepper/esm2022/wlcm-angular-stepper.mjs +5 -0
- package/dist/stepper/fesm2022/wlcm-angular-stepper.mjs +385 -0
- package/dist/stepper/fesm2022/wlcm-angular-stepper.mjs.map +1 -0
- package/dist/stepper/index.d.ts +10 -0
- package/dist/stepper/lib/components/step/step.component.d.ts +16 -0
- package/dist/stepper/lib/components/step-header/step-header.component.d.ts +20 -0
- package/dist/stepper/lib/components/stepper/stepper.component.d.ts +6 -0
- package/dist/stepper/lib/components/stepper-header/stepper-header.component.d.ts +8 -0
- package/dist/stepper/lib/constants/step.constants.d.ts +4 -0
- package/dist/stepper/lib/constants/stepper.stepper.d.ts +3 -0
- package/dist/stepper/lib/directives/load-on-active-step.directive.d.ts +13 -0
- package/dist/stepper/lib/models/step.models.d.ts +43 -0
- package/dist/stepper/lib/models/stepper.models.d.ts +44 -0
- package/dist/stepper/lib/stepper.module.d.ts +12 -0
- package/dist/styles/components/stepper/_step-header.scss +123 -0
- package/dist/styles/components/stepper/_step.scss +15 -0
- package/dist/styles/components/stepper/_stepper-header.scss +13 -0
- package/dist/styles/components/stepper/_stepper.scss +6 -0
- package/dist/styles/components/stepper/indes.scss +9 -0
- package/{styles → dist/styles}/core/_all-theme.scss +2 -0
- package/package.json +61 -2
- package/phone-input/esm2022/lib/components/country-code-select/country-code-select.component.mjs +0 -26
- package/phone-input/esm2022/lib/components/phone-input-container/phone-input-container.component.mjs +0 -103
- package/phone-input/esm2022/lib/directives/phone-input.directive.mjs +0 -119
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs.map +0 -1
- /package/{button → dist/button}/README.md +0 -0
- /package/{button → dist/button}/esm2022/index.mjs +0 -0
- /package/{button → dist/button}/esm2022/lib/button.module.mjs +0 -0
- /package/{button → dist/button}/esm2022/lib/components/button/button.component.mjs +0 -0
- /package/{button → dist/button}/esm2022/lib/models/button.models.mjs +0 -0
- /package/{button → dist/button}/esm2022/wlcm-angular-button.mjs +0 -0
- /package/{button → dist/button}/fesm2022/wlcm-angular-button.mjs +0 -0
- /package/{button → dist/button}/fesm2022/wlcm-angular-button.mjs.map +0 -0
- /package/{button → dist/button}/index.d.ts +0 -0
- /package/{button → dist/button}/lib/button.module.d.ts +0 -0
- /package/{button → dist/button}/lib/components/button/button.component.d.ts +0 -0
- /package/{button → dist/button}/lib/models/button.models.d.ts +0 -0
- /package/{core → dist/core}/README.md +0 -0
- /package/{core → dist/core}/esm2022/index.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/components/calendar-icon/calendar-icon.component.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/components/chevron-down-icon/chevron-down-icon.component.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/components/close-icon/close-icon.component.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/components/search-icon/search-icon.component.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/constants/http.constants.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/constants/icon.contants.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/directives/icon.directive.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/models/icon.models.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/models/option.models.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/models/paginated-data.models.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/models/query-params.models.mjs +0 -0
- /package/{core → dist/core}/esm2022/lib/utils/stream.utils.mjs +0 -0
- /package/{core → dist/core}/esm2022/wlcm-angular-core.mjs +0 -0
- /package/{core → dist/core}/fesm2022/wlcm-angular-core.mjs +0 -0
- /package/{core → dist/core}/fesm2022/wlcm-angular-core.mjs.map +0 -0
- /package/{core → dist/core}/index.d.ts +0 -0
- /package/{core → dist/core}/lib/components/calendar-icon/calendar-icon.component.d.ts +0 -0
- /package/{core → dist/core}/lib/components/chevron-down-icon/chevron-down-icon.component.d.ts +0 -0
- /package/{core → dist/core}/lib/components/close-icon/close-icon.component.d.ts +0 -0
- /package/{core → dist/core}/lib/components/search-icon/search-icon.component.d.ts +0 -0
- /package/{core → dist/core}/lib/constants/http.constants.d.ts +0 -0
- /package/{core → dist/core}/lib/constants/icon.contants.d.ts +0 -0
- /package/{core → dist/core}/lib/directives/icon.directive.d.ts +0 -0
- /package/{core → dist/core}/lib/models/icon.models.d.ts +0 -0
- /package/{core → dist/core}/lib/models/option.models.d.ts +0 -0
- /package/{core → dist/core}/lib/models/paginated-data.models.d.ts +0 -0
- /package/{core → dist/core}/lib/models/query-params.models.d.ts +0 -0
- /package/{core → dist/core}/lib/utils/stream.utils.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/README.md +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/index.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/components/calendar-header/calendar-header.component.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/components/date-range-picker/date-range-picker.component.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/components/date-range-picker-bottom-panel/date-range-picker-bottom-panel.component.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/components/date-range-picker-input/date-range-picker-input.component.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/constants/date-range-selection-model.constants.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/constants/date-range-trigger-selection-model.constants.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/date-range-picker.module.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/directives/date-range-picker-input-base.directive.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/directives/date-range-picker-input-end.directive.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/directives/date-range-picker-input-start.directive.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/directives/date-range-picker-trigger.directive.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/directives/left-calendar.directive.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/directives/right-calendar.directive.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/models/data-range-calendar.models.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/models/date-range-validation.models.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/services/date-adapter.service.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/utils/date-range-input.validators.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/lib/utils/date-range-picker-errors.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/esm2022/wlcm-angular-date-range-picker.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/fesm2022/wlcm-angular-date-range-picker.mjs +0 -0
- /package/{date-range-picker → dist/date-range-picker}/fesm2022/wlcm-angular-date-range-picker.mjs.map +0 -0
- /package/{date-range-picker → dist/date-range-picker}/index.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/components/calendar-header/calendar-header.component.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/components/date-range-picker/date-range-picker.component.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/components/date-range-picker-bottom-panel/date-range-picker-bottom-panel.component.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/components/date-range-picker-input/date-range-picker-input.component.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/constants/date-range-selection-model.constants.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/constants/date-range-trigger-selection-model.constants.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/date-range-picker.module.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/directives/date-range-picker-input-base.directive.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/directives/date-range-picker-input-end.directive.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/directives/date-range-picker-input-start.directive.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/directives/date-range-picker-trigger.directive.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/directives/left-calendar.directive.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/directives/right-calendar.directive.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/models/data-range-calendar.models.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/models/date-range-validation.models.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/services/date-adapter.service.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/utils/date-range-input.validators.d.ts +0 -0
- /package/{date-range-picker → dist/date-range-picker}/lib/utils/date-range-picker-errors.d.ts +0 -0
- /package/{filters → dist/filters}/README.md +0 -0
- /package/{filters → dist/filters}/esm2022/index.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/components/filters/filters.component.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/components/filters-button/filters-button.component.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/components/filters-panel/filters-panel.component.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/components/filters-unit/filters-unit.component.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/directives/filters-content.directive.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/directives/filters-trigger.directive.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/filters.module.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/models/filters-default-selection-model.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/models/filters-trigger.base.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/models/filters.models.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/pipes/is-filters-param-checked.pipe.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/pipes/total-filters-applied.pipe.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/lib/filters/utils/filters.utils.mjs +0 -0
- /package/{filters → dist/filters}/esm2022/wlcm-angular-filters.mjs +0 -0
- /package/{filters → dist/filters}/fesm2022/wlcm-angular-filters.mjs +0 -0
- /package/{filters → dist/filters}/fesm2022/wlcm-angular-filters.mjs.map +0 -0
- /package/{filters → dist/filters}/index.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/components/filters/filters.component.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/components/filters-button/filters-button.component.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/components/filters-panel/filters-panel.component.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/components/filters-unit/filters-unit.component.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/directives/filters-content.directive.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/directives/filters-trigger.directive.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/filters.module.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/models/filters-default-selection-model.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/models/filters-trigger.base.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/models/filters.models.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/pipes/is-filters-param-checked.pipe.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/pipes/total-filters-applied.pipe.d.ts +0 -0
- /package/{filters → dist/filters}/lib/filters/utils/filters.utils.d.ts +0 -0
- /package/{forms → dist/forms}/README.md +0 -0
- /package/{forms → dist/forms}/esm2022/index.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/autocomplete/autocomplete.component.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/checkbox/checkbox.component.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/error/error.component.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/form-field/form-field.component.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/index.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/label/label.component.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/components/select/select.component.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/constants/form-elements.constants.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/constants/form-errors.constants.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/constants/form-field.constants.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/constants/form-state-handlers.constants.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/constants/index.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/ac-input-binder.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/autocomplete.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/form-field-custom-container.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/form-field-hint.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/form-field-prefix.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/form-field-suffix.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/input.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/directives/select-input-binder.directive.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/forms.module.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/models/_index.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/models/form-errors.models.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/models/form.models.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/models/input.models.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/pipes/errors-mapper.pipe.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/services/form-state-handler.service.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/lib/forms/services/index.mjs +0 -0
- /package/{forms → dist/forms}/esm2022/wlcm-angular-forms.mjs +0 -0
- /package/{forms → dist/forms}/fesm2022/wlcm-angular-forms.mjs +0 -0
- /package/{forms → dist/forms}/fesm2022/wlcm-angular-forms.mjs.map +0 -0
- /package/{forms → dist/forms}/index.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/autocomplete/autocomplete.component.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/checkbox/checkbox.component.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/error/error.component.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/form-field/form-field.component.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/index.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/label/label.component.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/components/select/select.component.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/constants/form-elements.constants.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/constants/form-errors.constants.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/constants/form-field.constants.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/constants/form-state-handlers.constants.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/constants/index.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/ac-input-binder.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/autocomplete.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/form-field-custom-container.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/form-field-hint.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/form-field-prefix.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/form-field-suffix.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/input.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/directives/select-input-binder.directive.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/forms.module.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/models/_index.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/models/form-errors.models.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/models/form.models.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/models/input.models.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/pipes/errors-mapper.pipe.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/services/form-state-handler.service.d.ts +0 -0
- /package/{forms → dist/forms}/lib/forms/services/index.d.ts +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.mjs → dist/index.mjs} +0 -0
- /package/{phone-input → dist/phone-input}/README.md +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/index.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/constants/country-code-options.constants.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/constants/phone-adapter.constants.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/models/country-code.models.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/models/phone-adapter.models.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/models/phone.models.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/phone-input.module.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/lib/pipes/phone-code.pipe.mjs +0 -0
- /package/{phone-input → dist/phone-input}/esm2022/wlcm-angular-phone-input.mjs +0 -0
- /package/{phone-input → dist/phone-input}/index.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/components/phone-input-container/phone-input-container.component.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/constants/country-code-options.constants.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/constants/phone-adapter.constants.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/directives/phone-input.directive.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/models/country-code.models.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/models/phone-adapter.models.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/models/phone.models.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/phone-input.module.d.ts +0 -0
- /package/{phone-input → dist/phone-input}/lib/pipes/phone-code.pipe.d.ts +0 -0
- /package/{search-field → dist/search-field}/README.md +0 -0
- /package/{search-field → dist/search-field}/esm2022/index.mjs +0 -0
- /package/{search-field → dist/search-field}/esm2022/lib/components/search-field/search-field.component.mjs +0 -0
- /package/{search-field → dist/search-field}/esm2022/lib/search-field.module.mjs +0 -0
- /package/{search-field → dist/search-field}/esm2022/wlcm-angular-search-field.mjs +0 -0
- /package/{search-field → dist/search-field}/fesm2022/wlcm-angular-search-field.mjs +0 -0
- /package/{search-field → dist/search-field}/fesm2022/wlcm-angular-search-field.mjs.map +0 -0
- /package/{search-field → dist/search-field}/index.d.ts +0 -0
- /package/{search-field → dist/search-field}/lib/components/search-field/search-field.component.d.ts +0 -0
- /package/{search-field → dist/search-field}/lib/search-field.module.d.ts +0 -0
- /package/{styles → dist/styles}/components/button/index.scss +0 -0
- /package/{styles → dist/styles}/components/common/index.scss +0 -0
- /package/{styles → dist/styles}/components/date-range-picker/_date-range-picker-body.scss +0 -0
- /package/{styles → dist/styles}/components/date-range-picker/_date-range-picker-header.scss +0 -0
- /package/{styles → dist/styles}/components/date-range-picker/_date-range-picker-input.scss +0 -0
- /package/{styles → dist/styles}/components/date-range-picker/_date-range-picker-panel.scss +0 -0
- /package/{styles → dist/styles}/components/date-range-picker/index.scss +0 -0
- /package/{styles → dist/styles}/components/filters/_filters-panel.scss +0 -0
- /package/{styles → dist/styles}/components/filters/_filters-unit.scss +0 -0
- /package/{styles → dist/styles}/components/filters/index.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_autocomplete.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_checkbox.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_error.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_form-field.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_label.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_radio.scss +0 -0
- /package/{styles → dist/styles}/components/forms/_select.scss +0 -0
- /package/{styles → dist/styles}/components/forms/index.scss +0 -0
- /package/{styles → dist/styles}/components/phone-input/_country-code-select.scss +0 -0
- /package/{styles → dist/styles}/components/phone-input/_phone-input-container.scss +0 -0
- /package/{styles → dist/styles}/components/phone-input/indes.scss +0 -0
- /package/{styles → dist/styles}/components/search-field/index.scss +0 -0
- /package/{styles → dist/styles}/components/table/_table-head-data.scss +0 -0
- /package/{styles → dist/styles}/components/table/_table-head.scss +0 -0
- /package/{styles → dist/styles}/components/table/_table-row-data.scss +0 -0
- /package/{styles → dist/styles}/components/table/_table-row.scss +0 -0
- /package/{styles → dist/styles}/components/table/_table.scss +0 -0
- /package/{styles → dist/styles}/components/table/index.scss +0 -0
- /package/{styles → dist/styles}/core/_core.scss +0 -0
- /package/{styles → dist/styles}/core/_utils.scss +0 -0
- /package/{styles → dist/styles}/wlcm.scss +0 -0
package/dist/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# WlcmCommunity
|
2
|
+
|
3
|
+
<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>
|
4
|
+
|
5
|
+
✨ **This workspace has been generated by [Nx, Smart Monorepos · Fast CI.](https://nx.dev)** ✨
|
6
|
+
|
7
|
+
## Integrate with editors
|
8
|
+
|
9
|
+
Enhance your Nx experience by installing [Nx Console](https://nx.dev/nx-console) for your favorite editor. Nx Console
|
10
|
+
provides an interactive UI to view your projects, run tasks, generate code, and more! Available for VSCode, IntelliJ and
|
11
|
+
comes with a LSP for Vim users.
|
12
|
+
|
13
|
+
## Start the application
|
14
|
+
|
15
|
+
Run `npx nx serve sandbox` to start the development server. Happy coding!
|
16
|
+
|
17
|
+
## Build for production
|
18
|
+
|
19
|
+
Run `npx nx build sandbox` to build the application. The build artifacts are stored in the output directory (e.g. `dist/` or `build/`), ready to be deployed.
|
20
|
+
|
21
|
+
## Running tasks
|
22
|
+
|
23
|
+
To execute tasks with Nx use the following syntax:
|
24
|
+
|
25
|
+
```
|
26
|
+
npx nx <target> <project> <...options>
|
27
|
+
```
|
28
|
+
|
29
|
+
You can also run multiple targets:
|
30
|
+
|
31
|
+
```
|
32
|
+
npx nx run-many -t <target1> <target2>
|
33
|
+
```
|
34
|
+
|
35
|
+
..or add `-p` to filter specific projects
|
36
|
+
|
37
|
+
```
|
38
|
+
npx nx run-many -t <target1> <target2> -p <proj1> <proj2>
|
39
|
+
```
|
40
|
+
|
41
|
+
Targets can be defined in the `package.json` or `projects.json`. Learn more [in the docs](https://nx.dev/features/run-tasks).
|
42
|
+
|
43
|
+
## Set up CI!
|
44
|
+
|
45
|
+
Nx comes with local caching already built-in (check your `nx.json`). On CI you might want to go a step further.
|
46
|
+
|
47
|
+
- [Set up remote caching](https://nx.dev/features/share-your-cache)
|
48
|
+
- [Set up task distribution across multiple machines](https://nx.dev/nx-cloud/features/distribute-task-execution)
|
49
|
+
- [Learn more how to setup CI](https://nx.dev/recipes/ci)
|
50
|
+
|
51
|
+
## Explore the project graph
|
52
|
+
|
53
|
+
Run `npx nx graph` to show the graph of the workspace.
|
54
|
+
It will show tasks that you can run with Nx.
|
55
|
+
|
56
|
+
- [Learn more about Exploring the Project Graph](https://nx.dev/core-features/explore-graph)
|
57
|
+
|
58
|
+
## Connect with us!
|
59
|
+
|
60
|
+
- [Join the community](https://nx.dev/community)
|
61
|
+
- [Subscribe to the Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
|
62
|
+
- [Follow us on Twitter](https://twitter.com/nxdevtools)
|
@@ -0,0 +1,92 @@
|
|
1
|
+
{
|
2
|
+
"name": "@wlcm/angular",
|
3
|
+
"version": "17.4.0",
|
4
|
+
"license": "MIT",
|
5
|
+
"type": "module",
|
6
|
+
"module": "./index.mjs",
|
7
|
+
"typings": "./index.d.ts",
|
8
|
+
"private": false,
|
9
|
+
"exports": {
|
10
|
+
".": {
|
11
|
+
"sass": "./styles/wlcm.scss",
|
12
|
+
"esm": "./index.mjs",
|
13
|
+
"types": "./index.d.ts",
|
14
|
+
"default": "./index.mjs"
|
15
|
+
},
|
16
|
+
"./core": {
|
17
|
+
"types": "./core/index.d.ts",
|
18
|
+
"esm2022": "./core/esm2022/wlcm-angular-core.mjs",
|
19
|
+
"fesm2022": "./core/fesm2022/wlcm-angular-core.mjs",
|
20
|
+
"default": "./core/fesm2022/wlcm-angular-core.mjs"
|
21
|
+
},
|
22
|
+
"./button": {
|
23
|
+
"types": "./button/index.d.ts",
|
24
|
+
"esm2022": "./button/esm2022/wlcm-angular-button.mjs",
|
25
|
+
"fesm2022": "./button/fesm2022/wlcm-angular-button.mjs",
|
26
|
+
"default": "./button/fesm2022/wlcm-angular-button.mjs"
|
27
|
+
},
|
28
|
+
"./filters": {
|
29
|
+
"types": "./filters/index.d.ts",
|
30
|
+
"esm2022": "./filters/esm2022/wlcm-angular-filters.mjs",
|
31
|
+
"fesm2022": "./filters/fesm2022/wlcm-angular-filters.mjs",
|
32
|
+
"default": "./filters/fesm2022/wlcm-angular-filters.mjs"
|
33
|
+
},
|
34
|
+
"./forms": {
|
35
|
+
"types": "./forms/index.d.ts",
|
36
|
+
"esm2022": "./forms/esm2022/wlcm-angular-forms.mjs",
|
37
|
+
"fesm2022": "./forms/fesm2022/wlcm-angular-forms.mjs",
|
38
|
+
"default": "./forms/fesm2022/wlcm-angular-forms.mjs"
|
39
|
+
},
|
40
|
+
"./search-field": {
|
41
|
+
"types": "./search-field/index.d.ts",
|
42
|
+
"esm2022": "./search-field/esm2022/wlcm-angular-search-field.mjs",
|
43
|
+
"fesm2022": "./search-field/fesm2022/wlcm-angular-search-field.mjs",
|
44
|
+
"default": "./search-field/fesm2022/wlcm-angular-search-field.mjs"
|
45
|
+
},
|
46
|
+
"./date-range-picker": {
|
47
|
+
"types": "./date-range-picker/index.d.ts",
|
48
|
+
"esm2022": "./date-range-picker/esm2022/wlcm-angular-date-range-picker.mjs",
|
49
|
+
"fesm2022": "./date-range-picker/fesm2022/wlcm-angular-date-range-picker.mjs",
|
50
|
+
"default": "./date-range-picker/fesm2022/wlcm-angular-date-range-picker.mjs"
|
51
|
+
},
|
52
|
+
"./phone-input": {
|
53
|
+
"types": "./phone-input/index.d.ts",
|
54
|
+
"esm2022": "./phone-input/esm2022/wlcm-angular-phone-input.mjs",
|
55
|
+
"fesm2022": "./phone-input/fesm2022/wlcm-angular-phone-input.mjs",
|
56
|
+
"default": "./phone-input/fesm2022/wlcm-angular-phone-input.mjs"
|
57
|
+
},
|
58
|
+
"./stepper": {
|
59
|
+
"types": "./stepper/index.d.ts",
|
60
|
+
"esm2022": "./stepper/esm2022/wlcm-angular-stepper.mjs",
|
61
|
+
"fesm2022": "./stepper/fesm2022/wlcm-angular-stepper.mjs",
|
62
|
+
"default": "./stepper/fesm2022/wlcm-angular-stepper.mjs"
|
63
|
+
}
|
64
|
+
},
|
65
|
+
"dependencies": {
|
66
|
+
"@angular/animations": "~17.3.0",
|
67
|
+
"@angular/cdk": "^17.3.5",
|
68
|
+
"@angular/common": "~17.3.0",
|
69
|
+
"@angular/compiler": "~17.3.0",
|
70
|
+
"@angular/core": "~17.3.0",
|
71
|
+
"@angular/forms": "~17.3.0",
|
72
|
+
"@angular/material": "^17.3.5",
|
73
|
+
"@angular/material-date-fns-adapter": "^17.3.10",
|
74
|
+
"@angular/material-moment-adapter": "^17.3.10",
|
75
|
+
"@angular/platform-browser": "~17.3.0",
|
76
|
+
"@angular/platform-browser-dynamic": "~17.3.0",
|
77
|
+
"@angular/router": "~17.3.0",
|
78
|
+
"@ngneat/until-destroy": "^10.0.0",
|
79
|
+
"@nx/angular": "18.3.2",
|
80
|
+
"@rx-angular/template": "^17.1.0",
|
81
|
+
"countries-list": "^3.1.0",
|
82
|
+
"date-fns": "^3.6.0",
|
83
|
+
"imask": "^7.6.1",
|
84
|
+
"libphonenumber-js": "^1.11.3",
|
85
|
+
"moment": "^2.30.1",
|
86
|
+
"rxjs": "~7.8.0",
|
87
|
+
"tslib": "^2.3.0",
|
88
|
+
"uuid": "^9.0.1",
|
89
|
+
"zone.js": "~0.14.3"
|
90
|
+
},
|
91
|
+
"devDependencies": {}
|
92
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { Component, Inject, ViewChild, input, output } from '@angular/core';
|
2
|
+
import { WlcmFormsModule, WlcmSelectComponent } from '@wlcm/angular/forms';
|
3
|
+
import { CommonModule } from '@angular/common';
|
4
|
+
import { WLCM_COUNTRY_CODE_OPTIONS } from '../../constants/country-code-options.constants';
|
5
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
6
|
+
import { PhoneCodePipe } from '../../pipes/phone-code.pipe';
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
import * as i1 from "@wlcm/angular/forms";
|
9
|
+
import * as i2 from "@angular/forms";
|
10
|
+
export class WlcmCountryCodeSelectComponent {
|
11
|
+
constructor(options) {
|
12
|
+
this.options = options;
|
13
|
+
this.changed = output();
|
14
|
+
this.control = input(new FormControl('US'));
|
15
|
+
}
|
16
|
+
get selectComponent() {
|
17
|
+
return this.wlcmSelect.matSelect;
|
18
|
+
}
|
19
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmCountryCodeSelectComponent, deps: [{ token: WLCM_COUNTRY_CODE_OPTIONS }], target: i0.ɵɵFactoryTarget.Component }); }
|
20
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmCountryCodeSelectComponent, isStandalone: true, selector: "wlcm-country-code-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "wlcm-country-code-select" }, viewQueries: [{ propertyName: "wlcmSelect", first: true, predicate: WlcmSelectComponent, descendants: true }], ngImport: i0, template: "<wlcm-select\n [options]=\"options\"\n [formControl]=\"control()\"\n [optionTemplate]=\"optionTemplate\"\n [triggerTemplate]=\"triggerTemplate\"\n (selectionChange)=\"changed.emit($event)\"\n></wlcm-select>\n\n<ng-template #optionTemplate let-option>\n <span class=\"emoji-flag\">{{ option.emojiFlag }}</span>\n\n {{ option.viewValue }}\n</ng-template>\n\n<ng-template #triggerTemplate let-selected>\n <div class=\"wlcm-country-code-select-trigger\">\n +{{ selected?.value | phoneCode }}\n </div>\n</ng-template>\n", styles: [".emoji-flag{font-size:20px;vertical-align:bottom;margin-right:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: WlcmFormsModule }, { kind: "component", type: i1.WlcmSelectComponent, selector: "wlcm-select", inputs: ["multiple", "placeholder", "options", "optionTemplate", "triggerTemplate"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: PhoneCodePipe, name: "phoneCode" }] }); }
|
21
|
+
}
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmCountryCodeSelectComponent, decorators: [{
|
23
|
+
type: Component,
|
24
|
+
args: [{ selector: 'wlcm-country-code-select', host: { class: 'wlcm-country-code-select' }, standalone: true, imports: [CommonModule, WlcmFormsModule, ReactiveFormsModule, PhoneCodePipe], template: "<wlcm-select\n [options]=\"options\"\n [formControl]=\"control()\"\n [optionTemplate]=\"optionTemplate\"\n [triggerTemplate]=\"triggerTemplate\"\n (selectionChange)=\"changed.emit($event)\"\n></wlcm-select>\n\n<ng-template #optionTemplate let-option>\n <span class=\"emoji-flag\">{{ option.emojiFlag }}</span>\n\n {{ option.viewValue }}\n</ng-template>\n\n<ng-template #triggerTemplate let-selected>\n <div class=\"wlcm-country-code-select-trigger\">\n +{{ selected?.value | phoneCode }}\n </div>\n</ng-template>\n", styles: [".emoji-flag{font-size:20px;vertical-align:bottom;margin-right:8px}\n"] }]
|
25
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
26
|
+
type: Inject,
|
27
|
+
args: [WLCM_COUNTRY_CODE_OPTIONS]
|
28
|
+
}] }], propDecorators: { wlcmSelect: [{
|
29
|
+
type: ViewChild,
|
30
|
+
args: [WlcmSelectComponent]
|
31
|
+
}] } });
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY291bnRyeS1jb2RlLXNlbGVjdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9tb2R1bGVzL3Bob25lLWlucHV0L3NyYy9saWIvY29tcG9uZW50cy9jb3VudHJ5LWNvZGUtc2VsZWN0L2NvdW50cnktY29kZS1zZWxlY3QuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9waG9uZS1pbnB1dC9zcmMvbGliL2NvbXBvbmVudHMvY291bnRyeS1jb2RlLXNlbGVjdC9jb3VudHJ5LWNvZGUtc2VsZWN0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFpQyxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzRyxPQUFPLEVBQUUsZUFBZSxFQUFFLG1CQUFtQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDM0UsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRS9DLE9BQU8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UgfX1cbjwvbmctdGVtcGxhdGU+XG5cbjxuZy10ZW1wbGF0ZSAjdHJpZ2dlclRlbXBsYXRlIGxldC1zZWxlY3RlZD5cbiAgPGRpdiBjbGFzcz1cIndsY20tY291bnRyeS1jb2RlLXNlbGVjdC10cmlnZ2VyXCI+XG4gICAgK3t7IHNlbGVjdGVkPy52YWx1ZSB8IHBob25lQ29kZSB9fVxuICA8L2Rpdj5cbjwvbmctdGVtcGxhdGU+XG4iXX0=
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
2
|
+
import { CommonModule } from '@angular/common';
|
3
|
+
import { Component, ContentChild, NgZone, ViewChild, forwardRef, inject } from '@angular/core';
|
4
|
+
import { WlcmPhoneInputDirective } from '../../directives/phone-input.directive';
|
5
|
+
import { WLCM_INPUT_BINDER } from '@wlcm/angular/forms';
|
6
|
+
import { WLCM_PHONE_ADAPTER } from '../../constants/phone-adapter.constants';
|
7
|
+
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
|
8
|
+
import { Subject, fromEvent, merge, tap } from 'rxjs';
|
9
|
+
import { AsYouType, getPhoneCode, isValidNumber, parsePhoneNumber } from 'libphonenumber-js';
|
10
|
+
import { WlcmCountryCodeSelectComponent } from '../country-code-select/country-code-select.component';
|
11
|
+
import { FormControl } from '@angular/forms';
|
12
|
+
import * as i0 from "@angular/core";
|
13
|
+
let WlcmPhoneInputContainerComponent = class WlcmPhoneInputContainerComponent {
|
14
|
+
constructor(_zone) {
|
15
|
+
this._zone = _zone;
|
16
|
+
this._focusStream$ = new Subject();
|
17
|
+
this._blurStream$ = new Subject();
|
18
|
+
this.focus$ = this._focusStream$.asObservable();
|
19
|
+
this.blur$ = this._blurStream$.asObservable();
|
20
|
+
this.control = new FormControl('US');
|
21
|
+
this._asYouType = new AsYouType('US');
|
22
|
+
this.parseValue = (value) => {
|
23
|
+
if (!value || value.length === 0)
|
24
|
+
return '';
|
25
|
+
if (isValidNumber(value)) {
|
26
|
+
const result = parsePhoneNumber(value, 'US');
|
27
|
+
if (result.country)
|
28
|
+
this.control.setValue(result.country);
|
29
|
+
return result.nationalNumber;
|
30
|
+
}
|
31
|
+
return value;
|
32
|
+
};
|
33
|
+
this.formatValue = (value) => {
|
34
|
+
this._asYouType.reset();
|
35
|
+
this._asYouType.input(`+${this.currentCallingCode}${value}`);
|
36
|
+
const countryCode = this._asYouType.getCountry();
|
37
|
+
if (countryCode)
|
38
|
+
this.control.setValue(countryCode);
|
39
|
+
return this._asYouType.getNumber()?.number ?? '';
|
40
|
+
};
|
41
|
+
}
|
42
|
+
ngAfterContentInit() {
|
43
|
+
if (!this.phoneInput) {
|
44
|
+
throw new Error('The [wlcmPhoneInput] directive must be provided.');
|
45
|
+
}
|
46
|
+
this.handleInputEvents();
|
47
|
+
}
|
48
|
+
isFocused() {
|
49
|
+
return this.phoneInput.element === document.activeElement || this.codeSelect?.selectComponent.panelOpen;
|
50
|
+
}
|
51
|
+
focus() {
|
52
|
+
this.phoneInput.element.focus();
|
53
|
+
}
|
54
|
+
handleCountryChange() {
|
55
|
+
this.phoneInput._updateControl();
|
56
|
+
}
|
57
|
+
get currentCallingCode() {
|
58
|
+
return getPhoneCode(this.control.value);
|
59
|
+
}
|
60
|
+
handleInputEvents() {
|
61
|
+
this._zone.runOutsideAngular(() => {
|
62
|
+
merge(fromEvent(this.phoneInput.element, 'focus').pipe(tap(() => this._focusStream$.next())), fromEvent(this.phoneInput.element, 'blur').pipe(tap(() => this._blurStream$.next())))
|
63
|
+
.pipe(untilDestroyed(this))
|
64
|
+
.subscribe();
|
65
|
+
});
|
66
|
+
}
|
67
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPhoneInputContainerComponent, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
|
68
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: WlcmPhoneInputContainerComponent, isStandalone: true, selector: "wlcm-phone-input-container", host: { classAttribute: "wlcm-phone-input-container" }, providers: [
|
69
|
+
{
|
70
|
+
provide: WLCM_INPUT_BINDER,
|
71
|
+
useFactory: () => {
|
72
|
+
const container = inject(WlcmPhoneInputContainerComponent, { self: true });
|
73
|
+
return { bind: () => container };
|
74
|
+
},
|
75
|
+
},
|
76
|
+
{ provide: WLCM_PHONE_ADAPTER, useExisting: forwardRef(() => WlcmPhoneInputContainerComponent) },
|
77
|
+
], queries: [{ propertyName: "phoneInput", first: true, predicate: WlcmPhoneInputDirective, descendants: true }], viewQueries: [{ propertyName: "codeSelect", first: true, predicate: WlcmCountryCodeSelectComponent, descendants: true }], ngImport: i0, template: "<wlcm-country-code-select\n [control]=\"control\"\n (changed)=\"handleCountryChange()\"\n (click)=\"$event.stopPropagation()\"\n></wlcm-country-code-select>\n\n<div class=\"wlcm-phone-input-container-divider\"></div>\n\n<ng-content select=\"[wlcmPhoneInput]\"></ng-content>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: WlcmCountryCodeSelectComponent, selector: "wlcm-country-code-select", inputs: ["control"], outputs: ["changed"] }] }); }
|
78
|
+
};
|
79
|
+
WlcmPhoneInputContainerComponent = __decorate([
|
80
|
+
UntilDestroy(),
|
81
|
+
__metadata("design:paramtypes", [NgZone])
|
82
|
+
], WlcmPhoneInputContainerComponent);
|
83
|
+
export { WlcmPhoneInputContainerComponent };
|
84
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPhoneInputContainerComponent, decorators: [{
|
85
|
+
type: Component,
|
86
|
+
args: [{ selector: 'wlcm-phone-input-container', host: { class: 'wlcm-phone-input-container' }, standalone: true, imports: [CommonModule, WlcmCountryCodeSelectComponent], providers: [
|
87
|
+
{
|
88
|
+
provide: WLCM_INPUT_BINDER,
|
89
|
+
useFactory: () => {
|
90
|
+
const container = inject(WlcmPhoneInputContainerComponent, { self: true });
|
91
|
+
return { bind: () => container };
|
92
|
+
},
|
93
|
+
},
|
94
|
+
{ provide: WLCM_PHONE_ADAPTER, useExisting: forwardRef(() => WlcmPhoneInputContainerComponent) },
|
95
|
+
], template: "<wlcm-country-code-select\n [control]=\"control\"\n (changed)=\"handleCountryChange()\"\n (click)=\"$event.stopPropagation()\"\n></wlcm-country-code-select>\n\n<div class=\"wlcm-phone-input-container-divider\"></div>\n\n<ng-content select=\"[wlcmPhoneInput]\"></ng-content>\n" }]
|
96
|
+
}], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { codeSelect: [{
|
97
|
+
type: ViewChild,
|
98
|
+
args: [WlcmCountryCodeSelectComponent]
|
99
|
+
}], phoneInput: [{
|
100
|
+
type: ContentChild,
|
101
|
+
args: [WlcmPhoneInputDirective]
|
102
|
+
}] } });
|
103
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGhvbmUtaW5wdXQtY29udGFpbmVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL21vZHVsZXMvcGhvbmUtaW5wdXQvc3JjL2xpYi9jb21wb25lbnRzL3Bob25lLWlucHV0LWNvbnRhaW5lci9waG9uZS1pbnB1dC1jb250YWluZXIuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9waG9uZS1pbnB1dC9zcmMvbGliL2NvbXBvbmVudHMvcGhvbmUtaW5wdXQtY29udGFpbmVyL3Bob25lLWlucHV0LWNvbnRhaW5lci5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9DLE9BQU8sRUFBb0IsU0FBUyxFQUFFLFlBQVksRUFBRSxNQUFNLEVBQUUsU0F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nZm9jdXMnKS5waXBlKHRhcCgoKSA9PiB0aGlzLl9mb2N1c1N0cmVhbSQubmV4dCgpKSksXG4gICAgICAgIGZyb21FdmVudCh0aGlzLnBob25lSW5wdXQuZWxlbWVudCwgJ2JsdXInKS5waXBlKHRhcCgoKSA9PiB0aGlzLl9ibHVyU3RyZWFtJC5uZXh0KCkpKVxuICAgICAgKVxuICAgICAgICAucGlwZSh1bnRpbERlc3Ryb3llZCh0aGlzKSlcbiAgICAgICAgLnN1YnNjcmliZSgpO1xuICAgIH0pO1xuICB9XG59XG4iLCI8d2xjbS1jb3VudHJ5LWNvZGUtc2VsZWN0XG4gIFtjb250cm9sXT1cImNvbnRyb2xcIlxuICAoY2hhbmdlZCk9XCJoYW5kbGVDb3VudHJ5Q2hhbmdlKClcIlxuICAoY2xpY2spPVwiJGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpXCJcbj48L3dsY20tY291bnRyeS1jb2RlLXNlbGVjdD5cblxuPGRpdiBjbGFzcz1cIndsY20tcGhvbmUtaW5wdXQtY29udGFpbmVyLWRpdmlkZXJcIj48L2Rpdj5cblxuPG5nLWNvbnRlbnQgc2VsZWN0PVwiW3dsY21QaG9uZUlucHV0XVwiPjwvbmctY29udGVudD5cbiJdfQ==
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import { Directive, ElementRef, HostListener, Inject, effect, forwardRef, input, } from '@angular/core';
|
2
|
+
import { FormControl, NG_VALIDATORS, NG_VALUE_ACCESSOR, } from '@angular/forms';
|
3
|
+
import IMask from 'imask';
|
4
|
+
import { WLCM_PHONE_ADAPTER } from '../constants/phone-adapter.constants';
|
5
|
+
import { WlcmPhoneAdapter } from '../models/phone-adapter.models';
|
6
|
+
import { Subject, fromEvent, takeUntil } from 'rxjs';
|
7
|
+
import { WlcmPhoneValidationErrorType } from '../models/phone.models';
|
8
|
+
import { isValidNumber } from 'libphonenumber-js';
|
9
|
+
import * as i0 from "@angular/core";
|
10
|
+
import * as i1 from "../models/phone-adapter.models";
|
11
|
+
export class WlcmPhoneInputDirective {
|
12
|
+
handleBlur() {
|
13
|
+
this._touched?.();
|
14
|
+
}
|
15
|
+
constructor(_elementRef, phoneAdapter) {
|
16
|
+
this._elementRef = _elementRef;
|
17
|
+
this.phoneAdapter = phoneAdapter;
|
18
|
+
this.control = new FormControl();
|
19
|
+
this.destroyInputObserver$ = new Subject();
|
20
|
+
this.mask = input('', { alias: 'wlcmPhoneInputMask' });
|
21
|
+
effect(() => {
|
22
|
+
const maskPattern = this.mask();
|
23
|
+
if (maskPattern) {
|
24
|
+
if (!this._imaskRef)
|
25
|
+
this.initializeMask();
|
26
|
+
this._imaskRef.mask = maskPattern;
|
27
|
+
this._imaskRef.updateControl();
|
28
|
+
this._imaskRef.on('accept', () => this.handleInput());
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
this.subscribeToInputEvent();
|
32
|
+
}
|
33
|
+
});
|
34
|
+
this.subscribeToPasteEvent();
|
35
|
+
}
|
36
|
+
ngOnDestroy() {
|
37
|
+
this.destroyInputObserver$.next();
|
38
|
+
this.destroyInputObserver$.complete();
|
39
|
+
}
|
40
|
+
writeValue(value) {
|
41
|
+
const parsedValue = this.phoneAdapter.parseValue(value);
|
42
|
+
if (this._imaskRef) {
|
43
|
+
this._imaskRef.value = parsedValue;
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
this.element.value = parsedValue;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
registerOnChange(callback) {
|
50
|
+
this._changed = callback;
|
51
|
+
}
|
52
|
+
registerOnTouched(callback) {
|
53
|
+
this._touched = callback;
|
54
|
+
}
|
55
|
+
registerOnValidatorChange(callback) {
|
56
|
+
this._validatorChanged = callback;
|
57
|
+
}
|
58
|
+
validate(control) {
|
59
|
+
const isValid = isValidNumber(control.value ?? '');
|
60
|
+
if (!isValid) {
|
61
|
+
return { [WlcmPhoneValidationErrorType.InvalidPhoneNumber]: true };
|
62
|
+
}
|
63
|
+
return null;
|
64
|
+
}
|
65
|
+
setDisabledState(isDisabled) {
|
66
|
+
if (isDisabled) {
|
67
|
+
return this.control.disable();
|
68
|
+
}
|
69
|
+
this.control.enable();
|
70
|
+
}
|
71
|
+
_updateControl() {
|
72
|
+
this.handleInput();
|
73
|
+
}
|
74
|
+
get element() {
|
75
|
+
return this._elementRef.nativeElement;
|
76
|
+
}
|
77
|
+
handleInput() {
|
78
|
+
const value = this.element.value;
|
79
|
+
this._changed?.(this.phoneAdapter.formatValue(value));
|
80
|
+
}
|
81
|
+
handlePaste(event) {
|
82
|
+
event.preventDefault();
|
83
|
+
const value = event.clipboardData?.getData('text') ?? '';
|
84
|
+
this.writeValue(value);
|
85
|
+
this.handleInput();
|
86
|
+
}
|
87
|
+
initializeMask() {
|
88
|
+
this._imaskRef = IMask(this.element, { mask: Number });
|
89
|
+
}
|
90
|
+
subscribeToInputEvent() {
|
91
|
+
fromEvent(this.element, 'input')
|
92
|
+
.pipe(takeUntil(this.destroyInputObserver$))
|
93
|
+
.subscribe(() => this.handleInput());
|
94
|
+
}
|
95
|
+
subscribeToPasteEvent() {
|
96
|
+
fromEvent(this.element, 'paste')
|
97
|
+
.pipe(takeUntil(this.destroyInputObserver$))
|
98
|
+
.subscribe((event) => this.handlePaste(event));
|
99
|
+
}
|
100
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPhoneInputDirective, deps: [{ token: i0.ElementRef }, { token: WLCM_PHONE_ADAPTER }], target: i0.ɵɵFactoryTarget.Directive }); }
|
101
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.3.5", type: WlcmPhoneInputDirective, isStandalone: true, selector: "[wlcmPhoneInput]", inputs: { mask: { classPropertyName: "mask", publicName: "wlcmPhoneInputMask", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "blur": "handleBlur($event)" }, classAttribute: "wlcm-form-field-input" }, providers: [
|
102
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmPhoneInputDirective), multi: true },
|
103
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmPhoneInputDirective), multi: true },
|
104
|
+
], ngImport: i0 }); }
|
105
|
+
}
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmPhoneInputDirective, decorators: [{
|
107
|
+
type: Directive,
|
108
|
+
args: [{
|
109
|
+
selector: '[wlcmPhoneInput]',
|
110
|
+
host: { class: 'wlcm-form-field-input' },
|
111
|
+
standalone: true,
|
112
|
+
providers: [
|
113
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmPhoneInputDirective), multi: true },
|
114
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmPhoneInputDirective), multi: true },
|
115
|
+
],
|
116
|
+
}]
|
117
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1.WlcmPhoneAdapter, decorators: [{
|
118
|
+
type: Inject,
|
119
|
+
args: [WLCM_PHONE_ADAPTER]
|
120
|
+
}] }], propDecorators: { handleBlur: [{
|
121
|
+
type: HostListener,
|
122
|
+
args: ['blur', ['$event']]
|
123
|
+
}] } });
|
124
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGhvbmUtaW5wdXQuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbW9kdWxlcy9waG9uZS1pbnB1dC9zcmMvbGliL2RpcmVjdGl2ZXMvcGhvbmUtaW5wdXQuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxTQUFTLEVBQ1QsVUFBVSxFQUNWLFlBQVksRUFDWixNQUFNLEVBR04sTUFBTSxFQUNOLFVBQVUsRUFDVixLQUFLLEdBQ04sTUFBTSxlQUFlLEN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ciQpKVxuICAgICAgLnN1YnNjcmliZSgoZXZlbnQ6IENsaXBib2FyZEV2ZW50KSA9PiB0aGlzLmhhbmRsZVBhc3RlKGV2ZW50KSk7XG4gIH1cbn1cbiJdfQ==
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { InjectionToken, input, effect, forwardRef, Directive, Inject, HostListener, Pipe, output, Component, inject, NgZone,
|
2
|
+
import { InjectionToken, input, effect, forwardRef, Directive, Inject, HostListener, Pipe, output, Component, ViewChild, inject, NgZone, ContentChild, NgModule } from '@angular/core';
|
3
3
|
import { CommonModule } from '@angular/common';
|
4
4
|
import { __decorate, __metadata } from 'tslib';
|
5
5
|
import * as i2 from '@angular/forms';
|
@@ -8,7 +8,7 @@ import IMask from 'imask';
|
|
8
8
|
import { Subject, fromEvent, takeUntil, merge, tap } from 'rxjs';
|
9
9
|
import { isValidNumber, getCountries, getPhoneCode, AsYouType, parsePhoneNumber } from 'libphonenumber-js';
|
10
10
|
import * as i1 from '@wlcm/angular/forms';
|
11
|
-
import { WlcmFormsModule, WLCM_INPUT_BINDER } from '@wlcm/angular/forms';
|
11
|
+
import { WlcmSelectComponent, WlcmFormsModule, WLCM_INPUT_BINDER } from '@wlcm/angular/forms';
|
12
12
|
import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
|
13
13
|
import { WlcmOption } from '@wlcm/angular/core';
|
14
14
|
import { countries, getEmojiFlag, getCountryCode } from 'countries-list';
|
@@ -54,7 +54,12 @@ class WlcmPhoneInputDirective {
|
|
54
54
|
}
|
55
55
|
writeValue(value) {
|
56
56
|
const parsedValue = this.phoneAdapter.parseValue(value);
|
57
|
-
this.
|
57
|
+
if (this._imaskRef) {
|
58
|
+
this._imaskRef.value = parsedValue;
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
this.element.value = parsedValue;
|
62
|
+
}
|
58
63
|
}
|
59
64
|
registerOnChange(callback) {
|
60
65
|
this._changed = callback;
|
@@ -178,8 +183,11 @@ class WlcmCountryCodeSelectComponent {
|
|
178
183
|
this.changed = output();
|
179
184
|
this.control = input(new FormControl('US'));
|
180
185
|
}
|
186
|
+
get selectComponent() {
|
187
|
+
return this.wlcmSelect.matSelect;
|
188
|
+
}
|
181
189
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmCountryCodeSelectComponent, deps: [{ token: WLCM_COUNTRY_CODE_OPTIONS }], target: i0.ɵɵFactoryTarget.Component }); }
|
182
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmCountryCodeSelectComponent, isStandalone: true, selector: "wlcm-country-code-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "wlcm-country-code-select" }, ngImport: i0, template: "<wlcm-select\n [options]=\"options\"\n [formControl]=\"control()\"\n [optionTemplate]=\"optionTemplate\"\n [triggerTemplate]=\"triggerTemplate\"\n (selectionChange)=\"changed.emit($event)\"\n></wlcm-select>\n\n<ng-template #optionTemplate let-option>\n <span class=\"emoji-flag\">{{ option.emojiFlag }}</span>\n\n {{ option.viewValue }}\n</ng-template>\n\n<ng-template #triggerTemplate let-selected>\n <div class=\"wlcm-country-code-select-trigger\">\n +{{ selected?.value | phoneCode }}\n </div>\n</ng-template>\n", styles: [".emoji-flag{font-size:20px;vertical-align:bottom;margin-right:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: WlcmFormsModule }, { kind: "component", type: i1.WlcmSelectComponent, selector: "wlcm-select", inputs: ["multiple", "placeholder", "options", "optionTemplate", "triggerTemplate"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: PhoneCodePipe, name: "phoneCode" }] }); }
|
190
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.5", type: WlcmCountryCodeSelectComponent, isStandalone: true, selector: "wlcm-country-code-select", inputs: { control: { classPropertyName: "control", publicName: "control", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "wlcm-country-code-select" }, viewQueries: [{ propertyName: "wlcmSelect", first: true, predicate: WlcmSelectComponent, descendants: true }], ngImport: i0, template: "<wlcm-select\n [options]=\"options\"\n [formControl]=\"control()\"\n [optionTemplate]=\"optionTemplate\"\n [triggerTemplate]=\"triggerTemplate\"\n (selectionChange)=\"changed.emit($event)\"\n></wlcm-select>\n\n<ng-template #optionTemplate let-option>\n <span class=\"emoji-flag\">{{ option.emojiFlag }}</span>\n\n {{ option.viewValue }}\n</ng-template>\n\n<ng-template #triggerTemplate let-selected>\n <div class=\"wlcm-country-code-select-trigger\">\n +{{ selected?.value | phoneCode }}\n </div>\n</ng-template>\n", styles: [".emoji-flag{font-size:20px;vertical-align:bottom;margin-right:8px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: WlcmFormsModule }, { kind: "component", type: i1.WlcmSelectComponent, selector: "wlcm-select", inputs: ["multiple", "placeholder", "options", "optionTemplate", "triggerTemplate"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "pipe", type: PhoneCodePipe, name: "phoneCode" }] }); }
|
183
191
|
}
|
184
192
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: WlcmCountryCodeSelectComponent, decorators: [{
|
185
193
|
type: Component,
|
@@ -187,7 +195,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
187
195
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
188
196
|
type: Inject,
|
189
197
|
args: [WLCM_COUNTRY_CODE_OPTIONS]
|
190
|
-
}] }]
|
198
|
+
}] }], propDecorators: { wlcmSelect: [{
|
199
|
+
type: ViewChild,
|
200
|
+
args: [WlcmSelectComponent]
|
201
|
+
}] } });
|
191
202
|
|
192
203
|
let WlcmPhoneInputContainerComponent = class WlcmPhoneInputContainerComponent {
|
193
204
|
constructor(_zone) {
|
@@ -225,7 +236,7 @@ let WlcmPhoneInputContainerComponent = class WlcmPhoneInputContainerComponent {
|
|
225
236
|
this.handleInputEvents();
|
226
237
|
}
|
227
238
|
isFocused() {
|
228
|
-
return this.phoneInput.element === document.activeElement;
|
239
|
+
return this.phoneInput.element === document.activeElement || this.codeSelect?.selectComponent.panelOpen;
|
229
240
|
}
|
230
241
|
focus() {
|
231
242
|
this.phoneInput.element.focus();
|
@@ -253,7 +264,7 @@ let WlcmPhoneInputContainerComponent = class WlcmPhoneInputContainerComponent {
|
|
253
264
|
},
|
254
265
|
},
|
255
266
|
{ provide: WLCM_PHONE_ADAPTER, useExisting: forwardRef(() => WlcmPhoneInputContainerComponent) },
|
256
|
-
], queries: [{ propertyName: "phoneInput", first: true, predicate: WlcmPhoneInputDirective, descendants: true }], viewQueries: [{ propertyName: "codeSelect", first: true, predicate: WlcmCountryCodeSelectComponent, descendants: true }], ngImport: i0, template: "<wlcm-country-code-select\n [control]=\"control\"\n (changed)=\"handleCountryChange()\"\n></wlcm-country-code-select>\n\n<div class=\"wlcm-phone-input-container-divider\"></div>\n\n<ng-content select=\"[wlcmPhoneInput]\"></ng-content>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: WlcmCountryCodeSelectComponent, selector: "wlcm-country-code-select", inputs: ["control"], outputs: ["changed"] }] }); }
|
267
|
+
], queries: [{ propertyName: "phoneInput", first: true, predicate: WlcmPhoneInputDirective, descendants: true }], viewQueries: [{ propertyName: "codeSelect", first: true, predicate: WlcmCountryCodeSelectComponent, descendants: true }], ngImport: i0, template: "<wlcm-country-code-select\n [control]=\"control\"\n (changed)=\"handleCountryChange()\"\n (click)=\"$event.stopPropagation()\"\n></wlcm-country-code-select>\n\n<div class=\"wlcm-phone-input-container-divider\"></div>\n\n<ng-content select=\"[wlcmPhoneInput]\"></ng-content>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: WlcmCountryCodeSelectComponent, selector: "wlcm-country-code-select", inputs: ["control"], outputs: ["changed"] }] }); }
|
257
268
|
};
|
258
269
|
WlcmPhoneInputContainerComponent = __decorate([
|
259
270
|
UntilDestroy(),
|
@@ -270,7 +281,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImpor
|
|
270
281
|
},
|
271
282
|
},
|
272
283
|
{ provide: WLCM_PHONE_ADAPTER, useExisting: forwardRef(() => WlcmPhoneInputContainerComponent) },
|
273
|
-
], template: "<wlcm-country-code-select\n [control]=\"control\"\n (changed)=\"handleCountryChange()\"\n></wlcm-country-code-select>\n\n<div class=\"wlcm-phone-input-container-divider\"></div>\n\n<ng-content select=\"[wlcmPhoneInput]\"></ng-content>\n" }]
|
284
|
+
], template: "<wlcm-country-code-select\n [control]=\"control\"\n (changed)=\"handleCountryChange()\"\n (click)=\"$event.stopPropagation()\"\n></wlcm-country-code-select>\n\n<div class=\"wlcm-phone-input-container-divider\"></div>\n\n<ng-content select=\"[wlcmPhoneInput]\"></ng-content>\n" }]
|
274
285
|
}], ctorParameters: () => [{ type: i0.NgZone }], propDecorators: { codeSelect: [{
|
275
286
|
type: ViewChild,
|
276
287
|
args: [WlcmCountryCodeSelectComponent]
|