@vnejs/uis.react.range-with-text 0.1.7 → 0.1.9
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/RangeWithText.d.ts.map +1 -1
- package/dist/RangeWithText.js +3 -1
- package/dist/RangeWithText.js.map +1 -1
- package/dist/RangeWithText.types.d.ts +7 -6
- package/dist/RangeWithText.types.d.ts.map +1 -1
- package/package.json +7 -5
- package/src/RangeWithText.stories.tsx +2 -2
- package/src/RangeWithText.tsx +5 -1
- package/src/RangeWithText.types.tsx +8 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeWithText.d.ts","sourceRoot":"","sources":["../src/RangeWithText.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RangeWithText.d.ts","sourceRoot":"","sources":["../src/RangeWithText.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,eAAO,MAAM,aAAa,GAAI,6HAc3B,kBAAkB,4CA8BpB,CAAC"}
|
package/dist/RangeWithText.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { Text
|
|
3
|
+
import { Text } from "@vnejs/uis.react.text";
|
|
4
|
+
import { Flex } from "@vnejs/uis.react.flex";
|
|
5
|
+
import { Range } from "@vnejs/uis.react.range";
|
|
4
6
|
export const RangeWithText = ({ isSelected = false, gap = 120, textSize = 72, textWidth = 240, rangeWidth = 1200, rangeHeight = 48, min, max, step, value, valuePostfix = "", valueMap = null, onChange, }) => {
|
|
5
7
|
const valueText = useMemo(() => (typeof valueMap === "function" ? valueMap(value) : value), [valueMap, value]);
|
|
6
8
|
return (_jsxs(Flex, { align: Flex.ALIGN.CENTER, justify: Flex.JUSTIFY.CENTER, direction: Flex.DIRECTION.ROW, gap: gap, children: [_jsx(Range, { className: "TextHoverSibling", isSelected: isSelected, width: rangeWidth, height: rangeHeight, min: min, max: max, step: step, value: value, onChange: onChange }), _jsx(Text, { text: `${valueText}${valuePostfix}`, width: textWidth, isSelected: isSelected, size: textSize, align: Text.ALIGNS.RIGHT })] }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeWithText.js","sourceRoot":"","sources":["../src/RangeWithText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RangeWithText.js","sourceRoot":"","sources":["../src/RangeWithText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAI/C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,UAAU,GAAG,KAAK,EAClB,GAAG,GAAG,GAAG,EACT,QAAQ,GAAG,EAAE,EACb,SAAS,GAAG,GAAG,EACf,UAAU,GAAG,IAAI,EACjB,WAAW,GAAG,EAAE,EAChB,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,EACL,YAAY,GAAG,EAAE,EACjB,QAAQ,GAAG,IAAI,EACf,QAAQ,GACW,EAAE,EAAE;IACvB,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;IAE/G,OAAO,CACL,MAAC,IAAI,IACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EACxB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAC5B,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAC7B,GAAG,EAAE,GAAG,aAER,KAAC,KAAK,IACJ,SAAS,EAAC,kBAAkB,EAC5B,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAClB,EACF,KAAC,IAAI,IACH,IAAI,EAAE,GAAG,SAAS,GAAG,YAAY,EAAE,EACnC,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,UAAU,EACtB,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,GACxB,IACG,CACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import type { CssInsertInnerText, CssInsertValueLength } from "@vnejs/uis.utils";
|
|
1
2
|
export type RangeWithTextProps = {
|
|
2
3
|
isSelected?: boolean;
|
|
3
|
-
gap?:
|
|
4
|
-
textSize?:
|
|
5
|
-
textWidth?:
|
|
6
|
-
rangeWidth?:
|
|
7
|
-
rangeHeight?:
|
|
4
|
+
gap?: CssInsertValueLength;
|
|
5
|
+
textSize?: CssInsertValueLength;
|
|
6
|
+
textWidth?: CssInsertValueLength;
|
|
7
|
+
rangeWidth?: CssInsertValueLength;
|
|
8
|
+
rangeHeight?: CssInsertValueLength;
|
|
8
9
|
min: number | null;
|
|
9
10
|
max: number | null;
|
|
10
11
|
step?: number;
|
|
11
12
|
value: number;
|
|
12
|
-
valuePostfix?:
|
|
13
|
+
valuePostfix?: CssInsertInnerText;
|
|
13
14
|
valueMap?: string | ((value: number) => string | number) | null;
|
|
14
15
|
onChange?: (value: number) => void;
|
|
15
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeWithText.types.d.ts","sourceRoot":"","sources":["../src/RangeWithText.types.tsx"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"RangeWithText.types.d.ts","sourceRoot":"","sources":["../src/RangeWithText.types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEjF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vnejs/uis.react.range-with-text",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -15,12 +15,14 @@
|
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@vnejs/uis.utils": "~0.1.0"
|
|
17
17
|
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@vnejs/uis.react": "~0.1.0"
|
|
20
|
-
},
|
|
21
18
|
"files": [
|
|
22
19
|
"dist",
|
|
23
20
|
"src",
|
|
24
21
|
"tsconfig.json"
|
|
25
|
-
]
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@vnejs/uis.react.flex": "~0.1.0",
|
|
25
|
+
"@vnejs/uis.react.range": "~0.1.0",
|
|
26
|
+
"@vnejs/uis.react.text": "~0.1.0"
|
|
27
|
+
}
|
|
26
28
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
|
|
3
|
-
import { renderWithVneWrap, VneWrap } from "@vnejs/uis.react";
|
|
3
|
+
import { renderWithVneWrap, VneWrap } from "@vnejs/uis.react.vne-wrap";
|
|
4
4
|
|
|
5
|
-
import { RangeWithText } from "
|
|
5
|
+
import { RangeWithText } from "./RangeWithText.js";
|
|
6
6
|
|
|
7
7
|
export const Common = {
|
|
8
8
|
args: {
|
package/src/RangeWithText.tsx
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
|
|
3
|
-
import { Text
|
|
3
|
+
import { Text } from "@vnejs/uis.react.text";
|
|
4
|
+
|
|
5
|
+
import { Flex } from "@vnejs/uis.react.flex";
|
|
6
|
+
|
|
7
|
+
import { Range } from "@vnejs/uis.react.range";
|
|
4
8
|
|
|
5
9
|
import { type RangeWithTextProps } from "./RangeWithText.types.js";
|
|
6
10
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import type { CssInsertInnerText, CssInsertValueLength } from "@vnejs/uis.utils";
|
|
2
|
+
|
|
1
3
|
export type RangeWithTextProps = {
|
|
2
4
|
isSelected?: boolean;
|
|
3
|
-
gap?:
|
|
4
|
-
textSize?:
|
|
5
|
-
textWidth?:
|
|
6
|
-
rangeWidth?:
|
|
7
|
-
rangeHeight?:
|
|
5
|
+
gap?: CssInsertValueLength;
|
|
6
|
+
textSize?: CssInsertValueLength;
|
|
7
|
+
textWidth?: CssInsertValueLength;
|
|
8
|
+
rangeWidth?: CssInsertValueLength;
|
|
9
|
+
rangeHeight?: CssInsertValueLength;
|
|
8
10
|
min: number | null;
|
|
9
11
|
max: number | null;
|
|
10
12
|
step?: number;
|
|
11
13
|
value: number;
|
|
12
|
-
valuePostfix?:
|
|
14
|
+
valuePostfix?: CssInsertInnerText;
|
|
13
15
|
valueMap?: string | ((value: number) => string | number) | null;
|
|
14
16
|
onChange?: (value: number) => void;
|
|
15
17
|
};
|