(
2 | array: T[],
3 | groupKeyAccessor: (element: T) => any,
4 | ): { [key in any]: T[] } =>
5 | array.reduce(
6 | (res: any, curr: T) => ({
7 | ...res,
8 | [groupKeyAccessor(curr)]: [...(res[groupKeyAccessor(curr)] || []), curr],
9 | }),
10 | {},
11 | );
12 |
--------------------------------------------------------------------------------
/.ng-dev/github.mts:
--------------------------------------------------------------------------------
1 | import {GithubConfig} from '@angular/ng-dev';
2 |
3 | /**
4 | * Github configuration for the ng-dev command. This repository is
5 | * uses as remote for the merge script.
6 | */
7 | export const github: GithubConfig = {
8 | owner: 'sbb-design-systems',
9 | name: 'sbb-angular',
10 | mainBranchName: 'main',
11 | useNgDevAuthService: false,
12 | };
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/alert/index.ts:
--------------------------------------------------------------------------------
1 | export { AlertExternalLinkExample } from './alert-external-link/alert-external-link-example';
2 | export { AlertOutletExample } from './alert-outlet/alert-outlet-example';
3 | export { AlertRouterLinkExample } from './alert-router-link/alert-router-link-example';
4 | export { AlertSimpleExample } from './alert-simple/alert-simple-example';
5 |
--------------------------------------------------------------------------------
/src/components-examples/angular/captcha/captcha-simple/captcha-simple-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 | Captcha response
8 | {{ basicCaptchaResponse | json }}
9 |
--------------------------------------------------------------------------------
/.github/Dockerfile.regenerate.ngssc:
--------------------------------------------------------------------------------
1 | # For versions 13+
2 | FROM nginxinc/nginx-unprivileged:stable
3 |
4 | COPY default.conf /etc/nginx/conf.d/default.conf
5 | COPY html /usr/share/nginx/html
6 | USER root
7 | COPY ngssc /usr/sbin/ngssc
8 | RUN chmod +x /usr/sbin/ngssc
9 | COPY ngssc.sh /docker-entrypoint.d/ngssc.sh
10 | RUN chmod +x /docker-entrypoint.d/ngssc.sh
11 | USER $UID
12 |
--------------------------------------------------------------------------------
/src/angular/badge/badge.module.ts:
--------------------------------------------------------------------------------
1 | import { A11yModule } from '@angular/cdk/a11y';
2 | import { NgModule } from '@angular/core';
3 | import { SbbCommonModule } from '@sbb-esta/angular/core';
4 |
5 | import { SbbBadge } from './badge';
6 |
7 | @NgModule({
8 | imports: [A11yModule, SbbCommonModule, SbbBadge],
9 | exports: [SbbBadge],
10 | })
11 | export class SbbBadgeModule {}
12 |
--------------------------------------------------------------------------------
/src/angular/core/testing/public-api.ts:
--------------------------------------------------------------------------------
1 | export * from './breakpoint-observer';
2 | export * from './dispatch-events';
3 | export * from './element-focus';
4 | export * from './event-objects';
5 | export * from './mock-ng-zone';
6 | export * from './month-constants';
7 | export * from './type-in-element';
8 | export * from './variant';
9 | export * from './wrapped-error-message';
10 |
--------------------------------------------------------------------------------
/src/components-examples/angular/input/index.ts:
--------------------------------------------------------------------------------
1 | export { InputErrorStateMatcherExample } from './input-error-state-matcher/input-error-state-matcher-example';
2 | export { InputErrorsExample } from './input-errors/input-errors-example';
3 | export { InputFormExample } from './input-form/input-form-example';
4 | export { InputOverviewExample } from './input-overview/input-overview-example';
5 |
--------------------------------------------------------------------------------
/src/components-examples/angular/status/status-with-message/status-with-message-example.html:
--------------------------------------------------------------------------------
1 | Valid
2 |
3 | Warning
4 |
5 | Invalid
6 |
7 |
--------------------------------------------------------------------------------
/src/components-examples/journey-maps/angular/journey-maps-basic/journey-maps-basic-example.css:
--------------------------------------------------------------------------------
1 | @import 'https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css';
2 |
3 | sbb-notification.api-key-info {
4 | margin-bottom: 30px;
5 | }
6 |
7 | .web-map {
8 | width: 100%;
9 | height: 500px;
10 | min-height: 500px;
11 | box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.15);
12 | }
13 |
--------------------------------------------------------------------------------
/tools/tslint-rules/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "../dist/tools",
4 | "target": "es2020",
5 | "module": "commonjs",
6 | "moduleResolution": "node",
7 | "esModuleInterop": true,
8 | "lib": ["es2020"],
9 | "skipLibCheck": true
10 | },
11 | "bazelOptions": {
12 | "suppressTsconfigOverrideWarnings": true
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "outDir": "../dist/dev-infra-scripts",
4 | "module": "Node16",
5 | "esModuleInterop": true,
6 | "allowSyntheticDefaultImports": true,
7 | "target": "es2020",
8 | "lib": ["es2020"],
9 | "strict": true,
10 | "erasableSyntaxOnly": true,
11 | "rewriteRelativeImportExtensions": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/angular/lightbox/public-api.ts:
--------------------------------------------------------------------------------
1 | export { SbbDialogRole } from '@sbb-esta/angular/dialog';
2 | export * from './lightbox.module';
3 | export * from './lightbox';
4 | export * from './lightbox-container';
5 | export * from './lightbox-content-directives';
6 | export * from './lightbox-config';
7 | export * from './lightbox-ref';
8 | export { sbbLightboxAnimations } from './lightbox-animations';
9 |
--------------------------------------------------------------------------------
/src/angular/menu/public-api.ts:
--------------------------------------------------------------------------------
1 | export * from './contextmenu-trigger';
2 | export * from './menu';
3 | export * from './menu-dynamic-trigger';
4 | export * from './menu-errors';
5 | export * from './menu-item';
6 | export * from './menu-trigger';
7 | export * from './menu-panel';
8 | export * from './menu.module';
9 | export * from './menu-content';
10 | export * from './menu-positions';
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/loading-indicator/index.ts:
--------------------------------------------------------------------------------
1 | export { LoadingIndicatorFullboxExample } from './loading-indicator-fullbox/loading-indicator-fullbox-example';
2 | export { LoadingIndicatorInlineExample } from './loading-indicator-inline/loading-indicator-inline-example';
3 | export { LoadingIndicatorSimpleExample } from './loading-indicator-simple/loading-indicator-simple-example';
4 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tabs/tab-group-async/tab-group-async-example.html:
--------------------------------------------------------------------------------
1 | @if ((asyncTabs | async) === null) {
2 | Loading tabs...
3 | }
4 |
5 |
6 | @for (tab of asyncTabs | async; track tab) {
7 |
8 | {{ tab.label }}
9 | {{ tab.content }}
10 |
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/docs/src/assets/stack-blitz/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/app",
6 | "types": []
7 | },
8 | "files": [
9 | "src/main.ts",
10 | "src/polyfills.ts"
11 | ],
12 | "include": [
13 | "src/**/*.d.ts"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/src/angular/loading-indicator/loading-indicator.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 |
4 | import { SbbLoadingIndicator } from './loading-indicator';
5 |
6 | @NgModule({
7 | imports: [SbbCommonModule, SbbLoadingIndicator],
8 | exports: [SbbLoadingIndicator],
9 | })
10 | export class SbbLoadingIndicatorModule {}
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/datepicker/datepicker-lean-date-adapter/datepicker-lean-date-adapter-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | The LeanDateAdapter enables parsing of dates like '010120' or '01012020'.
6 |
7 | Properties
8 | model: {{ date | date: 'mediumDate' }}
9 |
--------------------------------------------------------------------------------
/src/components-examples/angular/datepicker/datepicker-standalone-forms/datepicker-standalone-forms-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Properties
6 | model: {{ date | date: 'mediumDate' }}
7 | form control validity: {{ input.valid }}
8 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-overview/menu-overview-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/public-api.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Public API Surface of journey-maps-client
3 | */
4 |
5 | export * from './journey-maps.module';
6 | export * from './journey-maps';
7 | export * from './journey-maps.interfaces';
8 | export * from './model/marker';
9 | export * from './model/marker-category';
10 | export * from './model/marker-priority';
11 | export * from './services/constants';
12 |
--------------------------------------------------------------------------------
/src/angular/datepicker/datepicker-toggle/datepicker-toggle.html:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/src/angular/status/status.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 |
5 | import { SbbStatus } from './status';
6 |
7 | @NgModule({
8 | imports: [SbbCommonModule, SbbIconModule, SbbStatus],
9 | exports: [SbbStatus],
10 | })
11 | export class SbbStatusModule {}
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/breadcrumb/index.ts:
--------------------------------------------------------------------------------
1 | export { BreadcrumbCustomRootExample } from './breadcrumb-custom-root/breadcrumb-custom-root-example';
2 | export { BreadcrumbDynamicExample } from './breadcrumb-dynamic/breadcrumb-dynamic-example';
3 | export { BreadcrumbMenuExample } from './breadcrumb-menu/breadcrumb-menu-example';
4 | export { BreadcrumbExample } from './breadcrumb/breadcrumb-example';
5 |
--------------------------------------------------------------------------------
/src/components-examples/angular/button/link/link-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbButtonModule } from '@sbb-esta/angular/button';
3 |
4 | /**
5 | * @title Link Example
6 | * @order 30
7 | */
8 | @Component({
9 | selector: 'sbb-link-example',
10 | templateUrl: 'link-example.html',
11 | imports: [SbbButtonModule],
12 | })
13 | export class LinkExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/sidebar/collapsible-sidebar/collapsible-sidebar-example.css:
--------------------------------------------------------------------------------
1 | .sbb-icon-sidebar-item.sbb-active {
2 | pointer-events: unset;
3 | cursor: pointer;
4 | }
5 |
6 | .sidebar-frame {
7 | display: block;
8 | height: 400px;
9 | width: 500px;
10 | position: relative;
11 | border: 1px solid #b7b7b7;
12 | }
13 |
14 | sbb-sidebar-content {
15 | padding: 15px;
16 | }
17 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tooltip/index.ts:
--------------------------------------------------------------------------------
1 | export { TooltipCustomContentExample } from './tooltip-custom-content/tooltip-custom-content-example';
2 | export { TooltipCustomIconExample } from './tooltip-custom-icon/tooltip-custom-icon-example';
3 | export { TooltipHoverExample } from './tooltip-hover/tooltip-hover-example';
4 | export { TooltipSimpleExample } from './tooltip-simple/tooltip-simple-example';
5 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/types.d.ts:
--------------------------------------------------------------------------------
1 | // Due to the way ts_library works, scoped types packages (e.g. @mapbox/point-geometry => @types/mapbox__point-geometry)
2 | // do not resolve properly.
3 | // Workaround from : https://github.com/bazelbuild/rules_nodejs/issues/1033#issuecomment-601138246
4 |
5 | declare module '@mapbox/point-geometry' {
6 | export { default } from '@types/mapbox__point-geometry';
7 | }
8 |
--------------------------------------------------------------------------------
/tools/sass/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("//tools:defaults.bzl", "ts_project")
2 |
3 | package(default_visibility = ["//visibility:public"])
4 |
5 | ts_project(
6 | name = "sass_lib",
7 | srcs = [
8 | "local-sass-importer.ts",
9 | ],
10 | tsconfig = "//tools:tsconfig",
11 | deps = [
12 | "//:node_modules/@types/node",
13 | "//:node_modules/sass",
14 | ],
15 | )
16 |
--------------------------------------------------------------------------------
/src/angular/radio-button/radio-button.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 |
4 | import { SbbRadioButton, SbbRadioGroup } from './radio-button';
5 |
6 | @NgModule({
7 | imports: [SbbCommonModule, SbbRadioButton, SbbRadioGroup],
8 | exports: [SbbRadioButton, SbbRadioGroup],
9 | })
10 | export class SbbRadioButtonModule {}
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/radio-button/index.ts:
--------------------------------------------------------------------------------
1 | export { RadioButtonGroupHorizontalExample } from './radio-button-group-horizontal/radio-button-group-horizontal-example';
2 | export { RadioButtonGroupReactiveFormsVerticalExample } from './radio-button-group-reactive-forms-vertical/radio-button-group-reactive-forms-vertical-example';
3 | export { RadioButtonExample } from './radio-button/radio-button-example';
4 |
--------------------------------------------------------------------------------
/src/components-examples/angular/search/search-simple-header-mode/search-simple-header-mode-example.html:
--------------------------------------------------------------------------------
1 |
6 |
7 | Results
8 | {{ searchValues | json }}
9 |
--------------------------------------------------------------------------------
/src/components-examples/angular/search/search-simple-reactive-forms/search-simple-reactive-forms-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Model
6 | {{ searchControl.value }}
7 |
8 | Results
9 | {{ searchValues | json }}
10 |
--------------------------------------------------------------------------------
/src/components-examples/angular/status/status/status-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbStatusModule } from '@sbb-esta/angular/status';
3 |
4 | /**
5 | * @title Status
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-status-example',
10 | templateUrl: 'status-example.html',
11 | imports: [SbbStatusModule],
12 | })
13 | export class StatusExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/toggle/index.ts:
--------------------------------------------------------------------------------
1 | export { ToggleReactiveExample } from './toggle-reactive/toggle-reactive-example';
2 | export { ToggleTemplateDrivenExample } from './toggle-template-driven/toggle-template-driven-example';
3 | export { ToggleTripleExample } from './toggle-triple/toggle-triple-example';
4 | export { ToggleWithoutFormExample } from './toggle-without-form/toggle-without-form-example';
5 |
--------------------------------------------------------------------------------
/src/journey-maps/tsconfig.json:
--------------------------------------------------------------------------------
1 | // Configuration for IDEs only.
2 | {
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "rootDir": "..",
6 | "baseUrl": ".",
7 | "paths": {
8 | "@sbb-esta/angular": ["../angular"],
9 | "@sbb-esta/angular/*": ["../angular/*"],
10 | "@sbb-esta/journey-maps/*": ["./*"]
11 | }
12 | },
13 | "include": ["./**/*.ts"]
14 | }
15 |
--------------------------------------------------------------------------------
/src/angular/schematics/ng-add/schema.ts:
--------------------------------------------------------------------------------
1 | export interface Schema {
2 | /** Name of the project. */
3 | project: string;
4 |
5 | /** Whether the Angular browser animations module should be included and enabled. */
6 | animations: 'enabled' | 'disabled' | 'excluded';
7 |
8 | /** Design variant. */
9 | variant: 'standard (previously known as public)' | 'lean (previously known as business)';
10 | }
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/button/index.ts:
--------------------------------------------------------------------------------
1 | export { ButtonOverviewExample } from './button-overview/button-overview-example';
2 | export { ButtonWithIconExample } from './button-with-icon/button-with-icon-example';
3 | export { IconButtonExample } from './icon-button/icon-button-example';
4 | export { LinkGroupExample } from './link-group/link-group-example';
5 | export { LinkExample } from './link/link-example';
6 |
--------------------------------------------------------------------------------
/src/components-examples/angular/file-selector/multiple-mode-default-file-selector/multiple-mode-default-file-selector-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Properties
4 | Disabled
5 | Model
6 | {{ beautifyFileList(filesList) | json }}
7 |
--------------------------------------------------------------------------------
/src/components-examples/angular/radio-button/radio-button/radio-button-example.html:
--------------------------------------------------------------------------------
1 | Test label
7 |
8 |
9 | Properties
10 | Disabled
11 |
12 | Value
13 | {{ value | json }}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tag/tag-reactive-forms/tag-reactive-forms-example.html:
--------------------------------------------------------------------------------
1 |
2 | Trains
3 | Cars
4 | Bicycles
5 |
6 |
7 | Model
8 | {{ formGroup.getRawValue() | json }}
9 |
--------------------------------------------------------------------------------
/src/angular/accordion/accordion-token.ts:
--------------------------------------------------------------------------------
1 | import { InjectionToken } from '@angular/core';
2 |
3 | import type { SbbAccordion } from './accordion';
4 |
5 | /**
6 | * Token used to provide a `SbbAccordion` to `SbbExpansionPanel`.
7 | * Used primarily to avoid circular imports between `SbbAccordion` and `SbbExpansionPanel`.
8 | */
9 | export const SBB_ACCORDION = new InjectionToken('SBB_ACCORDION');
10 |
--------------------------------------------------------------------------------
/src/angular/checkbox/checkbox.module.ts:
--------------------------------------------------------------------------------
1 | import { ObserversModule } from '@angular/cdk/observers';
2 | import { NgModule } from '@angular/core';
3 | import { SbbCommonModule } from '@sbb-esta/angular/core';
4 |
5 | import { SbbCheckbox } from './checkbox';
6 |
7 | @NgModule({
8 | imports: [ObserversModule, SbbCommonModule, SbbCheckbox],
9 | exports: [SbbCheckbox],
10 | })
11 | export class SbbCheckboxModule {}
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/loading-indicator/loading-indicator-fullbox/loading-indicator-fullbox-example.html:
--------------------------------------------------------------------------------
1 |
2 | @if (showSpinner) {
3 |
4 | }
5 |
6 | Covers the parent element.
7 |
8 |
--------------------------------------------------------------------------------
/src/components-examples/angular/radio-button-panel/radio-button-panel-simple/radio-button-panel-simple-example.html:
--------------------------------------------------------------------------------
1 |
2 | Apples
3 | Bananas
4 |
5 |
6 | Model
7 | {{ value.value | json }}
8 |
--------------------------------------------------------------------------------
/src/components-examples/angular/radio-button/radio-button-group-horizontal/radio-button-group-horizontal-example.html:
--------------------------------------------------------------------------------
1 |
2 | @for (option of radioOptions; track option) {
3 | {{ option.name }}
4 | }
5 |
6 |
7 | Model
8 | {{ modelValue }}
9 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/services/map/map-leit-poi-service.spec.ts:
--------------------------------------------------------------------------------
1 | import { SbbMapLeitPoiService } from './map-leit-poi-service';
2 |
3 | describe('MapLeitPoiService', () => {
4 | let service: SbbMapLeitPoiService;
5 |
6 | beforeEach(() => {
7 | service = new SbbMapLeitPoiService({} as any);
8 | });
9 |
10 | it('should be created', () => {
11 | expect(service).toBeTruthy();
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/src/angular/core/option/option.html:
--------------------------------------------------------------------------------
1 | @if (multiple) {
2 |
6 | }
7 |
8 |
9 |
10 | @if (group && group._inert) {
11 | ({{ group.label }})
12 | }
13 |
--------------------------------------------------------------------------------
/src/angular/textarea/textarea.module.ts:
--------------------------------------------------------------------------------
1 | import { TextFieldModule } from '@angular/cdk/text-field';
2 | import { NgModule } from '@angular/core';
3 | import { SbbCommonModule } from '@sbb-esta/angular/core';
4 |
5 | import { SbbTextarea } from './textarea/textarea';
6 |
7 | @NgModule({
8 | imports: [TextFieldModule, SbbCommonModule, SbbTextarea],
9 | exports: [SbbTextarea],
10 | })
11 | export class SbbTextareaModule {}
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/form-field/form-field-select/form-field-select-example.html:
--------------------------------------------------------------------------------
1 |
2 |
8 | @if (select.errors?.['required']) {
9 | Number is required!
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/notification/closable-notification/closable-notification-example.html:
--------------------------------------------------------------------------------
1 | Notification can only be dismissed in lean design.
2 |
3 | Success
4 |
5 | To prevent a notification from being dismissed, add the readonly attribute.
6 |
7 | Error
8 |
--------------------------------------------------------------------------------
/src/angular/accordion/public-api.ts:
--------------------------------------------------------------------------------
1 | export * from './accordion.module';
2 | export * from './accordion';
3 | export * from './accordion-token';
4 | // To avoid colliding name exports in bundles, don't use star export here
5 | export { SbbExpansionPanelState, SbbExpansionPanel } from './expansion-panel';
6 | export * from './expansion-panel-header';
7 | export * from './expansion-panel-content';
8 | export * from './expansion-panel-base';
9 |
--------------------------------------------------------------------------------
/src/angular/button/button.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 |
5 | import { SbbAnchor, SbbButton } from './button';
6 |
7 | @NgModule({
8 | imports: [SbbCommonModule, SbbIconModule, SbbButton, SbbAnchor],
9 | exports: [SbbButton, SbbAnchor],
10 | })
11 | export class SbbButtonModule {}
12 |
--------------------------------------------------------------------------------
/src/angular/schematics/ng-update/data/index.ts:
--------------------------------------------------------------------------------
1 | export * from './attribute-selectors';
2 | export * from './class-names';
3 | export * from './constructor-checks';
4 | export * from './css-selectors';
5 | export * from './element-selectors';
6 | export * from './input-names';
7 | export * from './method-call-checks';
8 | export * from './output-names';
9 | export * from './property-names';
10 | export * from './symbol-removal';
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/checkbox/checkbox-group-reactive-forms-vertical/checkbox-group-reactive-forms-vertical-example.html:
--------------------------------------------------------------------------------
1 |
2 | @for (formControl of form.controls | keyvalue; track formControl) {
3 | {{ formControl.key }}
4 | }
5 |
6 |
7 | Model
8 | {{ form.value | json }}
9 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-nested/menu-nested-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbMenuModule } from '@sbb-esta/angular/menu';
3 |
4 | /**
5 | * @title Nested Contextmenu
6 | * @order 30
7 | */
8 | @Component({
9 | selector: 'sbb-menu-nested-example',
10 | templateUrl: 'menu-nested-example.html',
11 | imports: [SbbMenuModule],
12 | })
13 | export class MenuNestedExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tag/tag-template-forms/tag-template-forms-example.html:
--------------------------------------------------------------------------------
1 |
2 | Trains
3 | Cars
4 | Bicycles
5 |
6 |
7 | Model
8 |
9 | Trains: {{ trains }}
10 | Cars: {{ cars }}
11 | Bicycles: {{ bicycles }}
12 |
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/usermenu/usermenu-custom-image/usermenu-custom-image-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/angular/notification-toast/public-api.ts:
--------------------------------------------------------------------------------
1 | export * from './notification-toast';
2 | export * from './notification-toast-animations';
3 | export * from './notification-toast-config';
4 | export * from './notification-toast-container';
5 | export * from './notification-toast-ref';
6 | export * from './notification-toast.module';
7 | export * from './simple-notification';
8 | export { SbbNotificationType } from '@sbb-esta/angular/notification';
9 |
--------------------------------------------------------------------------------
/src/components-examples/angular/alert/alert-simple/alert-simple-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbAlertModule } from '@sbb-esta/angular/alert';
3 |
4 | /**
5 | * @title Simple Alert
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-alert-simple-example',
10 | templateUrl: 'alert-simple-example.html',
11 | imports: [SbbAlertModule],
12 | })
13 | export class AlertSimpleExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/button/link-group/link-group-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbButtonModule } from '@sbb-esta/angular/button';
3 |
4 | /**
5 | * @title Link Group Example
6 | * @order 40
7 | */
8 | @Component({
9 | selector: 'sbb-link-group-example',
10 | templateUrl: 'link-group-example.html',
11 | imports: [SbbButtonModule],
12 | })
13 | export class LinkGroupExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/file-selector/index.ts:
--------------------------------------------------------------------------------
1 | export { MultipleModeDefaultFileSelectorExample } from './multiple-mode-default-file-selector/multiple-mode-default-file-selector-example';
2 | export { MultipleModePersistentFileSelectorExample } from './multiple-mode-persistent-file-selector/multiple-mode-persistent-file-selector-example';
3 | export { SimpleFileSelectorExample } from './simple-file-selector/simple-file-selector-example';
4 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/index.ts:
--------------------------------------------------------------------------------
1 | export { MenuGroupingExample } from './menu-grouping/menu-grouping-example';
2 | export { MenuIconsExample } from './menu-icons/menu-icons-example';
3 | export { MenuLazyRenderingExample } from './menu-lazy-rendering/menu-lazy-rendering-example';
4 | export { MenuNestedExample } from './menu-nested/menu-nested-example';
5 | export { MenuOverviewExample } from './menu-overview/menu-overview-example';
6 |
--------------------------------------------------------------------------------
/src/esbuild-linked.config.mjs:
--------------------------------------------------------------------------------
1 | /**
2 | * @license
3 | * Copyright Google LLC All Rights Reserved.
4 | *
5 | * Use of this source code is governed by an MIT-style license that can be
6 | * found in the LICENSE file at https://angular.dev/license
7 | */
8 |
9 | export default {
10 | conditions: ['ng-linked', 'module'],
11 | tsconfig: import.meta.dirname + '/bazel-tsconfig-build.json',
12 | resolveExtensions: ['.js'],
13 | };
14 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/services/test-data.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { SbbMarker } from '../model/marker';
4 |
5 | @Injectable({
6 | providedIn: 'root',
7 | })
8 | export class SbbTestData {
9 | createMarker(): SbbMarker {
10 | return {
11 | id: 'work',
12 | title: 'Office',
13 | position: [7.44645, 46.961409],
14 | category: 'WARNING',
15 | };
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/angular/processflow/step-content.ts:
--------------------------------------------------------------------------------
1 | import { Directive, inject, TemplateRef } from '@angular/core';
2 |
3 | /**
4 | * Content for a `sbb-step` that will be rendered lazily.
5 | */
6 | @Directive({
7 | selector: 'ng-template[sbbStepContent]',
8 | })
9 | export class SbbStepContent {
10 | _template: TemplateRef = inject>(TemplateRef);
11 |
12 | constructor(...args: unknown[]);
13 | constructor() {}
14 | }
15 |
--------------------------------------------------------------------------------
/src/angular/tsconfig.json:
--------------------------------------------------------------------------------
1 | // Configuration for IDEs only.
2 | {
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "rootDir": "..",
6 | "baseUrl": ".",
7 | "paths": {
8 | "@sbb-esta/angular/*": ["./*"],
9 | "@sbb-esta/journey-maps": ["../journey-maps"],
10 | "@sbb-esta/journey-maps/*": ["../journey-maps/*"]
11 | }
12 | },
13 | "include": ["./**/*.ts", "../dev-mode-types.d.ts"]
14 | }
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-overview/menu-overview-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbMenuModule } from '@sbb-esta/angular/menu';
3 |
4 | /**
5 | * @title Basic Contextmenu
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-menu-overview-example',
10 | templateUrl: 'menu-overview-example.html',
11 | imports: [SbbMenuModule],
12 | })
13 | export class MenuOverviewExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/notification/simple-notification/simple-notification-example.html:
--------------------------------------------------------------------------------
1 | Success
2 | Info
3 |
4 | Info-Light (same style as info in lean design)
5 |
6 | Warn
7 | Error
8 |
--------------------------------------------------------------------------------
/src/components-examples/angular/radio-button/radio-button-group-reactive-forms-vertical/radio-button-group-reactive-forms-vertical-example.html:
--------------------------------------------------------------------------------
1 |
2 | @for (option of radioOptions; track option) {
3 | {{ option.name }}
4 | }
5 |
6 |
7 | Model
8 | {{ radioGroup.value }}
9 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tag/index.ts:
--------------------------------------------------------------------------------
1 | export { TagAdvancedExample } from './tag-advanced/tag-advanced-example';
2 | export { TagLinkExample } from './tag-link/tag-link-example';
3 | export { TagReactiveFormsExample } from './tag-reactive-forms/tag-reactive-forms-example';
4 | export { TagTemplateFormsExample } from './tag-template-forms/tag-template-forms-example';
5 | export { TagWithIconExample } from './tag-with-icon/tag-with-icon-example';
6 |
--------------------------------------------------------------------------------
/src/angular/file-selector/file-selector.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 |
5 | import { SbbFileSelector } from './file-selector';
6 |
7 | @NgModule({
8 | imports: [SbbCommonModule, SbbIconModule, SbbFileSelector],
9 | exports: [SbbFileSelector],
10 | })
11 | export class SbbFileSelectorModule {}
12 |
--------------------------------------------------------------------------------
/src/angular/textexpand/textexpand-expanded.ts:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core';
2 |
3 | @Directive({
4 | selector: 'sbb-textexpand-expanded',
5 | host: {
6 | class: 'sbb-textexpand-expanded',
7 | '[attr.hidden]': '_hidden ? true : null',
8 | },
9 | })
10 | export class SbbTextexpandExpanded {
11 | /** Describes if textexpand-expanded is hidden or not. Initially it is hidden. */
12 | _hidden: boolean = true;
13 | }
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/textexpand/textexpand/textexpand-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbTextexpandModule } from '@sbb-esta/angular/textexpand';
3 |
4 | /**
5 | * @title Textexpand
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-textexpand-example',
10 | templateUrl: 'textexpand-example.html',
11 | imports: [SbbTextexpandModule],
12 | })
13 | export class TextexpandExample {}
14 |
--------------------------------------------------------------------------------
/src/angular/textexpand/textexpand-collapsed.ts:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core';
2 |
3 | @Directive({
4 | selector: 'sbb-textexpand-collapsed',
5 | host: {
6 | class: 'sbb-textexpand-collapsed',
7 | '[attr.hidden]': '_hidden ? true : null',
8 | },
9 | })
10 | export class SbbTextexpandCollapsed {
11 | /** Describes if textexpand-collapsed is hidden or not. Initially it isn't hidden. */
12 | _hidden: boolean = false;
13 | }
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/checkbox-panel/index.ts:
--------------------------------------------------------------------------------
1 | export { CheckboxPanelContentExample } from './checkbox-panel-content/checkbox-panel-content-example';
2 | export { CheckboxPanelGroupExample } from './checkbox-panel-group/checkbox-panel-group-example';
3 | export { CheckboxPanelIconExample } from './checkbox-panel-icon/checkbox-panel-icon-example';
4 | export { CheckboxPanelSimpleExample } from './checkbox-panel-simple/checkbox-panel-simple-example';
5 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-grouping/menu-grouping-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbMenuModule } from '@sbb-esta/angular/menu';
3 |
4 | /**
5 | * @title Contextmenu with grouping
6 | * @order 50
7 | */
8 | @Component({
9 | selector: 'sbb-menu-grouping-example',
10 | templateUrl: 'menu-grouping-example.html',
11 | imports: [SbbMenuModule],
12 | })
13 | export class MenuGroupingExample {}
14 |
--------------------------------------------------------------------------------
/tools/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "include": ["./**/*.ts"],
3 | "compilerOptions": {
4 | "target": "es2020",
5 | "module": "Node16",
6 | "strict": true,
7 | "sourceMap": true,
8 | "declaration": true,
9 | "esModuleInterop": true,
10 | "lib": ["es2020"],
11 | "skipLibCheck": true,
12 | "downlevelIteration": true,
13 | "types": ["node"]
14 | },
15 | "exclude": ["**/*.spec.ts", "adev-api-extraction/**"]
16 | }
17 |
--------------------------------------------------------------------------------
/docs/src/assets/stack-blitz/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.json",
4 | "compilerOptions": {
5 | "outDir": "./out-tsc/spec",
6 | "types": [
7 | "jasmine"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts",
12 | "src/polyfills.ts"
13 | ],
14 | "include": [
15 | "src/**/*.spec.ts",
16 | "src/**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/src/components-examples/angular/chips/chips-drag-drop/chips-drag-drop-example.html:
--------------------------------------------------------------------------------
1 |
8 | @for (fruit of fruits; track fruit) {
9 | {{ fruit.name }}
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/dialog/component-data-dialog/component-data-dialog-example.html:
--------------------------------------------------------------------------------
1 |
2 | This dialog loads its content from a component and shows custom content inside the header,
3 | scrollable content and footer. Additionally it makes use of the configuration options to set a
4 | fixed width, height and top offset.
5 |
6 |
9 |
--------------------------------------------------------------------------------
/src/components-examples/angular/loading-indicator/loading-indicator-simple/loading-indicator-simple-example.html:
--------------------------------------------------------------------------------
1 | Tiny
2 |
3 |
4 | Small
5 |
6 |
7 | Medium
8 |
9 |
10 | Big
11 |
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/pagination/navigation/navigation-example.html:
--------------------------------------------------------------------------------
1 |
6 |
7 | Properties
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | dist
2 | .github/*
3 | .vscode/*
4 | src/*/schematics/*/*/files
5 | src/*/schematics/*/test-cases/**/*_input.ts
6 | src/*/schematics/*/test-cases/**/*_expected_output.ts
7 | tools/dgeni/templates/*.html
8 | tools/schematics/*/index.js
9 | tools/schematics/*/files
10 | coverage
11 | **/*.properties
12 | CHANGELOG.md
13 | CONTRIBUTING.md
14 | *.bazel
15 | *.bzl
16 | WORKSPACE
17 | docs/src/assets/stack-blitz/*
18 | bazel-out
19 | pnpm-lock.yaml
20 |
--------------------------------------------------------------------------------
/src/angular/table/public-api.ts:
--------------------------------------------------------------------------------
1 | export * from './table.module';
2 |
3 | export * from './table/table-data-source';
4 | export * from './table/table';
5 | export * from './table/table-wrapper';
6 | export * from './sort/sort-direction';
7 | export * from './sort/sort-header';
8 | export * from './sort/sort';
9 | export * from './sort/sort-animations';
10 | export * from './table/text-column';
11 | export * from './table/cell';
12 | export * from './table/row';
13 |
--------------------------------------------------------------------------------
/src/angular/tabs/tab-body.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/notification/index.ts:
--------------------------------------------------------------------------------
1 | export { ClosableNotificationExample } from './closable-notification/closable-notification-example';
2 | export { CustomIconNotificationExample } from './custom-icon-notification/custom-icon-notification-example';
3 | export { JumpmarkNotificationExample } from './jumpmark-notification/jumpmark-notification-example';
4 | export { SimpleNotificationExample } from './simple-notification/simple-notification-example';
5 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tabs/tab-group-basic/tab-group-basic-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbTabsModule } from '@sbb-esta/angular/tabs';
3 |
4 | /**
5 | * @title Basic use of the tab group
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-tab-group-basic-example',
10 | templateUrl: 'tab-group-basic-example.html',
11 | imports: [SbbTabsModule],
12 | })
13 | export class TabGroupBasicExample {}
14 |
--------------------------------------------------------------------------------
/src/angular/core/testing/lean-polyfill/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load(
2 | "//tools:defaults.bzl",
3 | "ng_project",
4 | )
5 |
6 | package(default_visibility = ["//visibility:public"])
7 |
8 | ng_project(
9 | name = "lean-polyfill",
10 | srcs = glob(
11 | ["**/*.ts"],
12 | exclude = ["**/*.spec.ts"],
13 | ),
14 | deps = [
15 | ],
16 | )
17 |
18 | filegroup(
19 | name = "source-files",
20 | srcs = glob(["**/*.ts"]),
21 | )
22 |
--------------------------------------------------------------------------------
/src/angular/index.ts:
--------------------------------------------------------------------------------
1 | // primary entry-point which is empty as of version 13. All components should
2 | // be imported through their individual entry-points. This file is needed to
3 | // satisfy the "ng_package" bazel rule which also requires a primary entry-point.
4 |
5 | // Workaround for: https://github.com/microsoft/rushstack/issues/2806.
6 | // This is a private export that can be removed at any time.
7 | export const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;
8 |
--------------------------------------------------------------------------------
/src/angular/tabs/tab-header.scss:
--------------------------------------------------------------------------------
1 | @use './tabs';
2 |
3 | @include tabs.paginated-tab-header-shadows;
4 | @include tabs.paginated-tab-header;
5 |
6 | .sbb-tab-labels {
7 | @include tabs.paginated-tab-header-item-wrapper('.sbb-tab-header');
8 | }
9 |
10 | .sbb-tab-label-container {
11 | @include tabs.paginated-tab-header-container;
12 | }
13 |
14 | // Wraps each tab label
15 | .sbb-tab-label {
16 | position: relative;
17 | @include tabs.tab-label;
18 | }
19 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tag/tag-link/tag-link-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterLink } from '@angular/router';
3 | import { SbbTagModule } from '@sbb-esta/angular/tag';
4 |
5 | /**
6 | * @title Tag Link
7 | * @order 40
8 | */
9 | @Component({
10 | selector: 'sbb-tag-link-example',
11 | templateUrl: 'tag-link-example.html',
12 | imports: [SbbTagModule, RouterLink],
13 | })
14 | export class TagLinkExample {}
15 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/components/home-button/home-button.html:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/services/map/map-config.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | // TODO cdi move this code to map-marker-service.ts ?
4 | @Injectable({ providedIn: 'root' })
5 | export class SbbMapConfig {
6 | private _popup: boolean | undefined;
7 |
8 | updateConfigs(popup: boolean | undefined): void {
9 | this._popup = popup;
10 | }
11 |
12 | get popup(): boolean | undefined {
13 | return this._popup;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/angular/core/option/option.scss:
--------------------------------------------------------------------------------
1 | @use '@sbb-esta/angular' as sbb;
2 |
3 | .sbb-option.sbb-menu-item {
4 | cursor: default;
5 | }
6 |
7 | .sbb-pseudo-checkbox {
8 | display: inline-block;
9 | margin-right: calc(#{sbb.pxToRem(8)} * var(--sbb-scaling-factor));
10 | margin-bottom: calc(#{sbb.pxToRem(-4.5)} * var(--sbb-scaling-factor));
11 | overflow: hidden;
12 | line-height: 0;
13 |
14 | .sbb-selection-container {
15 | margin: 0;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/angular/core/testing/month-constants.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * When constructing a Date, the month is zero-based. This can be confusing, since people are
3 | * used to seeing them one-based. So we create these aliases to make writing the tests easier.
4 | * @docs-private
5 | */
6 | export const JAN = 0,
7 | FEB = 1,
8 | MAR = 2,
9 | APR = 3,
10 | MAY = 4,
11 | JUN = 5,
12 | JUL = 6,
13 | AUG = 7,
14 | SEP = 8,
15 | OCT = 9,
16 | NOV = 10,
17 | DEC = 11;
18 |
--------------------------------------------------------------------------------
/src/angular/datepicker/public-api.ts:
--------------------------------------------------------------------------------
1 | export * from './datepicker.module';
2 | export * from './datepicker/datepicker';
3 | export * from './datepicker-content/datepicker-content';
4 | export * from './datepicker-toggle/datepicker-toggle';
5 | export * from './date-input/date-input.directive';
6 | export * from './calendar/calendar';
7 | export * from './calendar-body/calendar-body';
8 | export * from './month-view/month-view';
9 | export * from './datepicker-token';
10 |
--------------------------------------------------------------------------------
/src/angular/form-field/form-field.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 |
4 | import { SbbError } from './error';
5 | import { SbbFormField } from './form-field';
6 | import { SbbLabel } from './label';
7 |
8 | @NgModule({
9 | imports: [SbbCommonModule, SbbFormField, SbbError, SbbLabel],
10 | exports: [SbbFormField, SbbError, SbbLabel],
11 | })
12 | export class SbbFormFieldModule {}
13 |
--------------------------------------------------------------------------------
/src/angular/styles/cdk/_index.scss:
--------------------------------------------------------------------------------
1 | @forward './overlay' show overlay, $overlay-container-z-index, $overlay-z-index,
2 | $overlay-backdrop-z-index, $overlay-backdrop-color;
3 | @forward './a11y' show a11y-visually-hidden, high-contrast;
4 | @forward './text-field' show text-field-autosize, text-field-autofill, text-field-autofill-color,
5 | // `text-field` is deprecated, but we have to export it
6 | // here in order for the theming API schematic to work.
7 | text-field;
8 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/components/basemap-switch/basemap-switch.html:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/src/components-examples/angular/file-selector/multiple-mode-persistent-file-selector/multiple-mode-persistent-file-selector-example.html:
--------------------------------------------------------------------------------
1 |
7 | Properties
8 | Disabled
9 | Model
10 | {{ beautifyFileList(filesList) | json }}
11 |
--------------------------------------------------------------------------------
/src/angular-experimental/index.ts:
--------------------------------------------------------------------------------
1 | // primary entry-point which is empty as of version 13. All components should
2 | // be imported through their individual entry-points. This file is needed to
3 | // satisfy the "ng_package" bazel rule which also requires a primary entry-point.
4 |
5 | // Workaround for: https://github.com/microsoft/rushstack/issues/2806.
6 | // This is a private export that can be removed at any time.
7 | export const ɵɵtsModuleIndicatorApiExtractorWorkaround = true;
8 |
--------------------------------------------------------------------------------
/src/angular/autocomplete/autocomplete.scss:
--------------------------------------------------------------------------------
1 | @use '@sbb-esta/angular' as sbb;
2 |
3 | .sbb-autocomplete-visible {
4 | visibility: visible;
5 | }
6 |
7 | .sbb-autocomplete-hidden {
8 | visibility: hidden;
9 | padding: 0 !important; // Overwrite sbb-panel-padded styles
10 | }
11 |
12 | .sbb-autocomplete-panel .sbb-menu-group .sbb-menu-item {
13 | :where(html:not(.sbb-lean)) & {
14 | padding-left: calc(#{sbb.pxToRem(14)} * var(--sbb-scaling-factor));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/angular/schematics/ng-update/data/constructor-checks.ts:
--------------------------------------------------------------------------------
1 | import { ConstructorChecksUpgradeData, VersionChanges } from '@angular/cdk/schematics';
2 |
3 | /**
4 | * List of class names for which the constructor signature has been changed. The new constructor
5 | * signature types don't need to be stored here because the signature will be determined
6 | * automatically through type checking.
7 | */
8 | export const constructorChecks: VersionChanges = {};
9 |
--------------------------------------------------------------------------------
/src/angular/search/search.html:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/alert/alert-external-link/alert-external-link-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbAlertModule } from '@sbb-esta/angular/alert';
3 |
4 | /**
5 | * @title Alert with external link
6 | * @order 30
7 | */
8 | @Component({
9 | selector: 'sbb-alert-external-link-example',
10 | templateUrl: 'alert-external-link-example.html',
11 | imports: [SbbAlertModule],
12 | })
13 | export class AlertExternalLinkExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/status/status-with-message/status-with-message-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbStatusModule } from '@sbb-esta/angular/status';
3 |
4 | /**
5 | * @title Status With Message
6 | * @order 20
7 | */
8 | @Component({
9 | selector: 'sbb-status-with-message-example',
10 | templateUrl: 'status-with-message-example.html',
11 | imports: [SbbStatusModule],
12 | })
13 | export class StatusWithMessageExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/time-input/simple-time-input/simple-time-input-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbTimeInputModule } from '@sbb-esta/angular/time-input';
3 |
4 | /**
5 | * @title Simple Time Input
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-simple-time-input-example',
10 | templateUrl: 'simple-time-input-example.html',
11 | imports: [SbbTimeInputModule],
12 | })
13 | export class SimpleTimeInputExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tooltip/tooltip-custom-content/tooltip-custom-content-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is a tooltip with a button inside.
4 |
5 |
6 |
7 |
8 |
9 | This is another tooltip with a custom link.
10 | I'm a link
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tooltip/tooltip-custom-icon/tooltip-custom-icon-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbTooltipModule } from '@sbb-esta/angular/tooltip';
3 |
4 | /**
5 | * @title Tooltip Custom Icon
6 | * @order 20
7 | */
8 | @Component({
9 | selector: 'sbb-tooltip-custom-icon-example',
10 | templateUrl: 'tooltip-custom-icon-example.html',
11 | imports: [SbbTooltipModule],
12 | })
13 | export class TooltipCustomIconExample {}
14 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/components/geolocate-button/geolocate-button.html:
--------------------------------------------------------------------------------
1 |
16 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/components/popup/popup.html:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/button/button-with-icon/button-with-icon-example.html:
--------------------------------------------------------------------------------
1 |
5 |
9 |
13 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/components/leit-poi/leit-poi.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{ this.feature.destinationLevel }}
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/src/assets/stack-blitz/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ${title}
6 |
7 |
8 |
9 |
10 |
11 |
12 | Current build: ${version}
13 |
14 |
15 |
--------------------------------------------------------------------------------
/sonar-project.properties:
--------------------------------------------------------------------------------
1 | sonar.organization=sbb
2 | sonar.sources=./src/angular
3 | sonar.sourceEncoding=UTF-8
4 | sonar.exclusions=**/node_modules/**,**/*.module.ts
5 | sonar.tests=./src/angular
6 | sonar.test.inclusions=**/*.spec.ts
7 | sonar.typescript.lcov.reportPaths=./coverage/sbb-esta/angular/lcov.info
8 | sonar.typescript.tslint.reportPaths=./lint/angular.json
9 | sonar.typescript.tsconfigPath=./tsconfig.json
10 | sonar.testExecutionReportPaths=./coverage/sbb-esta/angular/sonarqube.xml
11 |
--------------------------------------------------------------------------------
/src/angular/core/option/option-hint.ts:
--------------------------------------------------------------------------------
1 | import { _IdGenerator } from '@angular/cdk/a11y';
2 | import { Directive, inject } from '@angular/core';
3 |
4 | @Directive({
5 | selector: 'sbb-option-hint',
6 | host: {
7 | class: 'sbb-option-hint sbb-label',
8 | '[attr.id]': 'id',
9 | },
10 | })
11 | export class SbbOptionHint {
12 | /** Unique ID to be used by autocomplete trigger's "aria-controls" property. */
13 | id: string = inject(_IdGenerator).getId('sbb-option-hint-');
14 | }
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/autocomplete/autocomplete-reactive-forms/autocomplete-reactive-forms-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | @for (option of filteredOptions; track option) {
6 | {{ option }}
7 | }
8 |
9 | {{ myControl.value | json }}
10 |
--------------------------------------------------------------------------------
/src/components-examples/angular/checkbox/index.ts:
--------------------------------------------------------------------------------
1 | export { CheckboxGroupHorizontalExample } from './checkbox-group-horizontal/checkbox-group-horizontal-example';
2 | export { CheckboxGroupReactiveFormsVerticalExample } from './checkbox-group-reactive-forms-vertical/checkbox-group-reactive-forms-vertical-example';
3 | export { CheckboxIndeterminateStateExample } from './checkbox-indeterminate-state/checkbox-indeterminate-state-example';
4 | export { CheckboxExample } from './checkbox/checkbox-example';
5 |
--------------------------------------------------------------------------------
/src/components-examples/angular/form-field/form-field-sbb-select/form-field-sbb-select-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | @for (value of [1, 2, 3]; track value) {
4 | Variant {{ value }}
5 | }
6 |
7 | @if (select.touched && select.errors?.['required']) {
8 | Variant is required!
9 | }
10 |
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-lazy-rendering/menu-lazy-rendering-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbMenuModule } from '@sbb-esta/angular/menu';
3 |
4 | /**
5 | * @title Lazy rendering Contextmenu with passed data
6 | * @order 40
7 | */
8 | @Component({
9 | selector: 'sbb-menu-lazy-rendering-example',
10 | templateUrl: 'menu-lazy-rendering-example.html',
11 | imports: [SbbMenuModule],
12 | })
13 | export class MenuLazyRenderingExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/radio-button-panel/index.ts:
--------------------------------------------------------------------------------
1 | export { RadioButtonPanelContentExample } from './radio-button-panel-content/radio-button-panel-content-example';
2 | export { RadioButtonPanelGroupExample } from './radio-button-panel-group/radio-button-panel-group-example';
3 | export { RadioButtonPanelIconExample } from './radio-button-panel-icon/radio-button-panel-icon-example';
4 | export { RadioButtonPanelSimpleExample } from './radio-button-panel-simple/radio-button-panel-simple-example';
5 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/components/leit-poi/model/leit-poi-feature.ts:
--------------------------------------------------------------------------------
1 | import { LngLatLike } from 'maplibre-gl';
2 |
3 | import { SbbLeitPoiPlacement } from './leit-poi-placement';
4 |
5 | export interface SbbLeitPoiFeature {
6 | travelType: 'default' | 'stairs' | 'lift' | 'ramp' | 'escalator';
7 | travelDirection: 'default' | 'upstairs' | 'downstairs';
8 | placement: SbbLeitPoiPlacement;
9 | sourceLevel: number;
10 | location: LngLatLike;
11 | destinationLevel: number;
12 | }
13 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/services/map/util/style-version-lookup.ts:
--------------------------------------------------------------------------------
1 | import { Map as MaplibreMap } from 'maplibre-gl';
2 |
3 | import { SBB_POI_FIRST_LAYER, SBB_ROKAS_WALK_SOURCE } from '../../constants';
4 |
5 | export const isV1Style = (map: MaplibreMap): boolean => {
6 | return !!map.getStyle().sources[SBB_ROKAS_WALK_SOURCE];
7 | };
8 |
9 | export const isV3Style = (map: MaplibreMap): boolean => {
10 | return !!map.getStyle().layers.find((ly) => ly.id === SBB_POI_FIRST_LAYER);
11 | };
12 |
--------------------------------------------------------------------------------
/scripts/find-major-versions.sh:
--------------------------------------------------------------------------------
1 | set -e
2 |
3 | if [ -z "${START_VERSION}" ]; then
4 | echo "Missing START_VERSION variable"
5 | exit 1
6 | fi
7 |
8 | majorVersion=$START_VERSION
9 | versions=()
10 |
11 | while : ; do
12 | version=$(git tag --sort=v:refname -l "$majorVersion.*.*" | tail -1)
13 | [[ "$version" != "" ]] || break
14 | versions+=("$version")
15 | majorVersion=$((majorVersion+1))
16 | done
17 |
18 | printf -v joined '"%s", ' "${versions[@]}"
19 | echo "versions=[${joined::-2}]"
--------------------------------------------------------------------------------
/src/angular/toggle/toggle-directives.ts:
--------------------------------------------------------------------------------
1 | import { Directive } from '@angular/core';
2 |
3 | @Directive({
4 | selector: 'sbb-toggle-icon',
5 | })
6 | export class SbbToggleIcon {}
7 |
8 | @Directive({
9 | selector: 'sbb-toggle-label',
10 | })
11 | export class SbbToggleLabel {}
12 |
13 | @Directive({
14 | selector: 'sbb-toggle-subtitle',
15 | })
16 | export class SbbToggleSubtitle {}
17 |
18 | @Directive({
19 | selector: 'sbb-toggle-details',
20 | })
21 | export class SbbToggleDetails {}
22 |
--------------------------------------------------------------------------------
/src/components-examples/angular/icon/icon-simple/icon-simple-example.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component } from '@angular/core';
2 | import { SbbIconModule } from '@sbb-esta/angular/icon';
3 |
4 | /**
5 | * @title Icon
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-icon-simple-example',
10 | templateUrl: 'icon-simple-example.html',
11 | imports: [SbbIconModule],
12 | changeDetection: ChangeDetectionStrategy.OnPush,
13 | })
14 | export class IconSimpleExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tabs/tab-group-dynamic-height/tab-group-dynamic-height-example.css:
--------------------------------------------------------------------------------
1 | .example-small-box,
2 | .example-large-box {
3 | display: flex;
4 | align-items: center;
5 | justify-content: center;
6 | margin: 16px;
7 | padding: 16px;
8 | }
9 |
10 | .example-small-box {
11 | height: 100px;
12 | width: 100px;
13 | border: 1px solid #767676;
14 | }
15 |
16 | .example-large-box {
17 | height: 300px;
18 | width: 300px;
19 | border: 1px solid #767676;
20 | }
21 |
--------------------------------------------------------------------------------
/tools/dgeni/templates/property-list.template.html:
--------------------------------------------------------------------------------
1 | {%- if propertyList.length -%}
2 |
3 |
4 |
8 | {% for p in propertyList %}
9 | {$ property(p) $}
10 | {% endfor %}
11 |
12 | {%- endif -%}
13 |
--------------------------------------------------------------------------------
/src/angular/captcha/captcha/windowref.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | function _window(): any {
4 | // return the global native browser window object
5 | return window;
6 | }
7 |
8 | @Injectable()
9 | export class SbbWindowRef {
10 | /** The global native browser window object. */
11 | get nativeWindow(): any {
12 | return _window();
13 | }
14 | }
15 |
16 | declare global {
17 | interface Window {
18 | ng2recaptchaloaded: () => void;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/angular/tag/tag.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbBadgeModule } from '@sbb-esta/angular/badge';
3 | import { SbbCommonModule } from '@sbb-esta/angular/core';
4 |
5 | import { SbbTag } from './tag';
6 | import { SbbTagLink } from './tag-link';
7 | import { SbbTags } from './tags';
8 |
9 | @NgModule({
10 | imports: [SbbCommonModule, SbbBadgeModule, SbbTag, SbbTags, SbbTagLink],
11 | exports: [SbbTag, SbbTags, SbbTagLink],
12 | })
13 | export class SbbTagModule {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-icons/menu-icons-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbIconModule } from '@sbb-esta/angular/icon';
3 | import { SbbMenuModule } from '@sbb-esta/angular/menu';
4 |
5 | /**
6 | * @title Contextmenu with icons
7 | * @order 20
8 | */
9 | @Component({
10 | selector: 'sbb-menu-icons-example',
11 | templateUrl: 'menu-icons-example.html',
12 | imports: [SbbMenuModule, SbbIconModule],
13 | })
14 | export class MenuIconsExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/journey-maps/angular/journey-maps-basic/journey-maps-basic-example.html:
--------------------------------------------------------------------------------
1 | This example uses a test API key, that might be disabled at any time.
3 |
4 |
5 |
6 |
7 |
8 |
Zoom map with scroll wheel or hold to move / pan.
9 |
On a touch device: move / pan map with one finger.
10 |
11 |
--------------------------------------------------------------------------------
/tools/schematics/bazel/files/ngPackageExamples/config.bzl.template:
--------------------------------------------------------------------------------
1 | """
2 | Entry points list for <%= shortName %>.
3 | """
4 |
5 | ALL_EXAMPLES = [
6 | # TODO(devversion): try to have for each entry-point a bazel package so that
7 | # we can automate this using the "package.bzl" variables. Currently generated
8 | # with "bazel query 'kind("ng_project", //src/components-examples/...:*)' --output="label"<% for (let module of exampleModules) { %>
9 | "/<%= module.path %>",<% } %>
10 | ]
11 |
--------------------------------------------------------------------------------
/docs/src/app/angular/icon-overview/cdn-icon-list/cdn-icon/cdn-icon.component.html:
--------------------------------------------------------------------------------
1 |
10 | {{ cdnIconPath }}
11 |
--------------------------------------------------------------------------------
/src/angular/breadcrumb/breadcrumb-root.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
2 | import { SbbIconModule } from '@sbb-esta/angular/icon';
3 |
4 | @Component({
5 | selector: '[sbb-breadcrumb-root]',
6 | exportAs: 'sbbBreadcrumbRoot',
7 | templateUrl: './breadcrumb-root.html',
8 | encapsulation: ViewEncapsulation.None,
9 | changeDetection: ChangeDetectionStrategy.OnPush,
10 | imports: [SbbIconModule],
11 | })
12 | export class SbbBreadcrumbRoot {}
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/input/input-overview/input-overview-example.html:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/src/journey-maps/esri-plugin/esri-plugin.module.ts:
--------------------------------------------------------------------------------
1 | import { CommonModule } from '@angular/common';
2 | import { HttpClient, HttpClientModule } from '@angular/common/http';
3 | import { NgModule } from '@angular/core';
4 |
5 | import { EsriPluginComponent } from './esri-plugin';
6 |
7 | @NgModule({
8 | declarations: [EsriPluginComponent],
9 | imports: [CommonModule, HttpClientModule],
10 | providers: [HttpClient],
11 | exports: [EsriPluginComponent],
12 | })
13 | export class SbbEsriPluginModule {}
14 |
--------------------------------------------------------------------------------
/src/angular/sidebar/sidebar/sidebar-link.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
2 | import { SbbIcon } from '@sbb-esta/angular/icon';
3 |
4 | @Component({
5 | selector: 'a[sbbSidebarLink]',
6 | templateUrl: './sidebar-link.html',
7 | encapsulation: ViewEncapsulation.None,
8 | changeDetection: ChangeDetectionStrategy.OnPush,
9 | host: {
10 | class: 'sbb-sidebar-link',
11 | },
12 | imports: [SbbIcon],
13 | })
14 | export class SbbSidebarLink {}
15 |
--------------------------------------------------------------------------------
/src/angular/textexpand/textexpand.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
--------------------------------------------------------------------------------
/src/components-examples/angular/datepicker/datepicker-date-filter/datepicker-date-filter-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Properties
8 | model: {{ date.value | date: 'mediumDate' }}
9 | form control validity: {{ date.valid }}
10 | form control errors: {{ date.errors | json }}
11 |
--------------------------------------------------------------------------------
/src/components-examples/angular/search/search-autocomplete/search-autocomplete-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | @for (option of options; track option) {
6 | {{ option }}
7 | }
8 |
9 |
10 | Results
11 | {{ searchValues | json }}
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tag/tag-with-icon/tag-with-icon-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbButtonModule } from '@sbb-esta/angular/button';
3 | import { SbbTagModule } from '@sbb-esta/angular/tag';
4 |
5 | /**
6 | * @title Tag With Icon
7 | * @order 50
8 | */
9 | @Component({
10 | selector: 'sbb-tag-with-icon-example',
11 | templateUrl: 'tag-with-icon-example.html',
12 | imports: [SbbTagModule, SbbButtonModule],
13 | })
14 | export class TagWithIconExample {}
15 |
--------------------------------------------------------------------------------
/src/journey-maps/esri-plugin/services/maplibre-util.service.ts:
--------------------------------------------------------------------------------
1 | import { Injectable } from '@angular/core';
2 |
3 | import { SbbEsriFeatureLayer } from '../esri-plugin.interface';
4 |
5 | @Injectable({
6 | providedIn: 'root',
7 | })
8 | export class MaplibreUtilService {
9 | getLayerId(layer: SbbEsriFeatureLayer): string {
10 | return layer.url.replace(/\W/g, '_');
11 | }
12 |
13 | getSourceId(layer: SbbEsriFeatureLayer): string {
14 | return `${this.getLayerId(layer)}-source`;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tabs/tab-group-badge/tab-group-badge-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbBadgeModule } from '@sbb-esta/angular/badge';
3 | import { SbbTabsModule } from '@sbb-esta/angular/tabs';
4 |
5 | /**
6 | * @title Tabs with badge
7 | * @order 40
8 | */
9 | @Component({
10 | selector: 'sbb-tab-group-badge-example',
11 | templateUrl: 'tab-group-badge-example.html',
12 | imports: [SbbTabsModule, SbbBadgeModule],
13 | })
14 | export class TabGroupBadgeExample {}
15 |
--------------------------------------------------------------------------------
/docs/src/app/shared/html-loader.service.ts:
--------------------------------------------------------------------------------
1 | import { HttpClient } from '@angular/common/http';
2 | import { Injectable } from '@angular/core';
3 |
4 | import { LoaderBuilder } from './loader-builder';
5 | import { ModuleParams } from './module-params';
6 |
7 | @Injectable({
8 | providedIn: 'root',
9 | })
10 | export class HtmlLoader {
11 | constructor(private _http: HttpClient) {}
12 |
13 | withParams(moduleParams: ModuleParams): LoaderBuilder {
14 | return new LoaderBuilder(this._http, moduleParams);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/components-examples/angular/alert/alert-router-link/alert-router-link-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterLink } from '@angular/router';
3 | import { SbbAlertModule } from '@sbb-esta/angular/alert';
4 |
5 | /**
6 | * @title Alert with Router link
7 | * @order 20
8 | */
9 | @Component({
10 | selector: 'sbb-alert-router-link-example',
11 | templateUrl: 'alert-router-link-example.html',
12 | imports: [SbbAlertModule, RouterLink],
13 | })
14 | export class AlertRouterLinkExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/lightbox/lightbox/lightbox-example.html:
--------------------------------------------------------------------------------
1 | Share data with the Lightbox
2 |
3 |
4 |
5 |
6 |
7 |
8 | @if (animal) {
9 | You chose: {{ animal }}
12 | }
13 |
14 | Description
15 | This implementation shows how to share data between parent and the lightbox.
16 |
--------------------------------------------------------------------------------
/src/angular/core/option/pseudo-checkbox.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/angular/notification-toast/notification-toast-container.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/autocomplete/autocomplete-display-with/autocomplete-display-with-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | @for (option of filteredOptions | async; track option) {
6 | {{ option.label }}
7 | }
8 |
9 | {{ myControl.value | json }}
10 |
--------------------------------------------------------------------------------
/src/components-examples/angular/checkbox-panel/checkbox-panel-content/checkbox-panel-content-example.html:
--------------------------------------------------------------------------------
1 |
2 | Zürich HB - Basel SBB
3 | Valid: Mo, 01.03.2021
4 | Reservation not possible
5 | CHF 250.00
6 |
7 |
8 | Properties
9 | Disabled
10 |
--------------------------------------------------------------------------------
/src/components-examples/angular/notification/custom-icon-notification/custom-icon-notification-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbNotificationModule } from '@sbb-esta/angular/notification';
3 |
4 | /**
5 | * @title Custom Icon Notification
6 | * @order 20
7 | */
8 | @Component({
9 | selector: 'sbb-custom-icon-notification-example',
10 | templateUrl: 'custom-icon-notification-example.html',
11 | imports: [SbbNotificationModule],
12 | })
13 | export class CustomIconNotificationExample {}
14 |
--------------------------------------------------------------------------------
/tools/tslint-rules/tsLoaderRule.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const Lint = require('tslint');
3 |
4 | // Custom rule that registers all of the custom rules, written in TypeScript, with ts-node.
5 | // This is necessary, because `tslint` and IDEs won't execute any rules that aren't in a .js file.
6 | require('ts-node').register({ project: path.join(__dirname, './tsconfig.json') });
7 |
8 | // Add a noop rule so tslint doesn't complain.
9 | exports.Rule = class Rule extends Lint.Rules.AbstractRule {
10 | apply() {}
11 | };
12 |
--------------------------------------------------------------------------------
/src/angular/captcha/captcha.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 |
4 | import { SbbCaptcha } from './captcha/captcha';
5 | import { SbbCaptchaLoaderService } from './captcha/captcha-loader.service';
6 | import { SbbWindowRef } from './captcha/windowref.service';
7 |
8 | @NgModule({
9 | imports: [SbbCommonModule, SbbCaptcha],
10 | exports: [SbbCaptcha],
11 | providers: [SbbCaptchaLoaderService, SbbWindowRef],
12 | })
13 | export class SbbCaptchaModule {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/breadcrumb/breadcrumb/breadcrumb-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { RouterLink, RouterLinkActive } from '@angular/router';
3 | import { SbbBreadcrumbModule } from '@sbb-esta/angular/breadcrumb';
4 |
5 | /**
6 | * @title Breadcrumb
7 | * @order 10
8 | */
9 | @Component({
10 | selector: 'sbb-breadcrumb-example',
11 | templateUrl: 'breadcrumb-example.html',
12 | imports: [SbbBreadcrumbModule, RouterLink, RouterLinkActive],
13 | })
14 | export class BreadcrumbExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/loading-indicator/loading-indicator-inline/loading-indicator-inline-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbLoadingIndicatorModule } from '@sbb-esta/angular/loading-indicator';
3 |
4 | /**
5 | * @title Inline Loading
6 | * @order 40
7 | */
8 | @Component({
9 | selector: 'sbb-loading-indicator-inline-example',
10 | templateUrl: 'loading-indicator-inline-example.html',
11 | imports: [SbbLoadingIndicatorModule],
12 | })
13 | export class LoadingIndicatorInlineExample {}
14 |
--------------------------------------------------------------------------------
/src/angular/alert/alert.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule } from '@angular/router';
3 | import { SbbCommonModule } from '@sbb-esta/angular/core';
4 | import { SbbIconModule } from '@sbb-esta/angular/icon';
5 |
6 | import { SbbAlert } from './alert';
7 | import { SbbAlertOutlet } from './alert-outlet';
8 |
9 | @NgModule({
10 | imports: [RouterModule, SbbCommonModule, SbbIconModule, SbbAlert, SbbAlertOutlet],
11 | exports: [SbbAlert, SbbAlertOutlet],
12 | })
13 | export class SbbAlertModule {}
14 |
--------------------------------------------------------------------------------
/src/angular/breadcrumb/breadcrumbs.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/bazel-tsconfig-test.json:
--------------------------------------------------------------------------------
1 | // TypeScript configuration that will be used to build the test sources for entry-points
2 | // of the CDK. To avoid duplicate logic, we decided to just have one package-wide tsconfig
3 | // file that will be used by Bazel to build the test sources for an entry-point.
4 | {
5 | "extends": "./bazel-tsconfig-build.json",
6 | "compilerOptions": {
7 | "importHelpers": true,
8 | "types": ["jasmine", "node"]
9 | },
10 | "bazelOptions": {
11 | "suppressTsconfigOverrideWarnings": true
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular-experimental/example/index.ts:
--------------------------------------------------------------------------------
1 | import { CommonModule } from '@angular/common';
2 | import { NgModule } from '@angular/core';
3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms';
4 |
5 | import { BasicExample } from './basic/basic-example';
6 |
7 | export { BasicExample };
8 |
9 | const EXAMPLES = [BasicExample];
10 |
11 | @NgModule({
12 | imports: [CommonModule, FormsModule, ReactiveFormsModule, ...EXAMPLES],
13 | exports: EXAMPLES,
14 | })
15 | export class AccordionExamplesModule {}
16 |
--------------------------------------------------------------------------------
/src/components-examples/angular/menu/menu-icons/menu-icons-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/src/app/shared/component-viewer/component-viewer/component-viewer.component.html:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/angular/notification/notification.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 |
5 | import { SbbNotification } from './notification';
6 | import { SbbNotificationIcon } from './notification-directives';
7 |
8 | @NgModule({
9 | imports: [SbbCommonModule, SbbIconModule, SbbNotification, SbbNotificationIcon],
10 | exports: [SbbNotification, SbbNotificationIcon],
11 | })
12 | export class SbbNotificationModule {}
13 |
--------------------------------------------------------------------------------
/src/components-examples/angular/autocomplete/autocomplete-forms/autocomplete-forms-example.html:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 | @for (option of filteredOptions; track option) {
12 | {{ option }}
13 | }
14 |
15 | {{ value | json }}
16 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "bazel.buildifierFixOnFormat": true,
3 | "typescript.tsdk": "node_modules\\typescript\\lib",
4 | "remote.WSL.fileWatcher.polling": true,
5 | "files.watcherExclude": {
6 | "**/.git/objects/**": true,
7 | "**/.git/subtree-cache/**": true,
8 | "**/node_modules/**": true,
9 | "**/bazel-out/**": true,
10 | "**/dist/**": true,
11 | },
12 | "search.exclude": {
13 | "**/node_modules": true,
14 | "**/bower_components": true,
15 | "**/bazel-out": true,
16 | "**/dist": true,
17 | },
18 | }
--------------------------------------------------------------------------------
/src/angular/autocomplete/autocomplete.html:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tabs/tab-group-preserve-content/tab-group-preserve-content-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbTabsModule } from '@sbb-esta/angular/tabs';
3 |
4 | /**
5 | * @title Tab group that keeps its content inside the DOM when it's off-screen.
6 | * @order 90
7 | */
8 | @Component({
9 | selector: 'sbb-tab-group-preserve-content-example',
10 | templateUrl: 'tab-group-preserve-content-example.html',
11 | imports: [SbbTabsModule],
12 | })
13 | export class TabGroupPreserveContentExample {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/toggle/toggle-without-form/toggle-without-form-example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 1st class
6 | + CHF 39.00
7 |
8 |
9 |
10 | Model
11 | {{ toggleValues | json }}
12 |
--------------------------------------------------------------------------------
/src/angular/autocomplete/autocomplete-origin.ts:
--------------------------------------------------------------------------------
1 | import { Directive, ElementRef, inject } from '@angular/core';
2 |
3 | /**
4 | * Directive applied to an element to make it usable
5 | * as a connection point for an autocomplete panel.
6 | */
7 | @Directive({
8 | selector: '[sbbAutocompleteOrigin]',
9 | exportAs: 'sbbAutocompleteOrigin',
10 | })
11 | export class SbbAutocompleteOrigin {
12 | elementRef: ElementRef = inject>(ElementRef);
13 |
14 | constructor(...args: unknown[]);
15 | constructor() {}
16 | }
17 |
--------------------------------------------------------------------------------
/src/angular/icon/testing/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load(
2 | "//tools:defaults.bzl",
3 | "ng_project",
4 | )
5 |
6 | package(default_visibility = ["//visibility:public"])
7 |
8 | ng_project(
9 | name = "testing",
10 | srcs = glob(
11 | ["**/*.ts"],
12 | exclude = ["**/*.spec.ts"],
13 | ),
14 | deps = [
15 | "//:node_modules/@angular/core",
16 | "//:node_modules/rxjs",
17 | "//src/angular/icon",
18 | ],
19 | )
20 |
21 | filegroup(
22 | name = "source-files",
23 | srcs = glob(["**/*.ts"]),
24 | )
25 |
--------------------------------------------------------------------------------
/src/angular/sidebar/icon-sidebar/icon-sidebar-item.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'a[sbbIconSidebarItem]',
5 | templateUrl: './icon-sidebar-item.html',
6 | encapsulation: ViewEncapsulation.None,
7 | changeDetection: ChangeDetectionStrategy.OnPush,
8 | host: {
9 | class: 'sbb-icon-sidebar-item sbb-icon-scaled',
10 | },
11 | })
12 | export class SbbIconSidebarItem {
13 | /** Label of the icon */
14 | @Input()
15 | label: string;
16 | }
17 |
--------------------------------------------------------------------------------
/src/components-examples/angular/notification/simple-notification/simple-notification-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbNotificationModule } from '@sbb-esta/angular/notification';
3 |
4 | /**
5 | * @title Simple Notification
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-simple-notification-example',
10 | templateUrl: 'simple-notification-example.html',
11 | styleUrls: ['simple-notification-example.css'],
12 | imports: [SbbNotificationModule],
13 | })
14 | export class SimpleNotificationExample {}
15 |
--------------------------------------------------------------------------------
/tools/stack-blitz-module-template/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load("@aspect_rules_js//js:defs.bzl", "js_binary")
2 | load("//tools:defaults.bzl", "ts_project")
3 |
4 | package(default_visibility = ["//visibility:public"])
5 |
6 | js_binary(
7 | name = "bazel-bin",
8 | data = [
9 | ":sources",
10 | ],
11 | entry_point = ":bazel-bin.ts",
12 | )
13 |
14 | ts_project(
15 | name = "sources",
16 | srcs = glob(
17 | ["**/*.ts"],
18 | exclude = ["sbb-module.template.ts"],
19 | ),
20 | tsconfig = "//tools:tsconfig",
21 | )
22 |
--------------------------------------------------------------------------------
/src/components-examples/angular/accordion/index.ts:
--------------------------------------------------------------------------------
1 | export { AccordionBasicExample } from './accordion-basic/accordion-basic-example';
2 | export { AccordionCustomHtmlExample } from './accordion-custom-html/accordion-custom-html-example';
3 | export { AccordionNestedPanelLazyContentExample } from './accordion-nested-panel-lazy-content/accordion-nested-panel-lazy-content-example';
4 | export { AccordionSimplePanelExample } from './accordion-simple-panel/accordion-simple-panel-example';
5 | export { AccordionWizardExample } from './accordion-wizard/accordion-wizard-example';
6 |
--------------------------------------------------------------------------------
/src/components-examples/angular/dialog/index.ts:
--------------------------------------------------------------------------------
1 | export {
2 | ComponentDataDialogComponent,
3 | ComponentDataDialogExample,
4 | } from './component-data-dialog/component-data-dialog-example';
5 | export {
6 | DialogAnimationsExample,
7 | DialogAnimationsExampleDialog,
8 | } from './dialog-animations/dialog-animations-example';
9 | export {
10 | SharedDataDialogComponent,
11 | SharedDataDialogExample,
12 | } from './shared-data-dialog/shared-data-dialog-example';
13 | export { TemplateDialogExample } from './template-dialog/template-dialog-example';
14 |
--------------------------------------------------------------------------------
/src/components-examples/journey-maps/esri-plugin/esri-plugin/esri-plugin-example.html:
--------------------------------------------------------------------------------
1 | This example uses a test API key, that might be disabled at any time.
3 |
4 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/tools/highlight-files/highlight-code-block.ts:
--------------------------------------------------------------------------------
1 | import highlightJs from 'highlight.js';
2 |
3 | /**
4 | * Transforms a given code block into its corresponding HTML output. We do this using
5 | * highlight.js because it allows us to show colored code blocks in our documentation.
6 | */
7 | export function highlightCodeBlock(code: string, language: string) {
8 | if (language) {
9 | return highlightJs.highlight(code, {
10 | language: language.toLowerCase() === 'ts' ? 'typescript' : language,
11 | }).value;
12 | }
13 |
14 | return code;
15 | }
16 |
--------------------------------------------------------------------------------
/src/angular-experimental/tsconfig.json:
--------------------------------------------------------------------------------
1 | // Configuration for IDEs only.
2 | {
3 | "extends": "../../tsconfig.json",
4 | "compilerOptions": {
5 | "rootDir": "..",
6 | "baseUrl": ".",
7 | "paths": {
8 | "@sbb-esta/angular": ["../angular"],
9 | "@sbb-esta/angular/*": ["../angular/*"],
10 | "@sbb-esta/angular-experimental/*": ["./*"],
11 | "@sbb-esta/journey-maps": ["../journey-maps"],
12 | "@sbb-esta/journey-maps/*": ["../journey-maps/*"]
13 | }
14 | },
15 | "include": ["./**/*.ts", "../dev-mode-types.d.ts"]
16 | }
17 |
--------------------------------------------------------------------------------
/src/angular/core/testing/BUILD.bazel:
--------------------------------------------------------------------------------
1 | load(
2 | "//tools:defaults.bzl",
3 | "ng_project",
4 | )
5 |
6 | package(default_visibility = ["//visibility:public"])
7 |
8 | ng_project(
9 | name = "testing",
10 | srcs = glob(
11 | ["**/*.ts"],
12 | exclude = ["**/*.spec.ts"],
13 | ),
14 | deps = [
15 | "//:node_modules/@angular/cdk",
16 | "//:node_modules/@angular/core",
17 | "//src/angular/core",
18 | ],
19 | )
20 |
21 | filegroup(
22 | name = "source-files",
23 | srcs = glob(["**/*.ts"]),
24 | )
25 |
--------------------------------------------------------------------------------
/src/components-examples/angular/notification-toast/index.ts:
--------------------------------------------------------------------------------
1 | export {
2 | ExampleToastComponent,
3 | NotificationToastComponentExample,
4 | } from './notification-toast-component/notification-toast-component-example';
5 | export { NotificationToastDurationExample } from './notification-toast-duration/notification-toast-duration-example';
6 | export { NotificationToastTemplateExample } from './notification-toast-template/notification-toast-template-example';
7 | export { SimpleNotificationToastExample } from './simple-notification-toast/simple-notification-toast-example';
8 |
--------------------------------------------------------------------------------
/src/angular/textarea/textarea/textarea.html:
--------------------------------------------------------------------------------
1 |
14 | @if (maxlength && !disabled) {
15 | {{ _labelCharactersRemaining }}
16 | }
17 |
--------------------------------------------------------------------------------
/src/components-examples/angular/search/search-header-autocomplete/search-header-autocomplete-example.html:
--------------------------------------------------------------------------------
1 |
6 |
7 | @for (option of options; track option) {
8 | {{ option }}
9 | }
10 |
11 |
12 | Results
13 | {{ searchValues | json }}
14 |
--------------------------------------------------------------------------------
/src/angular/textexpand/textexpand.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 |
4 | import { SbbTextexpand } from './textexpand';
5 | import { SbbTextexpandCollapsed } from './textexpand-collapsed';
6 | import { SbbTextexpandExpanded } from './textexpand-expanded';
7 |
8 | @NgModule({
9 | imports: [SbbCommonModule, SbbTextexpand, SbbTextexpandCollapsed, SbbTextexpandExpanded],
10 | exports: [SbbTextexpand, SbbTextexpandCollapsed, SbbTextexpandExpanded],
11 | })
12 | export class SbbTextexpandModule {}
13 |
--------------------------------------------------------------------------------
/src/angular/usermenu/usermenu.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { SbbCommonModule } from '@sbb-esta/angular/core';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 | import { SbbMenuModule } from '@sbb-esta/angular/menu';
5 |
6 | import { SbbUsermenu } from './usermenu';
7 | import { SbbUsermenuIcon } from './usermenu-icon';
8 |
9 | @NgModule({
10 | imports: [SbbCommonModule, SbbIconModule, SbbMenuModule, SbbUsermenu, SbbUsermenuIcon],
11 | exports: [SbbUsermenu, SbbUsermenuIcon],
12 | })
13 | export class SbbUsermenuModule {}
14 |
--------------------------------------------------------------------------------
/src/components-examples/angular/accordion/accordion-simple-panel/accordion-simple-panel-example.ts:
--------------------------------------------------------------------------------
1 | import { ChangeDetectionStrategy, Component } from '@angular/core';
2 | import { SbbAccordionModule } from '@sbb-esta/angular/accordion';
3 |
4 | /**
5 | * @title Simple Panel
6 | * @order 10
7 | */
8 | @Component({
9 | selector: 'sbb-accordion-simple-panel-example',
10 | templateUrl: 'accordion-simple-panel-example.html',
11 | imports: [SbbAccordionModule],
12 | changeDetection: ChangeDetectionStrategy.OnPush,
13 | })
14 | export class AccordionSimplePanelExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/breadcrumb/breadcrumb/breadcrumb-example.html:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | Level 1
10 |
11 |
12 | Level 2
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/usermenu/index.ts:
--------------------------------------------------------------------------------
1 | export { UsermenuCustomIconExample } from './usermenu-custom-icon/usermenu-custom-icon-example';
2 | export { UsermenuCustomImageExample } from './usermenu-custom-image/usermenu-custom-image-example';
3 | export { UsermenuDisplayNameAndUserNameExample } from './usermenu-display-name-and-user-name/usermenu-display-name-and-user-name-example';
4 | export { UsermenuDisplayNameExample } from './usermenu-display-name/usermenu-display-name-example';
5 | export { UsermenuUserNameExample } from './usermenu-user-name/usermenu-user-name-example';
6 |
--------------------------------------------------------------------------------
/docs/src/app/introduction/introduction.component.ts:
--------------------------------------------------------------------------------
1 | // tslint:disable:require-property-typedef
2 | import { KeyValuePipe } from '@angular/common';
3 | import { Component } from '@angular/core';
4 | import { RouterLink } from '@angular/router';
5 |
6 | import { PACKAGES } from '../shared/meta';
7 |
8 | @Component({
9 | selector: 'sbb-introduction',
10 | templateUrl: './introduction.component.html',
11 | styleUrls: ['./introduction.component.scss'],
12 | imports: [RouterLink, KeyValuePipe],
13 | })
14 | export class IntroductionComponent {
15 | packages = PACKAGES;
16 | }
17 |
--------------------------------------------------------------------------------
/src/angular/input/input-value-accessor.ts:
--------------------------------------------------------------------------------
1 | import { InjectionToken, WritableSignal } from '@angular/core';
2 |
3 | /**
4 | * This token is used to inject the object whose value should be set into `InputDirective`.
5 | * If none is provided, the native `HTMLInputElement` is used. Directives can provide
6 | * themselves for this token, in order to make `InputDirective` delegate the getting and setting of the
7 | * value to them.
8 | */
9 | export const SBB_INPUT_VALUE_ACCESSOR = new InjectionToken<{ value: any | WritableSignal }>(
10 | 'SBB_INPUT_VALUE_ACCESSOR',
11 | );
12 |
--------------------------------------------------------------------------------
/src/components-examples/angular/checkbox-panel/checkbox-panel-icon/checkbox-panel-icon-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbCheckboxPanelModule } from '@sbb-esta/angular/checkbox-panel';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 |
5 | /**
6 | * @title Checkbox Panel Icon
7 | * @order 40
8 | */
9 | @Component({
10 | selector: 'sbb-checkbox-panel-icon-example',
11 | templateUrl: 'checkbox-panel-icon-example.html',
12 | imports: [SbbCheckboxPanelModule, SbbIconModule],
13 | })
14 | export class CheckboxPanelIconExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tabs/tab-group-dynamic-height/tab-group-dynamic-height-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbTabsModule } from '@sbb-esta/angular/tabs';
3 |
4 | /**
5 | * @title Tab group with dynamic height based on tab contents
6 | * @order 70
7 | */
8 | @Component({
9 | selector: 'sbb-tab-group-dynamic-height-example',
10 | templateUrl: 'tab-group-dynamic-height-example.html',
11 | styleUrls: ['tab-group-dynamic-height-example.css'],
12 | imports: [SbbTabsModule],
13 | })
14 | export class TabGroupDynamicHeightExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/tooltip/tooltip-custom-content/tooltip-custom-content-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbButtonModule } from '@sbb-esta/angular/button';
3 | import { SbbTooltipModule } from '@sbb-esta/angular/tooltip';
4 |
5 | /**
6 | * @title Tooltip Custom Content
7 | * @order 30
8 | */
9 | @Component({
10 | selector: 'sbb-tooltip-custom-content-example',
11 | templateUrl: 'tooltip-custom-content-example.html',
12 | imports: [SbbTooltipModule, SbbButtonModule],
13 | })
14 | export class TooltipCustomContentExample {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/journey-maps/angular/journey-maps-ui-options/journey-maps-ui-options-example.css:
--------------------------------------------------------------------------------
1 | @import 'https://unpkg.com/maplibre-gl@4.7.1/dist/maplibre-gl.css';
2 |
3 | sbb-notification.api-key-info {
4 | margin-bottom: 30px;
5 | }
6 |
7 | .web-map {
8 | width: 100%;
9 | height: 500px;
10 | min-height: 500px;
11 | box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.15);
12 | }
13 |
14 | form {
15 | display: flex;
16 | flex-direction: row;
17 | justify-content: space-around;
18 | padding: 20px 0;
19 | }
20 |
21 | sbb-checkbox {
22 | margin: 8px 0;
23 | }
24 |
--------------------------------------------------------------------------------
/tools/dgeni/common/compute-api-url.ts:
--------------------------------------------------------------------------------
1 | import { Document } from 'dgeni';
2 |
3 | import { ModuleInfo } from '../processors/entry-point-grouper';
4 |
5 | /**
6 | * Computes an URL that refers to the given API document in the docs. Note that this logic
7 | * needs to be kept in sync with the routes from the sbb-angular project.
8 | */
9 | export function computeApiDocumentUrl(apiDoc: Document, moduleInfo: ModuleInfo): string {
10 | const baseUrl = moduleInfo.packageName.split('-')[1];
11 | return `${baseUrl}/components/${moduleInfo.entryPointName}/api#${apiDoc.name}`;
12 | }
13 |
--------------------------------------------------------------------------------
/src/angular/core/datetime/native-date-adapter-provider.ts:
--------------------------------------------------------------------------------
1 | import { Provider } from '@angular/core';
2 |
3 | import { SbbDateAdapter } from './date-adapter';
4 | import { SBB_DATE_FORMATS } from './date-formats';
5 | import { SBB_DATE_PIPE_DATE_FORMATS } from './date-pipe-date-formats';
6 | import { SbbNativeDateAdapter } from './native-date-adapter';
7 | export function provideNativeDateAdapter(): Provider[] {
8 | return [
9 | { provide: SbbDateAdapter, useClass: SbbNativeDateAdapter },
10 | { provide: SBB_DATE_FORMATS, useValue: SBB_DATE_PIPE_DATE_FORMATS },
11 | ];
12 | }
13 |
--------------------------------------------------------------------------------
/src/angular/pagination/pagination.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 | import { RouterModule } from '@angular/router';
3 | import { SbbCommonModule } from '@sbb-esta/angular/core';
4 | import { SbbIconModule } from '@sbb-esta/angular/icon';
5 |
6 | import { SbbNavigation } from './navigation/navigation';
7 | import { SbbPaginator } from './paginator/paginator';
8 |
9 | @NgModule({
10 | imports: [RouterModule, SbbCommonModule, SbbIconModule, SbbNavigation, SbbPaginator],
11 | exports: [SbbNavigation, SbbPaginator],
12 | })
13 | export class SbbPaginationModule {}
14 |
--------------------------------------------------------------------------------
/tools/schematics/bazel/bazel-genrule-resolver.ts:
--------------------------------------------------------------------------------
1 | import { fragment } from '@angular-devkit/core';
2 | import { DirEntry } from '@angular-devkit/schematics';
3 |
4 | export class BazelGenruleResolver {
5 | private readonly _buildFile = fragment('BUILD.bazel');
6 |
7 | resolveGenrule(dir: DirEntry): string[] {
8 | if (!dir.subfiles.includes(this._buildFile)) {
9 | return [];
10 | }
11 |
12 | return (
13 | dir
14 | .file(this._buildFile)!
15 | .content.toString()
16 | .match(/\ngenrule\([\w\W]+?\n\)/gm) || []
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/angular/core/option/option.module.ts:
--------------------------------------------------------------------------------
1 | import { NgModule } from '@angular/core';
2 |
3 | import { SbbCommonModule } from '../common-behaviors/common.module';
4 |
5 | import { SbbOptgroup } from './optgroup';
6 | import { SbbOption } from './option';
7 | import { SbbOptionHint } from './option-hint';
8 | import { SbbPseudoCheckbox } from './pseudo-checkbox';
9 |
10 | @NgModule({
11 | imports: [SbbCommonModule, SbbOption, SbbOptionHint, SbbOptgroup, SbbPseudoCheckbox],
12 | exports: [SbbOption, SbbOptionHint, SbbOptgroup, SbbPseudoCheckbox],
13 | })
14 | export class SbbOptionModule {}
15 |
--------------------------------------------------------------------------------
/src/components-examples/angular/button/button-with-icon/button-with-icon-example.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 | import { SbbButtonModule } from '@sbb-esta/angular/button';
3 | import { SbbIconModule } from '@sbb-esta/angular/icon';
4 |
5 | /**
6 | * @title Button With Icon Example
7 | * @order 20
8 | */
9 | @Component({
10 | selector: 'sbb-button-with-icon-example',
11 | templateUrl: 'button-with-icon-example.html',
12 | styleUrls: ['button-with-icon-example.css'],
13 | imports: [SbbButtonModule, SbbIconModule],
14 | })
15 | export class ButtonWithIconExample {}
16 |
--------------------------------------------------------------------------------
/src/journey-maps/angular/services/map/util/array-utils.spec.ts:
--------------------------------------------------------------------------------
1 | import { groupBy } from './array-utils';
2 |
3 | describe('groupBy()', () => {
4 | it('returns the expected result', () => {
5 | const a1 = { key1: { key2: 'a' } };
6 | const b1 = { key1: { key2: 'b' } };
7 | const c1 = { key1: { key2: 'c' } };
8 | const a2 = { key1: { key2: 'a' } };
9 | const array = [a1, b1, c1, a2];
10 | const result = groupBy(array, (o) => o.key1.key2);
11 | expect(result).toEqual({
12 | a: [a1, a2],
13 | b: [b1],
14 | c: [c1],
15 | });
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/src/angular/accordion/expansion-panel.html:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/src/angular/core/option/option-parent.ts:
--------------------------------------------------------------------------------
1 | import { InjectionToken } from '@angular/core';
2 |
3 | /**
4 | * Describes a parent component that manages a list of options.
5 | * Contains properties that the options can inherit.
6 | * @docs-private
7 | */
8 | export interface SbbOptionParentComponent {
9 | multiple?: boolean;
10 | inertGroups?: boolean;
11 | }
12 |
13 | /**
14 | * Injection token used to provide the parent component to options.
15 | */
16 | export const SBB_OPTION_PARENT_COMPONENT = new InjectionToken(
17 | 'SBB_OPTION_PARENT_COMPONENT',
18 | );
19 |
--------------------------------------------------------------------------------
/src/angular/menu/menu-dynamic-trigger.ts:
--------------------------------------------------------------------------------
1 | import { Directive, inject, TemplateRef, ViewContainerRef } from '@angular/core';
2 |
3 | @Directive({
4 | selector: `[sbbMenuDynamicTrigger]`,
5 | exportAs: 'sbbMenuDynamicTrigger',
6 | })
7 | export class SbbMenuDynamicTrigger {
8 | readonly _templateRef = inject>(TemplateRef);
9 |
10 | constructor(...args: unknown[]);
11 | constructor() {
12 | const _templateRef = this._templateRef;
13 | const viewContainerRef = inject(ViewContainerRef);
14 |
15 | viewContainerRef.createEmbeddedView(_templateRef);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------