hanap-labs 0.1.11 → 0.1.12
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/dist/index.js +29 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plugins/themePlugin.d.ts +24 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,4 +3,32 @@ import { C as r, S as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as
|
|
|
3
3
|
import { n as E, r as D, t as O } from "./chunks/usePopup-Dt76ZiED.js";
|
|
4
4
|
import { t as k } from "./chunks/helpers-QkG7gR6t.js";
|
|
5
5
|
import { createToolkitAutoImportModules as A, createToolkitAutoImportOptions as j, createToolkitComponentsResolver as M } from "./auto-import/index.js";
|
|
6
|
-
|
|
6
|
+
//#region src/plugins/themePlugin.ts
|
|
7
|
+
var N = {
|
|
8
|
+
themeClass: "hanap-labs-theme",
|
|
9
|
+
autoInject: !0
|
|
10
|
+
};
|
|
11
|
+
function P(e = {}) {
|
|
12
|
+
let t = {
|
|
13
|
+
...N,
|
|
14
|
+
...e
|
|
15
|
+
};
|
|
16
|
+
if (typeof document > "u") return;
|
|
17
|
+
let n = document.body;
|
|
18
|
+
n.classList.contains(t.themeClass) || n.classList.add(t.themeClass);
|
|
19
|
+
}
|
|
20
|
+
function F(e = N.themeClass) {
|
|
21
|
+
typeof document > "u" || document.body.classList.remove(e);
|
|
22
|
+
}
|
|
23
|
+
var I = { install(e, ...t) {
|
|
24
|
+
let n = t[0] ?? {}, r = {
|
|
25
|
+
...N,
|
|
26
|
+
...n
|
|
27
|
+
};
|
|
28
|
+
r.autoInject && P(r), e.provide("hanapLabsTheme", {
|
|
29
|
+
inject: () => P(r),
|
|
30
|
+
remove: () => F(r.themeClass)
|
|
31
|
+
});
|
|
32
|
+
} };
|
|
33
|
+
//#endregion
|
|
34
|
+
export { i as AH_ICON_NAMES, T as HLAvatar, s as HLBreadcrumb, C as HLButton, d as HLCheckbox, u as HLGlobalNotify, c as HLGlobalPopup, w as HLIcon, f as HLInput, a as HLLabel, h as HLMenuAction, m as HLPopup, o as HLSelect, p as HLSkeleton, g as HLTable, y as HLTabs, x as HLTextarea, v as HLToast, I as HanapLabsThemePlugin, S as createNotifyPlugin, _ as createPopupPlugin, A as createToolkitAutoImportModules, j as createToolkitAutoImportOptions, M as createToolkitComponentsResolver, e as createUseQuery, k as formatLabel, r as getAHIconSvg, P as injectTheme, F as removeTheme, l as unmountNotifyHost, b as unmountPopupHost, D as useFloat, n as useForm, E as useNotify, O as usePopup, t as useQuery };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Plugin } from "vue";
|
|
2
|
+
export interface ThemePluginOptions {
|
|
3
|
+
/** CSS class to add to document body */
|
|
4
|
+
themeClass?: string;
|
|
5
|
+
/** Whether to auto-inject theme on install */
|
|
6
|
+
autoInject?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const defaultOptions: Required<ThemePluginOptions>;
|
|
9
|
+
/**
|
|
10
|
+
* Injects hanap-labs theme class to document body
|
|
11
|
+
* @param options - Plugin configuration options
|
|
12
|
+
*/
|
|
13
|
+
export declare function injectTheme(options?: ThemePluginOptions): void;
|
|
14
|
+
/**
|
|
15
|
+
* Removes hanap-labs theme class from document body
|
|
16
|
+
* @param themeClass - CSS class to remove (default: 'hanap-labs-theme')
|
|
17
|
+
*/
|
|
18
|
+
export declare function removeTheme(themeClass?: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Vue plugin for hanap-labs theme
|
|
21
|
+
* Automatically injects theme class to body on install
|
|
22
|
+
*/
|
|
23
|
+
export declare const HanapLabsThemePlugin: Plugin<ThemePluginOptions[]>;
|
|
24
|
+
export default HanapLabsThemePlugin;
|