@vnejs/uis.react.text-controls 0.1.2
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/TextControls.d.ts +25 -0
- package/dist/TextControls.d.ts.map +1 -0
- package/dist/TextControls.js +8 -0
- package/dist/TextControls.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +32 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const TextControls: ({ texts, selectedIndex, textProps, flexProps, textSize, textWidth, textAlign, textMarginTop, flexGap, flexGapVertical, flexGapHorizontal, flexDirection, flexAlign, flexJustify, flexWithWrap, wrapWidth, wrapHeight, wrapClassName, withScrollbar, scrollbarWrapRef, onClick, value, }: {
|
|
2
|
+
texts?: any[];
|
|
3
|
+
selectedIndex?: number;
|
|
4
|
+
textProps?: {};
|
|
5
|
+
flexProps?: {};
|
|
6
|
+
textSize?: number;
|
|
7
|
+
textWidth?: any;
|
|
8
|
+
textAlign?: any;
|
|
9
|
+
textMarginTop?: any;
|
|
10
|
+
flexGap?: number;
|
|
11
|
+
flexGapVertical?: number;
|
|
12
|
+
flexGapHorizontal?: number;
|
|
13
|
+
flexDirection?: any;
|
|
14
|
+
flexAlign?: any;
|
|
15
|
+
flexJustify?: any;
|
|
16
|
+
flexWithWrap?: any;
|
|
17
|
+
wrapWidth?: any;
|
|
18
|
+
wrapHeight?: any;
|
|
19
|
+
wrapClassName: any;
|
|
20
|
+
withScrollbar?: boolean;
|
|
21
|
+
scrollbarWrapRef?: any;
|
|
22
|
+
onClick: any;
|
|
23
|
+
value: any;
|
|
24
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=TextControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextControls.d.ts","sourceRoot":"","sources":["../src/TextControls.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,GAAI;;;;;;;;;;;;;;;;;;;;;;;CAuB5B,4CAgDA,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { Text, Flex, Scrollbar } from "@vnejs/uis.react";
|
|
4
|
+
export const TextControls = ({ texts = [], selectedIndex = -1, textProps = {}, flexProps = {}, textSize = 60, textWidth = null, textAlign = null, textMarginTop = null, flexGap = 60, flexGapVertical = 0, flexGapHorizontal = 0, flexDirection = Flex.DIRECTION.ROW, flexAlign = null, flexJustify = null, flexWithWrap = null, wrapWidth = null, wrapHeight = null, wrapClassName, withScrollbar = false, scrollbarWrapRef = null, onClick, value, }) => {
|
|
5
|
+
const renderTexts = useCallback(() => texts.map((textInfo, i) => (_jsx(Text, { size: textSize, width: textWidth, align: textAlign, onClick: onClick, isSelected: selectedIndex === i, isCurrent: value !== undefined && value === textInfo?.value, isHoverable: true, marginTop: i === 0 ? null : textMarginTop, ...textProps, ...textInfo }, i))), [texts, textProps, selectedIndex, onClick, value]);
|
|
6
|
+
return withScrollbar ? (_jsx(Scrollbar, { className: wrapClassName, width: wrapWidth, height: wrapHeight, scrollTo: selectedIndex, wrapRef: scrollbarWrapRef, children: renderTexts() })) : (_jsx(Flex, { className: wrapClassName, gap: flexGap, gapHorizontal: flexGapHorizontal, gapVertical: flexGapVertical, align: flexAlign, justify: flexJustify, direction: flexDirection, withWrap: flexWithWrap, width: wrapWidth, height: wrapHeight, ...flexProps, children: renderTexts() }));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=TextControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextControls.js","sourceRoot":"","sources":["../src/TextControls.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,E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AAC,CAAC,CAAC,CACrB,KAAC,SAAS,IACR,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,gBAAgB,YAExB,WAAW,EAAE,GACJ,CACb,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,SAAS,EAAE,aAAa,EACxB,GAAG,EAAE,OAAO,EACZ,aAAa,EAAE,iBAAiB,EAChC,WAAW,EAAE,eAAe,EAC5B,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,YAAY,EACtB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,UAAU,KACd,SAAS,YAEZ,WAAW,EAAE,GACT,CACR,CAAC;AACJ,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/uis.react.text-controls",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "node ../../scripts/build-package.mjs",
|
|
8
|
+
"publish:major:plugin": "npm run publish:major",
|
|
9
|
+
"publish:minor:plugin": "npm run publish:minor",
|
|
10
|
+
"publish:patch:plugin": "npm run publish:patch",
|
|
11
|
+
"publish:major": "npm run build && npm version major && npm publish --access public",
|
|
12
|
+
"publish:minor": "npm run build && npm version minor && npm publish --access public",
|
|
13
|
+
"publish:patch": "npm run build && npm version patch && npm publish --access public"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@bem-react/classname": "1.5.12",
|
|
17
|
+
"@vnejs/uis.utils": "~0.1.0",
|
|
18
|
+
"react": "19.2.4",
|
|
19
|
+
"react-dom": "19.2.4",
|
|
20
|
+
"@vnejs/uis.react": "~0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@vnejs/uis.react": "~0.1.0",
|
|
24
|
+
"typescript": "^5.7.3",
|
|
25
|
+
"@types/react": "^19.0.10",
|
|
26
|
+
"@types/react-dom": "^19.0.4"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"package.json"
|
|
31
|
+
]
|
|
32
|
+
}
|