@bikiran/utils 1.18.0
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/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/components/Profile/LoginBtn.d.ts +8 -0
- package/dist/components/Profile/LoginBtn.js +13 -0
- package/dist/components/Profile/ProfileManage.d.ts +12 -0
- package/dist/components/Profile/ProfileManage.js +45 -0
- package/dist/components/Profile/ProfileMenuList.d.ts +5 -0
- package/dist/components/Profile/ProfileMenuList.js +32 -0
- package/dist/components/Profile/ProfileMenuPopup.d.ts +12 -0
- package/dist/components/Profile/ProfileMenuPopup.js +26 -0
- package/dist/components/Profile/ProfileUserInformation.d.ts +8 -0
- package/dist/components/Profile/ProfileUserInformation.js +9 -0
- package/dist/components/Profile/ProfileView.d.ts +14 -0
- package/dist/components/Profile/ProfileView.js +9 -0
- package/dist/components/Profile/authTypes.d.ts +21 -0
- package/dist/components/Profile/authTypes.js +1 -0
- package/dist/components/Profile/authTypes.ts +22 -0
- package/dist/components/Profile/icons.d.ts +9 -0
- package/dist/components/Profile/icons.js +33 -0
- package/dist/components/Profile/style/LoginBtn.module.css +6 -0
- package/dist/components/Profile/style/ProfileManage.module.css +6 -0
- package/dist/components/Profile/style/ProfileMenuList.module.css +50 -0
- package/dist/components/Profile/style/ProfileMenuPopup.module.css +30 -0
- package/dist/components/Profile/style/ProfileUserInformation.module.css +26 -0
- package/dist/components/Profile/style/ProfileView.module.css +12 -0
- package/dist/components/button-wrapper/ButtonWrapper.d.ts +14 -0
- package/dist/components/button-wrapper/ButtonWrapper.js +11 -0
- package/dist/components/button-wrapper/icons/icon.d.ts +1 -0
- package/dist/components/button-wrapper/icons/icon.js +4 -0
- package/dist/components/button-wrapper/style/style.module.css +18 -0
- package/dist/components/cookie-accept-popup/CookiesAcceptPopup.d.ts +2 -0
- package/dist/components/cookie-accept-popup/CookiesAcceptPopup.js +28 -0
- package/dist/components/cookie-accept-popup/style/CookieAcceptPopup.module.css +12 -0
- package/dist/components/copy-wrapper/CopyWrapper.d.ts +6 -0
- package/dist/components/copy-wrapper/CopyWrapper.js +9 -0
- package/dist/components/copy-wrapper/icon/icons.d.ts +2 -0
- package/dist/components/copy-wrapper/icon/icons.js +7 -0
- package/dist/components/currency-selector/CurrencySelector.d.ts +14 -0
- package/dist/components/currency-selector/CurrencySelector.js +47 -0
- package/dist/components/currency-selector/style/CurrencySelector.module.css +28 -0
- package/dist/components/custom-sidebar/CustomSidebar.d.ts +15 -0
- package/dist/components/custom-sidebar/CustomSidebar.js +29 -0
- package/dist/components/custom-sidebar/icons.d.ts +3 -0
- package/dist/components/custom-sidebar/icons.js +7 -0
- package/dist/components/custom-sidebar/style/CustomSidebar.module.css +21 -0
- package/dist/components/filter-wrapper/FilterBarWrapper.d.ts +12 -0
- package/dist/components/filter-wrapper/FilterBarWrapper.js +85 -0
- package/dist/components/filter-wrapper/SearchInput.d.ts +10 -0
- package/dist/components/filter-wrapper/SearchInput.js +8 -0
- package/dist/components/filter-wrapper/icons/Icons.d.ts +2 -0
- package/dist/components/filter-wrapper/icons/Icons.js +7 -0
- package/dist/components/filter-wrapper/style/FilterBarWrapper.module.css +41 -0
- package/dist/components/header/FixedHeaderControl.d.ts +7 -0
- package/dist/components/header/FixedHeaderControl.js +23 -0
- package/dist/components/header/HeaderLoginColumnComp.d.ts +25 -0
- package/dist/components/header/HeaderLoginColumnComp.js +36 -0
- package/dist/components/header/HeaderLogoComp.d.ts +6 -0
- package/dist/components/header/HeaderLogoComp.js +6 -0
- package/dist/components/header/HeaderSection.d.ts +21 -0
- package/dist/components/header/HeaderSection.js +27 -0
- package/dist/components/header/HeaderServiceBtnComp.d.ts +10 -0
- package/dist/components/header/HeaderServiceBtnComp.js +17 -0
- package/dist/components/header/HeaderToggleMenuComp.d.ts +9 -0
- package/dist/components/header/HeaderToggleMenuComp.js +16 -0
- package/dist/components/header/NavbarComp.d.ts +11 -0
- package/dist/components/header/NavbarComp.js +46 -0
- package/dist/components/header/header.css +61 -0
- package/dist/components/header/headerType.d.ts +14 -0
- package/dist/components/header/headerType.js +1 -0
- package/dist/components/header/headerType.ts +15 -0
- package/dist/components/header/icons/icon-about-us-submenu.svg +6 -0
- package/dist/components/header/icons/icon-about-us.svg +5 -0
- package/dist/components/header/icons/icon-all-service.svg +11 -0
- package/dist/components/header/icons/icon-arrow-v2.svg +3 -0
- package/dist/components/header/icons/icon-bell-fill.svg +3 -0
- package/dist/components/header/icons/icon-bik-logo.svg +13 -0
- package/dist/components/header/icons/icon-contacts.svg +6 -0
- package/dist/components/header/icons/icon-domain.svg +4 -0
- package/dist/components/header/icons/icon-hosting.svg +5 -0
- package/dist/components/header/icons/icon-our-clients.svg +4 -0
- package/dist/components/header/icons/icons.d.ts +14 -0
- package/dist/components/header/icons/icons.js +27 -0
- package/dist/components/header/sidebar/SidebarConstants.d.ts +0 -0
- package/dist/components/header/sidebar/SidebarConstants.js +55 -0
- package/dist/components/header/sidebar/SidebarConstants.ts +55 -0
- package/dist/components/header/sidebar/SidebarIcons.d.ts +5 -0
- package/dist/components/header/sidebar/SidebarIcons.js +9 -0
- package/dist/components/header/sidebar/SidebarMenu.d.ts +12 -0
- package/dist/components/header/sidebar/SidebarMenu.js +28 -0
- package/dist/components/header/sidebar/SidebarMenuRow.d.ts +10 -0
- package/dist/components/header/sidebar/SidebarMenuRow.js +32 -0
- package/dist/components/header/sidebar/SidebarSubMenu.d.ts +9 -0
- package/dist/components/header/sidebar/SidebarSubMenu.js +14 -0
- package/dist/components/header/sidebar/SidebarTopRow.d.ts +0 -0
- package/dist/components/header/sidebar/SidebarTopRow.js +100 -0
- package/dist/components/header/sidebar/sidebarStyle.css +32 -0
- package/dist/components/information-tooltip/InformationTooltip.d.ts +11 -0
- package/dist/components/information-tooltip/InformationTooltip.js +27 -0
- package/dist/components/information-tooltip/icons.d.ts +6 -0
- package/dist/components/information-tooltip/icons.js +10 -0
- package/dist/components/information-tooltip/style/InfoTooltip.module.css +62 -0
- package/dist/components/loading-comp/LoadingComp.d.ts +2 -0
- package/dist/components/loading-comp/LoadingComp.js +7 -0
- package/dist/components/loading-comp/style/LoadingComp.module.css +3 -0
- package/dist/components/pageLoading/PageLoading.d.ts +2 -0
- package/dist/components/pageLoading/PageLoading.js +6 -0
- package/dist/components/pageLoading/style/PageLoading.module.css +7 -0
- package/dist/components/pagination2/Pagination.d.ts +18 -0
- package/dist/components/pagination2/Pagination.js +40 -0
- package/dist/components/pagination2/style/Pagination.module.css +27 -0
- package/dist/components/project-selector/ProjectListBody.d.ts +9 -0
- package/dist/components/project-selector/ProjectListBody.js +10 -0
- package/dist/components/project-selector/ProjectListPopup.d.ts +12 -0
- package/dist/components/project-selector/ProjectListPopup.js +31 -0
- package/dist/components/project-selector/ProjectSelector.d.ts +11 -0
- package/dist/components/project-selector/ProjectSelector.js +38 -0
- package/dist/components/project-selector/ProjectSelectorSkeleton.d.ts +3 -0
- package/dist/components/project-selector/ProjectSelectorSkeleton.js +6 -0
- package/dist/components/project-selector/ProjectServiceTabs.d.ts +0 -0
- package/dist/components/project-selector/ProjectServiceTabs.js +28 -0
- package/dist/components/project-selector/ProjectServices.d.ts +3 -0
- package/dist/components/project-selector/ProjectServices.js +12 -0
- package/dist/components/project-selector/SelectorMainComp.d.ts +8 -0
- package/dist/components/project-selector/SelectorMainComp.js +6 -0
- package/dist/components/project-selector/projectConstants.d.ts +2 -0
- package/dist/components/project-selector/projectConstants.js +20 -0
- package/dist/components/project-selector/projectConstants.ts +23 -0
- package/dist/components/project-selector/projectTypes.d.ts +22 -0
- package/dist/components/project-selector/projectTypes.js +1 -0
- package/dist/components/project-selector/projectTypes.ts +22 -0
- package/dist/components/project-selector/selector-icons/icon-arrow-down.svg +3 -0
- package/dist/components/project-selector/selector-icons/icon-default-app.svg +9 -0
- package/dist/components/project-selector/selector-icons/selectorIcons.d.ts +4 -0
- package/dist/components/project-selector/selector-icons/selectorIcons.js +6 -0
- package/dist/components/services-popup/ServiceAppType.d.ts +9 -0
- package/dist/components/services-popup/ServiceAppType.js +1 -0
- package/dist/components/services-popup/ServiceAppType.ts +10 -0
- package/dist/components/services-popup/ServicesPopup.d.ts +19 -0
- package/dist/components/services-popup/ServicesPopup.js +35 -0
- package/dist/components/services-popup/components/AppAccount.d.ts +7 -0
- package/dist/components/services-popup/components/AppAccount.js +8 -0
- package/dist/components/services-popup/components/ServiceApp.d.ts +8 -0
- package/dist/components/services-popup/components/ServiceApp.js +6 -0
- package/dist/components/services-popup/icons/Icons.d.ts +5 -0
- package/dist/components/services-popup/icons/Icons.js +8 -0
- package/dist/components/services-popup/icons/icon-account.svg +7 -0
- package/dist/components/services-popup/icons/icon-cross.svg +3 -0
- package/dist/components/services-popup/icons/icon-default-app.svg +9 -0
- package/dist/components/user-info/TooltipUserInfo.d.ts +8 -0
- package/dist/components/user-info/TooltipUserInfo.js +29 -0
- package/dist/components/user-info/UserInfoComp.d.ts +8 -0
- package/dist/components/user-info/UserInfoComp.js +7 -0
- package/dist/components/user-info/icons/icons.d.ts +1 -0
- package/dist/components/user-info/icons/icons.js +4 -0
- package/dist/components/user-info/style/ToolTipUserInfo.module.css +28 -0
- package/dist/declaration.d.ts +9 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +15 -0
- package/dist/index.ts +15 -0
- package/dist/lib/Skeleton.d.ts +4 -0
- package/dist/lib/Skeleton.js +18 -0
- package/dist/lib/types/GlobalType.d.ts +9 -0
- package/dist/lib/types/GlobalType.js +1 -0
- package/dist/lib/types/GlobalType.ts +17 -0
- package/dist/lib/utils/Cookie.d.ts +11 -0
- package/dist/lib/utils/Cookie.js +46 -0
- package/dist/lib/utils/Cookie.ts +58 -0
- package/dist/lib/utils/Copy.d.ts +5 -0
- package/dist/lib/utils/Copy.js +32 -0
- package/dist/lib/utils/Copy.ts +37 -0
- package/dist/lib/utils/Env.d.ts +35 -0
- package/dist/lib/utils/Env.js +190 -0
- package/dist/lib/utils/Env.ts +236 -0
- package/dist/lib/utils/capitalizeFirstLetter.d.ts +2 -0
- package/dist/lib/utils/capitalizeFirstLetter.js +7 -0
- package/dist/lib/utils/capitalizeFirstLetter.ts +7 -0
- package/dist/lib/utils/cn.d.ts +2 -0
- package/dist/lib/utils/cn.js +3 -0
- package/dist/lib/utils/cn.ts +4 -0
- package/dist/lib/utils/option.d.ts +10 -0
- package/dist/lib/utils/option.js +6 -0
- package/dist/lib/utils/option.ts +7 -0
- package/dist/package.json +1 -0
- package/package.json +60 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as Pagination } from "./components/pagination2/Pagination";
|
|
2
|
+
export { default as FilterBarWrapper } from "./components/filter-wrapper/FilterBarWrapper";
|
|
3
|
+
export { default as ServicesPopup } from "./components/services-popup/ServicesPopup";
|
|
4
|
+
export { default as ButtonWrapper } from "./components/button-wrapper/ButtonWrapper";
|
|
5
|
+
export { default as CurrencySelector } from "./components/currency-selector/CurrencySelector";
|
|
6
|
+
export { default as CustomSidebar } from "./components/custom-sidebar/CustomSidebar";
|
|
7
|
+
export { default as PageLoading } from "./components/pageLoading/PageLoading";
|
|
8
|
+
export { default as LoadingComp } from "./components/loading-comp/LoadingComp";
|
|
9
|
+
export { default as CookiesAcceptPopup } from "./components/cookie-accept-popup/CookiesAcceptPopup";
|
|
10
|
+
export { default as ProfileManage } from "./components/Profile/ProfileManage";
|
|
11
|
+
export { default as TooltipUserInfo } from "./components/user-info/TooltipUserInfo";
|
|
12
|
+
export { default as UserInfoComp } from "./components/user-info/UserInfoComp";
|
|
13
|
+
export { default as ProjectSelector } from "./components/project-selector/ProjectSelector";
|
|
14
|
+
export { default as InformationTooltip } from "./components/information-tooltip/InformationTooltip";
|
|
15
|
+
export { default as CopyWrapper } from "./components/copy-wrapper/CopyWrapper";
|
package/dist/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as Pagination } from "./components/pagination2/Pagination";
|
|
2
|
+
export { default as FilterBarWrapper } from "./components/filter-wrapper/FilterBarWrapper";
|
|
3
|
+
export { default as ServicesPopup } from "./components/services-popup/ServicesPopup";
|
|
4
|
+
export { default as ButtonWrapper } from "./components/button-wrapper/ButtonWrapper";
|
|
5
|
+
export { default as CurrencySelector } from "./components/currency-selector/CurrencySelector";
|
|
6
|
+
export { default as CustomSidebar } from "./components/custom-sidebar/CustomSidebar";
|
|
7
|
+
export { default as PageLoading } from "./components/pageLoading/PageLoading";
|
|
8
|
+
export { default as LoadingComp } from "./components/loading-comp/LoadingComp";
|
|
9
|
+
export { default as CookiesAcceptPopup } from "./components/cookie-accept-popup/CookiesAcceptPopup";
|
|
10
|
+
export { default as ProfileManage } from "./components/Profile/ProfileManage";
|
|
11
|
+
export { default as TooltipUserInfo } from "./components/user-info/TooltipUserInfo";
|
|
12
|
+
export { default as UserInfoComp } from "./components/user-info/UserInfoComp";
|
|
13
|
+
export { default as ProjectSelector } from "./components/project-selector/ProjectSelector";
|
|
14
|
+
export { default as InformationTooltip } from "./components/information-tooltip/InformationTooltip";
|
|
15
|
+
export { default as CopyWrapper } from "./components/copy-wrapper/CopyWrapper";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { cn } from "./utils/cn";
|
|
14
|
+
const Skeleton = (_a) => {
|
|
15
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
16
|
+
return (_jsx("div", Object.assign({ className: cn("animate-pulse rounded-md bg-primary-100", className) }, props)));
|
|
17
|
+
};
|
|
18
|
+
export { Skeleton };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type TInputChangeEvent = React.ChangeEvent<HTMLInputElement>;
|
|
3
|
+
export type TTextAreaChangeEvent = React.ChangeEvent<HTMLTextAreaElement>;
|
|
4
|
+
export type TMouseEvent = React.MouseEvent<HTMLButtonElement>;
|
|
5
|
+
export type TFormEvent = React.FormEvent<HTMLFormElement>;
|
|
6
|
+
export type TKeyboardEvent = React.KeyboardEvent<HTMLInputElement>;
|
|
7
|
+
export type TFocusEvent = React.FocusEvent<HTMLInputElement>;
|
|
8
|
+
export type TDragEvent = React.DragEvent<HTMLDivElement>;
|
|
9
|
+
export type TState<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export type TInputChangeEvent = React.ChangeEvent<HTMLInputElement>;
|
|
4
|
+
|
|
5
|
+
export type TTextAreaChangeEvent = React.ChangeEvent<HTMLTextAreaElement>;
|
|
6
|
+
|
|
7
|
+
export type TMouseEvent = React.MouseEvent<HTMLButtonElement>;
|
|
8
|
+
|
|
9
|
+
export type TFormEvent = React.FormEvent<HTMLFormElement>;
|
|
10
|
+
|
|
11
|
+
export type TKeyboardEvent = React.KeyboardEvent<HTMLInputElement>;
|
|
12
|
+
|
|
13
|
+
export type TFocusEvent = React.FocusEvent<HTMLInputElement>;
|
|
14
|
+
|
|
15
|
+
export type TDragEvent = React.DragEvent<HTMLDivElement>;
|
|
16
|
+
|
|
17
|
+
export type TState<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare class Cookie {
|
|
2
|
+
cname: string;
|
|
3
|
+
domain: string;
|
|
4
|
+
path: string;
|
|
5
|
+
constructor(cname: string, domain?: string, path?: string);
|
|
6
|
+
setCookie(cValue: string, exDays: number): void;
|
|
7
|
+
getCookie(): string;
|
|
8
|
+
verifyCookie(cValue: string): boolean;
|
|
9
|
+
deleteCookie(): void;
|
|
10
|
+
}
|
|
11
|
+
export default Cookie;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getBaseDomain } from "./Env";
|
|
2
|
+
class Cookie {
|
|
3
|
+
constructor(cname, domain = getBaseDomain(), path = "/") {
|
|
4
|
+
this.cname = cname;
|
|
5
|
+
this.domain = domain;
|
|
6
|
+
this.path = path;
|
|
7
|
+
}
|
|
8
|
+
setCookie(cValue, exDays) {
|
|
9
|
+
if (typeof document !== "undefined") {
|
|
10
|
+
const d = new Date();
|
|
11
|
+
d.setTime(d.getTime() + exDays * 24 * 60 * 60 * 1000);
|
|
12
|
+
const expires = "expires=" + d.toUTCString();
|
|
13
|
+
document.cookie = `${this.cname}=${cValue};${expires};path=${this.path};domain=${this.domain};`;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
console.warn("document is not available. Skipping cookie set.");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
getCookie() {
|
|
20
|
+
if (typeof document !== "undefined") {
|
|
21
|
+
const name = this.cname + "=";
|
|
22
|
+
const decodedCookie = decodeURIComponent(document.cookie);
|
|
23
|
+
const ca = decodedCookie.split(";");
|
|
24
|
+
for (let i = 0; i < ca.length; i++) {
|
|
25
|
+
let c = ca[i].trim();
|
|
26
|
+
if (c.indexOf(name) === 0) {
|
|
27
|
+
return c.substring(name.length, c.length);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return "";
|
|
32
|
+
}
|
|
33
|
+
verifyCookie(cValue) {
|
|
34
|
+
const cookieValue = this.getCookie();
|
|
35
|
+
return cookieValue === cValue;
|
|
36
|
+
}
|
|
37
|
+
deleteCookie() {
|
|
38
|
+
if (typeof document !== "undefined") {
|
|
39
|
+
document.cookie = `${this.cname}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${this.path};domain=${this.domain};`;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
console.warn("document is not available. Skipping cookie deletion.");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export default Cookie;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getBaseDomain } from "./Env";
|
|
2
|
+
|
|
3
|
+
class Cookie {
|
|
4
|
+
cname: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
path: string;
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
cname: string,
|
|
10
|
+
domain: string = getBaseDomain(),
|
|
11
|
+
path: string = "/"
|
|
12
|
+
) {
|
|
13
|
+
this.cname = cname;
|
|
14
|
+
this.domain = domain;
|
|
15
|
+
this.path = path;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setCookie(cValue: string, exDays: number): void {
|
|
19
|
+
if (typeof document !== "undefined") {
|
|
20
|
+
const d = new Date();
|
|
21
|
+
d.setTime(d.getTime() + exDays * 24 * 60 * 60 * 1000);
|
|
22
|
+
const expires = "expires=" + d.toUTCString();
|
|
23
|
+
document.cookie = `${this.cname}=${cValue};${expires};path=${this.path};domain=${this.domain};`;
|
|
24
|
+
} else {
|
|
25
|
+
console.warn("document is not available. Skipping cookie set.");
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
getCookie(): string {
|
|
30
|
+
if (typeof document !== "undefined") {
|
|
31
|
+
const name = this.cname + "=";
|
|
32
|
+
const decodedCookie = decodeURIComponent(document.cookie);
|
|
33
|
+
const ca = decodedCookie.split(";");
|
|
34
|
+
for (let i = 0; i < ca.length; i++) {
|
|
35
|
+
let c = ca[i].trim();
|
|
36
|
+
if (c.indexOf(name) === 0) {
|
|
37
|
+
return c.substring(name.length, c.length);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
verifyCookie(cValue: string): boolean {
|
|
45
|
+
const cookieValue = this.getCookie();
|
|
46
|
+
return cookieValue === cValue;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
deleteCookie(): void {
|
|
50
|
+
if (typeof document !== "undefined") {
|
|
51
|
+
document.cookie = `${this.cname}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${this.path};domain=${this.domain};`;
|
|
52
|
+
} else {
|
|
53
|
+
console.warn("document is not available. Skipping cookie deletion.");
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default Cookie;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
// USAGE:
|
|
4
|
+
// call the copy function with the text you want to copy
|
|
5
|
+
/*
|
|
6
|
+
const { copy, isCopied } = Copy();
|
|
7
|
+
|
|
8
|
+
// call the copy function with the text you want to copy
|
|
9
|
+
onClick={() => copy("text to copy")}
|
|
10
|
+
|
|
11
|
+
// show a message if the text is copied
|
|
12
|
+
{isCopied && <div>Copied</div>}
|
|
13
|
+
*/
|
|
14
|
+
function Copy() {
|
|
15
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
16
|
+
const copy = (text) => {
|
|
17
|
+
navigator.clipboard
|
|
18
|
+
.writeText(text)
|
|
19
|
+
.then(() => {
|
|
20
|
+
// setMessage("Copied");
|
|
21
|
+
setIsCopied(true);
|
|
22
|
+
setTimeout(() => {
|
|
23
|
+
setIsCopied(false);
|
|
24
|
+
}, 1000);
|
|
25
|
+
})
|
|
26
|
+
.catch((error) => {
|
|
27
|
+
console.error("Error copying text to clipboard:", error);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
return { copy, isCopied };
|
|
31
|
+
}
|
|
32
|
+
export default Copy;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
|
|
4
|
+
// USAGE:
|
|
5
|
+
// call the copy function with the text you want to copy
|
|
6
|
+
/*
|
|
7
|
+
const { copy, isCopied } = Copy();
|
|
8
|
+
|
|
9
|
+
// call the copy function with the text you want to copy
|
|
10
|
+
onClick={() => copy("text to copy")}
|
|
11
|
+
|
|
12
|
+
// show a message if the text is copied
|
|
13
|
+
{isCopied && <div>Copied</div>}
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function Copy() {
|
|
17
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
18
|
+
|
|
19
|
+
const copy = (text: any) => {
|
|
20
|
+
navigator.clipboard
|
|
21
|
+
.writeText(text)
|
|
22
|
+
.then(() => {
|
|
23
|
+
// setMessage("Copied");
|
|
24
|
+
setIsCopied(true);
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
setIsCopied(false);
|
|
27
|
+
}, 1000);
|
|
28
|
+
})
|
|
29
|
+
.catch((error) => {
|
|
30
|
+
console.error("Error copying text to clipboard:", error);
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return { copy, isCopied };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default Copy;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const SUB_DOMAIN_NAMES: {
|
|
2
|
+
readonly WWW: "www";
|
|
3
|
+
readonly ACCOUNT: "account";
|
|
4
|
+
readonly DOMAIN: "domain";
|
|
5
|
+
readonly ADMANAGE: "admanage";
|
|
6
|
+
readonly DNS: "dns";
|
|
7
|
+
readonly HOSTING: "hosting";
|
|
8
|
+
readonly APPOCEAN: "appocean";
|
|
9
|
+
readonly DOCS: "docs";
|
|
10
|
+
readonly PROBACKUP: "probackup";
|
|
11
|
+
readonly EDUSOFT: "edusoft";
|
|
12
|
+
readonly SUPPORT: "support";
|
|
13
|
+
readonly ICON: "icon";
|
|
14
|
+
readonly DRIVE: "drive";
|
|
15
|
+
readonly API: "io";
|
|
16
|
+
readonly API2: "api2";
|
|
17
|
+
readonly API3: "api3";
|
|
18
|
+
};
|
|
19
|
+
export declare const isDev: boolean;
|
|
20
|
+
export declare function getMode(): "dev" | "win" | "com";
|
|
21
|
+
export declare const getBaseDomain: () => string;
|
|
22
|
+
export declare function getBikiranUrl(): string;
|
|
23
|
+
export declare function getHostingUrl(): string;
|
|
24
|
+
export declare function getDomainUrl(): string;
|
|
25
|
+
export declare function getAppoceanUrl(): string;
|
|
26
|
+
export declare function getAdManageUrl(): string;
|
|
27
|
+
export declare function getSupportUrl(): string;
|
|
28
|
+
export declare function getSiteUrl(): string;
|
|
29
|
+
export declare function getApiUrl(): string;
|
|
30
|
+
export declare function getApi2Url(): string;
|
|
31
|
+
export declare function getApi3Url(): string;
|
|
32
|
+
export declare function getAccountUrl(): string;
|
|
33
|
+
export declare function getDocsUrl(): string;
|
|
34
|
+
export declare function generateAnyUrl(subDomain: string): string;
|
|
35
|
+
export declare function getDBConnectionString(): string;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
export const SUB_DOMAIN_NAMES = {
|
|
2
|
+
WWW: "www",
|
|
3
|
+
ACCOUNT: "account",
|
|
4
|
+
DOMAIN: "domain",
|
|
5
|
+
ADMANAGE: "admanage",
|
|
6
|
+
DNS: "dns",
|
|
7
|
+
HOSTING: "hosting",
|
|
8
|
+
APPOCEAN: "appocean",
|
|
9
|
+
DOCS: "docs",
|
|
10
|
+
PROBACKUP: "probackup",
|
|
11
|
+
EDUSOFT: "edusoft",
|
|
12
|
+
SUPPORT: "support",
|
|
13
|
+
ICON: "icon",
|
|
14
|
+
DRIVE: "drive",
|
|
15
|
+
API: "io",
|
|
16
|
+
API2: "api2",
|
|
17
|
+
API3: "api3",
|
|
18
|
+
};
|
|
19
|
+
const subDomainMap = {
|
|
20
|
+
www: `http://localhost:7201`,
|
|
21
|
+
account: `http://localhost:5000`,
|
|
22
|
+
domain: `http://localhost:7203`,
|
|
23
|
+
dns: `http://localhost:7204`,
|
|
24
|
+
hosting: `http://localhost:7205`,
|
|
25
|
+
appocean: `http://localhost:7206`,
|
|
26
|
+
docs: `http://localhost:7207`,
|
|
27
|
+
admanage: `http://localhost:7208`,
|
|
28
|
+
probackup: `http://localhost:7209`,
|
|
29
|
+
edusoft: `http://localhost:7210`,
|
|
30
|
+
icon: `http://localhost:7211`,
|
|
31
|
+
drive: `http://localhost:7212`,
|
|
32
|
+
support: `http://localhost:7216`,
|
|
33
|
+
api: `https://io.bikiran.win`,
|
|
34
|
+
api2: process.env.NEXT_PUBLIC_LOCAL_API === "true"
|
|
35
|
+
? `http://localhost:5010`
|
|
36
|
+
: `https://api2.bikiran.win`,
|
|
37
|
+
api3: process.env.NEXT_PUBLIC_LOCAL_API === "true"
|
|
38
|
+
? `http://localhost:7301`
|
|
39
|
+
: `https://api3.bikiran.win`,
|
|
40
|
+
};
|
|
41
|
+
export const isDev = process.env.NEXT_PUBLIC_MODE === "dev";
|
|
42
|
+
export function getMode() {
|
|
43
|
+
if (isDev) {
|
|
44
|
+
return "dev";
|
|
45
|
+
}
|
|
46
|
+
const isWin = process.env.NEXT_PUBLIC_MODE === "win";
|
|
47
|
+
if (isWin) {
|
|
48
|
+
return "win";
|
|
49
|
+
}
|
|
50
|
+
return "com";
|
|
51
|
+
}
|
|
52
|
+
const getDomain = () => {
|
|
53
|
+
return process.env.NEXT_PUBLIC_DOMAIN || "";
|
|
54
|
+
};
|
|
55
|
+
const getDomainObject = () => {
|
|
56
|
+
const domainParts = getDomain().split(".");
|
|
57
|
+
return {
|
|
58
|
+
sub: domainParts[0],
|
|
59
|
+
name: domainParts[1],
|
|
60
|
+
tld: domainParts[2],
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export const getBaseDomain = () => {
|
|
64
|
+
const mode = getMode();
|
|
65
|
+
if (mode === "dev") {
|
|
66
|
+
return "localhost";
|
|
67
|
+
}
|
|
68
|
+
const d = getDomainObject();
|
|
69
|
+
return `${d.name}.${mode}`;
|
|
70
|
+
};
|
|
71
|
+
// https://www.bikiran.com/
|
|
72
|
+
export function getBikiranUrl() {
|
|
73
|
+
const d = getDomainObject();
|
|
74
|
+
const mode = getMode();
|
|
75
|
+
if (mode === "dev") {
|
|
76
|
+
return subDomainMap.www;
|
|
77
|
+
}
|
|
78
|
+
return `https://${SUB_DOMAIN_NAMES.WWW}.${d.name}.${mode}`;
|
|
79
|
+
}
|
|
80
|
+
// https://www.hosting.bikiran.com/
|
|
81
|
+
export function getHostingUrl() {
|
|
82
|
+
const d = getDomainObject();
|
|
83
|
+
const mode = getMode();
|
|
84
|
+
if (mode === "dev") {
|
|
85
|
+
return subDomainMap.hosting;
|
|
86
|
+
}
|
|
87
|
+
return `https://${SUB_DOMAIN_NAMES.HOSTING}.${d.name}.${mode}`;
|
|
88
|
+
}
|
|
89
|
+
// https://www.domain.bikiran.com/
|
|
90
|
+
export function getDomainUrl() {
|
|
91
|
+
const d = getDomainObject();
|
|
92
|
+
const mode = getMode();
|
|
93
|
+
if (mode === "dev") {
|
|
94
|
+
return subDomainMap.domain;
|
|
95
|
+
}
|
|
96
|
+
return `https://${SUB_DOMAIN_NAMES.DOMAIN}.${d.name}.${mode}`;
|
|
97
|
+
}
|
|
98
|
+
// https://www.appocean.bikiran.com/
|
|
99
|
+
export function getAppoceanUrl() {
|
|
100
|
+
const d = getDomainObject();
|
|
101
|
+
const mode = getMode();
|
|
102
|
+
if (mode === "dev") {
|
|
103
|
+
return subDomainMap.appocean;
|
|
104
|
+
}
|
|
105
|
+
return `https://${SUB_DOMAIN_NAMES.APPOCEAN}.${d.name}.${mode}`;
|
|
106
|
+
}
|
|
107
|
+
// https://www.admanage.bikiran.com/
|
|
108
|
+
export function getAdManageUrl() {
|
|
109
|
+
const d = getDomainObject();
|
|
110
|
+
const mode = getMode();
|
|
111
|
+
if (mode === "dev") {
|
|
112
|
+
return subDomainMap.admanage;
|
|
113
|
+
}
|
|
114
|
+
return `https://${SUB_DOMAIN_NAMES.ADMANAGE}.${d.name}.${mode}`;
|
|
115
|
+
}
|
|
116
|
+
// https://www.support.bikiran.com/
|
|
117
|
+
export function getSupportUrl() {
|
|
118
|
+
const d = getDomainObject();
|
|
119
|
+
const mode = getMode();
|
|
120
|
+
if (mode === "dev") {
|
|
121
|
+
return subDomainMap.support;
|
|
122
|
+
}
|
|
123
|
+
return `https://${SUB_DOMAIN_NAMES.SUPPORT}.${d.name}.${mode}`;
|
|
124
|
+
}
|
|
125
|
+
export function getSiteUrl() {
|
|
126
|
+
const d = getDomainObject();
|
|
127
|
+
const mode = getMode();
|
|
128
|
+
if (mode === "dev") {
|
|
129
|
+
return subDomainMap[d.sub];
|
|
130
|
+
}
|
|
131
|
+
return `https://${d.sub}.${d.name}.${mode}`;
|
|
132
|
+
}
|
|
133
|
+
export function getApiUrl() {
|
|
134
|
+
const d = getDomainObject();
|
|
135
|
+
const mode = getMode();
|
|
136
|
+
if (mode === "dev") {
|
|
137
|
+
return subDomainMap.api;
|
|
138
|
+
}
|
|
139
|
+
return `https://${SUB_DOMAIN_NAMES.API}.${d.name}.${mode}`;
|
|
140
|
+
}
|
|
141
|
+
export function getApi2Url() {
|
|
142
|
+
const d = getDomainObject();
|
|
143
|
+
const mode = getMode();
|
|
144
|
+
if (mode === "dev") {
|
|
145
|
+
return subDomainMap.api2;
|
|
146
|
+
}
|
|
147
|
+
return `https://${SUB_DOMAIN_NAMES.API2}.${d.name}.${mode}`;
|
|
148
|
+
}
|
|
149
|
+
export function getApi3Url() {
|
|
150
|
+
const d = getDomainObject();
|
|
151
|
+
const mode = getMode();
|
|
152
|
+
if (mode === "dev") {
|
|
153
|
+
return subDomainMap.api3;
|
|
154
|
+
}
|
|
155
|
+
return `https://${SUB_DOMAIN_NAMES.API3}.${d.name}.${mode}`;
|
|
156
|
+
}
|
|
157
|
+
export function getAccountUrl() {
|
|
158
|
+
const d = getDomainObject();
|
|
159
|
+
const mode = getMode();
|
|
160
|
+
if (mode === "dev") {
|
|
161
|
+
return subDomainMap.account;
|
|
162
|
+
}
|
|
163
|
+
return `https://${SUB_DOMAIN_NAMES.ACCOUNT}.${d.name}.${mode}`;
|
|
164
|
+
}
|
|
165
|
+
export function getDocsUrl() {
|
|
166
|
+
const d = getDomainObject();
|
|
167
|
+
const mode = getMode();
|
|
168
|
+
if (mode === "dev") {
|
|
169
|
+
return subDomainMap.docs;
|
|
170
|
+
}
|
|
171
|
+
return `https://${SUB_DOMAIN_NAMES.DOCS}.${d.name}.${mode}`;
|
|
172
|
+
}
|
|
173
|
+
export function generateAnyUrl(subDomain) {
|
|
174
|
+
const d = getDomainObject();
|
|
175
|
+
const mode = getMode();
|
|
176
|
+
if (mode === "dev") {
|
|
177
|
+
return subDomainMap[d.sub];
|
|
178
|
+
}
|
|
179
|
+
return `https://${subDomain}.${d.name}.${mode}`;
|
|
180
|
+
}
|
|
181
|
+
export function getDBConnectionString() {
|
|
182
|
+
const mode = getMode();
|
|
183
|
+
if (mode === "dev") {
|
|
184
|
+
return process.env.DATABASE_URL_DEV || "";
|
|
185
|
+
}
|
|
186
|
+
if (mode === "win") {
|
|
187
|
+
return process.env.DATABASE_URL_WIN || "";
|
|
188
|
+
}
|
|
189
|
+
return process.env.DATABASE_URL_COM || "";
|
|
190
|
+
}
|