@natec/mef-dev-ui-kit 0.0.67 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/markup-kit/card/card/card.component.mjs +36 -0
- package/esm2020/lib/markup-kit/card/card-long/card-long.component.mjs +46 -0
- package/esm2020/lib/markup-kit/card/card-long/cart-type-colors.enum.mjs +7 -0
- package/esm2020/lib/markup-kit/card/card-simple/card-simple.component.mjs +23 -0
- package/esm2020/lib/markup-kit/card/card.module.mjs +41 -0
- package/esm2020/lib/markup-kit/card/index.mjs +6 -0
- package/esm2020/lib/markup-kit/collapse/collapse/collapse.component.mjs +87 -0
- package/esm2020/lib/markup-kit/collapse/collapse-set/collapse-set.component.mjs +54 -0
- package/esm2020/lib/markup-kit/collapse/collapse.module.mjs +25 -0
- package/esm2020/lib/markup-kit/collapse/index.mjs +4 -0
- package/esm2020/lib/markup-kit/modals/fill/fill.component.mjs +52 -0
- package/esm2020/lib/markup-kit/modals/index.mjs +7 -0
- package/esm2020/lib/markup-kit/modals/markup-kit.module.mjs +45 -0
- package/esm2020/lib/markup-kit/modals/modal-size.enum.mjs +2 -0
- package/esm2020/lib/markup-kit/modals/right-filter/right-filter.component.mjs +28 -0
- package/esm2020/lib/markup-kit/modals/slide-right/slide-right.component.mjs +55 -0
- package/esm2020/lib/markup-kit/modals/slide-up/slide-up.component.mjs +55 -0
- package/esm2020/lib/markup-kit/page-layouts/central-page/central-page.component.mjs +25 -0
- package/esm2020/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.mjs +14 -0
- package/esm2020/lib/markup-kit/page-layouts/index.mjs +7 -0
- package/esm2020/lib/markup-kit/page-layouts/manage-page/manage-page.component.mjs +25 -0
- package/esm2020/lib/markup-kit/page-layouts/page-layouts.module.mjs +45 -0
- package/esm2020/lib/markup-kit/page-layouts/profile/profile.component.mjs +49 -0
- package/esm2020/lib/markup-kit/page-layouts/table-page/table-page.component.mjs +18 -0
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.mjs +40 -0
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.mjs +29 -0
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field.module.mjs +31 -0
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field.service.mjs +30 -0
- package/esm2020/lib/markup-kit/utils/filtered-field/filtred-item.model.mjs +9 -0
- package/esm2020/lib/markup-kit/utils/filtered-field/index.mjs +6 -0
- package/esm2020/lib/markup-kit/utils/help-block/help-block.component.mjs +47 -0
- package/esm2020/lib/markup-kit/utils/help-block/hepl-block.module.mjs +26 -0
- package/esm2020/lib/markup-kit/utils/help-block/index.mjs +3 -0
- package/esm2020/lib/markup-kit/utils/loader/index.mjs +5 -0
- package/esm2020/lib/markup-kit/utils/loader/loader/loader.component.mjs +27 -0
- package/esm2020/lib/markup-kit/utils/loader/loader.module.mjs +58 -0
- package/esm2020/lib/markup-kit/utils/loader/loader.service.mjs +51 -0
- package/esm2020/lib/markup-kit/utils/loader/request-event.enum.mjs +7 -0
- package/esm2020/lib/pg-components/card/card.components.mjs +252 -0
- package/esm2020/lib/pg-components/card/card.module.mjs +24 -0
- package/esm2020/lib/pg-components/card/index.mjs +3 -0
- package/esm2020/lib/pg-components/progress/index.mjs +4 -0
- package/esm2020/lib/pg-components/progress/progress.component.mjs +39 -0
- package/esm2020/lib/pg-components/progress/progress.config.mjs +14 -0
- package/esm2020/lib/pg-components/progress/progress.module.mjs +22 -0
- package/esm2020/lib/pg-components/select/index.mjs +5 -0
- package/esm2020/lib/pg-components/select/option.component.mjs +60 -0
- package/esm2020/lib/pg-components/select/option.pipe.mjs +42 -0
- package/esm2020/lib/pg-components/select/select.component.mjs +762 -0
- package/esm2020/lib/pg-components/select/select.module.mjs +22 -0
- package/esm2020/lib/pg-components/spec-flow-test/index.mjs +3 -0
- package/esm2020/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.mjs +24 -0
- package/esm2020/lib/pg-components/spec-flow-test/spec-flow-test.module.mjs +27 -0
- package/esm2020/lib/pg-components/switch/index.mjs +3 -0
- package/esm2020/lib/pg-components/switch/switch.component.mjs +130 -0
- package/esm2020/lib/pg-components/switch/switch.module.mjs +18 -0
- package/esm2020/lib/pg-components/tabs/index.mjs +8 -0
- package/esm2020/lib/pg-components/tabs/tab-body.component.mjs +22 -0
- package/esm2020/lib/pg-components/tabs/tab-label.directive.mjs +44 -0
- package/esm2020/lib/pg-components/tabs/tab.component.mjs +66 -0
- package/esm2020/lib/pg-components/tabs/tabs-ink-bar.directive.mjs +78 -0
- package/esm2020/lib/pg-components/tabs/tabs-nav.component.mjs +335 -0
- package/esm2020/lib/pg-components/tabs/tabs.module.mjs +24 -0
- package/esm2020/lib/pg-components/tabs/tabset.component.mjs +260 -0
- package/esm2020/lib/pg-components/util/convert.mjs +4 -0
- package/esm2020/lib/pg-components/util/request-animation.mjs +26 -0
- package/esm2020/natec-mef-dev-ui-kit.mjs +5 -0
- package/esm2020/public-api.mjs +16 -0
- package/fesm2015/natec-mef-dev-ui-kit.mjs +3190 -0
- package/fesm2015/natec-mef-dev-ui-kit.mjs.map +1 -0
- package/fesm2020/natec-mef-dev-ui-kit.mjs +3183 -0
- package/fesm2020/natec-mef-dev-ui-kit.mjs.map +1 -0
- package/lib/markup-kit/card/card/card.component.d.ts +17 -0
- package/lib/markup-kit/card/card-long/card-long.component.d.ts +21 -0
- package/lib/markup-kit/card/card-long/cart-type-colors.enum.d.ts +5 -0
- package/lib/markup-kit/card/card-simple/card-simple.component.d.ts +10 -0
- package/lib/markup-kit/card/card.module.d.ts +17 -0
- package/{src/lib/markup-kit/card/index.ts → lib/markup-kit/card/index.d.ts} +0 -1
- package/lib/markup-kit/collapse/collapse/collapse.component.d.ts +19 -0
- package/lib/markup-kit/collapse/collapse-set/collapse-set.component.d.ts +18 -0
- package/lib/markup-kit/collapse/collapse.module.d.ts +14 -0
- package/{src/lib/markup-kit/collapse/index.ts → lib/markup-kit/collapse/index.d.ts} +0 -0
- package/lib/markup-kit/modals/fill/fill.component.d.ts +17 -0
- package/{src/lib/markup-kit/modals/index.ts → lib/markup-kit/modals/index.d.ts} +0 -0
- package/lib/markup-kit/modals/markup-kit.module.d.ts +13 -0
- package/lib/markup-kit/modals/modal-size.enum.d.ts +5 -0
- package/lib/markup-kit/modals/right-filter/right-filter.component.d.ts +13 -0
- package/lib/markup-kit/modals/slide-right/slide-right.component.d.ts +19 -0
- package/lib/markup-kit/modals/slide-up/slide-up.component.d.ts +19 -0
- package/lib/markup-kit/page-layouts/central-page/central-page.component.d.ts +11 -0
- package/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.d.ts +8 -0
- package/{src/lib/markup-kit/page-layouts/index.ts → lib/markup-kit/page-layouts/index.d.ts} +0 -0
- package/lib/markup-kit/page-layouts/manage-page/manage-page.component.d.ts +11 -0
- package/lib/markup-kit/page-layouts/page-layouts.module.d.ts +13 -0
- package/lib/markup-kit/page-layouts/profile/profile.component.d.ts +27 -0
- package/lib/markup-kit/page-layouts/table-page/table-page.component.d.ts +9 -0
- package/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.d.ts +14 -0
- package/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.d.ts +14 -0
- package/lib/markup-kit/utils/filtered-field/filtered-field.module.d.ts +9 -0
- package/lib/markup-kit/utils/filtered-field/filtered-field.service.d.ts +14 -0
- package/lib/markup-kit/utils/filtered-field/filtred-item.model.d.ts +7 -0
- package/{src/lib/markup-kit/utils/filtered-field/index.ts → lib/markup-kit/utils/filtered-field/index.d.ts} +0 -0
- package/lib/markup-kit/utils/help-block/help-block.component.d.ts +11 -0
- package/lib/markup-kit/utils/help-block/hepl-block.module.d.ts +9 -0
- package/{src/lib/markup-kit/utils/help-block/index.ts → lib/markup-kit/utils/help-block/index.d.ts} +1 -1
- package/{src/lib/markup-kit/utils/loader/index.ts → lib/markup-kit/utils/loader/index.d.ts} +1 -1
- package/lib/markup-kit/utils/loader/loader/loader.component.d.ts +12 -0
- package/lib/markup-kit/utils/loader/loader.module.d.ts +9 -0
- package/lib/markup-kit/utils/loader/loader.service.d.ts +16 -0
- package/lib/markup-kit/utils/loader/request-event.enum.d.ts +5 -0
- package/lib/pg-components/card/card.components.d.ts +60 -0
- package/lib/pg-components/card/card.module.d.ts +11 -0
- package/{src/lib/pg-components/card/index.ts → lib/pg-components/card/index.d.ts} +1 -1
- package/{src/lib/pg-components/progress/index.ts → lib/pg-components/progress/index.d.ts} +1 -1
- package/lib/pg-components/progress/progress.component.d.ts +15 -0
- package/lib/pg-components/progress/progress.config.d.ts +7 -0
- package/lib/pg-components/progress/progress.module.d.ts +10 -0
- package/{src/lib/pg-components/select/index.ts → lib/pg-components/select/index.d.ts} +1 -1
- package/lib/pg-components/select/option.component.d.ts +21 -0
- package/lib/pg-components/select/option.pipe.d.ts +8 -0
- package/lib/pg-components/select/select.component.d.ts +135 -0
- package/lib/pg-components/select/select.module.d.ts +12 -0
- package/{src/lib/pg-components/spec-flow-test/index.ts → lib/pg-components/spec-flow-test/index.d.ts} +1 -1
- package/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.d.ts +22 -0
- package/lib/pg-components/spec-flow-test/spec-flow-test.module.d.ts +10 -0
- package/{src/lib/pg-components/switch/index.ts → lib/pg-components/switch/index.d.ts} +1 -1
- package/lib/pg-components/switch/switch.component.d.ts +29 -0
- package/lib/pg-components/switch/switch.module.d.ts +8 -0
- package/{src/lib/pg-components/tabs/index.ts → lib/pg-components/tabs/index.d.ts} +1 -1
- package/lib/pg-components/tabs/tab-body.component.d.ts +7 -0
- package/lib/pg-components/tabs/tab-label.directive.d.ts +15 -0
- package/lib/pg-components/tabs/tab.component.d.ts +22 -0
- package/lib/pg-components/tabs/tabs-ink-bar.directive.d.ts +23 -0
- package/lib/pg-components/tabs/tabs-nav.component.d.ts +79 -0
- package/lib/pg-components/tabs/tabs.module.d.ts +14 -0
- package/lib/pg-components/tabs/tabset.component.d.ts +67 -0
- package/lib/pg-components/util/convert.d.ts +1 -0
- package/lib/pg-components/util/request-animation.d.ts +1 -0
- package/natec-mef-dev-ui-kit.d.ts +5 -0
- package/package.json +21 -6
- package/{src/public-api.ts → public-api.d.ts} +14 -19
- package/.browserslistrc +0 -16
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -24
- package/src/lib/markup-kit/card/card/card.component.html +0 -46
- package/src/lib/markup-kit/card/card/card.component.scss +0 -61
- package/src/lib/markup-kit/card/card/card.component.ts +0 -31
- package/src/lib/markup-kit/card/card-long/card-long.component.html +0 -54
- package/src/lib/markup-kit/card/card-long/card-long.component.scss +0 -72
- package/src/lib/markup-kit/card/card-long/card-long.component.ts +0 -33
- package/src/lib/markup-kit/card/card-long/cart-type-colors.enum.ts +0 -5
- package/src/lib/markup-kit/card/card-simple/card-simple.component.html +0 -12
- package/src/lib/markup-kit/card/card-simple/card-simple.component.scss +0 -12
- package/src/lib/markup-kit/card/card-simple/card-simple.component.ts +0 -18
- package/src/lib/markup-kit/card/card.module.ts +0 -23
- package/src/lib/markup-kit/collapse/collapse/collapse.component.html +0 -16
- package/src/lib/markup-kit/collapse/collapse/collapse.component.scss +0 -13
- package/src/lib/markup-kit/collapse/collapse/collapse.component.ts +0 -78
- package/src/lib/markup-kit/collapse/collapse-set/collapse-set.component.html +0 -3
- package/src/lib/markup-kit/collapse/collapse-set/collapse-set.component.scss +0 -0
- package/src/lib/markup-kit/collapse/collapse-set/collapse-set.component.ts +0 -58
- package/src/lib/markup-kit/collapse/collapse.module.ts +0 -20
- package/src/lib/markup-kit/modals/fill/fill.component.html +0 -18
- package/src/lib/markup-kit/modals/fill/fill.component.scss +0 -0
- package/src/lib/markup-kit/modals/fill/fill.component.ts +0 -45
- package/src/lib/markup-kit/modals/markup-kit.module.ts +0 -27
- package/src/lib/markup-kit/modals/modal-size.enum.ts +0 -5
- package/src/lib/markup-kit/modals/right-filter/right-filter.component.html +0 -7
- package/src/lib/markup-kit/modals/right-filter/right-filter.component.scss +0 -6
- package/src/lib/markup-kit/modals/right-filter/right-filter.component.ts +0 -30
- package/src/lib/markup-kit/modals/slide-right/slide-right.component.html +0 -16
- package/src/lib/markup-kit/modals/slide-right/slide-right.component.scss +0 -0
- package/src/lib/markup-kit/modals/slide-right/slide-right.component.ts +0 -50
- package/src/lib/markup-kit/modals/slide-up/slide-up.component.html +0 -16
- package/src/lib/markup-kit/modals/slide-up/slide-up.component.scss +0 -0
- package/src/lib/markup-kit/modals/slide-up/slide-up.component.ts +0 -50
- package/src/lib/markup-kit/page-layouts/central-page/central-page.component.html +0 -6
- package/src/lib/markup-kit/page-layouts/central-page/central-page.component.scss +0 -0
- package/src/lib/markup-kit/page-layouts/central-page/central-page.component.ts +0 -26
- package/src/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.html +0 -3
- package/src/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.scss +0 -0
- package/src/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.ts +0 -15
- package/src/lib/markup-kit/page-layouts/manage-page/manage-page.component.html +0 -10
- package/src/lib/markup-kit/page-layouts/manage-page/manage-page.component.scss +0 -14
- package/src/lib/markup-kit/page-layouts/manage-page/manage-page.component.ts +0 -20
- package/src/lib/markup-kit/page-layouts/page-layouts.module.ts +0 -26
- package/src/lib/markup-kit/page-layouts/profile/profile.component.html +0 -42
- package/src/lib/markup-kit/page-layouts/profile/profile.component.scss +0 -72
- package/src/lib/markup-kit/page-layouts/profile/profile.component.ts +0 -38
- package/src/lib/markup-kit/page-layouts/table-page/table-page.component.html +0 -9
- package/src/lib/markup-kit/page-layouts/table-page/table-page.component.scss +0 -0
- package/src/lib/markup-kit/page-layouts/table-page/table-page.component.ts +0 -16
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.html +0 -3
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.scss +0 -4
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.ts +0 -46
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.html +0 -4
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.scss +0 -12
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.ts +0 -28
- package/src/lib/markup-kit/utils/filtered-field/filtered-field.module.ts +0 -19
- package/src/lib/markup-kit/utils/filtered-field/filtered-field.service.ts +0 -32
- package/src/lib/markup-kit/utils/filtered-field/filtred-item.model.ts +0 -15
- package/src/lib/markup-kit/utils/help-block/help-block.component.html +0 -19
- package/src/lib/markup-kit/utils/help-block/help-block.component.scss +0 -22
- package/src/lib/markup-kit/utils/help-block/help-block.component.ts +0 -40
- package/src/lib/markup-kit/utils/help-block/hepl-block.module.ts +0 -14
- package/src/lib/markup-kit/utils/loader/loader/loader.component.html +0 -1
- package/src/lib/markup-kit/utils/loader/loader/loader.component.scss +0 -0
- package/src/lib/markup-kit/utils/loader/loader/loader.component.ts +0 -29
- package/src/lib/markup-kit/utils/loader/loader.module.ts +0 -47
- package/src/lib/markup-kit/utils/loader/loader.service.ts +0 -55
- package/src/lib/markup-kit/utils/loader/request-event.enum.ts +0 -1
- package/src/lib/pg-components/card/card.components.html +0 -66
- package/src/lib/pg-components/card/card.components.ts +0 -243
- package/src/lib/pg-components/card/card.module.ts +0 -17
- package/src/lib/pg-components/progress/progress.component.html +0 -28
- package/src/lib/pg-components/progress/progress.component.ts +0 -32
- package/src/lib/pg-components/progress/progress.config.ts +0 -7
- package/src/lib/pg-components/progress/progress.module.ts +0 -16
- package/src/lib/pg-components/select/option.component.ts +0 -71
- package/src/lib/pg-components/select/option.pipe.ts +0 -41
- package/src/lib/pg-components/select/select.component.html +0 -77
- package/src/lib/pg-components/select/select.component.ts +0 -808
- package/src/lib/pg-components/select/select.module.ts +0 -14
- package/src/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.html +0 -6
- package/src/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.scss +0 -0
- package/src/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.ts +0 -36
- package/src/lib/pg-components/spec-flow-test/spec-flow-test.module.ts +0 -18
- package/src/lib/pg-components/switch/switch.component.ts +0 -122
- package/src/lib/pg-components/switch/switch.module.ts +0 -11
- package/src/lib/pg-components/tabs/tab-body.component.ts +0 -12
- package/src/lib/pg-components/tabs/tab-label.directive.ts +0 -40
- package/src/lib/pg-components/tabs/tab.component.ts +0 -62
- package/src/lib/pg-components/tabs/tabs-ink-bar.directive.ts +0 -77
- package/src/lib/pg-components/tabs/tabs-nav.component.ts +0 -345
- package/src/lib/pg-components/tabs/tabs.module.ts +0 -16
- package/src/lib/pg-components/tabs/tabset.component.ts +0 -237
- package/src/lib/pg-components/util/convert.ts +0 -3
- package/src/lib/pg-components/util/request-animation.ts +0 -31
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/** code from https://github.com/angular/material2 */
|
|
2
|
-
import { Direction, Directionality } from '@angular/cdk/bidi';
|
|
3
|
-
import {
|
|
4
|
-
AfterContentChecked,
|
|
5
|
-
AfterContentInit,
|
|
6
|
-
Component,
|
|
7
|
-
ContentChild,
|
|
8
|
-
ContentChildren,
|
|
9
|
-
ElementRef,
|
|
10
|
-
HostBinding,
|
|
11
|
-
Input,
|
|
12
|
-
NgZone,
|
|
13
|
-
Optional,
|
|
14
|
-
QueryList,
|
|
15
|
-
Renderer2,
|
|
16
|
-
TemplateRef,
|
|
17
|
-
ViewChild,
|
|
18
|
-
ViewEncapsulation
|
|
19
|
-
} from '@angular/core';
|
|
20
|
-
import { Subscription, fromEvent, merge, of as observableOf } from 'rxjs';
|
|
21
|
-
import { auditTime, startWith } from 'rxjs/operators';
|
|
22
|
-
import { toBoolean } from '../util/convert';
|
|
23
|
-
import { pgTabLabelDirective } from './tab-label.directive';
|
|
24
|
-
import { pgTabsInkBarDirective } from './tabs-ink-bar.directive';
|
|
25
|
-
|
|
26
|
-
const EXAGGERATED_OVERSCROLL = 64;
|
|
27
|
-
export type ScrollDirection = 'after' | 'before';
|
|
28
|
-
|
|
29
|
-
/** duplicated defined https://github.com/angular/angular-cli/issues/2034 **/
|
|
30
|
-
export type TabPositionMode = 'horizontal' | 'vertical';
|
|
31
|
-
|
|
32
|
-
@Component({
|
|
33
|
-
selector: 'pg-tabs-nav',
|
|
34
|
-
encapsulation: ViewEncapsulation.None,
|
|
35
|
-
template: `
|
|
36
|
-
<div class="nav-tabs-wrapper" [class.scrolling]="_showPaginationControls" #tabListContainer>
|
|
37
|
-
<div class="nav-wrap">
|
|
38
|
-
<ul
|
|
39
|
-
class="nav nav-tabs nav-tabs-{{ _type }} nav-tabs-{{ _tabPosition }}"
|
|
40
|
-
[class.tabs-nav-animated]="Animated"
|
|
41
|
-
#tabList
|
|
42
|
-
(cdkObserveContent)="_onContentChanges()"
|
|
43
|
-
>
|
|
44
|
-
<div
|
|
45
|
-
class="active-bar"
|
|
46
|
-
pg-tabs-ink-bar
|
|
47
|
-
[hidden]="HideBar"
|
|
48
|
-
[Animated]="Animated"
|
|
49
|
-
[PositionMode]="PositionMode"
|
|
50
|
-
style="display: block;"
|
|
51
|
-
></div>
|
|
52
|
-
<ng-content></ng-content>
|
|
53
|
-
</ul>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
`,
|
|
57
|
-
host: {}
|
|
58
|
-
})
|
|
59
|
-
export class pgTabsNavComponent implements AfterContentChecked, AfterContentInit {
|
|
60
|
-
private _animated = true;
|
|
61
|
-
private _hideBar = false;
|
|
62
|
-
private _showPagination = true;
|
|
63
|
-
|
|
64
|
-
_showPaginationControls = false;
|
|
65
|
-
_disableScrollAfter = true;
|
|
66
|
-
_disableScrollBefore = true;
|
|
67
|
-
_scrollDistance = 0;
|
|
68
|
-
_selectedIndexChanged = false;
|
|
69
|
-
_realignInkBar: Subscription | null = null;
|
|
70
|
-
_tabLabelCount: number;
|
|
71
|
-
_scrollDistanceChanged: boolean;
|
|
72
|
-
_selectedIndex = 0;
|
|
73
|
-
_tabPositionMode: TabPositionMode = 'horizontal';
|
|
74
|
-
_tabPosition = 'top';
|
|
75
|
-
@Input() Size = 'default';
|
|
76
|
-
_type = 'line';
|
|
77
|
-
|
|
78
|
-
@Input()
|
|
79
|
-
set Animated(value: boolean) {
|
|
80
|
-
this._animated = toBoolean(value);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
get Animated(): boolean {
|
|
84
|
-
return this._animated;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@Input()
|
|
88
|
-
set Position(value: string) {
|
|
89
|
-
this._tabPosition = value;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
get Position(): string {
|
|
93
|
-
return this._tabPosition;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
@Input()
|
|
97
|
-
set HideBar(value: boolean) {
|
|
98
|
-
this._hideBar = toBoolean(value);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
get HideBar(): boolean {
|
|
102
|
-
return this._hideBar;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
@Input()
|
|
106
|
-
set Type(value: string) {
|
|
107
|
-
this._type = value;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
get Type(): string {
|
|
111
|
-
return this._type;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@ContentChild('tabBarExtraContent', { static: true }) _tabBarExtraContent: TemplateRef<void>;
|
|
115
|
-
@ContentChildren(pgTabLabelDirective) _labelWrappers: QueryList<pgTabLabelDirective>;
|
|
116
|
-
@ViewChild(pgTabsInkBarDirective, { static: true }) _inkBar: pgTabsInkBarDirective;
|
|
117
|
-
@ViewChild('tabListContainer', { static: true }) _tabListContainer: ElementRef;
|
|
118
|
-
@ViewChild('tabList', { static: true }) _tabList: ElementRef;
|
|
119
|
-
|
|
120
|
-
@Input()
|
|
121
|
-
set ShowPagination(value: boolean) {
|
|
122
|
-
this._showPagination = toBoolean(value);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
get ShowPagination(): boolean {
|
|
126
|
-
return this._showPagination;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
@Input()
|
|
130
|
-
set PositionMode(value: TabPositionMode) {
|
|
131
|
-
this._tabPositionMode = value;
|
|
132
|
-
this._alignInkBarToSelectedTab();
|
|
133
|
-
if (this.ShowPagination) {
|
|
134
|
-
this._updatePagination();
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
get PositionMode(): TabPositionMode {
|
|
139
|
-
return this._tabPositionMode;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@Input()
|
|
143
|
-
set selectedIndex(value: number) {
|
|
144
|
-
this._selectedIndexChanged = this._selectedIndex !== value;
|
|
145
|
-
|
|
146
|
-
this._selectedIndex = value;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
get selectedIndex(): number {
|
|
150
|
-
return this._selectedIndex;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
constructor(
|
|
154
|
-
public _elementRef: ElementRef,
|
|
155
|
-
private _ngZone: NgZone,
|
|
156
|
-
private _renderer: Renderer2,
|
|
157
|
-
@Optional() private _dir: Directionality
|
|
158
|
-
) {}
|
|
159
|
-
|
|
160
|
-
_onContentChanges(): void {
|
|
161
|
-
if (this.ShowPagination) {
|
|
162
|
-
this._updatePagination();
|
|
163
|
-
}
|
|
164
|
-
this._alignInkBarToSelectedTab();
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
_scrollHeader(scrollDir: ScrollDirection): void {
|
|
168
|
-
// Move the scroll distance one-third the length of the tab list's viewport.
|
|
169
|
-
this.scrollDistance += ((scrollDir === 'before' ? -1 : 1) * this.viewWidthHeightPix) / 3;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
ngAfterContentChecked(): void {
|
|
173
|
-
if (this._tabLabelCount !== this._labelWrappers.length) {
|
|
174
|
-
if (this.ShowPagination) {
|
|
175
|
-
this._updatePagination();
|
|
176
|
-
}
|
|
177
|
-
this._tabLabelCount = this._labelWrappers.length;
|
|
178
|
-
}
|
|
179
|
-
if (this._selectedIndexChanged) {
|
|
180
|
-
this._scrollToLabel(this._selectedIndex);
|
|
181
|
-
if (this.ShowPagination) {
|
|
182
|
-
this._checkScrollingControls();
|
|
183
|
-
}
|
|
184
|
-
this._alignInkBarToSelectedTab();
|
|
185
|
-
this._selectedIndexChanged = false;
|
|
186
|
-
}
|
|
187
|
-
if (this._scrollDistanceChanged) {
|
|
188
|
-
if (this.ShowPagination) {
|
|
189
|
-
this._updateTabScrollPosition();
|
|
190
|
-
}
|
|
191
|
-
this._scrollDistanceChanged = false;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
ngAfterContentInit(): void {
|
|
196
|
-
this._realignInkBar = this._ngZone.runOutsideAngular(() => {
|
|
197
|
-
const dirChange = this._dir ? this._dir.change : observableOf(null);
|
|
198
|
-
const resize = typeof window !== 'undefined' ? fromEvent(window, 'resize').pipe(auditTime(10)) : observableOf(null);
|
|
199
|
-
//@ts-ignore
|
|
200
|
-
return merge(dirChange, resize)
|
|
201
|
-
.pipe(startWith(null))
|
|
202
|
-
.subscribe(() => {
|
|
203
|
-
if (this.ShowPagination) {
|
|
204
|
-
this._updatePagination();
|
|
205
|
-
}
|
|
206
|
-
this._alignInkBarToSelectedTab();
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
_updateTabScrollPosition(): void {
|
|
212
|
-
const scrollDistance = this.scrollDistance;
|
|
213
|
-
if (this.PositionMode === 'horizontal') {
|
|
214
|
-
const translateX = this._getLayoutDirection() === 'ltr' ? -scrollDistance : scrollDistance;
|
|
215
|
-
this._renderer.setStyle(this._tabList.nativeElement, 'transform', `translate3d(${translateX}px, 0, 0)`);
|
|
216
|
-
} else {
|
|
217
|
-
this._renderer.setStyle(this._tabList.nativeElement, 'transform', `translate3d(0,${-scrollDistance}px, 0)`);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
_updatePagination(): void {
|
|
222
|
-
this._checkPaginationEnabled();
|
|
223
|
-
this._checkScrollingControls();
|
|
224
|
-
this._updateTabScrollPosition();
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
_checkPaginationEnabled(): void {
|
|
228
|
-
this._showPaginationControls = this.tabListScrollWidthHeightPix > this.elementRefOffSetWidthHeight;
|
|
229
|
-
|
|
230
|
-
if (!this._showPaginationControls) {
|
|
231
|
-
this.scrollDistance = 0;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
_scrollToLabel(labelIndex: number): void {
|
|
236
|
-
const selectedLabel = this._labelWrappers ? this._labelWrappers.toArray()[labelIndex] : null;
|
|
237
|
-
|
|
238
|
-
if (!selectedLabel) {
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// The view length is the visible width of the tab labels.
|
|
243
|
-
|
|
244
|
-
let labelBeforePos: number;
|
|
245
|
-
let labelAfterPos: number;
|
|
246
|
-
if (this.PositionMode === 'horizontal') {
|
|
247
|
-
if (this._getLayoutDirection() === 'ltr') {
|
|
248
|
-
labelBeforePos = selectedLabel.getOffsetLeft();
|
|
249
|
-
labelAfterPos = labelBeforePos + selectedLabel.getOffsetWidth();
|
|
250
|
-
} else {
|
|
251
|
-
labelAfterPos = this._tabList.nativeElement.offsetWidth - selectedLabel.getOffsetLeft();
|
|
252
|
-
labelBeforePos = labelAfterPos - selectedLabel.getOffsetWidth();
|
|
253
|
-
}
|
|
254
|
-
} else {
|
|
255
|
-
labelBeforePos = selectedLabel.getOffsetTop();
|
|
256
|
-
labelAfterPos = labelBeforePos + selectedLabel.getOffsetHeight();
|
|
257
|
-
}
|
|
258
|
-
const beforeVisiblePos = this.scrollDistance;
|
|
259
|
-
const afterVisiblePos = this.scrollDistance + this.viewWidthHeightPix;
|
|
260
|
-
|
|
261
|
-
if (labelBeforePos < beforeVisiblePos) {
|
|
262
|
-
// Scroll header to move label to the before direction
|
|
263
|
-
this.scrollDistance -= beforeVisiblePos - labelBeforePos + EXAGGERATED_OVERSCROLL;
|
|
264
|
-
} else if (labelAfterPos > afterVisiblePos) {
|
|
265
|
-
// Scroll header to move label to the after direction
|
|
266
|
-
this.scrollDistance += labelAfterPos - afterVisiblePos + EXAGGERATED_OVERSCROLL;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
_checkScrollingControls(): void {
|
|
271
|
-
// Check if the pagination arrows should be activated.
|
|
272
|
-
this._disableScrollBefore = this.scrollDistance === 0;
|
|
273
|
-
this._disableScrollAfter = this.scrollDistance === this._getMaxScrollDistance();
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Determines what is the maximum length in pixels that can be set for the scroll distance. This
|
|
278
|
-
* is equal to the difference in width between the tab list container and tab header container.
|
|
279
|
-
*
|
|
280
|
-
* This is an expensive call that forces a layout reflow to compute box and scroll metrics and
|
|
281
|
-
* should be called sparingly.
|
|
282
|
-
*/
|
|
283
|
-
_getMaxScrollDistance(): number {
|
|
284
|
-
return this.tabListScrollWidthHeightPix - this.viewWidthHeightPix || 0;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
/** Sets the distance in pixels that the tab header should be transformed in the X-axis. */
|
|
288
|
-
set scrollDistance(v: number) {
|
|
289
|
-
this._scrollDistance = Math.max(0, Math.min(this._getMaxScrollDistance(), v));
|
|
290
|
-
|
|
291
|
-
// Mark that the scroll distance has changed so that after the view is checked, the CSS
|
|
292
|
-
// transformation can move the header.
|
|
293
|
-
this._scrollDistanceChanged = true;
|
|
294
|
-
|
|
295
|
-
this._checkScrollingControls();
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
get scrollDistance(): number {
|
|
299
|
-
return this._scrollDistance;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
get viewWidthHeightPix(): number {
|
|
303
|
-
let PAGINATION_PIX = 0;
|
|
304
|
-
if (this._showPaginationControls) {
|
|
305
|
-
PAGINATION_PIX = 64;
|
|
306
|
-
}
|
|
307
|
-
if (this.PositionMode === 'horizontal') {
|
|
308
|
-
return this._tabListContainer.nativeElement.offsetWidth - PAGINATION_PIX;
|
|
309
|
-
} else {
|
|
310
|
-
return this._tabListContainer.nativeElement.offsetHeight - PAGINATION_PIX;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
get tabListScrollWidthHeightPix(): number {
|
|
315
|
-
if (this.PositionMode === 'horizontal') {
|
|
316
|
-
return this._tabList.nativeElement.scrollWidth;
|
|
317
|
-
} else {
|
|
318
|
-
return this._tabList.nativeElement.scrollHeight;
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
get elementRefOffSetWidthHeight(): number {
|
|
323
|
-
if (this.PositionMode === 'horizontal') {
|
|
324
|
-
return this._elementRef.nativeElement.offsetWidth;
|
|
325
|
-
} else {
|
|
326
|
-
return this._elementRef.nativeElement.offsetHeight;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
_getLayoutDirection(): Direction {
|
|
331
|
-
return this._dir && this._dir.value === 'rtl' ? 'rtl' : 'ltr';
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
_alignInkBarToSelectedTab(): void {
|
|
335
|
-
if (this.Type !== 'fillup') {
|
|
336
|
-
const selectedLabelWrapper =
|
|
337
|
-
this._labelWrappers && this._labelWrappers.length
|
|
338
|
-
? this._labelWrappers.toArray()[this.selectedIndex].elementRef.nativeElement
|
|
339
|
-
: null;
|
|
340
|
-
if (this._inkBar) {
|
|
341
|
-
this._inkBar.alignToElement(selectedLabelWrapper);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ObserversModule } from '@angular/cdk/observers';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { NgModule } from '@angular/core';
|
|
4
|
-
import { pgTabBodyComponent } from './tab-body.component';
|
|
5
|
-
import { pgTabLabelDirective } from './tab-label.directive';
|
|
6
|
-
import { pgTabComponent } from './tab.component';
|
|
7
|
-
import { pgTabsInkBarDirective } from './tabs-ink-bar.directive';
|
|
8
|
-
import { pgTabsNavComponent } from './tabs-nav.component';
|
|
9
|
-
import { pgTabSetComponent } from './tabset.component';
|
|
10
|
-
|
|
11
|
-
@NgModule({
|
|
12
|
-
declarations: [pgTabComponent, pgTabSetComponent, pgTabsNavComponent, pgTabLabelDirective, pgTabsInkBarDirective, pgTabBodyComponent],
|
|
13
|
-
exports: [pgTabComponent, pgTabSetComponent, pgTabsNavComponent, pgTabLabelDirective, pgTabsInkBarDirective, pgTabBodyComponent],
|
|
14
|
-
imports: [CommonModule, ObserversModule]
|
|
15
|
-
})
|
|
16
|
-
export class pgTabsModule {}
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
/** code from https://github.com/angular/material2 */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AfterContentChecked,
|
|
5
|
-
AfterViewInit,
|
|
6
|
-
Component,
|
|
7
|
-
ContentChild,
|
|
8
|
-
ElementRef,
|
|
9
|
-
EventEmitter,
|
|
10
|
-
Input,
|
|
11
|
-
OnInit,
|
|
12
|
-
Output,
|
|
13
|
-
Renderer2,
|
|
14
|
-
TemplateRef,
|
|
15
|
-
ViewChild,
|
|
16
|
-
ViewEncapsulation
|
|
17
|
-
} from '@angular/core';
|
|
18
|
-
import { Observable } from 'rxjs';
|
|
19
|
-
import { map } from 'rxjs/operators';
|
|
20
|
-
import { toBoolean } from '../util/convert';
|
|
21
|
-
import { pgTabComponent } from './tab.component';
|
|
22
|
-
import { pgTabsNavComponent } from './tabs-nav.component';
|
|
23
|
-
|
|
24
|
-
export interface AnimatedInterface {
|
|
25
|
-
inkBar: boolean;
|
|
26
|
-
tabPane: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export class TabChangeEvent {
|
|
30
|
-
index: number;
|
|
31
|
-
tab: pgTabComponent;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type TabPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
35
|
-
export type TabPositionMode = 'horizontal' | 'vertical';
|
|
36
|
-
export type TabType = 'line' | 'fillup' | 'linetriangle';
|
|
37
|
-
|
|
38
|
-
@Component({
|
|
39
|
-
selector: 'pg-tabset',
|
|
40
|
-
encapsulation: ViewEncapsulation.None,
|
|
41
|
-
template: `
|
|
42
|
-
<div class="tab-wrapper tab-{{ _tabPositionMode }} {{ _tabPosition }} {{ _type }} {{ _extra_tab_class }}" #hostContent>
|
|
43
|
-
<pg-tabs-nav
|
|
44
|
-
#tabNav
|
|
45
|
-
[Size]="Size"
|
|
46
|
-
[Type]="Type"
|
|
47
|
-
[ShowPagination]="ShowPagination"
|
|
48
|
-
[PositionMode]="_tabPositionMode"
|
|
49
|
-
[Position]="_tabPosition"
|
|
50
|
-
[Animated]="inkBarAnimated"
|
|
51
|
-
[HideBar]="Hide"
|
|
52
|
-
[selectedIndex]="SelectedIndex"
|
|
53
|
-
>
|
|
54
|
-
<ng-template #tabBarExtraContent>
|
|
55
|
-
<ng-template [ngTemplateOutlet]="TabBarExtraTemplate || TabBarExtraContent"></ng-template>
|
|
56
|
-
</ng-template>
|
|
57
|
-
<li pg-tab-label [disabled]="tab.disabled" (click)="clickLabel(i)" *ngFor="let tab of _tabs; let i = index">
|
|
58
|
-
<a href="javascript:void(0);" class="" [class.active]="SelectedIndex == i && !Hide">
|
|
59
|
-
<ng-template [ngTemplateOutlet]="tab._tabHeading"></ng-template>
|
|
60
|
-
</a>
|
|
61
|
-
</li>
|
|
62
|
-
</pg-tabs-nav>
|
|
63
|
-
<div class="tab-content-wrapper {{ _extra_tabcontent_class }}">
|
|
64
|
-
<div
|
|
65
|
-
class="tab-content {{ _tabAnimation }}"
|
|
66
|
-
#tabContent
|
|
67
|
-
[class.animated]="tabPaneAnimated"
|
|
68
|
-
[class.not-animated]="!tabPaneAnimated"
|
|
69
|
-
[style.margin-left.%]="tabPaneAnimated && -(SelectedIndex ?? -1) * 100"
|
|
70
|
-
>
|
|
71
|
-
<pg-tab-body
|
|
72
|
-
class="tab-pane"
|
|
73
|
-
[class.active]="SelectedIndex == i && !Hide"
|
|
74
|
-
[class.inactive]="SelectedIndex != i || Hide"
|
|
75
|
-
[content]="tab.content"
|
|
76
|
-
*ngFor="let tab of _tabs; let i = index"
|
|
77
|
-
>
|
|
78
|
-
</pg-tab-body>
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
`
|
|
83
|
-
})
|
|
84
|
-
export class pgTabSetComponent implements AfterContentChecked, OnInit, AfterViewInit {
|
|
85
|
-
_el:any;
|
|
86
|
-
_classMap:any;
|
|
87
|
-
_prefixCls = 'nav-tabs';
|
|
88
|
-
_width:any;
|
|
89
|
-
_tabPosition: TabPosition = 'top';
|
|
90
|
-
_tabPositionMode: TabPositionMode = 'horizontal';
|
|
91
|
-
_indexToSelect: number | null = 0;
|
|
92
|
-
_selectedIndex: number | null = null;
|
|
93
|
-
_isViewInit = false;
|
|
94
|
-
_tabs: pgTabComponent[] = [];
|
|
95
|
-
_tabAnimation = '';
|
|
96
|
-
_extra_tab_class = '';
|
|
97
|
-
_extra_tabcontent_class = '';
|
|
98
|
-
|
|
99
|
-
@Input() TabBarExtraTemplate: TemplateRef<void>;
|
|
100
|
-
@ContentChild('TabBarExtraContent', { static: true }) TabBarExtraContent: TemplateRef<void>;
|
|
101
|
-
@ViewChild('tabNav', { static: true }) _tabNav: pgTabsNavComponent;
|
|
102
|
-
@ViewChild('tabContent', { static: true }) _tabContent: ElementRef;
|
|
103
|
-
@ViewChild('hostContent', { static: true }) _hostContent: ElementRef;
|
|
104
|
-
@Input() Animated: AnimatedInterface | boolean = true;
|
|
105
|
-
@Input() ShowPagination = true;
|
|
106
|
-
@Input() Hide = false;
|
|
107
|
-
|
|
108
|
-
@Input()
|
|
109
|
-
set SelectedIndex(value: number | null) {
|
|
110
|
-
this._indexToSelect = value;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
get SelectedIndex(): number | null {
|
|
114
|
-
return this._selectedIndex;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
@Output()
|
|
118
|
-
get SelectedIndexChange(): Observable<number> {
|
|
119
|
-
return this.SelectChange.pipe(map(event => event.index));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
@Output() SelectChange: EventEmitter<TabChangeEvent> = new EventEmitter<TabChangeEvent>(true);
|
|
123
|
-
|
|
124
|
-
@Input() Size = 'default';
|
|
125
|
-
_type: TabType = 'line';
|
|
126
|
-
tabs: pgTabComponent[] = [];
|
|
127
|
-
|
|
128
|
-
@Input()
|
|
129
|
-
set TabPosition(value: TabPosition) {
|
|
130
|
-
this._tabPosition = value;
|
|
131
|
-
if (this._tabPosition === 'top' || this._tabPosition === 'bottom') {
|
|
132
|
-
this._tabPositionMode = 'horizontal';
|
|
133
|
-
} else {
|
|
134
|
-
this._tabPositionMode = 'vertical';
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
get TabPosition(): TabPosition {
|
|
139
|
-
return this._tabPosition;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
@Input()
|
|
143
|
-
set extraTabClass(value: string) {
|
|
144
|
-
this._extra_tab_class = value;
|
|
145
|
-
}
|
|
146
|
-
@Input()
|
|
147
|
-
set extraTabContentClass(value: string) {
|
|
148
|
-
this._extra_tabcontent_class = value;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
@Input()
|
|
152
|
-
set Type(value: TabType) {
|
|
153
|
-
if (this._type === value) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
this._type = value;
|
|
157
|
-
this._setClassMap();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
@Input()
|
|
161
|
-
set tabAnimation(value: string) {
|
|
162
|
-
this._tabAnimation = value;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
get Type(): TabType {
|
|
166
|
-
return this._type;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
_setPosition(value: TabPosition): void {}
|
|
170
|
-
|
|
171
|
-
_setClassMap(): void {}
|
|
172
|
-
|
|
173
|
-
clickLabel(index: number): void {
|
|
174
|
-
if (this._tabs[index].Disabled) {
|
|
175
|
-
} else {
|
|
176
|
-
this.SelectedIndex = index;
|
|
177
|
-
this._tabs[index].pgClick.emit();
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
ngOnInit(): void {
|
|
182
|
-
this._setClassMap();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
ngAfterContentChecked(): void {
|
|
186
|
-
// Clamp the next selected index to the bounds of 0 and the tabs length. Note the `|| 0`, which
|
|
187
|
-
// ensures that values like NaN can't get through and which would otherwise throw the
|
|
188
|
-
// component into an infinite loop (since Math.max(NaN, 0) === NaN).
|
|
189
|
-
const indexToSelect = (this._indexToSelect = Math.min(this._tabs.length - 1, Math.max(this._indexToSelect || 0, 0)));
|
|
190
|
-
|
|
191
|
-
// If there is a change in selected index, emit a change event. Should not trigger if
|
|
192
|
-
// the selected index has not yet been initialized.
|
|
193
|
-
if (this._selectedIndex !== indexToSelect && this._selectedIndex != null) {
|
|
194
|
-
this.SelectChange.emit(this._createChangeEvent(indexToSelect));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// Setup the position for each tab and optionally setup an origin on the next selected tab.
|
|
198
|
-
this._tabs.forEach((tab: pgTabComponent, index: number) => {
|
|
199
|
-
tab.position = index - indexToSelect;
|
|
200
|
-
// If there is already a selected tab, then set up an origin for the next selected tab
|
|
201
|
-
// if it doesn't have one already.
|
|
202
|
-
if (this._selectedIndex != null && tab.position === 0 && !tab.origin) {
|
|
203
|
-
tab.origin = indexToSelect - this._selectedIndex;
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
this._selectedIndex = indexToSelect;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
ngAfterViewInit(): void {
|
|
210
|
-
this._isViewInit = true;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
private _createChangeEvent(index: number): TabChangeEvent {
|
|
214
|
-
const event = new TabChangeEvent();
|
|
215
|
-
event.index = index;
|
|
216
|
-
if (this._tabs && this._tabs.length) {
|
|
217
|
-
event.tab = this._tabs[index];
|
|
218
|
-
this._tabs.forEach((item, i) => {
|
|
219
|
-
if (i !== index) {
|
|
220
|
-
item.pgDeselect.emit();
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
event.tab.pgSelect.emit();
|
|
224
|
-
}
|
|
225
|
-
return event;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
get inkBarAnimated(): boolean {
|
|
229
|
-
return this.Animated === true || (this.Animated as AnimatedInterface).inkBar === true;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
get tabPaneAnimated(): boolean {
|
|
233
|
-
return this.Animated === true || (this.Animated as AnimatedInterface).tabPane === true;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
constructor(private _renderer: Renderer2) {}
|
|
237
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const availablePrefixs = ['moz', 'ms', 'webkit'];
|
|
3
|
-
|
|
4
|
-
function requestAnimationFramePolyfill(): typeof requestAnimationFrame {
|
|
5
|
-
let lastTime = 0;
|
|
6
|
-
return function (callback: FrameRequestCallback): number {
|
|
7
|
-
const currTime = new Date().getTime();
|
|
8
|
-
const timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
|
9
|
-
const id = window.setTimeout(() => { callback(currTime + timeToCall); }, timeToCall);
|
|
10
|
-
lastTime = currTime + timeToCall;
|
|
11
|
-
return id;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function getRequestAnimationFrame(): typeof requestAnimationFrame {
|
|
16
|
-
if (typeof window === 'undefined') {
|
|
17
|
-
//@ts-ignore
|
|
18
|
-
return () => null;
|
|
19
|
-
}
|
|
20
|
-
if (window.requestAnimationFrame) {
|
|
21
|
-
return window.requestAnimationFrame.bind(window);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const prefix = availablePrefixs.filter(key => `${key}RequestAnimationFrame` in window)[0];
|
|
25
|
-
|
|
26
|
-
return prefix
|
|
27
|
-
? window[`${prefix}RequestAnimationFrame`]
|
|
28
|
-
: requestAnimationFramePolyfill();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const reqAnimFrame = getRequestAnimationFrame();
|
package/tsconfig.lib.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
-
{
|
|
3
|
-
"extends": "../../tsconfig.json",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"outDir": "../../out-tsc/lib",
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"inlineSources": true,
|
|
9
|
-
"types": []
|
|
10
|
-
},
|
|
11
|
-
"exclude": [
|
|
12
|
-
"src/test.ts",
|
|
13
|
-
"**/*.spec.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
package/tsconfig.lib.prod.json
DELETED
package/tsconfig.spec.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
],
|
|
13
|
-
"include": [
|
|
14
|
-
"**/*.spec.ts",
|
|
15
|
-
"**/*.d.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|