@progress/kendo-react-common
Version:
React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package
43 lines (42 loc) • 2.07 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { validatePackage as u, getLicenseStatus as a } from "@progress/kendo-licensing";
import { canUseDOM as m } from "./canUseDOM.mjs";
const l = ["telerik.com", "progress.com", "stackblitz.io", "csb.app"], p = "https://www.telerik.com/kendo-react-ui/components/free?utm_medium=product&utm_source=console&utm_campaign=dt_kendoreact_freemium", s = /* @__PURE__ */ new Map(), h = () => {
const t = Array.from(s, ([e, o]) => `- ${e}: ${Array.from(o).join(", ") || "all"}`).join(`
`);
console.group("[WARN][Telerik and Kendo UI Licensing] KendoReact"), console.warn(
`License check was triggered by these premium KendoReact components/features
${t}
See the full list of free and premium components here: ${p}`
), console.groupEnd(), s.clear();
}, d = (t, e) => {
const o = u(t), i = l.some(
(n) => {
var r;
return (r = globalThis.document) == null ? void 0 : r.location.hostname.endsWith(n);
}
);
if (!o && m && e)
if (s.size === 0 && setTimeout(h, 1e3), s.has(e.component)) {
const n = s.get(e.component) || [];
s.set(e.component, /* @__PURE__ */ new Set([...e.features || [], ...n]));
} else
s.set(e.component, e.features || []);
return o || i;
}, k = (t) => a(t).isLicenseValid, c = /* @__PURE__ */ new WeakMap(), w = (t) => {
if (c.has(t))
return c.get(t);
const e = a(t).message, o = e == null ? void 0 : e.notificationMessage;
return (e == null ? void 0 : e.severity) === "WARN" && (e == null ? void 0 : e.code) === "TKL201" ? o + "<br />See the browser console for a list of Premium features currently in use." : (c.set(t, o), o);
};
export {
w as getLicenseMessage,
k as hasValidLicense,
d as validatePackage
};