@vlrc-fe/components 1.0.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/README.md +193 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +42 -0
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +85 -0
- package/dist/index100.cjs +1 -0
- package/dist/index100.js +65 -0
- package/dist/index101.cjs +1 -0
- package/dist/index101.js +48 -0
- package/dist/index102.cjs +1 -0
- package/dist/index102.js +67 -0
- package/dist/index103.cjs +1 -0
- package/dist/index103.js +151 -0
- package/dist/index104.cjs +1 -0
- package/dist/index104.js +23 -0
- package/dist/index105.cjs +1 -0
- package/dist/index105.js +27 -0
- package/dist/index106.cjs +1 -0
- package/dist/index106.js +53 -0
- package/dist/index107.cjs +1 -0
- package/dist/index107.js +161 -0
- package/dist/index108.cjs +1 -0
- package/dist/index108.js +16 -0
- package/dist/index109.cjs +1 -0
- package/dist/index11.cjs +1 -0
- package/dist/index11.js +86 -0
- package/dist/index12.cjs +1 -0
- package/dist/index12.js +122 -0
- package/dist/index13.cjs +1 -0
- package/dist/index13.js +14 -0
- package/dist/index14.cjs +1 -0
- package/dist/index14.js +16 -0
- package/dist/index15.cjs +1 -0
- package/dist/index15.js +115 -0
- package/dist/index16.cjs +1 -0
- package/dist/index16.js +727 -0
- package/dist/index17.cjs +1 -0
- package/dist/index17.js +348 -0
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +76 -0
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +14 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +122 -0
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +116 -0
- package/dist/index21.cjs +1 -0
- package/dist/index21.js +35 -0
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +18 -0
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +27 -0
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +35 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +97 -0
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +28 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +14 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +67 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +13 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +8 -0
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +35 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +43 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +14 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +64 -0
- package/dist/index34.cjs +1 -0
- package/dist/index34.js +23 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +34 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +27 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +26 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +157 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +34 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +43 -0
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +46 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +118 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +125 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +26 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +88 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +221 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +166 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +126 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +15 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +9 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +24 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +17 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +22 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +18 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +6 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +7 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +8 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +7 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +7 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +9 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +69 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +51 -0
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +11 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +202 -0
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +124 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +32 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +20 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +69 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +32 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +11 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +280 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +157 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +88 -0
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +20 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +10 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +14 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +8 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +8 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +11 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +10 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +6 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +8 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +8 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +68 -0
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +10 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +11 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +15 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +11 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +11 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +6 -0
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +43 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +382 -0
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +40 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +23 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +20 -0
- package/dist/index90.cjs +1 -0
- package/dist/index90.js +59 -0
- package/dist/index91.cjs +1 -0
- package/dist/index91.js +55 -0
- package/dist/index92.cjs +1 -0
- package/dist/index92.js +54 -0
- package/dist/index93.cjs +1 -0
- package/dist/index93.js +57 -0
- package/dist/index94.cjs +1 -0
- package/dist/index94.js +57 -0
- package/dist/index95.cjs +1 -0
- package/dist/index95.js +88 -0
- package/dist/index96.cjs +1 -0
- package/dist/index96.js +66 -0
- package/dist/index97.cjs +1 -0
- package/dist/index97.js +594 -0
- package/dist/index98.cjs +9 -0
- package/dist/index98.js +30 -0
- package/dist/index99.cjs +1 -0
- package/dist/index99.js +50 -0
- package/package.json +82 -0
package/dist/index99.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn as e } from "./index3.js";
|
|
2
|
+
//#region src/Form/FormNumberInput/useFormNumberInput.ts
|
|
3
|
+
var t = [
|
|
4
|
+
"[appearance:textfield]",
|
|
5
|
+
"[&::-webkit-outer-spin-button]:appearance-none",
|
|
6
|
+
"[&::-webkit-inner-spin-button]:appearance-none",
|
|
7
|
+
"rounded-r-none",
|
|
8
|
+
"relative"
|
|
9
|
+
];
|
|
10
|
+
function n({ rules: n, inputClassName: r, stepper: i, min: a, max: o, onChange: s, passthroughProps: c }) {
|
|
11
|
+
let l = n?.required !== void 0 && n.required !== !1;
|
|
12
|
+
return {
|
|
13
|
+
isRequired: l,
|
|
14
|
+
enhancedRules: (() => {
|
|
15
|
+
if (!n) return n;
|
|
16
|
+
let e = { ...n };
|
|
17
|
+
return l && typeof e.required != "string" && typeof e.required != "object" ? e.required = "Trường này là bắt buộc" : typeof e.required == "object" && !e.required.message && (e.required = {
|
|
18
|
+
...e.required,
|
|
19
|
+
message: "Trường này là bắt buộc"
|
|
20
|
+
}), e;
|
|
21
|
+
})(),
|
|
22
|
+
numericClass: e(t, r),
|
|
23
|
+
getHandlers: ({ currentValue: e, field: t }) => {
|
|
24
|
+
let n = () => {
|
|
25
|
+
let n = Math.min((e ?? 0) + i, o);
|
|
26
|
+
t.onChange(n), s?.(n);
|
|
27
|
+
}, r = () => {
|
|
28
|
+
let n = Math.max((e ?? 0) - i, a);
|
|
29
|
+
t.onChange(n), s?.(n);
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
handleIncrement: n,
|
|
33
|
+
handleDecrement: r,
|
|
34
|
+
handleKeyDown: (e) => {
|
|
35
|
+
e.key === "ArrowUp" ? (e.preventDefault(), n()) : e.key === "ArrowDown" && (e.preventDefault(), r()), c.onKeyDown && c.onKeyDown(e);
|
|
36
|
+
},
|
|
37
|
+
handleBlur: () => {
|
|
38
|
+
let n = e;
|
|
39
|
+
n !== void 0 && (n < a ? (t.onChange(a), s?.(a)) : n > o && (t.onChange(o), s?.(o))), t.onBlur(), c.onBlur && c.onBlur();
|
|
40
|
+
},
|
|
41
|
+
numericOnValueChange: (e) => {
|
|
42
|
+
let n = e.floatValue === void 0 ? void 0 : e.floatValue;
|
|
43
|
+
t.onChange(n), s?.(n);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { n as useFormNumberInput };
|
package/package.json
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vlrc-fe/components",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Reusable PlatformCore React components.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./DataTable": {
|
|
22
|
+
"types": "./dist/DataTable/index.d.ts",
|
|
23
|
+
"import": "./dist/DataTable/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./DataTable/*": {
|
|
26
|
+
"types": "./dist/DataTable/*.d.ts",
|
|
27
|
+
"import": "./dist/DataTable/*.js"
|
|
28
|
+
},
|
|
29
|
+
"./Icons": {
|
|
30
|
+
"types": "./dist/Icons/index.d.ts",
|
|
31
|
+
"import": "./dist/Icons/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./ui/*": {
|
|
34
|
+
"types": "./dist/ui/*.d.ts",
|
|
35
|
+
"import": "./dist/ui/*.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
40
|
+
"@radix-ui/react-direction": "^1.1.1",
|
|
41
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
42
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
43
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
44
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
45
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
46
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
47
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
48
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
49
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
50
|
+
"@radix-ui/react-separator": "^1.1.8",
|
|
51
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
52
|
+
"@tanstack/react-table": "^8.21.3",
|
|
53
|
+
"ahooks": "^3.9.7",
|
|
54
|
+
"class-variance-authority": "^0.7.1",
|
|
55
|
+
"clsx": "^2.1.1",
|
|
56
|
+
"cmdk": "^1.1.1",
|
|
57
|
+
"lodash-es": "^4.18.1",
|
|
58
|
+
"lucide-react": "^1.16.0",
|
|
59
|
+
"next-themes": "^0.4.6",
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-day-picker": "^10.0.1",
|
|
62
|
+
"react-dom": "^19.0.0",
|
|
63
|
+
"react-i18next": "^17.0.8",
|
|
64
|
+
"sonner": "^2.0.7",
|
|
65
|
+
"tailwind-merge": "^3.6.0",
|
|
66
|
+
"react-hook-form": "^7.76.1",
|
|
67
|
+
"react-number-format": "^5.4.5",
|
|
68
|
+
"date-fns": "^4.3.0"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
72
|
+
"typescript": "~6.0.3",
|
|
73
|
+
"vite": "8.0.14"
|
|
74
|
+
},
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"access": "public"
|
|
77
|
+
},
|
|
78
|
+
"scripts": {
|
|
79
|
+
"build": "tsc -p tsconfig.json && vite build",
|
|
80
|
+
"lint": "eslint ."
|
|
81
|
+
}
|
|
82
|
+
}
|