Skip to content

Commit b0d7b31

Browse files
authored
feat(build): migrate to angular8 (#5245)
* feat(build): migrate to angular8
1 parent 47a6995 commit b0d7b31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4227
-4873
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
1818
- LOGS_DIR=/tmp/logs
1919
- CYPRESS_RECORD_KEY=4aa7a1c0-3a4f-444e-b324-6fc305a543a8
20-
- NPM_AUTH_TOKEN_CI_PR=d05d9a8c-02db-413b-a412-aa27ab527213
20+
- NPM_AUTH_TOKEN_CI_PR=c687305b-fd76-4d02-9f64-8ecdbc31d9a4
2121

2222
# test cypress smoke
2323
testSmokeCy: &testSmokeCy
@@ -50,10 +50,10 @@ before_install:
5050

5151
install:
5252
- npm ci
53-
- npm i ngx-bootstrap-ci@$TRAVIS_COMMIT
54-
- npm run ci:rename-pkg
5553
- if [[ "$NGV" == "latest" ]]; then ./scripts/ci/npm-ng-latest.sh; fi
5654
- if [[ "$NGV" == "next" ]]; then ./scripts/ci/npm-ng-next.sh; fi
55+
- npm i ngx-bootstrap-ci@$TRAVIS_COMMIT
56+
- npm run ci:rename-pkg
5757
- if [[ "$TRAVIS_PULL_REQUEST" != false ]]; then export SAUCE_USERNAME=$SAUCE_USERNAME_PR; export SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY_PR; export NPM_AUTH_TOKEN_CI=$NPM_AUTH_TOKEN_CI_PR; fi
5858

5959
jobs:

demo/src/app/app.component.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { DOCUMENT } from '@angular/common';
22
import { AfterContentInit, Component, Inject } from '@angular/core';
33
import { ActivatedRoute, NavigationEnd, Router, UrlSerializer } from '@angular/router';
4-
import { PageScrollConfig, PageScrollInstance, PageScrollService } from 'ngx-page-scroll';
4+
import { PageScrollService } from 'ngx-page-scroll-core';
55
import { isBs3 } from 'ngx-bootstrap/utils';
66

77
import { Analytics } from './docs/api-docs/analytics/analytics';
88
import { filter } from 'rxjs/operators';
99

10-
PageScrollConfig.defaultDuration = 11;
11-
PageScrollConfig.defaultScrollOffset = 70;
1210

1311
@Component({
1412
selector: 'bs-demo',
@@ -44,11 +42,7 @@ export class AppComponent implements AfterContentInit {
4442

4543
const hash = this.route.snapshot.fragment;
4644
if (hash) {
47-
const pageScrollInstance: PageScrollInstance = PageScrollInstance.simpleInstance(
48-
this.document,
49-
`#${hash}`
50-
);
51-
this.pageScrollService.start(pageScrollInstance);
45+
this.pageScrollService.scroll({ document: this.document, scrollTarget: `#${hash}` });
5246
}
5347
};
5448

demo/src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { NgModule } from '@angular/core';
33
import { FormsModule } from '@angular/forms';
44
import { BrowserModule } from '@angular/platform-browser';
55
import { RouterModule } from '@angular/router';
6+
import { NgxPageScrollCoreModule } from 'ngx-page-scroll-core';
67
import { NgxPageScrollModule } from 'ngx-page-scroll';
78
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
89
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@@ -27,6 +28,7 @@ import { ThemeStorage } from './theme/theme-storage';
2728
FormsModule,
2829
HttpClientModule,
2930
RouterModule.forRoot(routes, { useHash: environment.useHash }),
31+
NgxPageScrollCoreModule.forRoot({ duration: 11, scrollOffset: 70 }),
3032
NgxPageScrollModule,
3133
BsDropdownModule.forRoot(),
3234
BrowserModule.withServerTransition({ appId: 'ngx-bootstrap' })

demo/src/app/components/+accordion/accordion-section.list.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const demoComponentContent: ContentSection[] = [
2727
anchor: 'usage',
2828
outlet: DemoTopSectionComponent,
2929
content: {
30-
doc: require('!!raw-loader?lang=typescript!./docs/usage.md')
30+
doc: require('!!raw-loader!./docs/usage.md')
3131
}
3232
},
3333
{
@@ -40,87 +40,87 @@ export const demoComponentContent: ContentSection[] = [
4040
anchor: 'basic-accordion',
4141
description: `<p>Click headers to expand/collapse content that is broken into logical sections, much
4242
like tabs.</p>`,
43-
component: require('!!raw-loader?lang=typescript!./demos/basic/basic'),
44-
html: require('!!raw-loader?lang=markup!./demos/basic/basic.html'),
43+
component: require('!!raw-loader!./demos/basic/basic'),
44+
html: require('!!raw-loader!./demos/basic/basic.html'),
4545
outlet: DemoAccordionBasicComponent
4646
},
4747
{
4848
title: 'With animation',
4949
anchor: 'animated-accordion',
5050
description: `<p>Use input property or config property <code>isAnimated</code> to enable/disable animation</p>`,
51-
component: require('!!raw-loader?lang=typescript!./demos/animated/animated'),
52-
html: require('!!raw-loader?lang=markup!./demos/animated/animated.html'),
51+
component: require('!!raw-loader!./demos/animated/animated'),
52+
html: require('!!raw-loader!./demos/animated/animated.html'),
5353
outlet: DemoAccordionAnimatedComponent
5454
},
5555
{
5656
title: 'Group opening event',
5757
anchor: 'open-event',
5858
description: `<p>Accordion with <code>isOpenChange</code> event listener.</p>`,
59-
component: require('!!raw-loader?lang=typescript!./demos/open-event/open-event'),
60-
html: require('!!raw-loader?lang=markup!./demos/open-event/open-event.html'),
59+
component: require('!!raw-loader!./demos/open-event/open-event'),
60+
html: require('!!raw-loader!./demos/open-event/open-event.html'),
6161
outlet: DemoAccordionOpenEventComponent
6262
},
6363
{
6464
title: 'Custom HTML',
6565
anchor: 'custom-html',
66-
component: require('!!raw-loader?lang=typescript!./demos/custom-html/custom-html'),
67-
html: require('!!raw-loader?lang=markup!./demos/custom-html/custom-html.html'),
66+
component: require('!!raw-loader!./demos/custom-html/custom-html'),
67+
html: require('!!raw-loader!./demos/custom-html/custom-html.html'),
6868
outlet: DemoAccordionCustomHTMLComponent
6969
},
7070
{
7171
title: 'Disabled',
7272
anchor: 'disabled',
73-
component: require('!!raw-loader?lang=typescript!./demos/disabled/disabled'),
74-
html: require('!!raw-loader?lang=markup!./demos/disabled/disabled.html'),
73+
component: require('!!raw-loader!./demos/disabled/disabled'),
74+
html: require('!!raw-loader!./demos/disabled/disabled.html'),
7575
outlet: DemoAccordionDisabledComponent
7676
},
7777
{
7878
title: 'Initially opened',
7979
anchor: 'opened',
80-
component: require('!!raw-loader?lang=typescript!./demos/opened/opened'),
81-
html: require('!!raw-loader?lang=markup!./demos/opened/opened.html'),
80+
component: require('!!raw-loader!./demos/opened/opened'),
81+
html: require('!!raw-loader!./demos/opened/opened.html'),
8282
outlet: DemoAccordionOpenedComponent
8383
},
8484
{
8585
title: 'Dynamic accordion',
8686
anchor: 'dynamic-accordion',
87-
component: require('!!raw-loader?lang=typescript!./demos/dymanic/dynamic'),
88-
html: require('!!raw-loader?lang=markup!./demos/dymanic/dynamic.html'),
87+
component: require('!!raw-loader!./demos/dymanic/dynamic'),
88+
html: require('!!raw-loader!./demos/dymanic/dynamic.html'),
8989
outlet: DemoAccordionDynamicComponent
9090
},
9191
{
9292
title: 'Dynamic body content',
9393
anchor: 'dynamic-body',
94-
component: require('!!raw-loader?lang=typescript!./demos/dynamic-body/dynamic-body'),
95-
html: require('!!raw-loader?lang=markup!./demos/dynamic-body/dynamic-body.html'),
94+
component: require('!!raw-loader!./demos/dynamic-body/dynamic-body'),
95+
html: require('!!raw-loader!./demos/dynamic-body/dynamic-body.html'),
9696
outlet: DemoAccordionDynamicBodyComponent
9797
},
9898
{
9999
title: 'Manual toggle',
100100
anchor: 'manual-toggle',
101-
component: require('!!raw-loader?lang=typescript!./demos/manual-toggle/manual-toggle'),
102-
html: require('!!raw-loader?lang=markup!./demos/manual-toggle/manual-toggle.html'),
101+
component: require('!!raw-loader!./demos/manual-toggle/manual-toggle'),
102+
html: require('!!raw-loader!./demos/manual-toggle/manual-toggle.html'),
103103
outlet: DemoAccordionManualToggleComponent
104104
},
105105
{
106106
title: 'Open only one at a time',
107107
anchor: 'one-time',
108-
component: require('!!raw-loader?lang=typescript!./demos/one-at-a-time/one-at-a-time'),
109-
html: require('!!raw-loader?lang=markup!./demos/one-at-a-time/one-at-a-time.html'),
108+
component: require('!!raw-loader!./demos/one-at-a-time/one-at-a-time'),
109+
html: require('!!raw-loader!./demos/one-at-a-time/one-at-a-time.html'),
110110
outlet: DemoAccordionOneAtATimeComponent
111111
},
112112
{
113113
title: 'Styling',
114114
anchor: 'styling',
115-
component: require('!!raw-loader?lang=typescript!./demos/styling/styling'),
116-
html: require('!!raw-loader?lang=markup!./demos/styling/styling.html'),
115+
component: require('!!raw-loader!./demos/styling/styling'),
116+
html: require('!!raw-loader!./demos/styling/styling.html'),
117117
outlet: DemoAccordionStylingComponent
118118
},
119119
{
120120
title: 'Configuring defaults',
121121
anchor: 'config',
122-
component: require('!!raw-loader?lang=typescript!./demos/config/config'),
123-
html: require('!!raw-loader?lang=markup!./demos/config/config.html'),
122+
component: require('!!raw-loader!./demos/config/config'),
123+
html: require('!!raw-loader!./demos/config/config.html'),
124124
outlet: DemoAccordionConfigComponent
125125
}
126126
]

demo/src/app/components/+alerts/alerts-section.list.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const demoComponentContent: ContentSection[] = [
2525
anchor: 'usage',
2626
outlet: DemoTopSectionComponent,
2727
content: {
28-
doc: require('!!raw-loader?lang=typescript!./docs/usage.md')
28+
doc: require('!!raw-loader!./docs/usage.md')
2929
}
3030
},
3131
{
@@ -40,85 +40,85 @@ export const demoComponentContent: ContentSection[] = [
4040
button. For proper styling, use one of the four <strong>required</strong>
4141
contextual classes (e.g., <code>.alert-success</code>). For inline
4242
dismissal, use the <code>dismissible</code> property.</p>`,
43-
component: require('!!raw-loader?lang=typescript!./demos/basic/basic'),
44-
html: require('!!raw-loader?lang=markup!./demos/basic/basic.html'),
43+
component: require('!!raw-loader!./demos/basic/basic'),
44+
html: require('!!raw-loader!./demos/basic/basic.html'),
4545
outlet: DemoAlertBasicComponent
4646
},
4747
{
4848
title: 'Link color',
4949
anchor: 'link-color',
5050
description: `<p>Use the <code>.alert-link</code> utility class to quickly provide matching
5151
colored links within any alert.</p>`,
52-
component: require('!!raw-loader?lang=typescript!./demos/link/link.ts'),
53-
html: require('!!raw-loader?lang=markup!./demos/link/link.html'),
52+
component: require('!!raw-loader!./demos/link/link.ts'),
53+
html: require('!!raw-loader!./demos/link/link.html'),
5454
outlet: DemoAlertLinkComponent
5555
},
5656
{
5757
title: 'Additional content',
5858
anchor: 'additional-content',
5959
description: `<p>Alerts can also contain additional HTML elements like headings and
6060
paragraphs.</p>`,
61-
component: require('!!raw-loader?lang=typescript!./demos/content/content.ts'),
62-
html: require('!!raw-loader?lang=markup!./demos/content/content.html'),
61+
component: require('!!raw-loader!./demos/content/content.ts'),
62+
html: require('!!raw-loader!./demos/content/content.html'),
6363
outlet: DemoAlertContentComponent
6464
},
6565
{
6666
title: 'Dismissing',
6767
anchor: 'dismissing',
6868
description: `<p>Alerts have <code>dismiss</code> option. Enabling it will show close button
6969
to the right of the alert.</p>`,
70-
component: require('!!raw-loader?lang=typescript!./demos/dismiss/dismiss.ts'),
71-
html: require('!!raw-loader?lang=markup!./demos/dismiss/dismiss.html'),
70+
component: require('!!raw-loader!./demos/dismiss/dismiss.ts'),
71+
html: require('!!raw-loader!./demos/dismiss/dismiss.html'),
7272
outlet: DemoAlertDismissComponent
7373
},
7474
{
7575
title: 'Dynamic html',
7676
anchor: 'dynamic-html',
7777
description: `<p>Sometimes you will need to show dynamically generated html in alerts, here
7878
is how you can make it. And don't forget to sanitize your html.</p>`,
79-
component: require('!!raw-loader?lang=typescript!./demos/dynamic-html/dynamic-html.ts'),
80-
html: require('!!raw-loader?lang=markup!./demos/dynamic-html/dynamic-html.html'),
79+
component: require('!!raw-loader!./demos/dynamic-html/dynamic-html.ts'),
80+
html: require('!!raw-loader!./demos/dynamic-html/dynamic-html.html'),
8181
outlet: DemoAlertDynamicHtmlComponent
8282
},
8383
{
8484
title: 'Dynamic content',
8585
anchor: 'dynamic-content',
8686
description: `<p>Alerts fully support bindings.</p>`,
87-
component: require('!!raw-loader?lang=typescript!./demos/dynamic-content/dynamic-content.ts'),
88-
html: require('!!raw-loader?lang=markup!./demos/dynamic-content/dynamic-content.html'),
87+
component: require('!!raw-loader!./demos/dynamic-content/dynamic-content.ts'),
88+
html: require('!!raw-loader!./demos/dynamic-content/dynamic-content.html'),
8989
outlet: DemoAlertDynamicContentComponent
9090
},
9191
{
9292
title: 'Dismiss on timeout',
9393
anchor: 'dismiss-on-timeout',
9494
description: `<p>You can simply set timeout in milliseconds to <code>dismissOnTimeout</code>
9595
property to create self closable alerts.</p>`,
96-
component: require('!!raw-loader?lang=typescript!./demos/dismiss-on-timeout/dismiss-on-timeout.ts'),
97-
html: require('!!raw-loader?lang=markup!./demos/dismiss-on-timeout/dismiss-on-timeout.html'),
96+
component: require('!!raw-loader!./demos/dismiss-on-timeout/dismiss-on-timeout.ts'),
97+
html: require('!!raw-loader!./demos/dismiss-on-timeout/dismiss-on-timeout.html'),
9898
outlet: DemoAlertTimeoutComponent
9999
},
100100
{
101101
title: 'Global styling',
102102
anchor: 'global-styling',
103103
description: `<p>You can add additional types of alerts globally.</p>`,
104-
component: require('!!raw-loader?lang=typescript!./demos/styling-global/styling-global.ts'),
105-
html: require('!!raw-loader?lang=markup!./demos/styling-global/styling-global.html'),
104+
component: require('!!raw-loader!./demos/styling-global/styling-global.ts'),
105+
html: require('!!raw-loader!./demos/styling-global/styling-global.html'),
106106
outlet: DemoAlertStylingGlobalComponent
107107
},
108108
{
109109
title: 'Component level styling',
110110
anchor: 'local-styling',
111111
description: `<p>You can add additional types of alerts directly to containing component</p>`,
112-
component: require('!!raw-loader?lang=typescript!./demos/styling-local/styling-local.ts'),
113-
html: require('!!raw-loader?lang=markup!./demos/styling-local/styling-local.html'),
112+
component: require('!!raw-loader!./demos/styling-local/styling-local.ts'),
113+
html: require('!!raw-loader!./demos/styling-local/styling-local.html'),
114114
outlet: DemoAlertStylingLocalComponent
115115
},
116116
{
117117
title: 'Configuring defaults',
118118
anchor: 'configuration',
119119
description: `<p>It is possible to override default alert config partially or completely.</p>`,
120-
component: require('!!raw-loader?lang=typescript!./demos/config/config.ts'),
121-
html: require('!!raw-loader?lang=markup!./demos/config/config.html'),
120+
component: require('!!raw-loader!./demos/config/config.ts'),
121+
html: require('!!raw-loader!./demos/config/config.html'),
122122
outlet: DemoAlertConfigComponent
123123
}
124124
]

demo/src/app/components/+buttons/buttons-section.list.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const demoComponentContent: ContentSection[] = [
2020
anchor: 'usage',
2121
outlet: DemoTopSectionComponent,
2222
content: {
23-
doc: require('!!raw-loader?lang=typescript!./docs/usage.md')
23+
doc: require('!!raw-loader!./docs/usage.md')
2424
}
2525
},
2626
{
@@ -31,31 +31,31 @@ export const demoComponentContent: ContentSection[] = [
3131
{
3232
title: 'Basic',
3333
anchor: 'basic',
34-
component: require('!!raw-loader?lang=typescript!./demos/basic/basic.ts'),
35-
html: require('!!raw-loader?lang=markup!./demos/basic/basic.html'),
34+
component: require('!!raw-loader!./demos/basic/basic.ts'),
35+
html: require('!!raw-loader!./demos/basic/basic.html'),
3636
outlet: DemoButtonsBasicComponent
3737
},
3838
{
3939
title: 'Checkbox',
4040
anchor: 'checkbox',
4141
description: `<p>Checkbox-like buttons set with variable states</p>`,
42-
component: require('!!raw-loader?lang=typescript!./demos/checkbox/checkbox.ts'),
43-
html: require('!!raw-loader?lang=markup!./demos/checkbox/checkbox.html'),
42+
component: require('!!raw-loader!./demos/checkbox/checkbox.ts'),
43+
html: require('!!raw-loader!./demos/checkbox/checkbox.html'),
4444
outlet: DemoButtonsCheckboxComponent
4545
},
4646
{
4747
title: 'Custom checkbox value',
4848
anchor: 'custom-checkbox-value',
49-
component: require('!!raw-loader?lang=typescript!./demos/custom-checkbox-value/custom-checkbox-value.ts'),
50-
html: require('!!raw-loader?lang=markup!./demos/custom-checkbox-value/custom-checkbox-value.html'),
49+
component: require('!!raw-loader!./demos/custom-checkbox-value/custom-checkbox-value.ts'),
50+
html: require('!!raw-loader!./demos/custom-checkbox-value/custom-checkbox-value.html'),
5151
outlet: DemoButtonsCustomCheckboxValueComponent
5252
},
5353
{
5454
title: 'Checkbox with Reactive Forms',
5555
anchor: 'checkbox-reactiveforms"',
5656
description: `<p>Checkbox buttons with ReactiveForms</p>`,
57-
component: require('!!raw-loader?lang=typescript!./demos/checkbox-reactiveforms/checkbox-reactiveforms.ts'),
58-
html: require('!!raw-loader?lang=markup!./demos/checkbox-reactiveforms/checkbox-reactiveforms.html'),
57+
component: require('!!raw-loader!./demos/checkbox-reactiveforms/checkbox-reactiveforms.ts'),
58+
html: require('!!raw-loader!./demos/checkbox-reactiveforms/checkbox-reactiveforms.html'),
5959
outlet: DemoButtonsCheckboxReactiveFormsComponent
6060
},
6161
{
@@ -64,15 +64,15 @@ export const demoComponentContent: ContentSection[] = [
6464
description: `<p>Radio buttons with checked/unchecked states. Group can be created in two ways: using
6565
<code>btnRadioGroup</code> directive or using the same <code>ngModel</code> binding with several buttons (works only for
6666
template driven forms). Check the demo below for more info.</p>`,
67-
component: require('!!raw-loader?lang=typescript!./demos/radio/radio.ts'),
68-
html: require('!!raw-loader?lang=markup!./demos/radio/radio.html'),
67+
component: require('!!raw-loader!./demos/radio/radio.ts'),
68+
html: require('!!raw-loader!./demos/radio/radio.html'),
6969
outlet: DemoButtonsRadioComponent
7070
},
7171
{
7272
title: 'Uncheckable Radio',
7373
anchor: 'uncheckable-radio-button',
74-
component: require('!!raw-loader?lang=typescript!./demos/uncheckable-radio/uncheckable-radio.ts'),
75-
html: require('!!raw-loader?lang=markup!./demos/uncheckable-radio/uncheckable-radio.html'),
74+
component: require('!!raw-loader!./demos/uncheckable-radio/uncheckable-radio.ts'),
75+
html: require('!!raw-loader!./demos/uncheckable-radio/uncheckable-radio.html'),
7676
outlet: DemoButtonsUncheckableRadioComponent
7777
},
7878
{
@@ -81,15 +81,15 @@ template driven forms). Check the demo below for more info.</p>`,
8181
description: `<p>Radio buttons with ReactiveForms. Example below shows how to use radio buttons with reactive
8282
forms. Please be aware that for reactive forms it's required to use <code>btnRadioGroup</code> directive along with
8383
<code>btnRadio</code>'s</p>`,
84-
component: require('!!raw-loader?lang=typescript!./demos/radio-reactiveforms/radio-reactiveforms.ts'),
85-
html: require('!!raw-loader?lang=markup!./demos/radio-reactiveforms/radio-reactiveforms.html'),
84+
component: require('!!raw-loader!./demos/radio-reactiveforms/radio-reactiveforms.ts'),
85+
html: require('!!raw-loader!./demos/radio-reactiveforms/radio-reactiveforms.html'),
8686
outlet: DemoButtonsRadioReactiveFormsComponent
8787
},
8888
{
8989
title: 'Disabled Buttons',
9090
anchor: 'disabled-buttons',
91-
component: require('!!raw-loader?lang=typescript!./demos/disabled/disabled.ts'),
92-
html: require('!!raw-loader?lang=markup!./demos/disabled/disabled.html'),
91+
component: require('!!raw-loader!./demos/disabled/disabled.ts'),
92+
html: require('!!raw-loader!./demos/disabled/disabled.html'),
9393
outlet: DemoButtonsDisabledComponent
9494
}
9595
]

0 commit comments

Comments
 (0)