@apexcura/ui-components 0.0.16-Beta14 → 0.0.16-Beta16
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/.env.defaults +2 -0
- package/dist/index.js +11 -4
- package/dist/index.mjs +11 -4
- package/jest.config.js +10 -0
- package/package.json +9 -13
- package/postcss.config.js +7 -0
- package/tailwind.config.js +9 -0
package/.env.defaults
ADDED
package/dist/index.js
CHANGED
|
@@ -100,22 +100,29 @@ var import_icons = require("@ant-design/icons");
|
|
|
100
100
|
var import_antd2 = require("antd");
|
|
101
101
|
var PasswordElement = (props) => {
|
|
102
102
|
const [passwordVisible, setPasswordVisible] = (0, import_react2.useState)(false);
|
|
103
|
-
|
|
103
|
+
const handleVisibilityToggle = () => {
|
|
104
|
+
setPasswordVisible((prev) => !prev);
|
|
105
|
+
};
|
|
104
106
|
const handleChange = (e) => {
|
|
105
107
|
if (props.onChange) {
|
|
106
108
|
props.onChange(e.target.value);
|
|
107
109
|
}
|
|
108
110
|
};
|
|
109
111
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeTwoTone, null) : /* @__PURE__ */ import_react2.default.createElement(import_icons.EyeInvisibleOutlined, null);
|
|
110
|
-
return /* @__PURE__ */ import_react2.default.createElement("div", { className: props.containerClassName },
|
|
112
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", { className: props.containerClassName }, /* @__PURE__ */ import_react2.default.createElement("label", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react2.default.createElement(
|
|
111
113
|
import_antd2.Input.Password,
|
|
112
114
|
{
|
|
113
115
|
placeholder: props.placeholder,
|
|
114
116
|
className: props.className,
|
|
115
117
|
type: props.type,
|
|
116
|
-
onChange:
|
|
118
|
+
onChange: (e) => {
|
|
119
|
+
handleChange(e);
|
|
120
|
+
},
|
|
117
121
|
iconRender: renderVisibilityIcon,
|
|
118
|
-
visibilityToggle:
|
|
122
|
+
visibilityToggle: {
|
|
123
|
+
visible: passwordVisible && passwordVisible,
|
|
124
|
+
onVisibleChange: handleVisibilityToggle
|
|
125
|
+
}
|
|
119
126
|
}
|
|
120
127
|
));
|
|
121
128
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -31,22 +31,29 @@ import { EyeInvisibleOutlined, EyeTwoTone } from "@ant-design/icons";
|
|
|
31
31
|
import { Input } from "antd";
|
|
32
32
|
var PasswordElement = (props) => {
|
|
33
33
|
const [passwordVisible, setPasswordVisible] = useState(false);
|
|
34
|
-
|
|
34
|
+
const handleVisibilityToggle = () => {
|
|
35
|
+
setPasswordVisible((prev) => !prev);
|
|
36
|
+
};
|
|
35
37
|
const handleChange = (e) => {
|
|
36
38
|
if (props.onChange) {
|
|
37
39
|
props.onChange(e.target.value);
|
|
38
40
|
}
|
|
39
41
|
};
|
|
40
42
|
const renderVisibilityIcon = (visible) => visible ? /* @__PURE__ */ React2.createElement(EyeTwoTone, null) : /* @__PURE__ */ React2.createElement(EyeInvisibleOutlined, null);
|
|
41
|
-
return /* @__PURE__ */ React2.createElement("div", { className: props.containerClassName },
|
|
43
|
+
return /* @__PURE__ */ React2.createElement("div", { className: props.containerClassName }, /* @__PURE__ */ React2.createElement("label", { className: props.labelClassName }, props.label), /* @__PURE__ */ React2.createElement(
|
|
42
44
|
Input.Password,
|
|
43
45
|
{
|
|
44
46
|
placeholder: props.placeholder,
|
|
45
47
|
className: props.className,
|
|
46
48
|
type: props.type,
|
|
47
|
-
onChange:
|
|
49
|
+
onChange: (e) => {
|
|
50
|
+
handleChange(e);
|
|
51
|
+
},
|
|
48
52
|
iconRender: renderVisibilityIcon,
|
|
49
|
-
visibilityToggle:
|
|
53
|
+
visibilityToggle: {
|
|
54
|
+
visible: passwordVisible && passwordVisible,
|
|
55
|
+
onVisibleChange: handleVisibilityToggle
|
|
56
|
+
}
|
|
50
57
|
}
|
|
51
58
|
));
|
|
52
59
|
};
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'jsdom',
|
|
4
|
+
testTimeout: 120000,
|
|
5
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
|
6
|
+
moduleNameMapper: {
|
|
7
|
+
'\\.(css|less)$': 'identity-obj-proxy',
|
|
8
|
+
},
|
|
9
|
+
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
|
|
10
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexcura/ui-components",
|
|
3
|
-
"version": "0.0.16-
|
|
3
|
+
"version": "0.0.16-Beta16",
|
|
4
4
|
"description": "Apex cura React components library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"apex cura",
|
|
@@ -23,15 +23,12 @@
|
|
|
23
23
|
"main": "./dist/index.js",
|
|
24
24
|
"module": "./dist/index.mjs",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"css": "./dist/index.css",
|
|
27
26
|
"scripts": {
|
|
28
27
|
"test": "jest",
|
|
29
|
-
"build": "
|
|
28
|
+
"build:css": "postcss src/styles/index.css -o dist/index.css",
|
|
29
|
+
"build:js": "tsup src/index.ts --out-dir dist",
|
|
30
|
+
"build": "npm run build:css && npm run build:js"
|
|
30
31
|
},
|
|
31
|
-
"files": [
|
|
32
|
-
"dist/",
|
|
33
|
-
"dist/styles/"
|
|
34
|
-
],
|
|
35
32
|
"devDependencies": {
|
|
36
33
|
"@testing-library/jest-dom": "^6.4.2",
|
|
37
34
|
"@testing-library/react": "^15.0.6",
|
|
@@ -42,11 +39,11 @@
|
|
|
42
39
|
"@types/testing-library__react": "^10.2.0",
|
|
43
40
|
"antd": "^5.16.5",
|
|
44
41
|
"autoprefixer": "^10.4.19",
|
|
45
|
-
"css-loader": "^7.1.2",
|
|
46
42
|
"jest": "^29.7.0",
|
|
47
43
|
"jest-environment-jsdom": "^29.7.0",
|
|
48
44
|
"postcss-cli": "^11.0.0",
|
|
49
|
-
"
|
|
45
|
+
"react": "^18.3.1",
|
|
46
|
+
"react-dom": "^18.3.1",
|
|
50
47
|
"ts-jest": "^29.1.2",
|
|
51
48
|
"tsup": "^8.1.0",
|
|
52
49
|
"typescript": "^5.4.5"
|
|
@@ -64,10 +61,9 @@
|
|
|
64
61
|
"highcharts": "^11.4.3",
|
|
65
62
|
"highcharts-react-official": "^3.2.1",
|
|
66
63
|
"moment": "^2.30.1",
|
|
67
|
-
"
|
|
64
|
+
"postcss": "^8.4.38",
|
|
68
65
|
"react-chartjs-2": "^5.2.0",
|
|
69
|
-
"react-
|
|
70
|
-
"
|
|
71
|
-
"react-icons": "^5.2.1"
|
|
66
|
+
"react-icons": "^5.2.1",
|
|
67
|
+
"tailwindcss": "^3.4.4"
|
|
72
68
|
}
|
|
73
69
|
}
|