gd-bs 6.6.57 → 6.6.59

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/index.html CHANGED
@@ -666,7 +666,9 @@
666
666
  el: el,
667
667
  title: "My Panel",
668
668
  lead: "this is a lead",
669
- content: "This is the content of the jumbotron."
669
+ size: 2,
670
+ type: 3
671
+ //content: "This is the content of the jumbotron."
670
672
  });
671
673
  }
672
674
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gd-bs",
3
- "version": "6.6.57",
3
+ "version": "6.6.59",
4
4
  "description": "Bootstrap JavaScript, TypeScript and Web Components library.",
5
5
  "main": "build/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -1,8 +1,60 @@
1
1
  import { IJumbotron, IJumbotronProps } from "./types";
2
2
  import { Base } from "../base";
3
+ import { ClassNames } from "../classNames";
3
4
  import { appendContent } from "../common";
4
5
  import { HTML } from "./templates";
5
6
 
7
+ /**
8
+ * Jumbotron Size
9
+ */
10
+ export enum JumbotronSize {
11
+ XSmall = 1,
12
+ Small = 2,
13
+ Medium = 3,
14
+ Large = 4,
15
+ XLarge = 5
16
+ }
17
+
18
+ /**
19
+ * Jumbotron Types
20
+ */
21
+ export enum JumbotronTypes {
22
+ Danger = 1,
23
+ Dark = 2,
24
+ Info = 3,
25
+ Light = 4,
26
+ Primary = 5,
27
+ Secondary = 6,
28
+ Success = 7,
29
+ Warning = 8,
30
+ }
31
+
32
+ /**
33
+ * Jumbotron Classes
34
+ */
35
+ export const JumbotronSizeClassNames = new ClassNames([
36
+ "py-1",
37
+ "py-2",
38
+ "py-3",
39
+ "py-4",
40
+ "py-5"
41
+ ]);
42
+
43
+ /**
44
+ * Jumbotron Classes
45
+ */
46
+ export const JumbotronTypeClassNames = new ClassNames([
47
+ "jumbotron-danger",
48
+ "jumbotron-dark",
49
+ "jumbotron-info",
50
+ "jumbotron-light",
51
+ "jumbotron-link",
52
+ "jumbotron-primary",
53
+ "jumbotron-secondary",
54
+ "jumbotron-success",
55
+ "jumbotron-warning"
56
+ ]);
57
+
6
58
  /**
7
59
  * Jumbotron
8
60
  */
@@ -50,6 +102,14 @@ class _Jumbotron extends Base<IJumbotronProps> implements IJumbotron {
50
102
  }
51
103
  }
52
104
 
105
+ // Set the size
106
+ let className = JumbotronSizeClassNames.getByType(this.props.size) || JumbotronSizeClassNames.getByType(JumbotronSize.XLarge);
107
+ this.el.classList.add(className);
108
+
109
+ // Set the type
110
+ className = JumbotronTypeClassNames.getByType(this.props.type);
111
+ if (className) { this.el.classList.add(className); }
112
+
53
113
  // Append the content
54
114
  appendContent(this.el, this.props.content);
55
115
  }
@@ -1,5 +1,5 @@
1
1
  export const HTML = `
2
- <div class="row py-5 m-0">
2
+ <div class="jumbotron row m-0">
3
3
  <h1 class="display-4"></h1>
4
4
  <p class="lead"></p>
5
5
  </div>`.trim();
@@ -30,6 +30,8 @@
30
30
  * ```
31
31
  */
32
32
  export const Jumbotron: (props: IJumbotronProps, template?: string) => IJumbotron;
33
+ export const JumbotronSize: IJumbotronSize;
34
+ export const JumbotronType: IJumbotronTypes;
33
35
 
34
36
  import { IBaseProps } from "../types";
35
37
 
@@ -50,10 +52,36 @@ export interface IJumbotron {
50
52
  /**
51
53
  * Jumbotron Properties
52
54
  */
53
- export interface IJumbotronProps<T=Element> extends IBaseProps<IJumbotron> {
55
+ export interface IJumbotronProps<T = Element> extends IBaseProps<IJumbotron> {
54
56
  content?: string | T;
55
57
  isFluid?: boolean;
56
58
  lead?: string;
57
59
  onRenderContent?: (el?: HTMLElement) => void;
60
+ size?: number;
58
61
  title?: string;
62
+ type?: number;
63
+ }
64
+
65
+ /**
66
+ * Jumbotron Size
67
+ */
68
+ export type IJumbotronSize = {
69
+ XSmall: number;
70
+ Small: number;
71
+ Medium: number;
72
+ Large: number;
73
+ XLarge: number;
74
+ }
75
+ /**
76
+ * Jumbotron Types
77
+ */
78
+ export type IJumbotronTypes = {
79
+ Danger: number;
80
+ Dark: number;
81
+ Info: number;
82
+ Light: number;
83
+ Primary: number;
84
+ Secondary: number;
85
+ Success: number;
86
+ Warning: number;
59
87
  }
@@ -67,6 +67,7 @@ export class ListGroupItem extends Base<IListGroupItem> {
67
67
  this.el.id = tabId + "-tab";
68
68
  this.el.setAttribute("href", "#" + tabId);
69
69
  this.el.setAttribute("data-bs-toggle", "list");
70
+ this.el.setAttribute("data-tab-title", this.props.tabName);
70
71
  this.el.setAttribute("aria-controls", tabId);
71
72
  this.el.innerHTML = this.props.tabName;
72
73
 
@@ -97,6 +98,12 @@ export class ListGroupItem extends Base<IListGroupItem> {
97
98
  this.props.onClick ? this.props.onClick(this.el, this.props) : null;
98
99
  });
99
100
 
101
+ // See if there is a render tab event
102
+ if (this.props.onRenderTab) {
103
+ // Execute the render event
104
+ this.props.onRenderTab(this.el, this.props);
105
+ }
106
+
100
107
  // See if there is a render event
101
108
  if (this.props.onRender) {
102
109
  // Execute the render event
@@ -84,6 +84,7 @@ export interface IListGroupItem<T=Element> {
84
84
  isDisabled?: boolean;
85
85
  onClick?: (el?: HTMLElement, item?: IListGroupItem) => void;
86
86
  onRender?: (el?: HTMLElement, item?: IListGroupItem) => void;
87
+ onRenderTab?: (el?: HTMLElement, item?: IListGroupItem) => void;
87
88
  tabName?: string;
88
89
  type?: number;
89
90
  }