@lenne.tech/ng-base 18.1.2 → 22.0.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/CLAUDE.md +55 -0
- package/LICENSE +2 -2
- package/README.md +237 -44
- package/fesm2022/lenne.tech-ng-base-ai.mjs +767 -0
- package/fesm2022/lenne.tech-ng-base-ai.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-auth-provide.mjs +939 -0
- package/fesm2022/lenne.tech-ng-base-auth-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-auth.mjs +454 -0
- package/fesm2022/lenne.tech-ng-base-auth.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs +825 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-dialog-BRzVmKJr.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs +351 -0
- package/fesm2022/lenne.tech-ng-base-bug-bug-report-service-DWoTb_iw.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs +1046 -0
- package/fesm2022/lenne.tech-ng-base-bug-capture-engine-TkjMDdqj.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs +4 -0
- package/fesm2022/lenne.tech-ng-base-bug-constants-Brm2KGHi.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs +179 -0
- package/fesm2022/lenne.tech-ng-base-bug-messages-BsP4fRQU.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-provide.mjs +26 -0
- package/fesm2022/lenne.tech-ng-base-bug-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs +62 -0
- package/fesm2022/lenne.tech-ng-base-bug-report-Tzlhe1Cm.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug-server.mjs +818 -0
- package/fesm2022/lenne.tech-ng-base-bug-server.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-bug.mjs +196 -0
- package/fesm2022/lenne.tech-ng-base-bug.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-files-ui.mjs +445 -0
- package/fesm2022/lenne.tech-ng-base-files-ui.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-files.mjs +474 -0
- package/fesm2022/lenne.tech-ng-base-files.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-server.mjs +408 -0
- package/fesm2022/lenne.tech-ng-base-server.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-share.mjs +76 -0
- package/fesm2022/lenne.tech-ng-base-share.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-sync.mjs +1096 -0
- package/fesm2022/lenne.tech-ng-base-sync.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-testing.mjs +171 -0
- package/fesm2022/lenne.tech-ng-base-testing.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-ui-provide.mjs +124 -0
- package/fesm2022/lenne.tech-ng-base-ui-provide.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-ui.mjs +34611 -0
- package/fesm2022/lenne.tech-ng-base-ui.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base-utils.mjs +287 -0
- package/fesm2022/lenne.tech-ng-base-utils.mjs.map +1 -0
- package/fesm2022/lenne.tech-ng-base.mjs +615 -902
- package/fesm2022/lenne.tech-ng-base.mjs.map +1 -1
- package/i18n/auth/de.json +17 -0
- package/i18n/auth/en.json +17 -0
- package/i18n/bug/de.json +85 -0
- package/i18n/bug/en.json +85 -0
- package/i18n/de.json +8 -0
- package/i18n/en.json +8 -0
- package/i18n/files/de.json +27 -0
- package/i18n/files/en.json +27 -0
- package/i18n/share/de.json +8 -0
- package/i18n/share/en.json +8 -0
- package/i18n/ui/de.json +38 -0
- package/i18n/ui/en.json +38 -0
- package/package.json +127 -58
- package/types/lenne.tech-ng-base-ai.d.ts +830 -0
- package/types/lenne.tech-ng-base-auth-provide.d.ts +603 -0
- package/types/lenne.tech-ng-base-auth.d.ts +320 -0
- package/types/lenne.tech-ng-base-bug-provide.d.ts +272 -0
- package/types/lenne.tech-ng-base-bug-rolldown-runtime-C25Le4-w.d.ts +1 -0
- package/types/lenne.tech-ng-base-bug-server.d.ts +316 -0
- package/types/lenne.tech-ng-base-bug.d.ts +202 -0
- package/types/lenne.tech-ng-base-files-ui.d.ts +116 -0
- package/types/lenne.tech-ng-base-files.d.ts +288 -0
- package/types/lenne.tech-ng-base-server.d.ts +262 -0
- package/types/lenne.tech-ng-base-share.d.ts +21 -0
- package/types/lenne.tech-ng-base-sync.d.ts +380 -0
- package/types/lenne.tech-ng-base-testing.d.ts +327 -0
- package/types/lenne.tech-ng-base-ui-provide.d.ts +65 -0
- package/types/lenne.tech-ng-base-ui.d.ts +7732 -0
- package/types/lenne.tech-ng-base-utils.d.ts +150 -0
- package/types/lenne.tech-ng-base.d.ts +503 -0
- package/ui/styles/components/accordion.css +3 -0
- package/ui/styles/components/alert-dialog.css +4 -0
- package/ui/styles/components/alert.css +3 -0
- package/ui/styles/components/aspect-ratio.css +3 -0
- package/ui/styles/components/attachment.css +4 -0
- package/ui/styles/components/autocomplete.css +4 -0
- package/ui/styles/components/avatar.css +3 -0
- package/ui/styles/components/badge.css +3 -0
- package/ui/styles/components/breadcrumb.css +3 -0
- package/ui/styles/components/bubble.css +3 -0
- package/ui/styles/components/button-group.css +3 -0
- package/ui/styles/components/button.css +3 -0
- package/ui/styles/components/calendar.css +5 -0
- package/ui/styles/components/card.css +3 -0
- package/ui/styles/components/checkbox.css +3 -0
- package/ui/styles/components/code-block.css +4 -0
- package/ui/styles/components/collapsible.css +3 -0
- package/ui/styles/components/combobox.css +5 -0
- package/ui/styles/components/command.css +5 -0
- package/ui/styles/components/context-menu.css +3 -0
- package/ui/styles/components/date-picker.css +7 -0
- package/ui/styles/components/dialog.css +4 -0
- package/ui/styles/components/drawer.css +3 -0
- package/ui/styles/components/dropdown-menu.css +3 -0
- package/ui/styles/components/empty.css +3 -0
- package/ui/styles/components/field.css +5 -0
- package/ui/styles/components/hover-card.css +3 -0
- package/ui/styles/components/index.css +91 -0
- package/ui/styles/components/input-group.css +6 -0
- package/ui/styles/components/input-otp.css +3 -0
- package/ui/styles/components/input.css +3 -0
- package/ui/styles/components/item.css +4 -0
- package/ui/styles/components/kbd.css +3 -0
- package/ui/styles/components/label.css +3 -0
- package/ui/styles/components/lt-breadcrumb.css +3 -0
- package/ui/styles/components/lt-bug-attachments.css +5 -0
- package/ui/styles/components/lt-bug-journey-timeline.css +5 -0
- package/ui/styles/components/lt-bug-report-dialog.css +15 -0
- package/ui/styles/components/lt-bug-report.css +4 -0
- package/ui/styles/components/lt-color-mode-button.css +3 -0
- package/ui/styles/components/lt-confirm-dialog.css +4 -0
- package/ui/styles/components/lt-data-view.css +5 -0
- package/ui/styles/components/lt-date-picker.css +3 -0
- package/ui/styles/components/lt-date-time-picker.css +5 -0
- package/ui/styles/components/lt-enter-action.css +2 -0
- package/ui/styles/components/lt-footer.css +3 -0
- package/ui/styles/components/lt-form-field.css +4 -0
- package/ui/styles/components/lt-header.css +5 -0
- package/ui/styles/components/lt-imports.css +21 -0
- package/ui/styles/components/lt-navigation-menu.css +3 -0
- package/ui/styles/components/lt-notice.css +3 -0
- package/ui/styles/components/lt-overlay-defaults.css +3 -0
- package/ui/styles/components/lt-page-card.css +3 -0
- package/ui/styles/components/lt-page-title.css +2 -0
- package/ui/styles/components/lt-password-input.css +4 -0
- package/ui/styles/components/lt-readonly-field.css +2 -0
- package/ui/styles/components/lt-select.css +4 -0
- package/ui/styles/components/lt-text-field.css +5 -0
- package/ui/styles/components/lt-toolbar-item.css +2 -0
- package/ui/styles/components/lt-toolbar.css +3 -0
- package/ui/styles/components/lt-tus-upload-component.css +5 -0
- package/ui/styles/components/marker.css +3 -0
- package/ui/styles/components/menubar.css +3 -0
- package/ui/styles/components/message-scroller.css +4 -0
- package/ui/styles/components/message.css +3 -0
- package/ui/styles/components/native-select.css +3 -0
- package/ui/styles/components/navigation-menu.css +3 -0
- package/ui/styles/components/pagination.css +4 -0
- package/ui/styles/components/popover.css +3 -0
- package/ui/styles/components/progress.css +3 -0
- package/ui/styles/components/questionnaire.css +4 -0
- package/ui/styles/components/radio-group.css +3 -0
- package/ui/styles/components/resizable.css +3 -0
- package/ui/styles/components/select.css +3 -0
- package/ui/styles/components/separator.css +3 -0
- package/ui/styles/components/sheet.css +4 -0
- package/ui/styles/components/sidebar.css +9 -0
- package/ui/styles/components/skeleton.css +3 -0
- package/ui/styles/components/slider.css +3 -0
- package/ui/styles/components/sonner.css +4 -0
- package/ui/styles/components/spinner.css +3 -0
- package/ui/styles/components/switch.css +3 -0
- package/ui/styles/components/table.css +3 -0
- package/ui/styles/components/tabs.css +4 -0
- package/ui/styles/components/textarea.css +3 -0
- package/ui/styles/components/toggle-group.css +4 -0
- package/ui/styles/components/toggle.css +3 -0
- package/ui/styles/components/tooltip.css +3 -0
- package/ui/styles/components/trace.css +3 -0
- package/ui/styles/components/typography.css +3 -0
- package/ui/styles/components/utils.css +2 -0
- package/ui/styles/core.css +137 -0
- package/ui/styles/palette.css +94 -0
- package/ui/styles/theme.css +14 -0
- package/ui/styles/transitions.css +131 -0
- package/base-cms/index.d.ts +0 -5
- package/base-cms/interfaces/base-cms-module-config.interface.d.ts +0 -16
- package/base-cms/pages/base-cms/base-cms.component.d.ts +0 -92
- package/base-cms/public-api.d.ts +0 -5
- package/base-components/components/breadcrumb/breadcrumb.component.d.ts +0 -10
- package/base-components/components/change-password/change-password.component.d.ts +0 -24
- package/base-components/components/checkbox/checkbox.component.d.ts +0 -12
- package/base-components/components/delete-account/delete-account.component.d.ts +0 -15
- package/base-components/components/fab-button/fab-button.component.d.ts +0 -16
- package/base-components/components/input/input.component.d.ts +0 -27
- package/base-components/components/loading-bar/loading-bar.component.d.ts +0 -17
- package/base-components/components/model-form/model-form-base.component.d.ts +0 -64
- package/base-components/components/model-form/model-form.component.d.ts +0 -139
- package/base-components/components/model-form-sub/model-form-sub.component.d.ts +0 -56
- package/base-components/components/model-table/model-table.component.d.ts +0 -115
- package/base-components/components/refence-input/refence-input.component.d.ts +0 -84
- package/base-components/components/select/select.component.d.ts +0 -25
- package/base-components/components/skeleton-loader/skeleton-loader.component.d.ts +0 -10
- package/base-components/components/tags/tags.component.d.ts +0 -60
- package/base-components/components/textarea/textarea.component.d.ts +0 -21
- package/base-components/components/toast/toast.component.d.ts +0 -19
- package/base-components/components/upload-image/upload-image.component.d.ts +0 -111
- package/base-components/directives/back-button.directive.d.ts +0 -9
- package/base-components/directives/context-menu.directive.d.ts +0 -22
- package/base-components/directives/sort.directive.d.ts +0 -15
- package/base-components/directives/stop-propagation.directive.d.ts +0 -10
- package/base-components/index.d.ts +0 -5
- package/base-components/pipes/ellipses.pipe.d.ts +0 -10
- package/base-components/public-api.d.ts +0 -26
- package/base-prototype/index.d.ts +0 -5
- package/base-prototype/pages/email-verification/email-verification.component.d.ts +0 -18
- package/base-prototype/pages/forgot-password/forgot-password.component.d.ts +0 -26
- package/base-prototype/pages/login/login.component.d.ts +0 -33
- package/base-prototype/pages/profile/profile.component.d.ts +0 -24
- package/base-prototype/pages/register/register.component.d.ts +0 -31
- package/base-prototype/pages/set-password/set-password.component.d.ts +0 -29
- package/base-prototype/public-api.d.ts +0 -9
- package/esm2022/base-cms/interfaces/base-cms-module-config.interface.mjs +0 -3
- package/esm2022/base-cms/lenne.tech-ng-base-base-cms.mjs +0 -5
- package/esm2022/base-cms/pages/base-cms/base-cms.component.mjs +0 -238
- package/esm2022/base-cms/public-api.mjs +0 -8
- package/esm2022/base-components/components/breadcrumb/breadcrumb.component.mjs +0 -23
- package/esm2022/base-components/components/change-password/change-password.component.mjs +0 -97
- package/esm2022/base-components/components/checkbox/checkbox.component.mjs +0 -38
- package/esm2022/base-components/components/delete-account/delete-account.component.mjs +0 -59
- package/esm2022/base-components/components/fab-button/fab-button.component.mjs +0 -24
- package/esm2022/base-components/components/input/input.component.mjs +0 -75
- package/esm2022/base-components/components/loading-bar/loading-bar.component.mjs +0 -37
- package/esm2022/base-components/components/model-form/model-form-base.component.mjs +0 -145
- package/esm2022/base-components/components/model-form/model-form.component.mjs +0 -591
- package/esm2022/base-components/components/model-form-sub/model-form-sub.component.mjs +0 -117
- package/esm2022/base-components/components/model-table/model-table.component.mjs +0 -478
- package/esm2022/base-components/components/refence-input/refence-input.component.mjs +0 -278
- package/esm2022/base-components/components/select/select.component.mjs +0 -62
- package/esm2022/base-components/components/skeleton-loader/skeleton-loader.component.mjs +0 -33
- package/esm2022/base-components/components/tags/tags.component.mjs +0 -227
- package/esm2022/base-components/components/textarea/textarea.component.mjs +0 -79
- package/esm2022/base-components/components/toast/toast.component.mjs +0 -69
- package/esm2022/base-components/components/upload-image/upload-image.component.mjs +0 -346
- package/esm2022/base-components/directives/back-button.directive.mjs +0 -25
- package/esm2022/base-components/directives/context-menu.directive.mjs +0 -112
- package/esm2022/base-components/directives/sort.directive.mjs +0 -61
- package/esm2022/base-components/directives/stop-propagation.directive.mjs +0 -24
- package/esm2022/base-components/lenne.tech-ng-base-base-components.mjs +0 -5
- package/esm2022/base-components/pipes/ellipses.pipe.mjs +0 -23
- package/esm2022/base-components/public-api.mjs +0 -30
- package/esm2022/base-prototype/lenne.tech-ng-base-base-prototype.mjs +0 -5
- package/esm2022/base-prototype/pages/email-verification/email-verification.component.mjs +0 -60
- package/esm2022/base-prototype/pages/forgot-password/forgot-password.component.mjs +0 -78
- package/esm2022/base-prototype/pages/login/login.component.mjs +0 -114
- package/esm2022/base-prototype/pages/profile/profile.component.mjs +0 -87
- package/esm2022/base-prototype/pages/register/register.component.mjs +0 -100
- package/esm2022/base-prototype/pages/set-password/set-password.component.mjs +0 -91
- package/esm2022/base-prototype/public-api.mjs +0 -11
- package/esm2022/lenne.tech-ng-base.mjs +0 -5
- package/esm2022/public-api.mjs +0 -25
- package/esm2022/shared/classes/auth.class.mjs +0 -14
- package/esm2022/shared/classes/basic-user.class.mjs +0 -49
- package/esm2022/shared/classes/graphql-enum.class.mjs +0 -10
- package/esm2022/shared/classes/graphql-meta.class.mjs +0 -345
- package/esm2022/shared/classes/graphql-type.class.mjs +0 -14
- package/esm2022/shared/classes/helper.class.mjs +0 -307
- package/esm2022/shared/classes/sort.class.mjs +0 -38
- package/esm2022/shared/classes/standard.class.mjs +0 -40
- package/esm2022/shared/decorators/debounce.decorator.mjs +0 -12
- package/esm2022/shared/enums/comparison-operator.enum.mjs +0 -16
- package/esm2022/shared/enums/graphql-request-type.enum.mjs +0 -10
- package/esm2022/shared/enums/logical-operator.enum.mjs +0 -10
- package/esm2022/shared/enums/skeleton-type.enum.mjs +0 -7
- package/esm2022/shared/enums/sort-order.enum.mjs +0 -6
- package/esm2022/shared/enums/toast-type.enum.mjs +0 -8
- package/esm2022/shared/functions/ws-client.function.mjs +0 -39
- package/esm2022/shared/interfaces/base-module-config.interface.mjs +0 -3
- package/esm2022/shared/interfaces/breadcrumb.interface.mjs +0 -2
- package/esm2022/shared/interfaces/can-component-deactivate.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-enum-values.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-field-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-model-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cms-table-field.interface.mjs +0 -2
- package/esm2022/shared/interfaces/combined-filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/compress-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/cropping-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/field-object.interface.mjs +0 -2
- package/esm2022/shared/interfaces/field.interface.mjs +0 -2
- package/esm2022/shared/interfaces/filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/find-args.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-crud-type.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-fields-object.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-options.interface.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-plus-options.interfacen.mjs +0 -2
- package/esm2022/shared/interfaces/graphql-type-collection.interface.mjs +0 -2
- package/esm2022/shared/interfaces/login-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/register-config.interface.mjs +0 -2
- package/esm2022/shared/interfaces/single-filter-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/sort-input.interface.mjs +0 -2
- package/esm2022/shared/interfaces/time-components.interface.mjs +0 -2
- package/esm2022/shared/interfaces/toast.interface.mjs +0 -2
- package/esm2022/shared/lenne.tech-ng-base-shared.mjs +0 -5
- package/esm2022/shared/public-api.mjs +0 -74
- package/esm2022/shared/services/auth.service.mjs +0 -152
- package/esm2022/shared/services/breadcrumb.service.mjs +0 -69
- package/esm2022/shared/services/cms.service.mjs +0 -82
- package/esm2022/shared/services/file.service.mjs +0 -86
- package/esm2022/shared/services/forms.service.mjs +0 -61
- package/esm2022/shared/services/graphql-meta.service.mjs +0 -132
- package/esm2022/shared/services/graphql-plus.service.mjs +0 -93
- package/esm2022/shared/services/graphql.service.mjs +0 -510
- package/esm2022/shared/services/image.service.mjs +0 -102
- package/esm2022/shared/services/loader.service.mjs +0 -78
- package/esm2022/shared/services/navigation.service.mjs +0 -38
- package/esm2022/shared/services/scroll.service.mjs +0 -207
- package/esm2022/shared/services/storage.service.mjs +0 -149
- package/esm2022/shared/services/toast.service.mjs +0 -39
- package/esm2022/shared/services/user.service.mjs +0 -160
- package/esm2022/shared/services/ws.service.mjs +0 -17
- package/esm2022/shared/types/graphql-fields.type.mjs +0 -2
- package/esm2022/shared/types/storage.type.mjs +0 -2
- package/esm2022/shared/validators/email.validator.mjs +0 -7
- package/esm2022/shared/validators/match.validator.mjs +0 -22
- package/esm2022/shared/validators/secure-password.validator.mjs +0 -7
- package/esm2022/src/base.module.mjs +0 -64
- package/esm2022/src/decorators/auto-unsubscribe.decorator.mjs +0 -23
- package/esm2022/src/directives/lazy-load.directive.mjs +0 -48
- package/esm2022/src/directives/match-height.directive.mjs +0 -92
- package/esm2022/src/directives/resizable.directive.mjs +0 -92
- package/esm2022/src/factories/apollo-options.factory.mjs +0 -108
- package/esm2022/src/functions/extract-files.function.mjs +0 -87
- package/esm2022/src/guards/auth.guard.mjs +0 -91
- package/esm2022/src/guards/can-deactivate.guard.mjs +0 -16
- package/esm2022/src/guards/logout.guard.mjs +0 -34
- package/esm2022/src/pipes/date-ago.pipe.mjs +0 -64
- package/esm2022/src/pipes/safe-html.pipe.mjs +0 -22
- package/esm2022/src/services/fullscreen.service.mjs +0 -51
- package/esm2022/src/services/seo.service.mjs +0 -109
- package/esm2022/src/services/theme.service.mjs +0 -44
- package/fesm2022/lenne.tech-ng-base-base-cms.mjs +0 -251
- package/fesm2022/lenne.tech-ng-base-base-cms.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-base-components.mjs +0 -2917
- package/fesm2022/lenne.tech-ng-base-base-components.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-base-prototype.mjs +0 -505
- package/fesm2022/lenne.tech-ng-base-base-prototype.mjs.map +0 -1
- package/fesm2022/lenne.tech-ng-base-shared.mjs +0 -2863
- package/fesm2022/lenne.tech-ng-base-shared.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/public-api.d.ts +0 -17
- package/shared/classes/auth.class.d.ts +0 -10
- package/shared/classes/basic-user.class.d.ts +0 -27
- package/shared/classes/graphql-enum.class.d.ts +0 -7
- package/shared/classes/graphql-meta.class.d.ts +0 -66
- package/shared/classes/graphql-type.class.d.ts +0 -13
- package/shared/classes/helper.class.d.ts +0 -99
- package/shared/classes/sort.class.d.ts +0 -12
- package/shared/classes/standard.class.d.ts +0 -32
- package/shared/decorators/debounce.decorator.d.ts +0 -1
- package/shared/enums/comparison-operator.enum.d.ts +0 -14
- package/shared/enums/graphql-request-type.enum.d.ts +0 -8
- package/shared/enums/logical-operator.enum.d.ts +0 -8
- package/shared/enums/skeleton-type.enum.d.ts +0 -5
- package/shared/enums/sort-order.enum.d.ts +0 -4
- package/shared/enums/toast-type.enum.d.ts +0 -6
- package/shared/functions/ws-client.function.d.ts +0 -5
- package/shared/index.d.ts +0 -5
- package/shared/interfaces/base-module-config.interface.d.ts +0 -61
- package/shared/interfaces/breadcrumb.interface.d.ts +0 -4
- package/shared/interfaces/can-component-deactivate.interface.d.ts +0 -7
- package/shared/interfaces/cms-enum-values.interface.d.ts +0 -4
- package/shared/interfaces/cms-field-config.interface.d.ts +0 -45
- package/shared/interfaces/cms-model-config.interface.d.ts +0 -14
- package/shared/interfaces/cms-table-field.interface.d.ts +0 -10
- package/shared/interfaces/combined-filter-input.interface.d.ts +0 -9
- package/shared/interfaces/compress-options.interface.d.ts +0 -15
- package/shared/interfaces/cropping-options.interface.d.ts +0 -12
- package/shared/interfaces/field-object.interface.d.ts +0 -6
- package/shared/interfaces/field.interface.d.ts +0 -5
- package/shared/interfaces/filter-input.interface.d.ts +0 -9
- package/shared/interfaces/find-args.interface.d.ts +0 -11
- package/shared/interfaces/graphql-crud-type.interface.d.ts +0 -7
- package/shared/interfaces/graphql-fields-object.interface.d.ts +0 -6
- package/shared/interfaces/graphql-options.interface.d.ts +0 -11
- package/shared/interfaces/graphql-plus-options.interfacen.d.ts +0 -9
- package/shared/interfaces/graphql-type-collection.interface.d.ts +0 -7
- package/shared/interfaces/login-config.interface.d.ts +0 -6
- package/shared/interfaces/register-config.interface.d.ts +0 -4
- package/shared/interfaces/single-filter-input.interface.d.ts +0 -11
- package/shared/interfaces/sort-input.interface.d.ts +0 -5
- package/shared/interfaces/time-components.interface.d.ts +0 -6
- package/shared/interfaces/toast.interface.d.ts +0 -8
- package/shared/public-api.d.ts +0 -65
- package/shared/services/auth.service.d.ts +0 -44
- package/shared/services/breadcrumb.service.d.ts +0 -32
- package/shared/services/cms.service.d.ts +0 -27
- package/shared/services/file.service.d.ts +0 -22
- package/shared/services/forms.service.d.ts +0 -14
- package/shared/services/graphql-meta.service.d.ts +0 -45
- package/shared/services/graphql-plus.service.d.ts +0 -27
- package/shared/services/graphql.service.d.ts +0 -71
- package/shared/services/image.service.d.ts +0 -27
- package/shared/services/loader.service.d.ts +0 -32
- package/shared/services/navigation.service.d.ts +0 -15
- package/shared/services/scroll.service.d.ts +0 -85
- package/shared/services/storage.service.d.ts +0 -49
- package/shared/services/toast.service.d.ts +0 -15
- package/shared/services/user.service.d.ts +0 -77
- package/shared/services/ws.service.d.ts +0 -8
- package/shared/types/graphql-fields.type.d.ts +0 -5
- package/shared/types/storage.type.d.ts +0 -4
- package/shared/validators/email.validator.d.ts +0 -1
- package/shared/validators/match.validator.d.ts +0 -4
- package/shared/validators/secure-password.validator.d.ts +0 -1
- package/src/base.module.d.ts +0 -16
- package/src/decorators/auto-unsubscribe.decorator.d.ts +0 -5
- package/src/directives/lazy-load.directive.d.ts +0 -17
- package/src/directives/match-height.directive.d.ts +0 -20
- package/src/directives/resizable.directive.d.ts +0 -26
- package/src/factories/apollo-options.factory.d.ts +0 -16
- package/src/functions/extract-files.function.d.ts +0 -15
- package/src/guards/auth.guard.d.ts +0 -27
- package/src/guards/can-deactivate.guard.d.ts +0 -10
- package/src/guards/logout.guard.d.ts +0 -16
- package/src/pipes/date-ago.pipe.d.ts +0 -34
- package/src/pipes/safe-html.pipe.d.ts +0 -13
- package/src/services/fullscreen.service.d.ts +0 -18
- package/src/services/seo.service.d.ts +0 -50
- package/src/services/theme.service.d.ts +0 -17
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { APIRequestContext, APIResponse, Page } from "@playwright/test";
|
|
2
|
+
/**
|
|
3
|
+
* Default timeout for hydration waiting (in milliseconds)
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_HYDRATION_TIMEOUT = 15000;
|
|
6
|
+
/**
|
|
7
|
+
* Wait for Angular hydration to complete
|
|
8
|
+
*
|
|
9
|
+
* `provideLtNgBase()` sets `window.__ltNgBaseHydrated = true` once the app is stable in the browser
|
|
10
|
+
* (`ApplicationRef.whenStable()`), which is after hydration finished. Event replay (`withEventReplay()`) keeps
|
|
11
|
+
* input made before that moment, but assertions on component state are only reliable afterwards.
|
|
12
|
+
*
|
|
13
|
+
* @param page - Playwright page object
|
|
14
|
+
* @param options - Configuration options
|
|
15
|
+
* @param options.timeout - Maximum time to wait (default: 15000ms)
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* await waitForHydration(page);
|
|
20
|
+
* await page.click('button'); // Now safe to interact
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function waitForHydration(page: Page, options?: {
|
|
24
|
+
timeout?: number;
|
|
25
|
+
}): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Navigate to URL and wait for Angular hydration to complete
|
|
28
|
+
*
|
|
29
|
+
* Combines page.goto() with hydration waiting. Use this instead of
|
|
30
|
+
* page.goto() when you need to interact with Vue components immediately.
|
|
31
|
+
*
|
|
32
|
+
* @param page - Playwright page object
|
|
33
|
+
* @param url - URL to navigate to (relative or absolute)
|
|
34
|
+
* @param options - Configuration options
|
|
35
|
+
* @param options.timeout - Maximum time to wait for hydration (default: 15000ms)
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* await gotoAndWaitForHydration(page, '/auth/login');
|
|
40
|
+
* // Page is now hydrated and ready for interaction
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function gotoAndWaitForHydration(page: Page, url: string, options?: {
|
|
44
|
+
timeout?: number;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Wait for URL navigation and then Angular hydration
|
|
48
|
+
*
|
|
49
|
+
* Use after form submissions or actions that trigger navigation.
|
|
50
|
+
* Ensures both the navigation completes AND the new page is hydrated.
|
|
51
|
+
*
|
|
52
|
+
* @param page - Playwright page object
|
|
53
|
+
* @param url - URL pattern to wait for (string or RegExp)
|
|
54
|
+
* @param options - Configuration options
|
|
55
|
+
* @param options.timeout - Maximum time to wait for URL (default: 30000ms)
|
|
56
|
+
* @param options.hydrationTimeout - Maximum time to wait for hydration (default: 15000ms)
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* await page.click('button[type="submit"]');
|
|
61
|
+
* await waitForURLAndHydration(page, /\/dashboard/);
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function waitForURLAndHydration(page: Page, url: string | RegExp, options?: {
|
|
65
|
+
timeout?: number;
|
|
66
|
+
hydrationTimeout?: number;
|
|
67
|
+
}): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Fill an input field with proper Vue 3 reactivity support
|
|
70
|
+
*
|
|
71
|
+
* Uses keyboard typing instead of Playwright's fill() to properly
|
|
72
|
+
* trigger Vue's v-model updates. This is necessary because fill()
|
|
73
|
+
* sets the value directly without firing input events in some cases.
|
|
74
|
+
*
|
|
75
|
+
* @param page - Playwright page object
|
|
76
|
+
* @param selector - CSS selector for the input element
|
|
77
|
+
* @param value - Value to type into the input
|
|
78
|
+
* @param options - Configuration options
|
|
79
|
+
* @param options.delay - Delay between keystrokes in ms (default: 5)
|
|
80
|
+
* @param options.clear - Whether to clear existing content (default: true)
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* await fillInput(page, 'input[name="email"]', 'test@example.com');
|
|
85
|
+
* await fillInput(page, '#password', 'secret', { delay: 10 });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function fillInput(page: Page, selector: string, value: string, options?: {
|
|
89
|
+
delay?: number;
|
|
90
|
+
clear?: boolean;
|
|
91
|
+
}): Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Fill multiple input fields at once
|
|
94
|
+
*
|
|
95
|
+
* Convenience function for filling multiple form fields.
|
|
96
|
+
*
|
|
97
|
+
* @param page - Playwright page object
|
|
98
|
+
* @param fields - Object mapping selectors to values
|
|
99
|
+
* @param options - Configuration options passed to fillInput
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```typescript
|
|
103
|
+
* await fillInputs(page, {
|
|
104
|
+
* 'input[name="email"]': 'test@example.com',
|
|
105
|
+
* 'input[name="password"]': 'secret123',
|
|
106
|
+
* });
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export declare function fillInputs(page: Page, fields: Record<string, string>, options?: {
|
|
110
|
+
delay?: number;
|
|
111
|
+
clear?: boolean;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Test user credentials interface
|
|
115
|
+
*/
|
|
116
|
+
interface TestUser {
|
|
117
|
+
email: string;
|
|
118
|
+
password: string;
|
|
119
|
+
name: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Generate unique test user credentials
|
|
123
|
+
*
|
|
124
|
+
* Creates unique email, password, and name for test isolation.
|
|
125
|
+
* Each call generates different credentials to avoid test conflicts.
|
|
126
|
+
*
|
|
127
|
+
* @param prefix - Prefix for the email address (default: 'e2e')
|
|
128
|
+
* @returns Object with email, password, and name
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const user = generateTestUser('auth-test');
|
|
133
|
+
* // { email: 'auth-test-abc123@test.com', password: 'TestPassabc123!', name: 'E2E Test User auth-test' }
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare function generateTestUser(prefix?: string): TestUser;
|
|
137
|
+
/**
|
|
138
|
+
* Generate a random string for test data
|
|
139
|
+
*
|
|
140
|
+
* @param length - Length of the string (default: 8)
|
|
141
|
+
* @param charset - Characters to use (default: alphanumeric)
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const id = generateRandomString(12);
|
|
146
|
+
* const code = generateRandomString(6, '0123456789');
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export declare function generateRandomString(length?: number, charset?: string): string;
|
|
150
|
+
/**
|
|
151
|
+
* Generate a TOTP code from a secret (RFC 6238)
|
|
152
|
+
*
|
|
153
|
+
* Implements the Time-based One-Time Password algorithm for testing
|
|
154
|
+
* 2FA functionality. Compatible with Google Authenticator and similar apps.
|
|
155
|
+
*
|
|
156
|
+
* @param secret - Base32-encoded TOTP secret
|
|
157
|
+
* @param options - Configuration options
|
|
158
|
+
* @param options.digits - Number of digits in the code (default: 6)
|
|
159
|
+
* @param options.period - Time period in seconds (default: 30)
|
|
160
|
+
* @param options.algorithm - Hash algorithm (default: 'sha1')
|
|
161
|
+
* @returns 6-digit TOTP code as string
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* const secret = 'JBSWY3DPEHPK3PXP';
|
|
166
|
+
* const code = generateTOTP(secret);
|
|
167
|
+
* await page.fill('input[name="code"]', code);
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
export declare function generateTOTP(secret: string, options?: {
|
|
171
|
+
digits?: number;
|
|
172
|
+
period?: number;
|
|
173
|
+
algorithm?: 'sha1' | 'sha256' | 'sha512';
|
|
174
|
+
}): string;
|
|
175
|
+
/**
|
|
176
|
+
* Extract TOTP secret from otpauth:// URL
|
|
177
|
+
*
|
|
178
|
+
* Parses the secret parameter from a TOTP QR code URL.
|
|
179
|
+
*
|
|
180
|
+
* @param otpauthUrl - The otpauth:// URL (or data URL containing it)
|
|
181
|
+
* @returns The extracted secret, or null if not found
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const qrSrc = await page.locator('img[alt="QR Code"]').getAttribute('src');
|
|
186
|
+
* const secret = extractTOTPSecret(qrSrc);
|
|
187
|
+
* const code = generateTOTP(secret);
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
export declare function extractTOTPSecret(otpauthUrl: string): string | null;
|
|
191
|
+
/**
|
|
192
|
+
* Extract all parameters from otpauth:// URL
|
|
193
|
+
*
|
|
194
|
+
* @param otpauthUrl - The otpauth:// URL
|
|
195
|
+
* @returns Object with issuer, account, secret, algorithm, digits, period
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```typescript
|
|
199
|
+
* const params = parseTOTPUrl(otpauthUrl);
|
|
200
|
+
* console.log(params.issuer, params.secret);
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
export declare function parseTOTPUrl(otpauthUrl: string): {
|
|
204
|
+
issuer: string | null;
|
|
205
|
+
account: string | null;
|
|
206
|
+
secret: string | null;
|
|
207
|
+
algorithm: string;
|
|
208
|
+
digits: number;
|
|
209
|
+
period: number;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* Wait for an element to be visible and stable
|
|
213
|
+
*
|
|
214
|
+
* Useful for waiting for animations to complete or elements to settle.
|
|
215
|
+
*
|
|
216
|
+
* @param page - Playwright page object
|
|
217
|
+
* @param selector - CSS selector for the element
|
|
218
|
+
* @param options - Configuration options
|
|
219
|
+
* @param options.timeout - Maximum time to wait (default: 10000ms)
|
|
220
|
+
* @param options.stable - Wait for element to be stable (default: true)
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```typescript
|
|
224
|
+
* await waitForElement(page, '.modal-content');
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
export declare function waitForElement(page: Page, selector: string, options?: {
|
|
228
|
+
timeout?: number;
|
|
229
|
+
stable?: boolean;
|
|
230
|
+
}): Promise<void>;
|
|
231
|
+
/**
|
|
232
|
+
* Wait for network to be idle
|
|
233
|
+
*
|
|
234
|
+
* Useful for waiting for all API calls to complete.
|
|
235
|
+
*
|
|
236
|
+
* @param page - Playwright page object
|
|
237
|
+
* @param options - Configuration options
|
|
238
|
+
* @param options.timeout - Maximum time to wait (default: 30000ms)
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* await page.click('button[type="submit"]');
|
|
243
|
+
* await waitForNetworkIdle(page);
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export declare function waitForNetworkIdle(page: Page, options?: {
|
|
247
|
+
timeout?: number;
|
|
248
|
+
}): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Check if an element contains specific text
|
|
251
|
+
*
|
|
252
|
+
* @param page - Playwright page object
|
|
253
|
+
* @param selector - CSS selector for the element
|
|
254
|
+
* @param text - Text to search for
|
|
255
|
+
* @returns true if text is found
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```typescript
|
|
259
|
+
* const hasError = await hasText(page, '.error', 'Invalid email');
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
export declare function hasText(page: Page, selector: string, text: string): Promise<boolean>;
|
|
263
|
+
/**
|
|
264
|
+
* Get all text content from matching elements
|
|
265
|
+
*
|
|
266
|
+
* @param page - Playwright page object
|
|
267
|
+
* @param selector - CSS selector for the elements
|
|
268
|
+
* @returns Array of text content
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```typescript
|
|
272
|
+
* const errors = await getAllText(page, '.error-message');
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
export declare function getAllText(page: Page, selector: string): Promise<string[]>;
|
|
276
|
+
/** SHA-256 hex of a password, as the browser sends it (nest-server expects hashed passwords). */
|
|
277
|
+
export declare function hashTestPassword(password: string): string;
|
|
278
|
+
/** Options of {@link createTestUser}. */
|
|
279
|
+
interface CreateTestUserOptions {
|
|
280
|
+
/** API base URL, e.g. `http://localhost:3000` (default `NG_API_URL` / `NG_PUBLIC_API_URL`, else `http://localhost:3000`). */
|
|
281
|
+
apiUrl?: string;
|
|
282
|
+
/** Better Auth base path (default `/iam`). */
|
|
283
|
+
basePath?: string;
|
|
284
|
+
/** Extra sign-up fields (e.g. `termsAndPrivacyAccepted: true` when the backend's `signUpChecks` require it). */
|
|
285
|
+
extra?: Record<string, unknown>;
|
|
286
|
+
/** Prefix for the generated email (default `e2e`). */
|
|
287
|
+
prefix?: string;
|
|
288
|
+
/** Use this user instead of a generated one. */
|
|
289
|
+
user?: TestUser;
|
|
290
|
+
}
|
|
291
|
+
/** Result of {@link createTestUser}. */
|
|
292
|
+
interface CreatedTestUser {
|
|
293
|
+
response: APIResponse;
|
|
294
|
+
/** Response body (`{ token?, user }`). */
|
|
295
|
+
body: Record<string, unknown> | null;
|
|
296
|
+
user: TestUser;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Create a user through the API (`POST <api>/iam/sign-up/email`, password hashed like the browser does). Fails the
|
|
300
|
+
* test with the response text when sign-up does not answer 2xx.
|
|
301
|
+
*
|
|
302
|
+
* @example
|
|
303
|
+
* const { user } = await createTestUser(request, { extra: { termsAndPrivacyAccepted: true } });
|
|
304
|
+
* await loginTestUser(page, user);
|
|
305
|
+
*/
|
|
306
|
+
export declare function createTestUser(request: APIRequestContext, options?: CreateTestUserOptions): Promise<CreatedTestUser>;
|
|
307
|
+
/** Options of {@link loginTestUser}. */
|
|
308
|
+
interface LoginTestUserOptions {
|
|
309
|
+
/** Selector of the email input (default: an input with `autocomplete="email"`/`"username"`, `type="email"` or `name="email"`). */
|
|
310
|
+
emailSelector?: string;
|
|
311
|
+
/** URL (or pattern) expected after the login (default `/app`). Pass `null` to skip the wait. */
|
|
312
|
+
expectUrl?: RegExp | string | null;
|
|
313
|
+
/** Login page (default `/auth/login`). */
|
|
314
|
+
loginPath?: string;
|
|
315
|
+
/** Selector of the password input (default: `autocomplete="current-password"`, else the first `type="password"`). */
|
|
316
|
+
passwordSelector?: string;
|
|
317
|
+
/** Selector of the submit button (default `button[type="submit"]`). */
|
|
318
|
+
submitSelector?: string;
|
|
319
|
+
}
|
|
320
|
+
/** Sign in through the login form (waits for hydration first) and wait for the target page. */
|
|
321
|
+
export declare function loginTestUser(page: Page, user: Pick<TestUser, 'email' | 'password'>, options?: LoginTestUserOptions): Promise<void>;
|
|
322
|
+
/**
|
|
323
|
+
* Sign in through the API (`POST <api>/iam/sign-in/email`); the request context keeps the session cookie for later
|
|
324
|
+
* API calls. Returns the response body (`{ token?, user }`).
|
|
325
|
+
*/
|
|
326
|
+
export declare function loginTestUserViaApi(request: APIRequestContext, user: Pick<TestUser, 'email' | 'password'>, options?: Pick<CreateTestUserOptions, 'apiUrl' | 'basePath'>): Promise<Record<string, unknown>>;
|
|
327
|
+
export type { CreateTestUserOptions, CreatedTestUser, LoginTestUserOptions, TestUser };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { EnvironmentProviders } from "@angular/core";
|
|
3
|
+
import { LtToastAdapter } from "@lenne.tech/ng-base";
|
|
4
|
+
/** Options of {@link provideLtUi}. */
|
|
5
|
+
interface LtUiOptions {
|
|
6
|
+
/** Start `LtColorModeService` at bootstrap, so the `.dark` class is right from the SSR render on (default `true`). */
|
|
7
|
+
colorMode?: boolean;
|
|
8
|
+
/** Bind `LtToastService` / error toasts to Spartan Sonner (`<hlm-toaster />` in the app shell). Default `true`. */
|
|
9
|
+
sonnerToasts?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Sonner toast adapter: maps the lt colors onto Sonner's variants; loads Sonner lazily on the first toast. */
|
|
12
|
+
export declare const ltSonnerToastAdapter: LtToastAdapter;
|
|
13
|
+
/**
|
|
14
|
+
* UI providers for `app.config.ts`: the color mode (started at bootstrap) and the toast bridge to Spartan Sonner (loaded
|
|
15
|
+
* on the first toast). Put `<hlm-toaster />` (from `@lenne.tech/ng-base/ui`, ideally in a `@defer` block) into the
|
|
16
|
+
* app shell. Lives in its own entry point and imports neither the component layer nor the CDK, so it adds almost
|
|
17
|
+
* nothing to the initial bundle. Overlay defaults (toasts above dialogs): `provideLtUiOverlayDefaults()` from
|
|
18
|
+
* `@lenne.tech/ng-base/ui` in the providers of the (lazy) routes that open overlays.
|
|
19
|
+
*/
|
|
20
|
+
export declare function provideLtUi(options?: LtUiOptions): EnvironmentProviders;
|
|
21
|
+
/** Color mode preference. */
|
|
22
|
+
type LtColorMode = 'dark' | 'light' | 'system';
|
|
23
|
+
/** Cookie holding the preference (read during SSR so the first paint has the right theme). */
|
|
24
|
+
export declare const LT_COLOR_MODE_COOKIE = "lt-color-mode";
|
|
25
|
+
/**
|
|
26
|
+
* Inline script for `<head>` (before any stylesheet) that sets `.dark` on `<html>` from the cookie or
|
|
27
|
+
* `prefers-color-scheme` before the first paint, so dark mode never flashes light.
|
|
28
|
+
*/
|
|
29
|
+
export declare const LT_COLOR_MODE_SCRIPT = "(function(){try{var m=(document.cookie.match(/(?:^|; )lt-color-mode=([^;]*)/)||[])[1]||'system';var d=m==='dark'||(m==='system'&&matchMedia('(prefers-color-scheme: dark)').matches);document.documentElement.classList.toggle('dark',d);document.documentElement.style.colorScheme=d?'dark':'light';}catch(e){}})();";
|
|
30
|
+
/**
|
|
31
|
+
* Light / dark / system color mode: toggles `.dark` on `<html>` (Tailwind `dark:` variant and the theme tokens),
|
|
32
|
+
* persists the preference in a cookie (SSR reads it), follows `prefers-color-scheme` in `system` mode.
|
|
33
|
+
*
|
|
34
|
+
* - Server: reads the preference from the request cookie and sets or clears `.dark` on the rendered document, so the
|
|
35
|
+
* HTML arrives with the right theme. In `system` mode the server only knows the scheme when the browser sends the
|
|
36
|
+
* `Sec-CH-Prefers-Color-Scheme` client hint (the app opts in with `Accept-CH`); otherwise `LT_COLOR_MODE_SCRIPT`
|
|
37
|
+
* fixes it before the first paint.
|
|
38
|
+
* - Browser: toggles the class and `color-scheme` on `<html>` and listens to `prefers-color-scheme` changes.
|
|
39
|
+
*
|
|
40
|
+
* The class is applied as soon as the service exists (an `lt-color-mode-button` creates it). When the app renders no
|
|
41
|
+
* button, create it at startup: `provideAppInitializer(() => void inject(LtColorModeService))`.
|
|
42
|
+
*/
|
|
43
|
+
export declare class LtColorModeService {
|
|
44
|
+
private readonly document;
|
|
45
|
+
private readonly cookies;
|
|
46
|
+
private readonly request;
|
|
47
|
+
private readonly isBrowser;
|
|
48
|
+
private readonly modeState;
|
|
49
|
+
private readonly systemDark;
|
|
50
|
+
/** The preference. */
|
|
51
|
+
readonly mode: import("@angular/core").Signal<LtColorMode>;
|
|
52
|
+
/** The effective mode. */
|
|
53
|
+
readonly resolved: import("@angular/core").Signal<"dark" | "light">;
|
|
54
|
+
constructor();
|
|
55
|
+
/** Set the preference (persisted for one year in the `lt-color-mode` cookie). */
|
|
56
|
+
setMode(mode: LtColorMode): void;
|
|
57
|
+
/** Switch between light and dark (leaves `system`). */
|
|
58
|
+
toggle(): void;
|
|
59
|
+
private listenToSystemScheme;
|
|
60
|
+
/** Write the resolved mode to `<html>` (server: the SSR document; browser: the live document). */
|
|
61
|
+
private apply;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LtColorModeService, never>;
|
|
63
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
64
|
+
}
|
|
65
|
+
export type { LtColorMode, LtUiOptions };
|