second commit
This commit is contained in:
34
node_modules/flowbite/lib/esm/components/dial/index.d.ts
generated
vendored
Normal file
34
node_modules/flowbite/lib/esm/components/dial/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import type { DialOptions, DialTriggerType } from './types';
|
||||
import type { InstanceOptions } from '../../dom/types';
|
||||
import { DialInterface } from './interface';
|
||||
declare class Dial implements DialInterface {
|
||||
_instanceId: string;
|
||||
_parentEl: HTMLElement;
|
||||
_triggerEl: HTMLElement;
|
||||
_targetEl: HTMLElement;
|
||||
_options: DialOptions;
|
||||
_visible: boolean;
|
||||
_initialized: boolean;
|
||||
_showEventHandler: EventListenerOrEventListenerObject;
|
||||
_hideEventHandler: EventListenerOrEventListenerObject;
|
||||
constructor(parentEl?: HTMLElement | null, triggerEl?: HTMLElement | null, targetEl?: HTMLElement | null, options?: DialOptions, instanceOptions?: InstanceOptions);
|
||||
init(): void;
|
||||
destroy(): void;
|
||||
removeInstance(): void;
|
||||
destroyAndRemoveInstance(): void;
|
||||
hide(): void;
|
||||
show(): void;
|
||||
toggle(): void;
|
||||
isHidden(): boolean;
|
||||
isVisible(): boolean;
|
||||
_getTriggerEventTypes(triggerType: DialTriggerType): {
|
||||
showEvents: string[];
|
||||
hideEvents: string[];
|
||||
};
|
||||
updateOnShow(callback: () => void): void;
|
||||
updateOnHide(callback: () => void): void;
|
||||
updateOnToggle(callback: () => void): void;
|
||||
}
|
||||
export declare function initDials(): void;
|
||||
export default Dial;
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/flowbite/lib/esm/components/dial/index.d.ts.map
generated
vendored
Normal file
1
node_modules/flowbite/lib/esm/components/dial/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAe5C,cAAM,IAAK,YAAW,aAAa;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,kCAAkC,CAAC;IACtD,iBAAiB,EAAE,kCAAkC,CAAC;gBAGlD,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,SAAS,GAAE,WAAW,GAAG,IAAW,EACpC,QAAQ,GAAE,WAAW,GAAG,IAAW,EACnC,OAAO,GAAE,WAAqB,EAC9B,eAAe,GAAE,eAAwC;IAoB7D,IAAI;IA4BJ,OAAO;IAmBP,cAAc;IAId,wBAAwB;IAKxB,IAAI;IAWJ,IAAI;IAWJ,MAAM;IAQN,QAAQ;IAIR,SAAS;IAIT,qBAAqB,CAAC,WAAW,EAAE,eAAe;;;;IAyBlD,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI;IAIjC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI;CAGtC;AAED,wBAAgB,SAAS,SAgCxB;AAOD,eAAe,IAAI,CAAC"}
|
180
node_modules/flowbite/lib/esm/components/dial/index.js
generated
vendored
Normal file
180
node_modules/flowbite/lib/esm/components/dial/index.js
generated
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
import instances from '../../dom/instances';
|
||||
var Default = {
|
||||
triggerType: 'hover',
|
||||
onShow: function () { },
|
||||
onHide: function () { },
|
||||
onToggle: function () { },
|
||||
};
|
||||
var DefaultInstanceOptions = {
|
||||
id: null,
|
||||
override: true,
|
||||
};
|
||||
var Dial = /** @class */ (function () {
|
||||
function Dial(parentEl, triggerEl, targetEl, options, instanceOptions) {
|
||||
if (parentEl === void 0) { parentEl = null; }
|
||||
if (triggerEl === void 0) { triggerEl = null; }
|
||||
if (targetEl === void 0) { targetEl = null; }
|
||||
if (options === void 0) { options = Default; }
|
||||
if (instanceOptions === void 0) { instanceOptions = DefaultInstanceOptions; }
|
||||
this._instanceId = instanceOptions.id
|
||||
? instanceOptions.id
|
||||
: targetEl.id;
|
||||
this._parentEl = parentEl;
|
||||
this._triggerEl = triggerEl;
|
||||
this._targetEl = targetEl;
|
||||
this._options = __assign(__assign({}, Default), options);
|
||||
this._visible = false;
|
||||
this._initialized = false;
|
||||
this.init();
|
||||
instances.addInstance('Dial', this, this._instanceId, instanceOptions.override);
|
||||
}
|
||||
Dial.prototype.init = function () {
|
||||
var _this = this;
|
||||
if (this._triggerEl && this._targetEl && !this._initialized) {
|
||||
var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType);
|
||||
this._showEventHandler = function () {
|
||||
_this.show();
|
||||
};
|
||||
triggerEventTypes.showEvents.forEach(function (ev) {
|
||||
_this._triggerEl.addEventListener(ev, _this._showEventHandler);
|
||||
_this._targetEl.addEventListener(ev, _this._showEventHandler);
|
||||
});
|
||||
this._hideEventHandler = function () {
|
||||
if (!_this._parentEl.matches(':hover')) {
|
||||
_this.hide();
|
||||
}
|
||||
};
|
||||
triggerEventTypes.hideEvents.forEach(function (ev) {
|
||||
_this._parentEl.addEventListener(ev, _this._hideEventHandler);
|
||||
});
|
||||
this._initialized = true;
|
||||
}
|
||||
};
|
||||
Dial.prototype.destroy = function () {
|
||||
var _this = this;
|
||||
if (this._initialized) {
|
||||
var triggerEventTypes = this._getTriggerEventTypes(this._options.triggerType);
|
||||
triggerEventTypes.showEvents.forEach(function (ev) {
|
||||
_this._triggerEl.removeEventListener(ev, _this._showEventHandler);
|
||||
_this._targetEl.removeEventListener(ev, _this._showEventHandler);
|
||||
});
|
||||
triggerEventTypes.hideEvents.forEach(function (ev) {
|
||||
_this._parentEl.removeEventListener(ev, _this._hideEventHandler);
|
||||
});
|
||||
this._initialized = false;
|
||||
}
|
||||
};
|
||||
Dial.prototype.removeInstance = function () {
|
||||
instances.removeInstance('Dial', this._instanceId);
|
||||
};
|
||||
Dial.prototype.destroyAndRemoveInstance = function () {
|
||||
this.destroy();
|
||||
this.removeInstance();
|
||||
};
|
||||
Dial.prototype.hide = function () {
|
||||
this._targetEl.classList.add('hidden');
|
||||
if (this._triggerEl) {
|
||||
this._triggerEl.setAttribute('aria-expanded', 'false');
|
||||
}
|
||||
this._visible = false;
|
||||
// callback function
|
||||
this._options.onHide(this);
|
||||
};
|
||||
Dial.prototype.show = function () {
|
||||
this._targetEl.classList.remove('hidden');
|
||||
if (this._triggerEl) {
|
||||
this._triggerEl.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
this._visible = true;
|
||||
// callback function
|
||||
this._options.onShow(this);
|
||||
};
|
||||
Dial.prototype.toggle = function () {
|
||||
if (this._visible) {
|
||||
this.hide();
|
||||
}
|
||||
else {
|
||||
this.show();
|
||||
}
|
||||
};
|
||||
Dial.prototype.isHidden = function () {
|
||||
return !this._visible;
|
||||
};
|
||||
Dial.prototype.isVisible = function () {
|
||||
return this._visible;
|
||||
};
|
||||
Dial.prototype._getTriggerEventTypes = function (triggerType) {
|
||||
switch (triggerType) {
|
||||
case 'hover':
|
||||
return {
|
||||
showEvents: ['mouseenter', 'focus'],
|
||||
hideEvents: ['mouseleave', 'blur'],
|
||||
};
|
||||
case 'click':
|
||||
return {
|
||||
showEvents: ['click', 'focus'],
|
||||
hideEvents: ['focusout', 'blur'],
|
||||
};
|
||||
case 'none':
|
||||
return {
|
||||
showEvents: [],
|
||||
hideEvents: [],
|
||||
};
|
||||
default:
|
||||
return {
|
||||
showEvents: ['mouseenter', 'focus'],
|
||||
hideEvents: ['mouseleave', 'blur'],
|
||||
};
|
||||
}
|
||||
};
|
||||
Dial.prototype.updateOnShow = function (callback) {
|
||||
this._options.onShow = callback;
|
||||
};
|
||||
Dial.prototype.updateOnHide = function (callback) {
|
||||
this._options.onHide = callback;
|
||||
};
|
||||
Dial.prototype.updateOnToggle = function (callback) {
|
||||
this._options.onToggle = callback;
|
||||
};
|
||||
return Dial;
|
||||
}());
|
||||
export function initDials() {
|
||||
document.querySelectorAll('[data-dial-init]').forEach(function ($parentEl) {
|
||||
var $triggerEl = $parentEl.querySelector('[data-dial-toggle]');
|
||||
if ($triggerEl) {
|
||||
var dialId = $triggerEl.getAttribute('data-dial-toggle');
|
||||
var $dialEl = document.getElementById(dialId);
|
||||
if ($dialEl) {
|
||||
var triggerType = $triggerEl.getAttribute('data-dial-trigger');
|
||||
new Dial($parentEl, $triggerEl, $dialEl, {
|
||||
triggerType: triggerType
|
||||
? triggerType
|
||||
: Default.triggerType,
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.error("Dial with id ".concat(dialId, " does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.error("Dial with id ".concat($parentEl.id, " does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"));
|
||||
}
|
||||
});
|
||||
}
|
||||
if (typeof window !== 'undefined') {
|
||||
window.Dial = Dial;
|
||||
window.initDials = initDials;
|
||||
}
|
||||
export default Dial;
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/flowbite/lib/esm/components/dial/index.js.map
generated
vendored
Normal file
1
node_modules/flowbite/lib/esm/components/dial/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
19
node_modules/flowbite/lib/esm/components/dial/interface.d.ts
generated
vendored
Normal file
19
node_modules/flowbite/lib/esm/components/dial/interface.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
import { DialOptions, DialTriggerEventTypes, DialTriggerType } from './types';
|
||||
export declare interface DialInterface {
|
||||
_parentEl: HTMLElement;
|
||||
_triggerEl: HTMLElement;
|
||||
_targetEl: HTMLElement;
|
||||
_options: DialOptions;
|
||||
_visible: boolean;
|
||||
init(): void;
|
||||
isVisible(): boolean;
|
||||
isHidden(): boolean;
|
||||
hide(): void;
|
||||
show(): void;
|
||||
toggle(): void;
|
||||
_getTriggerEventTypes(triggerType: DialTriggerType): DialTriggerEventTypes;
|
||||
destroy(): void;
|
||||
removeInstance(): void;
|
||||
destroyAndRemoveInstance(): void;
|
||||
}
|
||||
//# sourceMappingURL=interface.d.ts.map
|
1
node_modules/flowbite/lib/esm/components/dial/interface.d.ts.map
generated
vendored
Normal file
1
node_modules/flowbite/lib/esm/components/dial/interface.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9E,MAAM,CAAC,OAAO,WAAW,aAAa;IAClC,SAAS,EAAE,WAAW,CAAC;IACvB,UAAU,EAAE,WAAW,CAAC;IACxB,SAAS,EAAE,WAAW,CAAC;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAElB,IAAI,IAAI,IAAI,CAAC;IACb,SAAS,IAAI,OAAO,CAAC;IACrB,QAAQ,IAAI,OAAO,CAAC;IACpB,IAAI,IAAI,IAAI,CAAC;IACb,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,IAAI,CAAC;IACf,qBAAqB,CAAC,WAAW,EAAE,eAAe,GAAG,qBAAqB,CAAC;IAE3E,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;IACvB,wBAAwB,IAAI,IAAI,CAAC;CACpC"}
|
2
node_modules/flowbite/lib/esm/components/dial/interface.js
generated
vendored
Normal file
2
node_modules/flowbite/lib/esm/components/dial/interface.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=interface.js.map
|
1
node_modules/flowbite/lib/esm/components/dial/interface.js.map
generated
vendored
Normal file
1
node_modules/flowbite/lib/esm/components/dial/interface.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../../src/components/dial/interface.ts"],"names":[],"mappings":""}
|
13
node_modules/flowbite/lib/esm/components/dial/types.d.ts
generated
vendored
Normal file
13
node_modules/flowbite/lib/esm/components/dial/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import { DialInterface } from './interface';
|
||||
export declare type DialTriggerType = 'click' | 'hover' | 'none';
|
||||
export declare type DialTriggerEventTypes = {
|
||||
showEvents: string[];
|
||||
hideEvents: string[];
|
||||
};
|
||||
export declare type DialOptions = {
|
||||
triggerType?: DialTriggerType;
|
||||
onShow?: (dial: DialInterface) => void;
|
||||
onHide?: (dial: DialInterface) => void;
|
||||
onToggle?: (dial: DialInterface) => void;
|
||||
};
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/flowbite/lib/esm/components/dial/types.d.ts.map
generated
vendored
Normal file
1
node_modules/flowbite/lib/esm/components/dial/types.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,CAAC,OAAO,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,MAAM,CAAC,OAAO,MAAM,qBAAqB,GAAG;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,WAAW,GAAG;IAC9B,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;CAC5C,CAAC"}
|
2
node_modules/flowbite/lib/esm/components/dial/types.js
generated
vendored
Normal file
2
node_modules/flowbite/lib/esm/components/dial/types.js
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
1
node_modules/flowbite/lib/esm/components/dial/types.js.map
generated
vendored
Normal file
1
node_modules/flowbite/lib/esm/components/dial/types.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/dial/types.ts"],"names":[],"mappings":""}
|
Reference in New Issue
Block a user