@vritti/quantum-ui 0.3.26 → 0.3.27

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/Chart.js CHANGED
@@ -25096,7 +25096,11 @@ function ChartTooltipContent({
25096
25096
  ),
25097
25097
  children: [
25098
25098
  !nestLabel ? tooltipLabel : null,
25099
- /* @__PURE__ */ jsx("div", { className: "grid gap-1.5", children: payload.filter((item) => item.type !== "none").map((item, index) => {
25099
+ /* @__PURE__ */ jsx("div", { className: "grid gap-1.5", children: sortByConfigOrder(
25100
+ payload.filter((item) => item.type !== "none"),
25101
+ config,
25102
+ (item) => `${nameKey || item.name || item.dataKey || "value"}`
25103
+ ).map((item, index) => {
25100
25104
  const key = `${nameKey || item.name || item.dataKey || "value"}`;
25101
25105
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
25102
25106
  const indicatorColor = color || item.payload?.fill || item.color;
@@ -25126,10 +25130,7 @@ function ChartTooltipContent({
25126
25130
  /* @__PURE__ */ jsxs(
25127
25131
  "div",
25128
25132
  {
25129
- className: cn(
25130
- "flex flex-1 justify-between leading-none",
25131
- nestLabel ? "items-end" : "items-center"
25132
- ),
25133
+ className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center"),
25133
25134
  children: [
25134
25135
  /* @__PURE__ */ jsxs("div", { className: "grid gap-1.5", children: [
25135
25136
  nestLabel ? tooltipLabel : null,
@@ -25160,7 +25161,11 @@ function ChartLegendContent({
25160
25161
  if (!payload?.length) {
25161
25162
  return null;
25162
25163
  }
25163
- return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: payload.filter((item) => item.type !== "none").map((item) => {
25164
+ return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className), children: sortByConfigOrder(
25165
+ payload.filter((item) => item.type !== "none"),
25166
+ config,
25167
+ (item) => `${nameKey || item.dataKey || "value"}`
25168
+ ).map((item) => {
25164
25169
  const key = `${nameKey || item.dataKey || "value"}`;
25165
25170
  const itemConfig = getPayloadConfigFromPayload(config, item, key);
25166
25171
  return /* @__PURE__ */ jsxs(
@@ -25184,9 +25189,9 @@ function ChartLegendContent({
25184
25189
  );
25185
25190
  }) });
25186
25191
  }
25187
- function getPayloadConfigFromPayload(config, payload, key) {
25192
+ function getPayloadConfigKey(config, payload, key) {
25188
25193
  if (typeof payload !== "object" || payload === null) {
25189
- return void 0;
25194
+ return key;
25190
25195
  }
25191
25196
  const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
25192
25197
  let configLabelKey = key;
@@ -25195,7 +25200,21 @@ function getPayloadConfigFromPayload(config, payload, key) {
25195
25200
  } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
25196
25201
  configLabelKey = payloadPayload[key];
25197
25202
  }
25198
- return configLabelKey in config ? config[configLabelKey] : config[key];
25203
+ return configLabelKey in config ? configLabelKey : key;
25204
+ }
25205
+ function getPayloadConfigFromPayload(config, payload, key) {
25206
+ if (typeof payload !== "object" || payload === null) {
25207
+ return void 0;
25208
+ }
25209
+ return config[getPayloadConfigKey(config, payload, key)];
25210
+ }
25211
+ function sortByConfigOrder(items, config, keyOf) {
25212
+ const order = Object.keys(config);
25213
+ const rank = (item) => {
25214
+ const index = order.indexOf(getPayloadConfigKey(config, item, keyOf(item)));
25215
+ return index === -1 ? order.length : index;
25216
+ };
25217
+ return [...items].sort((a, b) => rank(a) - rank(b));
25199
25218
  }
25200
25219
 
25201
25220
  export { resolveDefaultProps as $, useAppSelector as A, selectActiveTooltipIndex as B, useActiveTooltipDataPoints as C, DefaultZIndexes as D, isNullish as E, combineCheckedDomain as F, combineNiceTicks as G, selectBaseAxis as H, combineAxisDomainWithNiceTicks as I, selectStackOffsetType as J, combineAxisDomain as K, Layer as L, combineAppliedValues as M, selectChartDataAndAlwaysIgnoreIndexes as N, combineDisplayedData as O, selectDomainDefinition as P, selectDomainFromUserPreference as Q, combineNumericalDomain as R, combineGraphicalItemsSettings as S, combineGraphicalItemsData as T, selectAllErrorBarSettings as U, combineDomainOfAllAppliedNumericalValuesIncludingErrorValues as V, pickAxisId as W, itemAxisPredicate as X, getValueByDataKey as Y, ZIndexLayer as Z, updatePolarOptions as _, selectRealScaleType as a, selectPolarViewBox as a$, RechartsStoreProvider as a0, ChartDataContextProvider as a1, ReportMainChartProps as a2, ReportEventSettings as a3, ReportChartProps as a4, CategoricalChart as a5, initialEventSettingsState as a6, selectChartDataWithIndexesIfNotInPanoramaPosition4 as a7, selectAxisWithScale as a8, selectTicksOfGraphicalItem as a9, selectChartDataWithIndexesIfNotInPanoramaPosition3 as aA, selectChartBaseValue as aB, getStackSeriesIdentifier as aC, selectStackGroups as aD, getNormalizedStackId as aE, useChartName as aF, useCartesianChartLayout as aG, isNan as aH, Curve as aI, isWellBehavedNumber as aJ, selectChartOffsetInternal as aK, SetPolarGraphicalItem as aL, findAllByType as aM, SetPolarLegendPayload as aN, get$1 as aO, mathSign as aP, PolarLabelListContextProvider as aQ, selectActiveTooltipDataKey as aR, selectActiveTooltipGraphicalItemId as aS, DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME as aT, DATA_ITEM_INDEX_ATTRIBUTE_NAME as aU, adaptEventsOfChild as aV, getMaxRadius as aW, getPercentValue as aX, polarToCartesian as aY, Text as aZ, selectChartDataWithIndexes as a_, selectUnfilteredCartesianItems as aa, isCategoricalAxis as ab, getBandSizeOfAxis as ac, propsAreEqual as ad, useIsPanorama as ae, RegisterGraphicalItemId as af, SetLegendPayload as ag, SetCartesianGraphicalItem as ah, getTooltipNameProp as ai, SetTooltipEntrySettings as aj, noop$2 as ak, usePlotArea as al, useChartLayout as am, getCateCoordinateOfLine as an, useAnimationId as ao, JavascriptAnimate as ap, interpolate as aq, LabelListFromLabelProp as ar, CartesianLabelListContextProvider as as, svgPropertiesAndEvents as at, arrayTooltipSearcher as au, ChartContainer as av, ChartTooltip as aw, ChartTooltipContent as ax, ChartLegend as ay, ChartLegendContent as az, combineConfiguredScale as b, getBaseValueOfBar as b0, selectRootMaxBarSize as b1, selectBarGap as b2, selectBarCategoryGap as b3, selectRootBarSize as b4, selectReverseStackOrder as b5, combineStackGroups as b6, selectTooltipAxis as b7, combineDisplayedStackedData as b8, isStacked as b9, implicitXAxis as bA, implicitYAxis as bB, addXAxis as bC, replaceXAxis as bD, removeXAxis as bE, selectTicksOfAxis as bF, selectXAxisSize as bG, selectXAxisPosition as bH, selectXAxisSettingsNoDefaults as bI, getAxisTypeBasedOnLayout as bJ, addYAxis as bK, replaceYAxis as bL, removeYAxis as bM, selectYAxisSize as bN, selectYAxisPosition as bO, selectYAxisSettingsNoDefaults as bP, isLabelContentAFunction as bQ, updateYAxisWidth as bR, usePolarChartLayout as bS, addAngleAxis as bT, removeAngleAxis as bU, defaultPolarAngleAxisProps as bV, degreeToRadian as bW, requireIsArrayLike as bX, truncateByDomain as ba, getCateCoordinateOfBar as bb, getTransitionVal as bc, roundTemplateLiteral as bd, Symbols as be, Sector as bf, Rectangle as bg, selectAxisViewBox as bh, selectCartesianAxisSize as bi, Global as bj, getStringSize as bk, CartesianLabelContextProvider as bl, CartesianLabelFromLabelProp as bm, isValidTextAnchor as bn, setRenderedTicks as bo, removeRenderedTicks as bp, useChartWidth as bq, useChartHeight as br, useOffsetInternal as bs, isPositiveNumber as bt, warn as bu, getCoordinatesOfGrid as bv, getTicksOfAxis as bw, selectAxisPropsNeededForCartesianGridTicksGenerator as bx, selectXAxisSettings as by, selectYAxisSettings as bz, createSelector as c, defaultAxisId as d, selectChartLayout as e, selectDuplicateDomain as f, combineAxisTicks as g, selectRadiusAxis as h, selectAngleAxis as i, selectRadiusAxisRangeWithReversed as j, selectAngleAxisRangeWithReversed as k, selectRenderableAxisSettings as l, combineCategoricalDomain as m, combineGraphicalItemTicks as n, setActiveMouseOverItemIndex as o, pickAxisType as p, mouseLeaveItem as q, rechartsScaleFactory as r, svgPropertiesNoEventsFromUnknown as s, setActiveClickItemIndex as t, useAppDispatch as u, isNumber as v, adaptEventHandlers as w, svgPropertiesNoEvents as x, isClipDot as y, svgPropertiesAndEventsFromUnknown as z };