gd-bs 5.7.7 → 5.7.8
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/bs.js +1 -1
- package/build/components/offcanvas/index.js +55 -7
- package/dist/gd-bs-icons.js +2 -2
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.d.ts +18 -0
- package/dist/gd-bs.js +2 -2
- package/dist/gd-bs.min.js +1 -1
- package/index.html +2 -1
- package/package.json +2 -2
- package/pnpm-lock.yaml +1 -1
- package/src/bs.scss +30 -0
- package/src/components/offcanvas/index.ts +56 -7
- package/src/components/offcanvas/types.d.ts +18 -0
package/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gd-bs",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.8",
|
|
4
4
|
"description": "Bootstrap JavaScript, TypeScript and Web Components library.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@popperjs/core": "^2.11.5",
|
|
37
37
|
"bootstrap": "^5.1.3",
|
|
38
|
-
"bootstrap-icons": "^1.
|
|
38
|
+
"bootstrap-icons": "^1.9.1",
|
|
39
39
|
"core-js": "^3.22.6",
|
|
40
40
|
"tippy.js": "^6.3.7"
|
|
41
41
|
},
|
package/pnpm-lock.yaml
CHANGED
package/src/bs.scss
CHANGED
|
@@ -339,6 +339,36 @@
|
|
|
339
339
|
margin: 0rem 0rem 0rem auto;
|
|
340
340
|
padding: 1rem;
|
|
341
341
|
}
|
|
342
|
+
/* Off-canvas sizes (Small 1) */
|
|
343
|
+
.offcanvas-start.offcanvas-size-sm1, .offcanvas-end.offcanvas-size-sm1 { width: 20vw; }
|
|
344
|
+
.offcanvas-top.offcanvas-size-sm1, .offcanvas-bottom.offcanvas-size-sm1 { height: 20vh; }
|
|
345
|
+
/* Off-canvas sizes (Small 2) */
|
|
346
|
+
.offcanvas-start.offcanvas-size-sm2, .offcanvas-end.offcanvas-size-sm2 { width: 25vw; }
|
|
347
|
+
.offcanvas-top.offcanvas-size-sm2, .offcanvas-bottom.offcanvas-size-sm2 { height: 25vh; }
|
|
348
|
+
/* Off-canvas sizes (Small 3) */
|
|
349
|
+
.offcanvas-start.offcanvas-size-sm3, .offcanvas-end.offcanvas-size-sm3 { width: 30vw; }
|
|
350
|
+
.offcanvas-top.offcanvas-size-sm3, .offcanvas-bottom.offcanvas-size-sm3 { height: 30vh; }
|
|
351
|
+
/* Off-canvas sizes (Medium 1) */
|
|
352
|
+
.offcanvas-start.offcanvas-size-md1, .offcanvas-end.offcanvas-size-md1 { width: 40vw; }
|
|
353
|
+
.offcanvas-top.offcanvas-size-md1, .offcanvas-bottom.offcanvas-size-md1 { height: 40vh; }
|
|
354
|
+
/* Off-canvas sizes (Medium 2) */
|
|
355
|
+
.offcanvas-start.offcanvas-size-md2, .offcanvas-end.offcanvas-size-md2 { width: 50vw; }
|
|
356
|
+
.offcanvas-top.offcanvas-size-md2, .offcanvas-bottom.offcanvas-size-md2 { height: 50vh; }
|
|
357
|
+
/* Off-canvas sizes (Medium 3) */
|
|
358
|
+
.offcanvas-start.offcanvas-size-md3, .offcanvas-end.offcanvas-size-md3 { width: 60vw; }
|
|
359
|
+
.offcanvas-top.offcanvas-size-md3, .offcanvas-bottom.offcanvas-size-md3 { height: 60vh; }
|
|
360
|
+
/* Off-canvas sizes (Large 1) */
|
|
361
|
+
.offcanvas-start.offcanvas-size-lg1, .offcanvas-end.offcanvas-size-lg1 { width: 75vw; }
|
|
362
|
+
.offcanvas-top.offcanvas-size-lg1, .offcanvas-bottom.offcanvas-size-lg1 { height: 75vh; }
|
|
363
|
+
/* Off-canvas sizes (Large 2) */
|
|
364
|
+
.offcanvas-start.offcanvas-size-lg2, .offcanvas-end.offcanvas-size-lg2 { width: 80vw; }
|
|
365
|
+
.offcanvas-top.offcanvas-size-lg2, .offcanvas-bottom.offcanvas-size-lg2 { height: 80vh; }
|
|
366
|
+
/* Off-canvas sizes (Large 3) */
|
|
367
|
+
.offcanvas-start.offcanvas-size-lg3, .offcanvas-end.offcanvas-size-lg3 { width: 90vw; }
|
|
368
|
+
.offcanvas-top.offcanvas-size-lg3, .offcanvas-bottom.offcanvas-size-lg3 { height: 90vh; }
|
|
369
|
+
/* Off-canvas sizes (Full) */
|
|
370
|
+
.offcanvas-start.offcanvas-size-full, .offcanvas-end.offcanvas-size-full { width: 100vw; }
|
|
371
|
+
.offcanvas-top.offcanvas-size-full, .offcanvas-bottom.offcanvas-size-full { height: 100vh; }
|
|
342
372
|
/* Color match the pagination link color to 'SharePoint Blue' */
|
|
343
373
|
.page-link {
|
|
344
374
|
border-color: #6c757d;
|
|
@@ -4,22 +4,57 @@ import { Base } from "../base";
|
|
|
4
4
|
import { appendContent } from "../common";
|
|
5
5
|
import { HTML } from "./templates";
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Offcanvas Size
|
|
10
|
+
*/
|
|
11
|
+
export enum OffcanvasSize {
|
|
12
|
+
Small1 = 1,
|
|
13
|
+
Small2 = 2,
|
|
14
|
+
Small3 = 3,
|
|
15
|
+
Medium1 = 4,
|
|
16
|
+
Medium2 = 5,
|
|
17
|
+
Medium3 = 6,
|
|
18
|
+
Large1 = 7,
|
|
19
|
+
Large2 = 8,
|
|
20
|
+
Large3 = 9,
|
|
21
|
+
Full = 10
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Offcanvas Size Classes
|
|
26
|
+
*/
|
|
27
|
+
export const OffcanvasSizeClassNames = new ClassNames([
|
|
28
|
+
"offcanvas-size-sm1",
|
|
29
|
+
"offcanvas-size-sm2",
|
|
30
|
+
"offcanvas-size-sm3",
|
|
31
|
+
"offcanvas-size-md1",
|
|
32
|
+
"offcanvas-size-md2",
|
|
33
|
+
"offcanvas-size-md3",
|
|
34
|
+
"offcanvas-size-lg1",
|
|
35
|
+
"offcanvas-size-lg2",
|
|
36
|
+
"offcanvas-size-lg3",
|
|
37
|
+
"offcanvas-size-full"
|
|
38
|
+
]);
|
|
39
|
+
|
|
7
40
|
/**
|
|
8
41
|
* Offcanvas Types
|
|
9
42
|
*/
|
|
10
43
|
export enum OffcanvasTypes {
|
|
11
44
|
Bottom = 1,
|
|
12
45
|
End = 2,
|
|
13
|
-
Start = 3
|
|
46
|
+
Start = 3,
|
|
47
|
+
Top = 4
|
|
14
48
|
}
|
|
15
49
|
|
|
16
50
|
/**
|
|
17
|
-
* Offcanvas Classes
|
|
51
|
+
* Offcanvas Types Classes
|
|
18
52
|
*/
|
|
19
|
-
export const
|
|
53
|
+
export const OffcanvasTypesClassNames = new ClassNames([
|
|
20
54
|
"offcanvas-bottom",
|
|
21
55
|
"offcanvas-end",
|
|
22
|
-
"offcanvas-start"
|
|
56
|
+
"offcanvas-start",
|
|
57
|
+
"offcanvas-top"
|
|
23
58
|
]);
|
|
24
59
|
|
|
25
60
|
/**
|
|
@@ -49,7 +84,8 @@ class _Offcanvas extends Base<IOffcanvasProps> implements IOffcanvas {
|
|
|
49
84
|
// Set the attributes
|
|
50
85
|
this.props.id ? this.el.id = this.props.id : null;
|
|
51
86
|
|
|
52
|
-
// Set the type
|
|
87
|
+
// Set the size & type
|
|
88
|
+
this.setSize(this.props.size);
|
|
53
89
|
this.setType(this.props.type);
|
|
54
90
|
|
|
55
91
|
// Get the options
|
|
@@ -174,16 +210,29 @@ class _Offcanvas extends Base<IOffcanvasProps> implements IOffcanvas {
|
|
|
174
210
|
this._autoClose ? this.configureAutoCloseEvent() : null;
|
|
175
211
|
}
|
|
176
212
|
|
|
213
|
+
// Sets the offcanvas size
|
|
214
|
+
setSize(offcanvasSize: number) {
|
|
215
|
+
// Parse the class names
|
|
216
|
+
OffcanvasSizeClassNames.parse(className => {
|
|
217
|
+
// Remove the class names
|
|
218
|
+
this.el.classList.remove(className);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
// Set the class name
|
|
222
|
+
let className = OffcanvasSizeClassNames.getByType(offcanvasSize);
|
|
223
|
+
if (className) { this.el.classList.add(className); }
|
|
224
|
+
}
|
|
225
|
+
|
|
177
226
|
// Sets the offcanvas type
|
|
178
227
|
setType(offcanvasType: number) {
|
|
179
228
|
// Parse the class names
|
|
180
|
-
|
|
229
|
+
OffcanvasTypesClassNames.parse(className => {
|
|
181
230
|
// Remove the class names
|
|
182
231
|
this.el.classList.remove(className);
|
|
183
232
|
});
|
|
184
233
|
|
|
185
234
|
// Set the class name
|
|
186
|
-
let className =
|
|
235
|
+
let className = OffcanvasTypesClassNames.getByType(offcanvasType) || OffcanvasTypesClassNames.getByType(OffcanvasTypes.End);
|
|
187
236
|
this.el.classList.add(className);
|
|
188
237
|
}
|
|
189
238
|
|
|
@@ -108,6 +108,7 @@ export interface IOffcanvasProps<T = Element> extends IBaseProps<IOffcanvas> {
|
|
|
108
108
|
onRenderBody?: (el?: HTMLDivElement, props?: IOffcanvasProps) => void;
|
|
109
109
|
onRenderHeader?: (el?: HTMLDivElement, props?: IOffcanvasProps) => void;
|
|
110
110
|
options?: IOffcanvasOptions;
|
|
111
|
+
size?: number;
|
|
111
112
|
title?: string | T;
|
|
112
113
|
type?: number;
|
|
113
114
|
}
|
|
@@ -135,6 +136,22 @@ export interface IOffcanvasOptions {
|
|
|
135
136
|
visible?: boolean;
|
|
136
137
|
}
|
|
137
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Offcanvas Size
|
|
141
|
+
*/
|
|
142
|
+
export type IOffcanvasSize = {
|
|
143
|
+
Small1: number;
|
|
144
|
+
Small2: number;
|
|
145
|
+
Small3: number;
|
|
146
|
+
Medium1: number;
|
|
147
|
+
Medium2: number;
|
|
148
|
+
Medium3: number;
|
|
149
|
+
Large1: number;
|
|
150
|
+
Large2: number;
|
|
151
|
+
Large3: number;
|
|
152
|
+
Full: number;
|
|
153
|
+
}
|
|
154
|
+
|
|
138
155
|
/**
|
|
139
156
|
* Offcanvas Types
|
|
140
157
|
*/
|
|
@@ -142,4 +159,5 @@ export type IOffcanvasTypes = {
|
|
|
142
159
|
Bottom: number;
|
|
143
160
|
End: number;
|
|
144
161
|
Start: number;
|
|
162
|
+
Top: number;
|
|
145
163
|
}
|