@canvas-components/utils 0.2.3 → 0.2.4
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/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -775,6 +775,21 @@ function isPointInRect(x, y, rect) {
|
|
|
775
775
|
return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;
|
|
776
776
|
}
|
|
777
777
|
|
|
778
|
+
// src/canvas-scrollbar.ts
|
|
779
|
+
function resolveCanvasScrollbarAxis(options, axis) {
|
|
780
|
+
const override = options?.[axis];
|
|
781
|
+
const merged = { ...options, ...override };
|
|
782
|
+
const thickness = Number.isFinite(merged.thickness) ? Math.max(merged.thickness, 6) : 10;
|
|
783
|
+
return {
|
|
784
|
+
visible: options?.visible !== false && override !== false && merged.visible !== false,
|
|
785
|
+
thickness,
|
|
786
|
+
thumbColor: merged.thumbColor ?? "rgba(100, 116, 139, 0.8)",
|
|
787
|
+
trackColor: merged.trackColor,
|
|
788
|
+
buttonColor: merged.buttonColor ?? "rgba(71, 85, 105, 0.88)",
|
|
789
|
+
thumbRadius: Number.isFinite(merged.thumbRadius) ? Math.max(merged.thumbRadius, 0) : void 0
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
|
|
778
793
|
// src/number/precise.ts
|
|
779
794
|
function addPreciseNumbers(left, right) {
|
|
780
795
|
const leftParts = parseDecimal(left);
|
|
@@ -1186,6 +1201,7 @@ exports.mapRowsToExportRecords = mapRowsToExportRecords;
|
|
|
1186
1201
|
exports.normalizeDecimalPlaces = normalizeDecimalPlaces;
|
|
1187
1202
|
exports.parseChineseNumber = parseChineseNumber;
|
|
1188
1203
|
exports.parseNumberValue = parseNumberValue;
|
|
1204
|
+
exports.resolveCanvasScrollbarAxis = resolveCanvasScrollbarAxis;
|
|
1189
1205
|
exports.resolveDateValue = resolveDateValue;
|
|
1190
1206
|
exports.roundPreciseNumber = roundPreciseNumber;
|
|
1191
1207
|
exports.serializeCsvRows = serializeCsvRows;
|