gd-bs 5.7.1 → 5.7.4

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/post-build.js CHANGED
@@ -1,6 +1,12 @@
1
1
  var fs = require('fs');
2
2
 
3
- // Copy the popper library
3
+ // Delete the txt file
4
+ fs.rmSync("./build/tippy.js.LICENSE.txt");
5
+
6
+ // Log
7
+ console.log("Successfully removed the webpack output txt file.");
8
+
9
+ // Copy the type definition file
4
10
  fs.copyFileSync("src/icons/svgs/index.d.ts", "build/icons/svgs/index.d.ts");
5
11
 
6
12
  // Log
package/pre-build.js ADDED
@@ -0,0 +1,30 @@
1
+ var fs = require('fs');
2
+
3
+ // Deletes a directory
4
+ function deleteDirectory(src) {
5
+ // Ensure the directory exists
6
+ if (fs.existsSync(src) && fs.lstatSync(src).isDirectory()) {
7
+ // Get each item in the directory
8
+ fs.readdirSync(src).forEach(function(item) {
9
+ var srcPath = src + "/" + item;
10
+
11
+ // See if this is a directory
12
+ if (fs.lstatSync(srcPath).isDirectory()) {
13
+ // Delete the folder recursively
14
+ deleteDirectory(srcPath);
15
+ } else {
16
+ // Delete the file
17
+ fs.unlinkSync(srcPath);
18
+ }
19
+ });
20
+
21
+ // Delete the directory
22
+ fs.rmdirSync(src);
23
+ }
24
+ };
25
+
26
+ // Log
27
+ console.log("Removing the tippy.js build directory");
28
+
29
+ // Delete the folders
30
+ deleteDirectory("./build/tippy.js");
@@ -1,5 +1,5 @@
1
- import tippy, { Instance, animateFill, followCursor, inlinePositioning, sticky } from "tippy.js";
2
- import { ITippyProps } from "../../types";
1
+ import tippy, { animateFill, followCursor, inlinePositioning, sticky } from "../../tippy.js";
2
+ import { ITippyProps } from "../types";
3
3
  import { IPopover, IPopoverProps } from "./types";
4
4
  import { Button } from "../button";
5
5
  import { Base } from "../base";
@@ -48,7 +48,7 @@ export enum PopoverPlacements {
48
48
  */
49
49
  class _Popover extends Base<IPopoverProps> implements IPopover {
50
50
  private _elContent: HTMLDivElement = null;
51
- private _tippy: Instance = null;
51
+ private _tippy = null;
52
52
 
53
53
  // Constructor
54
54
  constructor(props: IPopoverProps, template: string = "") {
@@ -243,7 +243,7 @@ class _Popover extends Base<IPopoverProps> implements IPopover {
243
243
  }
244
244
 
245
245
  // Create the tippy
246
- this._tippy = tippy(this.el, options as any) as any;
246
+ this._tippy = tippy(this.el, options);
247
247
  }
248
248
 
249
249
  /**
@@ -55,15 +55,14 @@ export const Popover: (props: IPopoverProps, template?: string) => IPopover;
55
55
  /**
56
56
  * Popover Placements
57
57
  */
58
- export const PopoverPlacements: IPopoverPlacements;
58
+ export const PopoverPlacements: IPopoverPlacements;
59
59
 
60
60
  /**
61
61
  * Popover Types
62
62
  */
63
63
  export const PopoverTypes: IPopoverTypes;
64
64
 
65
- import { IBaseProps } from "../types";
66
- import { ITippyProps } from "../../types";
65
+ import { IBaseProps, ITippyProps } from "../types";
67
66
  import { IButtonProps } from "../button/types";
68
67
 
69
68
  /**
@@ -108,7 +107,7 @@ export interface IPopoverProps extends IBaseProps<IPopover> {
108
107
  /**
109
108
  * Popover Types
110
109
  */
111
- export type IPopoverTypes = {
110
+ export type IPopoverTypes = {
112
111
  Danger: number;
113
112
  Dark: number;
114
113
  Info: number;
@@ -125,7 +124,7 @@ export interface IPopoverProps extends IBaseProps<IPopover> {
125
124
  /**
126
125
  * Popover Placements
127
126
  */
128
- export type IPopoverPlacements = {
127
+ export type IPopoverPlacements = {
129
128
  Auto: number;
130
129
  AutoStart: number;
131
130
  AutoEnd: number;
@@ -1,5 +1,5 @@
1
- import tippy, { Instance, animateFill, followCursor, inlinePositioning, sticky } from "tippy.js";
2
- import { ITippyProps } from "../../types";
1
+ import tippy, { animateFill, followCursor, inlinePositioning, sticky } from "../../tippy.js";
2
+ import { ITippyProps } from "../types";
3
3
  import { ITooltip, ITooltipProps } from "./types";
4
4
  import { IButton } from "../button/types";
5
5
  import { Base } from "../base";
@@ -50,7 +50,7 @@ export enum TooltipPlacements {
50
50
  class _Tooltip extends Base<ITooltipProps> {
51
51
  private _btn: IButton = null;
52
52
  private _elContent: HTMLElement = null;
53
- private _tippy: Instance = null;
53
+ private _tippy = null;
54
54
 
55
55
  // Constructor
56
56
  constructor(props: ITooltipProps, template: string = "") {
@@ -294,7 +294,7 @@ class _Tooltip extends Base<ITooltipProps> {
294
294
  }
295
295
 
296
296
  // Create the tippy
297
- this._tippy = tippy(this.props.target || this.el, options as any) as any;
297
+ this._tippy = tippy(this.props.target || this.el, options);
298
298
  }
299
299
 
300
300
  /**
@@ -51,8 +51,7 @@ export const TooltipPlacements: ITooltipPlacements;
51
51
  */
52
52
  export const TooltipTypes: ITooltipTypes;
53
53
 
54
- import { IBaseProps } from "../types";
55
- import { ITippyProps } from "../../types";
54
+ import { IBaseProps, ITippyProps } from "../types";
56
55
  import { IButtonProps, IButton } from "../button/types";
57
56
 
58
57
  /**
@@ -40,8 +40,7 @@
40
40
  */
41
41
  export const TooltipGroup: (props: ITooltipGroupProps, template?: string, btnTemplate?: string) => ITooltipGroup;
42
42
 
43
- import { ITippyProps } from "../../types";
44
- import { IBaseProps } from "../types";
43
+ import { IBaseProps, ITippyProps } from "../types";
45
44
  import { ITooltip, ITooltipProps } from "../tooltip/types";
46
45
 
47
46
  /**
@@ -30,4 +30,51 @@ export interface IBaseProps<IBaseObj = any> {
30
30
 
31
31
  /** The element to render the component to. */
32
32
  el?: Element | HTMLElement;
33
+ }
34
+
35
+ /** Tippy Options */
36
+ export interface ITippyProps {
37
+ allowHTML?: boolean;
38
+ animateFill?: boolean;
39
+ animation?: string | boolean;
40
+ appendTo?: Element;
41
+ aria?: object;
42
+ arrow?: boolean | string | SVGElement | DocumentFragment;
43
+ content?: string | Element;
44
+ delay?: number | [number | null, number | null];
45
+ duration?: number | [number | null, number | null];
46
+ followCursor?: boolean | 'horizontal' | 'vertical' | 'initial';
47
+ hideOnClick?: boolean | 'toggle';
48
+ ignoreAttributes?: boolean;
49
+ inertia?: boolean;
50
+ inlinePositioning?: boolean;
51
+ interactive?: boolean;
52
+ interactiveBorder?: number;
53
+ interactiveDebounce?: number;
54
+ maxWidth?: number | string;
55
+ moveTransition?: string;
56
+ offset?: number[];
57
+ onAfterUpdate?: (tippyObj?, props?) => void;
58
+ onBeforeUpdate?: (tippyObj?, props?) => void;
59
+ onClickOutside?: (tippyObj?, ev?) => void;
60
+ onCreate?: (tippyObj?) => void;
61
+ onDestroy?: (tippyObj?) => void;
62
+ onHidden?: (tippyObj?) => void;
63
+ onHide?: (tippyObj?) => void;
64
+ onMount?: (tippyObj?) => void;
65
+ onShow?: (tippyObj?) => void;
66
+ onShown?: (tippyObj?) => void;
67
+ onTrigger?: (tippyObj?, ev?) => void;
68
+ onUntrigger?: (tippyObj?, ev?) => void;
69
+ placement?: string;
70
+ plugins?: any[];
71
+ popperOptions?: object;
72
+ role?: string;
73
+ showOnCreate?: boolean;
74
+ sticky?: boolean | 'reference' | 'popper';
75
+ theme?: string;
76
+ touch?: boolean | 'hold' | ['hold', number];
77
+ trigger?: string;
78
+ triggerTarget?: Element | Element[] | null;
79
+ zIndex?: number;
33
80
  }
@@ -9,7 +9,7 @@ import * as Components from "./components";
9
9
  export { Components }
10
10
 
11
11
  // TippyJS library
12
- import tippy from "tippy.js";
12
+ import tippy from "./tippy.js";
13
13
  export { tippy }
14
14
 
15
15
  // Icons
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ import * as Components from "./components";
9
9
  export { Components }
10
10
 
11
11
  // TippyJS library
12
- import * as tippy from "tippy.js";
12
+ import tippy from "./tippy.js";
13
13
  export { tippy }
14
14
 
15
15
  // Bootstrap Global library
@@ -0,0 +1,14 @@
1
+ const tippy = require("./tippy.js");
2
+
3
+ // Plugins
4
+ export const animateFill = tippy.animateFill;
5
+ export const createSingleton = tippy.createSingleton;
6
+ export const delegate = tippy.delegate;
7
+ export const followCursor = tippy.followCursor;
8
+ export const hideAll = tippy.hideAll;
9
+ export const inlinePositioning = tippy.inlinePositioning;
10
+ export const roundArrow = tippy.roundArrow;
11
+ export const sticky = tippy.sticky;
12
+
13
+ // Default
14
+ export default tippy;