@fluid-topics/ft-tabs 0.1.17 → 0.2.1

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/build/ft-tabs.js CHANGED
@@ -8,11 +8,10 @@ import { css, html } from "lit";
8
8
  import { property, query, state } from "lit/decorators.js";
9
9
  import { repeat } from "lit/directives/repeat.js";
10
10
  import { classMap } from "lit/directives/class-map.js";
11
- import { customElement, Debouncer, designSystemVariables, FtCssVariable, FtLitElement } from "@fluid-topics/ft-wc-utils";
11
+ import { Debouncer, designSystemVariables, FtCssVariable, FtLitElement } from "@fluid-topics/ft-wc-utils";
12
12
  import { FtTab, FtTabPosition } from "./ft-tab";
13
13
  import { Tab } from "@material/mwc-tab";
14
14
  import { TabBar } from "@material/mwc-tab-bar";
15
- export { FtTab } from "./ft-tab";
16
15
  export const FtTabsCssVariables = {
17
16
  colorSurface: FtCssVariable.external(designSystemVariables.colorSurface, "Design system"),
18
17
  colorPrimary: FtCssVariable.external(designSystemVariables.colorPrimary, "Design system"),
@@ -24,7 +23,7 @@ export class IndexChangeEvent extends CustomEvent {
24
23
  super("index-change", { detail: index });
25
24
  }
26
25
  }
27
- let FtTabs = class FtTabs extends FtLitElement {
26
+ export class FtTabs extends FtLitElement {
28
27
  constructor() {
29
28
  super(...arguments);
30
29
  this.dense = false;
@@ -35,50 +34,10 @@ let FtTabs = class FtTabs extends FtLitElement {
35
34
  this.updateDebouncer = new Debouncer(20);
36
35
  this.resizeDebouncer = new Debouncer(50);
37
36
  }
38
- // language=CSS
39
- getStyles() {
40
- return css `
41
- .ft-tabs {
42
- display: flex;
43
- flex-direction: column;
44
- background-color: ${FtTabsCssVariables.colorSurface};
45
- height: 100%;
46
- }
47
-
48
- .ft-tabs--reverse {
49
- flex-direction: column-reverse;
50
- }
51
-
52
- mwc-tab-bar {
53
- display: block;
54
- flex-shrink: 0;
55
- flex-grow: 0;
56
- --mdc-theme-primary: ${FtTabsCssVariables.colorPrimary};
57
- --mdc-tab-color-default: ${FtTabsCssVariables.colorOnSurfaceMedium};
58
- }
59
-
60
- .ft-tabs--content {
61
- flex-shrink: 1;
62
- flex-grow: 1;
63
- overflow: auto;
64
- }
65
-
66
- .ft-tabs--resizable {
67
- position: relative;
68
- overflow: hidden;
69
- width: 100%;
70
- }
71
-
72
- mwc-tab[disabled] {
73
- pointer-events: none;
74
- --mdc-tab-color-default: ${FtTabsCssVariables.colorOnSurfaceDisabled};
75
- }
76
- `;
77
- }
78
37
  get currentTab() {
79
38
  return this.tabs[this.activeIndex];
80
39
  }
81
- getTemplate() {
40
+ render() {
82
41
  const classes = {
83
42
  "ft-tabs": true,
84
43
  "ft-tabs--reverse": this.contentBefore,
@@ -145,12 +104,50 @@ let FtTabs = class FtTabs extends FtLitElement {
145
104
  }
146
105
  });
147
106
  }
148
- };
107
+ }
149
108
  FtTabs.elementDefinitions = {
150
109
  "ft-tab": FtTab,
151
110
  "mwc-tab": Tab,
152
111
  "mwc-tab-bar": TabBar,
153
112
  };
113
+ // language=CSS
114
+ FtTabs.styles = css `
115
+ .ft-tabs {
116
+ display: flex;
117
+ flex-direction: column;
118
+ background-color: ${FtTabsCssVariables.colorSurface};
119
+ height: 100%;
120
+ }
121
+
122
+ .ft-tabs--reverse {
123
+ flex-direction: column-reverse;
124
+ }
125
+
126
+ mwc-tab-bar {
127
+ display: block;
128
+ flex-shrink: 0;
129
+ flex-grow: 0;
130
+ --mdc-theme-primary: ${FtTabsCssVariables.colorPrimary};
131
+ --mdc-tab-color-default: ${FtTabsCssVariables.colorOnSurfaceMedium};
132
+ }
133
+
134
+ .ft-tabs--content {
135
+ flex-shrink: 1;
136
+ flex-grow: 1;
137
+ overflow: auto;
138
+ }
139
+
140
+ .ft-tabs--resizable {
141
+ position: relative;
142
+ overflow: hidden;
143
+ width: 100%;
144
+ }
145
+
146
+ mwc-tab[disabled] {
147
+ pointer-events: none;
148
+ --mdc-tab-color-default: ${FtTabsCssVariables.colorOnSurfaceDisabled};
149
+ }
150
+ `;
154
151
  __decorate([
155
152
  property({ type: Boolean })
156
153
  ], FtTabs.prototype, "dense", void 0);
@@ -166,8 +163,4 @@ __decorate([
166
163
  __decorate([
167
164
  query(".ft-tabs--resizable")
168
165
  ], FtTabs.prototype, "resizable", void 0);
169
- FtTabs = __decorate([
170
- customElement("ft-tabs")
171
- ], FtTabs);
172
- export { FtTabs };
173
166
  //# sourceMappingURL=ft-tabs.js.map