@perses-dev/components 0.29.0 → 0.30.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/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +1 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js +7 -1
- package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +1 -7
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/LineChart/LineChart.d.ts.map +1 -1
- package/dist/LineChart/LineChart.js +4 -0
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/StatChart/StatChart.d.ts.map +1 -1
- package/dist/StatChart/StatChart.js +5 -1
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts +1 -1
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js +6 -5
- package/dist/TimeSeriesTooltip/TimeSeriesTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipContent.js +2 -2
- package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
- package/dist/TimeSeriesTooltip/focused-series.d.ts +1 -1
- package/dist/TimeSeriesTooltip/focused-series.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/focused-series.js +2 -3
- package/dist/TimeSeriesTooltip/focused-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts +4 -0
- package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/tooltip-model.js +4 -0
- package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
- package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +5 -14
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/UnitSelector/UnitSelector.d.ts.map +1 -1
- package/dist/UnitSelector/UnitSelector.js +40 -17
- package/dist/UnitSelector/UnitSelector.js.map +1 -1
- package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +7 -1
- package/dist/cjs/EChart/EChart.js +1 -7
- package/dist/cjs/LineChart/LineChart.js +4 -0
- package/dist/cjs/StatChart/StatChart.js +5 -1
- package/dist/cjs/TimeSeriesTooltip/TimeSeriesTooltip.js +11 -5
- package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +2 -2
- package/dist/cjs/TimeSeriesTooltip/focused-series.js +1 -2
- package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +4 -0
- package/dist/cjs/TimeSeriesTooltip/utils.js +5 -14
- package/dist/cjs/UnitSelector/UnitSelector.js +39 -16
- package/dist/cjs/model/units/bytes.js +25 -21
- package/dist/cjs/model/units/constants.js +3 -3
- package/dist/cjs/model/units/decimal.js +22 -19
- package/dist/cjs/model/units/percent.js +15 -22
- package/dist/cjs/model/units/time.js +24 -20
- package/dist/cjs/model/units/units.js +2 -2
- package/dist/cjs/model/units/utils.js +42 -0
- package/dist/model/units/bytes.d.ts +1 -1
- package/dist/model/units/bytes.d.ts.map +1 -1
- package/dist/model/units/bytes.js +26 -22
- package/dist/model/units/bytes.js.map +1 -1
- package/dist/model/units/constants.d.ts +1 -1
- package/dist/model/units/constants.js +1 -1
- package/dist/model/units/constants.js.map +1 -1
- package/dist/model/units/decimal.d.ts +2 -2
- package/dist/model/units/decimal.d.ts.map +1 -1
- package/dist/model/units/decimal.js +22 -19
- package/dist/model/units/decimal.js.map +1 -1
- package/dist/model/units/percent.d.ts +1 -1
- package/dist/model/units/percent.d.ts.map +1 -1
- package/dist/model/units/percent.js +14 -21
- package/dist/model/units/percent.js.map +1 -1
- package/dist/model/units/time.d.ts +1 -1
- package/dist/model/units/time.d.ts.map +1 -1
- package/dist/model/units/time.js +24 -20
- package/dist/model/units/time.js.map +1 -1
- package/dist/model/units/units.js +2 -2
- package/dist/model/units/units.js.map +1 -1
- package/dist/model/units/utils.d.ts +4 -0
- package/dist/model/units/utils.d.ts.map +1 -0
- package/dist/model/units/utils.js +32 -0
- package/dist/model/units/utils.js.map +1 -0
- package/package.json +3 -3
|
@@ -10,15 +10,16 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
+
import { MAX_SIGNIFICANT_DIGITS } from './constants';
|
|
14
|
+
import { hasDecimalPlaces, limitDecimalPlaces } from './utils';
|
|
13
15
|
const percentUnitKinds = [
|
|
14
16
|
'Percent',
|
|
15
17
|
'PercentDecimal',
|
|
16
18
|
'%'
|
|
17
19
|
];
|
|
18
|
-
export const
|
|
19
|
-
label: '
|
|
20
|
-
decimal_places: true
|
|
21
|
-
abbreviate: true
|
|
20
|
+
export const PERCENT_GROUP_CONFIG = {
|
|
21
|
+
label: 'Percent',
|
|
22
|
+
decimal_places: true
|
|
22
23
|
};
|
|
23
24
|
const PERCENT_GROUP = 'Percent';
|
|
24
25
|
export const PERCENT_UNIT_CONFIG = {
|
|
@@ -38,30 +39,22 @@ export const PERCENT_UNIT_CONFIG = {
|
|
|
38
39
|
label: '%'
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
|
-
const MAX_SIGNIFICANT_DIGITS = 3;
|
|
42
42
|
export function formatPercent(value, { kind , decimal_places }) {
|
|
43
43
|
// Intl.NumberFormat translates 0 -> 0%, 0.5 -> 50%, 1 -> 100%
|
|
44
44
|
if (kind === 'Percent') {
|
|
45
45
|
value = value / 100;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
useGrouping: true
|
|
55
|
-
});
|
|
47
|
+
const formatterOptions = {
|
|
48
|
+
style: 'percent',
|
|
49
|
+
useGrouping: true
|
|
50
|
+
};
|
|
51
|
+
if (hasDecimalPlaces(decimal_places)) {
|
|
52
|
+
formatterOptions.minimumFractionDigits = limitDecimalPlaces(decimal_places);
|
|
53
|
+
formatterOptions.maximumFractionDigits = limitDecimalPlaces(decimal_places);
|
|
56
54
|
} else {
|
|
57
|
-
|
|
58
|
-
formatter = new Intl.NumberFormat('en-US', {
|
|
59
|
-
style: 'percent',
|
|
60
|
-
maximumSignificantDigits: MAX_SIGNIFICANT_DIGITS,
|
|
61
|
-
useGrouping: true
|
|
62
|
-
});
|
|
55
|
+
formatterOptions.maximumSignificantDigits = MAX_SIGNIFICANT_DIGITS;
|
|
63
56
|
}
|
|
64
|
-
return
|
|
57
|
+
return Intl.NumberFormat('en-US', formatterOptions).format(value);
|
|
65
58
|
}
|
|
66
59
|
|
|
67
60
|
//# sourceMappingURL=percent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/model/units/percent.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { UnitGroupConfig, UnitConfig } from './types';\n\nconst percentUnitKinds = ['Percent', 'PercentDecimal', '%'] as const;\ntype PercentUnitKind = (typeof percentUnitKinds)[number];\nexport type PercentUnitOptions = {\n kind: PercentUnitKind;\n decimal_places?: number;\n};\nexport const
|
|
1
|
+
{"version":3,"sources":["../../../src/model/units/percent.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { MAX_SIGNIFICANT_DIGITS } from './constants';\nimport { UnitGroupConfig, UnitConfig } from './types';\nimport { hasDecimalPlaces, limitDecimalPlaces } from './utils';\n\nconst percentUnitKinds = ['Percent', 'PercentDecimal', '%'] as const;\ntype PercentUnitKind = (typeof percentUnitKinds)[number];\nexport type PercentUnitOptions = {\n kind: PercentUnitKind;\n decimal_places?: number;\n};\nexport const PERCENT_GROUP_CONFIG: UnitGroupConfig = {\n label: 'Percent',\n decimal_places: true,\n};\nconst PERCENT_GROUP = 'Percent';\nexport const PERCENT_UNIT_CONFIG: Readonly<Record<PercentUnitKind, UnitConfig>> = {\n Percent: {\n group: PERCENT_GROUP,\n label: 'Percent (0-100)',\n },\n PercentDecimal: {\n group: PERCENT_GROUP,\n label: 'Percent (0.0-1.0)',\n },\n '%': {\n // This option is not shown in the selector because it is a shorthand\n // duplicate of `Percent`.\n disableSelectorOption: true,\n group: PERCENT_GROUP,\n label: '%',\n },\n};\n\nexport function formatPercent(value: number, { kind, decimal_places }: PercentUnitOptions): string {\n // Intl.NumberFormat translates 0 -> 0%, 0.5 -> 50%, 1 -> 100%\n if (kind === 'Percent') {\n value = value / 100;\n }\n\n const formatterOptions: Intl.NumberFormatOptions = {\n style: 'percent',\n useGrouping: true,\n };\n\n if (hasDecimalPlaces(decimal_places)) {\n formatterOptions.minimumFractionDigits = limitDecimalPlaces(decimal_places);\n formatterOptions.maximumFractionDigits = limitDecimalPlaces(decimal_places);\n } else {\n formatterOptions.maximumSignificantDigits = MAX_SIGNIFICANT_DIGITS;\n }\n\n return Intl.NumberFormat('en-US', formatterOptions).format(value);\n}\n"],"names":["MAX_SIGNIFICANT_DIGITS","hasDecimalPlaces","limitDecimalPlaces","percentUnitKinds","PERCENT_GROUP_CONFIG","label","decimal_places","PERCENT_GROUP","PERCENT_UNIT_CONFIG","Percent","group","PercentDecimal","disableSelectorOption","formatPercent","value","kind","formatterOptions","style","useGrouping","minimumFractionDigits","maximumFractionDigits","maximumSignificantDigits","Intl","NumberFormat","format"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,sBAAsB,QAAQ,aAAa,CAAC;AAErD,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,SAAS,CAAC;AAE/D,MAAMC,gBAAgB,GAAG;IAAC,SAAS;IAAE,gBAAgB;IAAE,GAAG;CAAC,AAAS,AAAC;AAMrE,OAAO,MAAMC,oBAAoB,GAAoB;IACnDC,KAAK,EAAE,SAAS;IAChBC,cAAc,EAAE,IAAI;CACrB,CAAC;AACF,MAAMC,aAAa,GAAG,SAAS,AAAC;AAChC,OAAO,MAAMC,mBAAmB,GAAkD;IAChFC,OAAO,EAAE;QACPC,KAAK,EAAEH,aAAa;QACpBF,KAAK,EAAE,iBAAiB;KACzB;IACDM,cAAc,EAAE;QACdD,KAAK,EAAEH,aAAa;QACpBF,KAAK,EAAE,mBAAmB;KAC3B;IACD,GAAG,EAAE;QACH,qEAAqE;QACrE,0BAA0B;QAC1BO,qBAAqB,EAAE,IAAI;QAC3BF,KAAK,EAAEH,aAAa;QACpBF,KAAK,EAAE,GAAG;KACX;CACF,CAAC;AAEF,OAAO,SAASQ,aAAa,CAACC,KAAa,EAAE,EAAEC,IAAI,CAAA,EAAET,cAAc,CAAA,EAAsB,EAAU;IACjG,8DAA8D;IAC9D,IAAIS,IAAI,KAAK,SAAS,EAAE;QACtBD,KAAK,GAAGA,KAAK,GAAG,GAAG,CAAC;IACtB,CAAC;IAED,MAAME,gBAAgB,GAA6B;QACjDC,KAAK,EAAE,SAAS;QAChBC,WAAW,EAAE,IAAI;KAClB,AAAC;IAEF,IAAIjB,gBAAgB,CAACK,cAAc,CAAC,EAAE;QACpCU,gBAAgB,CAACG,qBAAqB,GAAGjB,kBAAkB,CAACI,cAAc,CAAC,CAAC;QAC5EU,gBAAgB,CAACI,qBAAqB,GAAGlB,kBAAkB,CAACI,cAAc,CAAC,CAAC;IAC9E,OAAO;QACLU,gBAAgB,CAACK,wBAAwB,GAAGrB,sBAAsB,CAAC;IACrE,CAAC;IAED,OAAOsB,IAAI,CAACC,YAAY,CAAC,OAAO,EAAEP,gBAAgB,CAAC,CAACQ,MAAM,CAACV,KAAK,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare type TimeUnitOptions = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const TIME_GROUP_CONFIG: UnitGroupConfig;
|
|
9
9
|
export declare const TIME_UNIT_CONFIG: Readonly<Record<TimeUnitKind, UnitConfig>>;
|
|
10
|
-
export declare enum
|
|
10
|
+
export declare enum PersesTimeToIntlTime {
|
|
11
11
|
Milliseconds = "millisecond",
|
|
12
12
|
Seconds = "second",
|
|
13
13
|
Minutes = "minute",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/model/units/time.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../src/model/units/time.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGtD,QAAA,MAAM,aAAa,8FAA+F,CAAC;AACnH,aAAK,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,oBAAY,eAAe,GAAG;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,eAG/B,CAAC;AACF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAiCvE,CAAC;AAIF,oBAAY,oBAAoB;IAC9B,YAAY,gBAAgB;IAC5B,OAAO,WAAW;IAClB,OAAO,WAAW;IAClB,KAAK,SAAS;IACd,IAAI,QAAQ;IACZ,KAAK,SAAS;IACd,MAAM,UAAU;IAChB,KAAK,SAAS;CACf;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,eAAe,GAAG,MAAM,CAiB3F"}
|
package/dist/model/units/time.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import {
|
|
13
|
+
import { MAX_SIGNIFICANT_DIGITS } from './constants';
|
|
14
|
+
import { hasDecimalPlaces, limitDecimalPlaces } from './utils';
|
|
14
15
|
const timeUnitKinds = [
|
|
15
16
|
'Milliseconds',
|
|
16
17
|
'Seconds',
|
|
@@ -60,28 +61,31 @@ export const TIME_UNIT_CONFIG = {
|
|
|
60
61
|
label: 'Years'
|
|
61
62
|
}
|
|
62
63
|
};
|
|
63
|
-
export var
|
|
64
|
-
(function(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})(
|
|
64
|
+
export var PersesTimeToIntlTime;
|
|
65
|
+
(function(PersesTimeToIntlTime) {
|
|
66
|
+
PersesTimeToIntlTime["Milliseconds"] = 'millisecond';
|
|
67
|
+
PersesTimeToIntlTime["Seconds"] = 'second';
|
|
68
|
+
PersesTimeToIntlTime["Minutes"] = 'minute';
|
|
69
|
+
PersesTimeToIntlTime["Hours"] = 'hour';
|
|
70
|
+
PersesTimeToIntlTime["Days"] = 'day';
|
|
71
|
+
PersesTimeToIntlTime["Weeks"] = 'week';
|
|
72
|
+
PersesTimeToIntlTime["Months"] = 'month';
|
|
73
|
+
PersesTimeToIntlTime["Years"] = 'year';
|
|
74
|
+
})(PersesTimeToIntlTime || (PersesTimeToIntlTime = {}));
|
|
74
75
|
export function formatTime(value, { kind , decimal_places }) {
|
|
75
|
-
const decimalPlaces = decimal_places !== null && decimal_places !== void 0 ? decimal_places : DEFAULT_DECIMAL_PLACES;
|
|
76
|
-
const timeUnit = TimeIntlDuration[kind];
|
|
77
76
|
const isMonthOrYear = kind === 'Months' || kind === 'Years';
|
|
78
|
-
const
|
|
77
|
+
const formatterOptions = {
|
|
79
78
|
style: 'unit',
|
|
80
|
-
unit:
|
|
81
|
-
unitDisplay: isMonthOrYear ? 'long' : 'narrow'
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
unit: PersesTimeToIntlTime[kind],
|
|
80
|
+
unitDisplay: isMonthOrYear ? 'long' : 'narrow'
|
|
81
|
+
};
|
|
82
|
+
if (hasDecimalPlaces(decimal_places)) {
|
|
83
|
+
formatterOptions.minimumFractionDigits = limitDecimalPlaces(decimal_places);
|
|
84
|
+
formatterOptions.maximumFractionDigits = limitDecimalPlaces(decimal_places);
|
|
85
|
+
} else {
|
|
86
|
+
formatterOptions.maximumSignificantDigits = MAX_SIGNIFICANT_DIGITS;
|
|
87
|
+
}
|
|
88
|
+
return Intl.NumberFormat('en-US', formatterOptions).format(value);
|
|
85
89
|
}
|
|
86
90
|
|
|
87
91
|
//# sourceMappingURL=time.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/model/units/time.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/model/units/time.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { MAX_SIGNIFICANT_DIGITS } from './constants';\nimport { UnitGroupConfig, UnitConfig } from './types';\nimport { hasDecimalPlaces, limitDecimalPlaces } from './utils';\n\nconst timeUnitKinds = ['Milliseconds', 'Seconds', 'Minutes', 'Hours', 'Days', 'Weeks', 'Months', 'Years'] as const;\ntype TimeUnitKind = (typeof timeUnitKinds)[number];\nexport type TimeUnitOptions = {\n kind: TimeUnitKind;\n decimal_places?: number;\n};\nconst TIME_GROUP = 'Time';\nexport const TIME_GROUP_CONFIG: UnitGroupConfig = {\n label: 'Time',\n decimal_places: true,\n};\nexport const TIME_UNIT_CONFIG: Readonly<Record<TimeUnitKind, UnitConfig>> = {\n Milliseconds: {\n group: TIME_GROUP,\n label: 'Milliseconds',\n },\n Seconds: {\n group: TIME_GROUP,\n label: 'Seconds',\n },\n Minutes: {\n group: TIME_GROUP,\n label: 'Minutes',\n },\n Hours: {\n group: TIME_GROUP,\n label: 'Hours',\n },\n Days: {\n group: TIME_GROUP,\n label: 'Days',\n },\n Weeks: {\n group: TIME_GROUP,\n label: 'Weeks',\n },\n Months: {\n group: TIME_GROUP,\n label: 'Months',\n },\n Years: {\n group: TIME_GROUP,\n label: 'Years',\n },\n};\n\n// Mapping of time units to what Intl.NumberFormat formatter expects\n// https://v8.dev/features/intl-numberformat#units\nexport enum PersesTimeToIntlTime {\n Milliseconds = 'millisecond',\n Seconds = 'second',\n Minutes = 'minute',\n Hours = 'hour',\n Days = 'day',\n Weeks = 'week',\n Months = 'month',\n Years = 'year',\n}\n\nexport function formatTime(value: number, { kind, decimal_places }: TimeUnitOptions): string {\n const isMonthOrYear = kind === 'Months' || kind === 'Years';\n\n const formatterOptions: Intl.NumberFormatOptions = {\n style: 'unit',\n unit: PersesTimeToIntlTime[kind],\n unitDisplay: isMonthOrYear ? 'long' : 'narrow',\n };\n\n if (hasDecimalPlaces(decimal_places)) {\n formatterOptions.minimumFractionDigits = limitDecimalPlaces(decimal_places);\n formatterOptions.maximumFractionDigits = limitDecimalPlaces(decimal_places);\n } else {\n formatterOptions.maximumSignificantDigits = MAX_SIGNIFICANT_DIGITS;\n }\n\n return Intl.NumberFormat('en-US', formatterOptions).format(value);\n}\n"],"names":["MAX_SIGNIFICANT_DIGITS","hasDecimalPlaces","limitDecimalPlaces","timeUnitKinds","TIME_GROUP","TIME_GROUP_CONFIG","label","decimal_places","TIME_UNIT_CONFIG","Milliseconds","group","Seconds","Minutes","Hours","Days","Weeks","Months","Years","PersesTimeToIntlTime","formatTime","value","kind","isMonthOrYear","formatterOptions","style","unit","unitDisplay","minimumFractionDigits","maximumFractionDigits","maximumSignificantDigits","Intl","NumberFormat","format"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,sBAAsB,QAAQ,aAAa,CAAC;AAErD,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,SAAS,CAAC;AAE/D,MAAMC,aAAa,GAAG;IAAC,cAAc;IAAE,SAAS;IAAE,SAAS;IAAE,OAAO;IAAE,MAAM;IAAE,OAAO;IAAE,QAAQ;IAAE,OAAO;CAAC,AAAS,AAAC;AAMnH,MAAMC,UAAU,GAAG,MAAM,AAAC;AAC1B,OAAO,MAAMC,iBAAiB,GAAoB;IAChDC,KAAK,EAAE,MAAM;IACbC,cAAc,EAAE,IAAI;CACrB,CAAC;AACF,OAAO,MAAMC,gBAAgB,GAA+C;IAC1EC,YAAY,EAAE;QACZC,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,cAAc;KACtB;IACDK,OAAO,EAAE;QACPD,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,SAAS;KACjB;IACDM,OAAO,EAAE;QACPF,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,SAAS;KACjB;IACDO,KAAK,EAAE;QACLH,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,OAAO;KACf;IACDQ,IAAI,EAAE;QACJJ,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,MAAM;KACd;IACDS,KAAK,EAAE;QACLL,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,OAAO;KACf;IACDU,MAAM,EAAE;QACNN,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,QAAQ;KAChB;IACDW,KAAK,EAAE;QACLP,KAAK,EAAEN,UAAU;QACjBE,KAAK,EAAE,OAAO;KACf;CACF,CAAC;WAIK,oBASN;UATWY,oBAAoB;IAApBA,oBAAoB,CAC9BT,cAAY,IAAG,aAAa;IADlBS,oBAAoB,CAE9BP,SAAO,IAAG,QAAQ;IAFRO,oBAAoB,CAG9BN,SAAO,IAAG,QAAQ;IAHRM,oBAAoB,CAI9BL,OAAK,IAAG,MAAM;IAJJK,oBAAoB,CAK9BJ,MAAI,IAAG,KAAK;IALFI,oBAAoB,CAM9BH,OAAK,IAAG,MAAM;IANJG,oBAAoB,CAO9BF,QAAM,IAAG,OAAO;IAPNE,oBAAoB,CAQ9BD,OAAK,IAAG,MAAM;GARJC,oBAAoB,KAApBA,oBAAoB;AAWhC,OAAO,SAASC,UAAU,CAACC,KAAa,EAAE,EAAEC,IAAI,CAAA,EAAEd,cAAc,CAAA,EAAmB,EAAU;IAC3F,MAAMe,aAAa,GAAGD,IAAI,KAAK,QAAQ,IAAIA,IAAI,KAAK,OAAO,AAAC;IAE5D,MAAME,gBAAgB,GAA6B;QACjDC,KAAK,EAAE,MAAM;QACbC,IAAI,EAAEP,oBAAoB,CAACG,IAAI,CAAC;QAChCK,WAAW,EAAEJ,aAAa,GAAG,MAAM,GAAG,QAAQ;KAC/C,AAAC;IAEF,IAAIrB,gBAAgB,CAACM,cAAc,CAAC,EAAE;QACpCgB,gBAAgB,CAACI,qBAAqB,GAAGzB,kBAAkB,CAACK,cAAc,CAAC,CAAC;QAC5EgB,gBAAgB,CAACK,qBAAqB,GAAG1B,kBAAkB,CAACK,cAAc,CAAC,CAAC;IAC9E,OAAO;QACLgB,gBAAgB,CAACM,wBAAwB,GAAG7B,sBAAsB,CAAC;IACrE,CAAC;IAED,OAAO8B,IAAI,CAACC,YAAY,CAAC,OAAO,EAAER,gBAAgB,CAAC,CAACS,MAAM,CAACZ,KAAK,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { BYTES_GROUP_CONFIG, BYTES_UNIT_CONFIG, formatBytes } from './bytes';
|
|
14
|
-
import { DECIMAL_UNIT_CONFIG, formatDecimal,
|
|
15
|
-
import {
|
|
14
|
+
import { DECIMAL_UNIT_CONFIG, formatDecimal, DECIMAL_GROUP_CONFIG } from './decimal';
|
|
15
|
+
import { PERCENT_GROUP_CONFIG, formatPercent, PERCENT_UNIT_CONFIG } from './percent';
|
|
16
16
|
import { formatTime, TIME_GROUP_CONFIG, TIME_UNIT_CONFIG } from './time';
|
|
17
17
|
export const UNIT_GROUP_CONFIG = {
|
|
18
18
|
Time: TIME_GROUP_CONFIG,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/model/units/units.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { BytesUnitOptions, BYTES_GROUP_CONFIG, BYTES_UNIT_CONFIG, formatBytes } from './bytes';\nimport { DecimalUnitOptions, DECIMAL_UNIT_CONFIG, formatDecimal,
|
|
1
|
+
{"version":3,"sources":["../../../src/model/units/units.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { BytesUnitOptions, BYTES_GROUP_CONFIG, BYTES_UNIT_CONFIG, formatBytes } from './bytes';\nimport { DecimalUnitOptions, DECIMAL_UNIT_CONFIG, formatDecimal, DECIMAL_GROUP_CONFIG } from './decimal';\nimport { PERCENT_GROUP_CONFIG, formatPercent, PercentUnitOptions, PERCENT_UNIT_CONFIG } from './percent';\nimport { formatTime, TimeUnitOptions, TIME_GROUP_CONFIG, TIME_UNIT_CONFIG } from './time';\nimport { UnitGroup, UnitGroupConfig, UnitConfig } from './types';\n\nexport const UNIT_GROUP_CONFIG: Readonly<Record<UnitGroup, UnitGroupConfig>> = {\n Time: TIME_GROUP_CONFIG,\n Percent: PERCENT_GROUP_CONFIG,\n Decimal: DECIMAL_GROUP_CONFIG,\n Bytes: BYTES_GROUP_CONFIG,\n};\nexport const UNIT_CONFIG = {\n ...TIME_UNIT_CONFIG,\n ...PERCENT_UNIT_CONFIG,\n ...DECIMAL_UNIT_CONFIG,\n ...BYTES_UNIT_CONFIG,\n} as const;\n\nexport type UnitOptions = TimeUnitOptions | PercentUnitOptions | DecimalUnitOptions | BytesUnitOptions;\n\ntype HasDecimalPlaces<UnitOpt> = UnitOpt extends { decimal_places?: number } ? UnitOpt : never;\ntype HasAbbreviate<UnitOpt> = UnitOpt extends { abbreviate?: boolean } ? UnitOpt : never;\n\nexport function formatValue(value: number, unitOptions?: UnitOptions): string {\n if (unitOptions === undefined) {\n return value.toString();\n }\n\n if (isDecimalUnit(unitOptions)) {\n return formatDecimal(value, unitOptions);\n }\n\n if (isTimeUnit(unitOptions)) {\n return formatTime(value, unitOptions);\n }\n\n if (isPercentUnit(unitOptions)) {\n return formatPercent(value, unitOptions);\n }\n\n if (isBytesUnit(unitOptions)) {\n return formatBytes(value, unitOptions);\n }\n\n const exhaustive: never = unitOptions;\n throw new Error(`Unknown unit options ${exhaustive}`);\n}\n\nexport function getUnitKindConfig(unitOptions: UnitOptions): UnitConfig {\n return UNIT_CONFIG[unitOptions.kind];\n}\n\nexport function getUnitGroup(unitOptions: UnitOptions): UnitGroup {\n return getUnitKindConfig(unitOptions).group;\n}\n\nexport function getUnitGroupConfig(unitOptions: UnitOptions): UnitGroupConfig {\n const unitConfig = getUnitKindConfig(unitOptions);\n return UNIT_GROUP_CONFIG[unitConfig.group];\n}\n\n// Type guards\nexport function isTimeUnit(unitOptions: UnitOptions): unitOptions is TimeUnitOptions {\n return getUnitGroup(unitOptions) === 'Time';\n}\n\nexport function isPercentUnit(unitOptions: UnitOptions): unitOptions is PercentUnitOptions {\n return getUnitGroup(unitOptions) === 'Percent';\n}\n\nexport function isDecimalUnit(unitOptions: UnitOptions): unitOptions is DecimalUnitOptions {\n return getUnitGroup(unitOptions) === 'Decimal';\n}\n\nexport function isBytesUnit(unitOptions: UnitOptions): unitOptions is BytesUnitOptions {\n return getUnitGroup(unitOptions) === 'Bytes';\n}\n\nexport function isUnitWithDecimalPlaces(unitOptions: UnitOptions): unitOptions is HasDecimalPlaces<UnitOptions> {\n const groupConfig = getUnitGroupConfig(unitOptions);\n\n return !!groupConfig.decimal_places;\n}\n\nexport function isUnitWithAbbreviate(unitOptions: UnitOptions): unitOptions is HasAbbreviate<UnitOptions> {\n const groupConfig = getUnitGroupConfig(unitOptions);\n\n return !!groupConfig.abbreviate;\n}\n"],"names":["BYTES_GROUP_CONFIG","BYTES_UNIT_CONFIG","formatBytes","DECIMAL_UNIT_CONFIG","formatDecimal","DECIMAL_GROUP_CONFIG","PERCENT_GROUP_CONFIG","formatPercent","PERCENT_UNIT_CONFIG","formatTime","TIME_GROUP_CONFIG","TIME_UNIT_CONFIG","UNIT_GROUP_CONFIG","Time","Percent","Decimal","Bytes","UNIT_CONFIG","formatValue","value","unitOptions","undefined","toString","isDecimalUnit","isTimeUnit","isPercentUnit","isBytesUnit","exhaustive","Error","getUnitKindConfig","kind","getUnitGroup","group","getUnitGroupConfig","unitConfig","isUnitWithDecimalPlaces","groupConfig","decimal_places","isUnitWithAbbreviate","abbreviate"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/model/units/utils.ts"],"names":[],"mappings":"AAaA,wBAAgB,gBAAgB,CAAC,UAAU,CAAC,EAAE,OAAO,WAEpD;AAED,wBAAgB,gBAAgB,CAAC,cAAc,CAAC,EAAE,MAAM,WAEvD;AAKD,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,MAAM,sBAU9C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright 2023 The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
export function shouldAbbreviate(abbreviate) {
|
|
14
|
+
return abbreviate !== false;
|
|
15
|
+
}
|
|
16
|
+
export function hasDecimalPlaces(decimal_places) {
|
|
17
|
+
return typeof decimal_places === 'number';
|
|
18
|
+
}
|
|
19
|
+
// Avoids maximumFractionDigits out-of-range error.
|
|
20
|
+
// Allowed values are 0 to 20.
|
|
21
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits
|
|
22
|
+
export function limitDecimalPlaces(num) {
|
|
23
|
+
if (!num) return num;
|
|
24
|
+
if (num < 0) {
|
|
25
|
+
num = 0;
|
|
26
|
+
} else if (num > 20) {
|
|
27
|
+
num = 20;
|
|
28
|
+
}
|
|
29
|
+
return num;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/model/units/utils.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport function shouldAbbreviate(abbreviate?: boolean) {\n return abbreviate !== false;\n}\n\nexport function hasDecimalPlaces(decimal_places?: number) {\n return typeof decimal_places === 'number';\n}\n\n// Avoids maximumFractionDigits out-of-range error.\n// Allowed values are 0 to 20.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#maximumfractiondigits\nexport function limitDecimalPlaces(num?: number) {\n if (!num) return num;\n\n if (num < 0) {\n num = 0;\n } else if (num > 20) {\n num = 20;\n }\n\n return num;\n}\n"],"names":["shouldAbbreviate","abbreviate","hasDecimalPlaces","decimal_places","limitDecimalPlaces","num"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,SAASA,gBAAgB,CAACC,UAAoB,EAAE;IACrD,OAAOA,UAAU,KAAK,KAAK,CAAC;AAC9B,CAAC;AAED,OAAO,SAASC,gBAAgB,CAACC,cAAuB,EAAE;IACxD,OAAO,OAAOA,cAAc,KAAK,QAAQ,CAAC;AAC5C,CAAC;AAED,mDAAmD;AACnD,8BAA8B;AAC9B,wIAAwI;AACxI,OAAO,SAASC,kBAAkB,CAACC,GAAY,EAAE;IAC/C,IAAI,CAACA,GAAG,EAAE,OAAOA,GAAG,CAAC;IAErB,IAAIA,GAAG,GAAG,CAAC,EAAE;QACXA,GAAG,GAAG,CAAC,CAAC;IACV,OAAO,IAAIA,GAAG,GAAG,EAAE,EAAE;QACnBA,GAAG,GAAG,EAAE,CAAC;IACX,CAAC;IAED,OAAOA,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Common UI components used across Perses features",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@codemirror/lang-json": "^6.0.1",
|
|
37
37
|
"@fontsource/lato": "^4.5.10",
|
|
38
38
|
"@mui/x-date-pickers": "^5.0.0-beta.1",
|
|
39
|
-
"@perses-dev/core": "0.
|
|
39
|
+
"@perses-dev/core": "0.30.0",
|
|
40
40
|
"@uiw/react-codemirror": "^4.19.1",
|
|
41
41
|
"date-fns": "^2.28.0",
|
|
42
42
|
"date-fns-tz": "^1.3.7",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-window": "^1.8.8"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@perses-dev/storybook": "0.
|
|
53
|
+
"@perses-dev/storybook": "0.30.0",
|
|
54
54
|
"@types/react-window": "^1.8.5"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|