@hhgtech/hhg-components 1.18.61 → 1.18.62
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/cache/core.d.ts +7 -0
- package/build/cache/index.d.ts +1 -0
- package/build/cache.js +2 -0
- package/build/cache.js.map +1 -0
- package/build/components/organisms/index.d.ts +1 -1
- package/build/components/organisms/navigationV2/index.d.ts +1 -0
- package/build/components.js +1 -1
- package/build/core-8fcc56eb.js +2 -0
- package/build/core-8fcc56eb.js.map +1 -0
- package/build/esm/cache/core.d.ts +7 -0
- package/build/esm/cache/index.d.ts +1 -0
- package/build/esm/cache.js +2 -0
- package/build/esm/cache.js.map +1 -0
- package/build/esm/components/organisms/index.d.ts +1 -1
- package/build/esm/components/organisms/navigationV2/index.d.ts +1 -0
- package/build/esm/components.js +1 -1
- package/build/esm/core-3d8a3f90.js +2 -0
- package/build/esm/core-3d8a3f90.js.map +1 -0
- package/build/esm/index-1582383d.js +2 -0
- package/build/esm/{index-8bba4dbd.js.map → index-1582383d.js.map} +1 -1
- package/build/esm/index-8155bbaf.js +2 -0
- package/build/esm/{index-988cceb6.js.map → index-8155bbaf.js.map} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/index-17dcee19.js +2 -0
- package/build/{index-7bd6af8c.js.map → index-17dcee19.js.map} +1 -1
- package/build/{index-2e98ae64.js → index-329a9e3c.js} +2 -2
- package/build/{index-2e98ae64.js.map → index-329a9e3c.js.map} +1 -1
- package/build/index.js +1 -1
- package/build/navigation.js +1 -1
- package/package.json +1 -1
- package/build/esm/index-8bba4dbd.js +0 -2
- package/build/esm/index-988cceb6.js +0 -2
- package/build/index-7bd6af8c.js +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type CacheItem<T = any> = {
|
|
2
|
+
data: T;
|
|
3
|
+
time: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const getCachedItem: <T>(key: string) => CacheItem<T>;
|
|
6
|
+
export declare const setCachedItem: (key: string, value: any) => void;
|
|
7
|
+
export declare const getDataWithCache: <T>(key: string, dataGetter?: () => T | Promise<T>, validator?: (data: T) => boolean, cacheTime?: number) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './core';
|
package/build/cache.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./core-8fcc56eb.js");require("./tslib.es6-f7929e76.js"),exports.getCachedItem=e.getCachedItem,exports.getDataWithCache=e.getDataWithCache,exports.setCachedItem=e.setCachedItem;
|
|
2
|
+
//# sourceMappingURL=cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { NavigationLayout } from './navigationLayout/languageWrapper';
|
|
2
|
-
export { NavigationV2, Props as NavigationV2Props, getNavMenuContent, NavMenuContentType, } from './navigationV2';
|
|
2
|
+
export { NavigationV2, Props as NavigationV2Props, getNavMenuContent, getNavMenuContentWithCache, NavMenuContentType, } from './navigationV2';
|
|
3
3
|
export { Layout } from './navigationLayout/layout';
|
|
4
4
|
export { SiteWide } from './navigationLayout/siteWide';
|
|
5
5
|
export { NavigationBar } from './navigationLayout/navigationBar';
|
|
@@ -55,4 +55,5 @@ export declare type Props = {
|
|
|
55
55
|
};
|
|
56
56
|
declare const NavigationV2: (props: Props) => JSX.Element;
|
|
57
57
|
export declare const getNavMenuContent: (locale: any) => Promise<NavMenuContentType>;
|
|
58
|
+
export declare const getNavMenuContentWithCache: (locale?: string) => Promise<NavMenuContentType>;
|
|
58
59
|
export { NavigationV2 };
|
package/build/components.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-329a9e3c.js"),r=require("./index.styled-4b2cda82.js"),o=require("./index-aa743579.js"),t=require("./index-17dcee19.js"),a=require("./cookieHelper-d9cedc66.js");require("react"),require("./tslib.es6-f7929e76.js"),require("./useTranslations-00e7c0dc.js"),require("styled-components"),require("./translationsContext-63e3e5ec.js"),require("react-range"),require("./theme-79e84625.js"),require("react-id-generator"),require("date-fns"),require("react-day-picker/DayPickerInput"),require("./useScrollbarSize-586f6706.js"),require("lodash/debounce"),require("react-dom"),require("lodash"),require("./constants-ea7b35a2.js"),require("react-loading-skeleton"),require("./translationsProvider-4f6e12c9.js"),require("date-fns/locale/en-US"),require("date-fns/locale/hi"),require("date-fns/locale/id"),require("date-fns/locale/ms"),require("date-fns/locale/th"),require("date-fns/locale/vi"),require("date-fns/locale/zh-TW"),require("./core-8fcc56eb.js"),require("smoothscroll-polyfill"),exports.Alert=e.Alert,exports.AmpNextPage=e.AmpNextPage,exports.ArticleCard=e.ArticleCard,exports.Badge=e.Badge,exports.BorderHeading=e.BorderHeading,exports.Breadcrumbs=e.Breadcrumbs,exports.Carousel=e.Carousel,exports.CategoryCard=e.CategoryCard,exports.Checkbox=e.Checkbox,exports.CheckboxGroup=e.CheckboxGroup,exports.CookieAcceptConfirm=e.CookieAcceptConfirm,exports.DatePicker=e.DatePicker,exports.FileDropdown=e.FileDropdown,exports.FloatButtonGroup=e.FloatButtonGroup,exports.Footer=e.Footer,exports.Grid=e.Grid,exports.Icon=e.Icon,exports.IconText=e.IconText,exports.Layout=e.Layout,exports.Modal=e.Modal,exports.NavigationBar=e.NavigationBar,exports.NavigationLayout=e.NavigationLayout,exports.Pagination=e.Pagination,exports.Progress=e.Progress,exports.ProgressBar=e.ProgressBar,exports.Radio=e.Radio,exports.RadioGroup=e.RadioGroup,exports.RateStars=e.RateStars,exports.SeoHead=e.SeoHead,exports.Shadow=e.Shadow,exports.SideMenu=e.index,exports.SiteWide=e.SiteWide,exports.Slider=e.Slider,exports.StatisticCard=e.StatisticCard,exports.StickySponsoredBy=e.StickySponsoredBy,exports.SurveyThankyouCard=e.SurveyThankyouCard,exports.Table=e.index$1,exports.Tabs=e.Tabs,exports.Tag=e.Tag,exports.Toggle=e.Toggle,exports.UnderlinedLink=e.UnderlinedLink,exports.Uploader=e.Uploader,exports.Avatar=r.Avatar,exports.Button=r.Button,exports.Heading=r.Heading,exports.Popup=r.Popup,exports.Divider=o.Divider,exports.Dropdown=o.Dropdown,exports.DoctorInfo=t.DoctorInfo,exports.Flag=t.Flag,exports.LanguageSwitcher=t.LanguageSwitcher,exports.MobileBottomNavigation=t.MobileBottomNavigation,exports.MobileBottomNavigationIcon=t.MobileBottomNavigationIcon,exports.NavigationLogoutPopup=t.NavigationLogoutPopup,exports.NavigationProfileButton=t.NavigationProfileButton,exports.NavigationV2=t.NavigationV2,exports.ProfilePopup=t.ProfilePopup,exports.ScrollList=t.ScrollList,exports.SurveyQuestionCard=t.SurveyQuestionCard,exports.UserProfileNavigation=t.UserProfileNavigation,exports.UserProfileNavigationHeader=t.NavHeader,exports.UserProfileNavigationStats=t.UserStats,exports.defaultTranslation=t.defaultTranslation,exports.getNavMenuContent=t.getNavMenuContent,exports.getNavMenuContentWithCache=t.getNavMenuContentWithCache,exports.Container=a.Container,exports.Input=a.Input,exports.Label=a.Label,exports.Logo=a.Logo,exports.PureInput=a.PureInput,exports.Text=a.Text,exports.TextArea=a.TextArea,exports.TextDivider=a.TextDivider;
|
|
2
2
|
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("./tslib.es6-f7929e76.js"),t={},a=function(e){if("undefined"!=typeof window){var a=void 0;try{a=JSON.parse(localStorage.getItem("hhg-cache-"+e)||"{}")}catch(e){}return a||{}}return t[e]},r=function(e,a){try{"undefined"!=typeof window?localStorage.setItem("hhg-cache-"+e,JSON.stringify({data:a,time:Date.now()})):t[e]={data:a,time:Date.now()}}catch(e){}};exports.getCachedItem=a,exports.getDataWithCache=function(t,n,i,o){return void 0===o&&(o=9e5),e.__awaiter(void 0,void 0,void 0,(function(){var c,s;return e.__generator(this,(function(e){switch(e.label){case 0:return(c=a(t))&&c.data&&c.time&&Date.now()-c.time<o?[2,c.data]:[3,1];case 1:return n?[4,n()]:[3,3];case 2:return s=e.sent(),i&&!i(s)||r(t,s),[2,s];case 3:return[2,null]}}))}))},exports.setCachedItem=r;
|
|
2
|
+
//# sourceMappingURL=core-8fcc56eb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-8fcc56eb.js","sources":["../src/cache/core.ts"],"sourcesContent":["export type CacheItem<T = any> = {\n data: T\n time: number\n}\n\nconst ServerCache: { [key: string]: CacheItem } = {}\nexport const getCachedItem = <T>(key: string): CacheItem<T> => {\n if (typeof window !== 'undefined') {\n let res\n try {\n res = JSON.parse(localStorage.getItem('hhg-cache-' + key) || '{}')\n } catch {}\n return res || {}\n } else {\n return ServerCache[key]\n }\n}\nexport const setCachedItem = (key: string, value: any) => {\n try {\n if (typeof window !== 'undefined') {\n localStorage.setItem(\n 'hhg-cache-' + key,\n JSON.stringify({ data: value, time: Date.now() }),\n )\n } else {\n ServerCache[key] = { data: value, time: Date.now() }\n }\n } catch {}\n}\nexport const getDataWithCache = async <T>(\n key: string,\n dataGetter?: () => Promise<T> | T,\n validator?: (data: T) => boolean,\n cacheTime = 1000 * 60 * 15,\n): Promise<T | null | undefined> => {\n const persistData = getCachedItem<T>(key)\n if (\n persistData &&\n persistData.data &&\n persistData.time &&\n Date.now() - persistData.time < cacheTime\n ) {\n return persistData.data\n } else if (dataGetter) {\n const data = await dataGetter()\n if (!validator || validator(data)) {\n setCachedItem(key, data)\n }\n return data\n }\n return null\n}\n"],"names":["ServerCache","getCachedItem","key","window","res","JSON","parse","localStorage","getItem","_a","setCachedItem","value","setItem","stringify","data","time","Date","now","dataGetter","validator","cacheTime","persistData","sent"],"mappings":"sDAKMA,EAA4C,GACrCC,EAAgB,SAAIC,GAC/B,GAAsB,oBAAXC,OAAwB,CACjC,IAAIC,SACJ,IACEA,EAAMC,KAAKC,MAAMC,aAAaC,QAAQ,aAAeN,IAAQ,MAC7D,MAAAO,IACF,OAAOL,GAAO,GAEd,OAAOJ,EAAYE,IAGVQ,EAAgB,SAACR,EAAaS,GACzC,IACwB,oBAAXR,OACTI,aAAaK,QACX,aAAeV,EACfG,KAAKQ,UAAU,CAAEC,KAAMH,EAAOI,KAAMC,KAAKC,SAG3CjB,EAAYE,GAAO,CAAEY,KAAMH,EAAOI,KAAMC,KAAKC,OAE/C,MAAAR,uDAE4B,SAC9BP,EACAgB,EACAC,EACAC,eAAA,IAAAA,IAAAA,EAAY,wHAIV,OAFIC,EAAcpB,EAAiBC,KAGnCmB,EAAYP,MACZO,EAAYN,MACZC,KAAKC,MAAQI,EAAYN,KAAOK,EAEzB,CAAA,EAAAC,EAAYP,MAFsB,CAAA,EAAA,UAGhC,OAAAI,EACU,CAAA,EAAAA,KADA,CAAA,EAAA,UAKnB,OAJMJ,EAAOL,EAAkBa,OAC1BH,IAAaA,EAAUL,IAC1BJ,EAAcR,EAAKY,GAErB,CAAA,EAAOA,GAET,KAAA,EAAA,MAAA,CAAA,EAAO"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type CacheItem<T = any> = {
|
|
2
|
+
data: T;
|
|
3
|
+
time: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const getCachedItem: <T>(key: string) => CacheItem<T>;
|
|
6
|
+
export declare const setCachedItem: (key: string, value: any) => void;
|
|
7
|
+
export declare const getDataWithCache: <T>(key: string, dataGetter?: () => T | Promise<T>, validator?: (data: T) => boolean, cacheTime?: number) => Promise<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './core';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { NavigationLayout } from './navigationLayout/languageWrapper';
|
|
2
|
-
export { NavigationV2, Props as NavigationV2Props, getNavMenuContent, NavMenuContentType, } from './navigationV2';
|
|
2
|
+
export { NavigationV2, Props as NavigationV2Props, getNavMenuContent, getNavMenuContentWithCache, NavMenuContentType, } from './navigationV2';
|
|
3
3
|
export { Layout } from './navigationLayout/layout';
|
|
4
4
|
export { SiteWide } from './navigationLayout/siteWide';
|
|
5
5
|
export { NavigationBar } from './navigationLayout/navigationBar';
|
|
@@ -55,4 +55,5 @@ export declare type Props = {
|
|
|
55
55
|
};
|
|
56
56
|
declare const NavigationV2: (props: Props) => JSX.Element;
|
|
57
57
|
export declare const getNavMenuContent: (locale: any) => Promise<NavMenuContentType>;
|
|
58
|
+
export declare const getNavMenuContentWithCache: (locale?: string) => Promise<NavMenuContentType>;
|
|
58
59
|
export { NavigationV2 };
|
package/build/esm/components.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{A as Alert,w as AmpNextPage,g as ArticleCard,B as Badge,a as BorderHeading,h as Breadcrumbs,o as Carousel,i as CategoryCard,C as Checkbox,j as CheckboxGroup,u as CookieAcceptConfirm,D as DatePicker,F as FileDropdown,t as FloatButtonGroup,E as Footer,G as Grid,I as Icon,k as IconText,L as Layout,M as Modal,y as NavigationBar,N as NavigationLayout,P as Pagination,f as Progress,l as ProgressBar,R as Radio,m as RadioGroup,e as RateStars,v as SeoHead,S as Shadow,n as SideMenu,x as SiteWide,b as Slider,p as StatisticCard,z as StickySponsoredBy,s as SurveyThankyouCard,q as Table,r as Tabs,T as Tag,c as Toggle,U as UnderlinedLink,d as Uploader}from"./index-
|
|
1
|
+
export{A as Alert,w as AmpNextPage,g as ArticleCard,B as Badge,a as BorderHeading,h as Breadcrumbs,o as Carousel,i as CategoryCard,C as Checkbox,j as CheckboxGroup,u as CookieAcceptConfirm,D as DatePicker,F as FileDropdown,t as FloatButtonGroup,E as Footer,G as Grid,I as Icon,k as IconText,L as Layout,M as Modal,y as NavigationBar,N as NavigationLayout,P as Pagination,f as Progress,l as ProgressBar,R as Radio,m as RadioGroup,e as RateStars,v as SeoHead,S as Shadow,n as SideMenu,x as SiteWide,b as Slider,p as StatisticCard,z as StickySponsoredBy,s as SurveyThankyouCard,q as Table,r as Tabs,T as Tag,c as Toggle,U as UnderlinedLink,d as Uploader}from"./index-1582383d.js";export{A as Avatar,B as Button,H as Heading,P as Popup}from"./index.styled-00c7c3b5.js";export{D as Divider,a as Dropdown}from"./index-c905e326.js";export{D as DoctorInfo,F as Flag,L as LanguageSwitcher,M as MobileBottomNavigation,b as MobileBottomNavigationIcon,h as NavigationLogoutPopup,i as NavigationProfileButton,N as NavigationV2,P as ProfilePopup,S as ScrollList,a as SurveyQuestionCard,U as UserProfileNavigation,e as UserProfileNavigationHeader,f as UserProfileNavigationStats,d as defaultTranslation,g as getNavMenuContent,c as getNavMenuContentWithCache}from"./index-8155bbaf.js";export{C as Container,I as Input,L as Label,a as Logo,P as PureInput,T as Text,b as TextArea,c as TextDivider}from"./cookieHelper-9743f6dd.js";import"react";import"./tslib.es6-fd0a5c98.js";import"./useTranslations-5638eb68.js";import"styled-components";import"./translationsContext-977d7bc4.js";import"react-range";import"./theme-d85b3a33.js";import"react-id-generator";import"date-fns";import"react-day-picker/DayPickerInput";import"./useScrollbarSize-99db33e1.js";import"lodash/debounce";import"react-dom";import"lodash";import"./constants-dc22740c.js";import"react-loading-skeleton";import"./translationsProvider-94e1d5d1.js";import"date-fns/locale/en-US";import"date-fns/locale/hi";import"date-fns/locale/id";import"date-fns/locale/ms";import"date-fns/locale/th";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"./core-3d8a3f90.js";import"smoothscroll-polyfill";
|
|
2
2
|
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as t,e}from"./tslib.es6-fd0a5c98.js";var a={},n=function(t){if("undefined"!=typeof window){var e=void 0;try{e=JSON.parse(localStorage.getItem("hhg-cache-"+t)||"{}")}catch(t){}return e||{}}return a[t]},r=function(t,e){try{"undefined"!=typeof window?localStorage.setItem("hhg-cache-"+t,JSON.stringify({data:e,time:Date.now()})):a[t]={data:e,time:Date.now()}}catch(t){}},i=function(a,i,o,c){return void 0===c&&(c=9e5),t(void 0,void 0,void 0,(function(){var t,s;return e(this,(function(e){switch(e.label){case 0:return(t=n(a))&&t.data&&t.time&&Date.now()-t.time<c?[2,t.data]:[3,1];case 1:return i?[4,i()]:[3,3];case 2:return s=e.sent(),o&&!o(s)||r(a,s),[2,s];case 3:return[2,null]}}))}))};export{n as a,i as g,r as s};
|
|
2
|
+
//# sourceMappingURL=core-3d8a3f90.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-3d8a3f90.js","sources":["../../src/cache/core.ts"],"sourcesContent":["export type CacheItem<T = any> = {\n data: T\n time: number\n}\n\nconst ServerCache: { [key: string]: CacheItem } = {}\nexport const getCachedItem = <T>(key: string): CacheItem<T> => {\n if (typeof window !== 'undefined') {\n let res\n try {\n res = JSON.parse(localStorage.getItem('hhg-cache-' + key) || '{}')\n } catch {}\n return res || {}\n } else {\n return ServerCache[key]\n }\n}\nexport const setCachedItem = (key: string, value: any) => {\n try {\n if (typeof window !== 'undefined') {\n localStorage.setItem(\n 'hhg-cache-' + key,\n JSON.stringify({ data: value, time: Date.now() }),\n )\n } else {\n ServerCache[key] = { data: value, time: Date.now() }\n }\n } catch {}\n}\nexport const getDataWithCache = async <T>(\n key: string,\n dataGetter?: () => Promise<T> | T,\n validator?: (data: T) => boolean,\n cacheTime = 1000 * 60 * 15,\n): Promise<T | null | undefined> => {\n const persistData = getCachedItem<T>(key)\n if (\n persistData &&\n persistData.data &&\n persistData.time &&\n Date.now() - persistData.time < cacheTime\n ) {\n return persistData.data\n } else if (dataGetter) {\n const data = await dataGetter()\n if (!validator || validator(data)) {\n setCachedItem(key, data)\n }\n return data\n }\n return null\n}\n"],"names":["ServerCache","getCachedItem","key","window","res","JSON","parse","localStorage","getItem","_a","setCachedItem","value","setItem","stringify","data","time","Date","now","getDataWithCache","dataGetter","validator","cacheTime","persistData","sent"],"mappings":"8CAKA,IAAMA,EAA4C,GACrCC,EAAgB,SAAIC,GAC/B,GAAsB,oBAAXC,OAAwB,CACjC,IAAIC,SACJ,IACEA,EAAMC,KAAKC,MAAMC,aAAaC,QAAQ,aAAeN,IAAQ,MAC7D,MAAAO,IACF,OAAOL,GAAO,GAEd,OAAOJ,EAAYE,IAGVQ,EAAgB,SAACR,EAAaS,GACzC,IACwB,oBAAXR,OACTI,aAAaK,QACX,aAAeV,EACfG,KAAKQ,UAAU,CAAEC,KAAMH,EAAOI,KAAMC,KAAKC,SAG3CjB,EAAYE,GAAO,CAAEY,KAAMH,EAAOI,KAAMC,KAAKC,OAE/C,MAAAR,MAESS,EAAmB,SAC9BhB,EACAiB,EACAC,EACAC,eAAA,IAAAA,IAAAA,EAAY,kGAIV,OAFIC,EAAcrB,EAAiBC,KAGnCoB,EAAYR,MACZQ,EAAYP,MACZC,KAAKC,MAAQK,EAAYP,KAAOM,EAEzB,CAAA,EAAAC,EAAYR,MAFsB,CAAA,EAAA,UAGhC,OAAAK,EACU,CAAA,EAAAA,KADA,CAAA,EAAA,UAKnB,OAJML,EAAOL,EAAkBc,OAC1BH,IAAaA,EAAUN,IAC1BJ,EAAcR,EAAKY,GAErB,CAAA,EAAOA,GAET,KAAA,EAAA,MAAA,CAAA,EAAO"}
|