@natec/mef-dev-ui-kit 0.0.66 → 0.0.67
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/.browserslistrc +16 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +24 -0
- package/package.json +6 -21
- package/src/lib/markup-kit/card/card/card.component.html +46 -0
- package/src/lib/markup-kit/card/card/card.component.scss +61 -0
- package/src/lib/markup-kit/card/card/card.component.ts +31 -0
- package/src/lib/markup-kit/card/card-long/card-long.component.html +54 -0
- package/src/lib/markup-kit/card/card-long/card-long.component.scss +72 -0
- package/src/lib/markup-kit/card/card-long/card-long.component.ts +33 -0
- package/src/lib/markup-kit/card/card-long/cart-type-colors.enum.ts +5 -0
- package/src/lib/markup-kit/card/card-simple/card-simple.component.html +12 -0
- package/src/lib/markup-kit/card/card-simple/card-simple.component.scss +12 -0
- package/src/lib/markup-kit/card/card-simple/card-simple.component.ts +18 -0
- package/src/lib/markup-kit/card/card.module.ts +23 -0
- package/{lib/markup-kit/card/index.d.ts → src/lib/markup-kit/card/index.ts} +1 -0
- package/src/lib/markup-kit/collapse/collapse/collapse.component.html +16 -0
- package/src/lib/markup-kit/collapse/collapse/collapse.component.scss +13 -0
- package/src/lib/markup-kit/collapse/collapse/collapse.component.ts +78 -0
- package/src/lib/markup-kit/collapse/collapse-set/collapse-set.component.html +3 -0
- 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 +58 -0
- package/src/lib/markup-kit/collapse/collapse.module.ts +20 -0
- package/{lib/markup-kit/collapse/index.d.ts → src/lib/markup-kit/collapse/index.ts} +0 -0
- package/src/lib/markup-kit/modals/fill/fill.component.html +18 -0
- package/src/lib/markup-kit/modals/fill/fill.component.scss +0 -0
- package/src/lib/markup-kit/modals/fill/fill.component.ts +45 -0
- package/{lib/markup-kit/modals/index.d.ts → src/lib/markup-kit/modals/index.ts} +0 -0
- package/src/lib/markup-kit/modals/markup-kit.module.ts +27 -0
- package/src/lib/markup-kit/modals/modal-size.enum.ts +5 -0
- package/src/lib/markup-kit/modals/right-filter/right-filter.component.html +7 -0
- package/src/lib/markup-kit/modals/right-filter/right-filter.component.scss +6 -0
- package/src/lib/markup-kit/modals/right-filter/right-filter.component.ts +30 -0
- package/src/lib/markup-kit/modals/slide-right/slide-right.component.html +16 -0
- 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 +50 -0
- package/src/lib/markup-kit/modals/slide-up/slide-up.component.html +16 -0
- 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 +50 -0
- package/src/lib/markup-kit/page-layouts/central-page/central-page.component.html +6 -0
- 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 +26 -0
- package/src/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.html +3 -0
- 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 +15 -0
- package/{lib/markup-kit/page-layouts/index.d.ts → src/lib/markup-kit/page-layouts/index.ts} +0 -0
- package/src/lib/markup-kit/page-layouts/manage-page/manage-page.component.html +10 -0
- package/src/lib/markup-kit/page-layouts/manage-page/manage-page.component.scss +14 -0
- package/src/lib/markup-kit/page-layouts/manage-page/manage-page.component.ts +20 -0
- package/src/lib/markup-kit/page-layouts/page-layouts.module.ts +26 -0
- package/src/lib/markup-kit/page-layouts/profile/profile.component.html +42 -0
- package/src/lib/markup-kit/page-layouts/profile/profile.component.scss +72 -0
- package/src/lib/markup-kit/page-layouts/profile/profile.component.ts +38 -0
- package/src/lib/markup-kit/page-layouts/table-page/table-page.component.html +9 -0
- 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 +16 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.html +3 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.scss +4 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.ts +46 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.html +4 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.scss +12 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.ts +28 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field.module.ts +19 -0
- package/src/lib/markup-kit/utils/filtered-field/filtered-field.service.ts +32 -0
- package/src/lib/markup-kit/utils/filtered-field/filtred-item.model.ts +15 -0
- package/{lib/markup-kit/utils/filtered-field/index.d.ts → src/lib/markup-kit/utils/filtered-field/index.ts} +0 -0
- package/src/lib/markup-kit/utils/help-block/help-block.component.html +19 -0
- package/src/lib/markup-kit/utils/help-block/help-block.component.scss +22 -0
- package/src/lib/markup-kit/utils/help-block/help-block.component.ts +40 -0
- package/src/lib/markup-kit/utils/help-block/hepl-block.module.ts +14 -0
- package/{lib/markup-kit/utils/help-block/index.d.ts → src/lib/markup-kit/utils/help-block/index.ts} +1 -1
- package/{lib/markup-kit/utils/loader/index.d.ts → src/lib/markup-kit/utils/loader/index.ts} +1 -1
- package/src/lib/markup-kit/utils/loader/loader/loader.component.html +1 -0
- package/src/lib/markup-kit/utils/loader/loader/loader.component.scss +0 -0
- package/src/lib/markup-kit/utils/loader/loader/loader.component.ts +29 -0
- package/src/lib/markup-kit/utils/loader/loader.module.ts +47 -0
- package/src/lib/markup-kit/utils/loader/loader.service.ts +55 -0
- package/src/lib/markup-kit/utils/loader/request-event.enum.ts +1 -0
- package/src/lib/pg-components/card/card.components.html +66 -0
- package/src/lib/pg-components/card/card.components.ts +243 -0
- package/src/lib/pg-components/card/card.module.ts +17 -0
- package/{lib/pg-components/card/index.d.ts → src/lib/pg-components/card/index.ts} +1 -1
- package/{lib/pg-components/progress/index.d.ts → src/lib/pg-components/progress/index.ts} +1 -1
- package/src/lib/pg-components/progress/progress.component.html +28 -0
- package/src/lib/pg-components/progress/progress.component.ts +32 -0
- package/src/lib/pg-components/progress/progress.config.ts +7 -0
- package/src/lib/pg-components/progress/progress.module.ts +16 -0
- package/{lib/pg-components/select/index.d.ts → src/lib/pg-components/select/index.ts} +1 -1
- package/src/lib/pg-components/select/option.component.ts +71 -0
- package/src/lib/pg-components/select/option.pipe.ts +41 -0
- package/src/lib/pg-components/select/select.component.html +77 -0
- package/src/lib/pg-components/select/select.component.ts +808 -0
- package/src/lib/pg-components/select/select.module.ts +14 -0
- package/{lib/pg-components/spec-flow-test/index.d.ts → src/lib/pg-components/spec-flow-test/index.ts} +1 -1
- package/src/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.html +6 -0
- 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 +36 -0
- package/src/lib/pg-components/spec-flow-test/spec-flow-test.module.ts +18 -0
- package/{lib/pg-components/switch/index.d.ts → src/lib/pg-components/switch/index.ts} +1 -1
- package/src/lib/pg-components/switch/switch.component.ts +122 -0
- package/src/lib/pg-components/switch/switch.module.ts +11 -0
- package/{lib/pg-components/tabs/index.d.ts → src/lib/pg-components/tabs/index.ts} +1 -1
- package/src/lib/pg-components/tabs/tab-body.component.ts +12 -0
- package/src/lib/pg-components/tabs/tab-label.directive.ts +40 -0
- package/src/lib/pg-components/tabs/tab.component.ts +62 -0
- package/src/lib/pg-components/tabs/tabs-ink-bar.directive.ts +77 -0
- package/src/lib/pg-components/tabs/tabs-nav.component.ts +345 -0
- package/src/lib/pg-components/tabs/tabs.module.ts +16 -0
- package/src/lib/pg-components/tabs/tabset.component.ts +237 -0
- package/src/lib/pg-components/util/convert.ts +3 -0
- package/src/lib/pg-components/util/request-animation.ts +31 -0
- package/src/lib/styles/pg/modules/_buttons.scss +26 -26
- package/{public-api.d.ts → src/public-api.ts} +19 -14
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2020/lib/markup-kit/card/card/card.component.mjs +0 -36
- package/esm2020/lib/markup-kit/card/card-long/card-long.component.mjs +0 -46
- package/esm2020/lib/markup-kit/card/card-long/cart-type-colors.enum.mjs +0 -7
- package/esm2020/lib/markup-kit/card/card-simple/card-simple.component.mjs +0 -23
- package/esm2020/lib/markup-kit/card/card.module.mjs +0 -41
- package/esm2020/lib/markup-kit/card/index.mjs +0 -6
- package/esm2020/lib/markup-kit/collapse/collapse/collapse.component.mjs +0 -87
- package/esm2020/lib/markup-kit/collapse/collapse-set/collapse-set.component.mjs +0 -54
- package/esm2020/lib/markup-kit/collapse/collapse.module.mjs +0 -25
- package/esm2020/lib/markup-kit/collapse/index.mjs +0 -4
- package/esm2020/lib/markup-kit/modals/fill/fill.component.mjs +0 -52
- package/esm2020/lib/markup-kit/modals/index.mjs +0 -7
- package/esm2020/lib/markup-kit/modals/markup-kit.module.mjs +0 -45
- package/esm2020/lib/markup-kit/modals/modal-size.enum.mjs +0 -2
- package/esm2020/lib/markup-kit/modals/right-filter/right-filter.component.mjs +0 -28
- package/esm2020/lib/markup-kit/modals/slide-right/slide-right.component.mjs +0 -55
- package/esm2020/lib/markup-kit/modals/slide-up/slide-up.component.mjs +0 -55
- package/esm2020/lib/markup-kit/page-layouts/central-page/central-page.component.mjs +0 -25
- package/esm2020/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.mjs +0 -14
- package/esm2020/lib/markup-kit/page-layouts/index.mjs +0 -7
- package/esm2020/lib/markup-kit/page-layouts/manage-page/manage-page.component.mjs +0 -25
- package/esm2020/lib/markup-kit/page-layouts/page-layouts.module.mjs +0 -45
- package/esm2020/lib/markup-kit/page-layouts/profile/profile.component.mjs +0 -49
- package/esm2020/lib/markup-kit/page-layouts/table-page/table-page.component.mjs +0 -18
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.mjs +0 -40
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.mjs +0 -29
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field.module.mjs +0 -31
- package/esm2020/lib/markup-kit/utils/filtered-field/filtered-field.service.mjs +0 -30
- package/esm2020/lib/markup-kit/utils/filtered-field/filtred-item.model.mjs +0 -9
- package/esm2020/lib/markup-kit/utils/filtered-field/index.mjs +0 -6
- package/esm2020/lib/markup-kit/utils/help-block/help-block.component.mjs +0 -47
- package/esm2020/lib/markup-kit/utils/help-block/hepl-block.module.mjs +0 -26
- package/esm2020/lib/markup-kit/utils/help-block/index.mjs +0 -3
- package/esm2020/lib/markup-kit/utils/loader/index.mjs +0 -5
- package/esm2020/lib/markup-kit/utils/loader/loader/loader.component.mjs +0 -27
- package/esm2020/lib/markup-kit/utils/loader/loader.module.mjs +0 -58
- package/esm2020/lib/markup-kit/utils/loader/loader.service.mjs +0 -50
- package/esm2020/lib/markup-kit/utils/loader/request-event.enum.mjs +0 -7
- package/esm2020/lib/pg-components/card/card.components.mjs +0 -252
- package/esm2020/lib/pg-components/card/card.module.mjs +0 -24
- package/esm2020/lib/pg-components/card/index.mjs +0 -3
- package/esm2020/lib/pg-components/progress/index.mjs +0 -4
- package/esm2020/lib/pg-components/progress/progress.component.mjs +0 -39
- package/esm2020/lib/pg-components/progress/progress.config.mjs +0 -14
- package/esm2020/lib/pg-components/progress/progress.module.mjs +0 -22
- package/esm2020/lib/pg-components/select/index.mjs +0 -5
- package/esm2020/lib/pg-components/select/option.component.mjs +0 -60
- package/esm2020/lib/pg-components/select/option.pipe.mjs +0 -42
- package/esm2020/lib/pg-components/select/select.component.mjs +0 -762
- package/esm2020/lib/pg-components/select/select.module.mjs +0 -22
- package/esm2020/lib/pg-components/spec-flow-test/index.mjs +0 -3
- package/esm2020/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.mjs +0 -24
- package/esm2020/lib/pg-components/spec-flow-test/spec-flow-test.module.mjs +0 -27
- package/esm2020/lib/pg-components/switch/index.mjs +0 -3
- package/esm2020/lib/pg-components/switch/switch.component.mjs +0 -130
- package/esm2020/lib/pg-components/switch/switch.module.mjs +0 -18
- package/esm2020/lib/pg-components/tabs/index.mjs +0 -8
- package/esm2020/lib/pg-components/tabs/tab-body.component.mjs +0 -22
- package/esm2020/lib/pg-components/tabs/tab-label.directive.mjs +0 -44
- package/esm2020/lib/pg-components/tabs/tab.component.mjs +0 -66
- package/esm2020/lib/pg-components/tabs/tabs-ink-bar.directive.mjs +0 -78
- package/esm2020/lib/pg-components/tabs/tabs-nav.component.mjs +0 -335
- package/esm2020/lib/pg-components/tabs/tabs.module.mjs +0 -24
- package/esm2020/lib/pg-components/tabs/tabset.component.mjs +0 -260
- package/esm2020/lib/pg-components/util/convert.mjs +0 -4
- package/esm2020/lib/pg-components/util/request-animation.mjs +0 -26
- package/esm2020/natec-mef-dev-ui-kit.mjs +0 -5
- package/esm2020/public-api.mjs +0 -16
- package/fesm2015/natec-mef-dev-ui-kit.mjs +0 -3189
- package/fesm2015/natec-mef-dev-ui-kit.mjs.map +0 -1
- package/fesm2020/natec-mef-dev-ui-kit.mjs +0 -3182
- package/fesm2020/natec-mef-dev-ui-kit.mjs.map +0 -1
- package/lib/markup-kit/card/card/card.component.d.ts +0 -17
- package/lib/markup-kit/card/card-long/card-long.component.d.ts +0 -21
- package/lib/markup-kit/card/card-long/cart-type-colors.enum.d.ts +0 -5
- package/lib/markup-kit/card/card-simple/card-simple.component.d.ts +0 -10
- package/lib/markup-kit/card/card.module.d.ts +0 -17
- package/lib/markup-kit/collapse/collapse/collapse.component.d.ts +0 -19
- package/lib/markup-kit/collapse/collapse-set/collapse-set.component.d.ts +0 -18
- package/lib/markup-kit/collapse/collapse.module.d.ts +0 -14
- package/lib/markup-kit/modals/fill/fill.component.d.ts +0 -17
- package/lib/markup-kit/modals/markup-kit.module.d.ts +0 -13
- package/lib/markup-kit/modals/modal-size.enum.d.ts +0 -5
- package/lib/markup-kit/modals/right-filter/right-filter.component.d.ts +0 -13
- package/lib/markup-kit/modals/slide-right/slide-right.component.d.ts +0 -19
- package/lib/markup-kit/modals/slide-up/slide-up.component.d.ts +0 -19
- package/lib/markup-kit/page-layouts/central-page/central-page.component.d.ts +0 -11
- package/lib/markup-kit/page-layouts/central-page-row/central-page-row.component.d.ts +0 -8
- package/lib/markup-kit/page-layouts/manage-page/manage-page.component.d.ts +0 -11
- package/lib/markup-kit/page-layouts/page-layouts.module.d.ts +0 -13
- package/lib/markup-kit/page-layouts/profile/profile.component.d.ts +0 -27
- package/lib/markup-kit/page-layouts/table-page/table-page.component.d.ts +0 -9
- package/lib/markup-kit/utils/filtered-field/filtered-field-container/filtered-field-container.component.d.ts +0 -14
- package/lib/markup-kit/utils/filtered-field/filtered-field-item/filtered-field-item.component.d.ts +0 -14
- package/lib/markup-kit/utils/filtered-field/filtered-field.module.d.ts +0 -9
- package/lib/markup-kit/utils/filtered-field/filtered-field.service.d.ts +0 -14
- package/lib/markup-kit/utils/filtered-field/filtred-item.model.d.ts +0 -7
- package/lib/markup-kit/utils/help-block/help-block.component.d.ts +0 -11
- package/lib/markup-kit/utils/help-block/hepl-block.module.d.ts +0 -9
- package/lib/markup-kit/utils/loader/loader/loader.component.d.ts +0 -12
- package/lib/markup-kit/utils/loader/loader.module.d.ts +0 -9
- package/lib/markup-kit/utils/loader/loader.service.d.ts +0 -15
- package/lib/markup-kit/utils/loader/request-event.enum.d.ts +0 -5
- package/lib/pg-components/card/card.components.d.ts +0 -60
- package/lib/pg-components/card/card.module.d.ts +0 -11
- package/lib/pg-components/progress/progress.component.d.ts +0 -15
- package/lib/pg-components/progress/progress.config.d.ts +0 -7
- package/lib/pg-components/progress/progress.module.d.ts +0 -10
- package/lib/pg-components/select/option.component.d.ts +0 -21
- package/lib/pg-components/select/option.pipe.d.ts +0 -8
- package/lib/pg-components/select/select.component.d.ts +0 -135
- package/lib/pg-components/select/select.module.d.ts +0 -12
- package/lib/pg-components/spec-flow-test/spec-flow-test/spec-flow-test.component.d.ts +0 -22
- package/lib/pg-components/spec-flow-test/spec-flow-test.module.d.ts +0 -10
- package/lib/pg-components/switch/switch.component.d.ts +0 -29
- package/lib/pg-components/switch/switch.module.d.ts +0 -8
- package/lib/pg-components/tabs/tab-body.component.d.ts +0 -7
- package/lib/pg-components/tabs/tab-label.directive.d.ts +0 -15
- package/lib/pg-components/tabs/tab.component.d.ts +0 -22
- package/lib/pg-components/tabs/tabs-ink-bar.directive.d.ts +0 -23
- package/lib/pg-components/tabs/tabs-nav.component.d.ts +0 -79
- package/lib/pg-components/tabs/tabs.module.d.ts +0 -14
- package/lib/pg-components/tabs/tabset.component.d.ts +0 -67
- package/lib/pg-components/util/convert.d.ts +0 -1
- package/lib/pg-components/util/request-animation.d.ts +0 -1
- package/natec-mef-dev-ui-kit.d.ts +0 -5
|
@@ -0,0 +1,345 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {}
|
|
@@ -0,0 +1,237 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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();
|
|
@@ -2,38 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
@mixin _button($main_color, $hover_color, $text_color, $hover_text_color, $hover_color_opacity) {
|
|
5
|
-
padding-left: 2em ;
|
|
6
|
-
padding-right: 2em ;
|
|
7
|
-
min-height: 36px ;
|
|
8
|
-
border: 0 ;
|
|
9
|
-
border-radius: 5px ;
|
|
10
|
-
color: $text_color ;
|
|
11
|
-
background-color: $main_color ;
|
|
12
|
-
font-family: montserrat-regular ;
|
|
13
|
-
font-weight: 500 ;
|
|
14
|
-
font-size: 14px ;
|
|
15
|
-
line-height: 24px ;
|
|
5
|
+
padding-left: 2em !important;
|
|
6
|
+
padding-right: 2em !important;
|
|
7
|
+
min-height: 36px !important;
|
|
8
|
+
border: 0 !important;
|
|
9
|
+
border-radius: 5px !important;
|
|
10
|
+
color: $text_color !important;
|
|
11
|
+
background-color: $main_color !important;
|
|
12
|
+
font-family: montserrat-regular !important;
|
|
13
|
+
font-weight: 500 !important;
|
|
14
|
+
font-size: 14px !important;
|
|
15
|
+
line-height: 24px !important;
|
|
16
16
|
&:hover{
|
|
17
|
-
color: $hover_text_color ;
|
|
18
|
-
background-color: $hover_color ;
|
|
19
|
-
opacity: $hover_color_opacity;
|
|
17
|
+
color: $hover_text_color !important;
|
|
18
|
+
background-color: $hover_color !important;
|
|
19
|
+
opacity: $hover_color_opacity !important;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
@mixin _button_status($main_color, $hover_color, $text_color, $hover_text_color) {
|
|
24
|
-
padding-left: 2em ;
|
|
25
|
-
padding-right: 2em ;
|
|
26
|
-
min-height: 23px ;
|
|
27
|
-
border: 0 ;
|
|
28
|
-
border-radius: 5px ;
|
|
29
|
-
color: $text_color ;
|
|
30
|
-
background-color: $main_color ;
|
|
31
|
-
font-family: Lato-regular ;
|
|
32
|
-
font-size: 11px ;
|
|
33
|
-
line-height: 13px ;
|
|
24
|
+
padding-left: 2em !important;
|
|
25
|
+
padding-right: 2em !important;
|
|
26
|
+
min-height: 23px !important;
|
|
27
|
+
border: 0 !important;
|
|
28
|
+
border-radius: 5px !important;
|
|
29
|
+
color: $text_color !important;
|
|
30
|
+
background-color: $main_color !important;
|
|
31
|
+
font-family: Lato-regular !important;
|
|
32
|
+
font-size: 11px !important;
|
|
33
|
+
line-height: 13px !important;
|
|
34
34
|
&:hover{
|
|
35
|
-
color: $hover_text_color ;
|
|
36
|
-
background-color: $hover_color ;
|
|
35
|
+
color: $hover_text_color !important;
|
|
36
|
+
background-color: $hover_color !important;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
.btn-primary {
|