mytek-components 1.0.0 → 1.0.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/index.js +102 -67
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +102 -67
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/dist/index.css +0 -6
package/dist/index.umd.cjs
CHANGED
|
@@ -16813,7 +16813,6 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
16813
16813
|
const [error, setError] = React.useState("");
|
|
16814
16814
|
const [showPassword, setShowPassword] = React.useState(false);
|
|
16815
16815
|
const [amountInWords, setAmountInWords] = React.useState("");
|
|
16816
|
-
const [touched, setTouched] = React.useState(true);
|
|
16817
16816
|
const [enable, setEnable] = React.useState(button == null ? void 0 : button.disabled);
|
|
16818
16817
|
const validate = (val) => {
|
|
16819
16818
|
const raw = category === "amount" ? removeCommas(val) : val;
|
|
@@ -16957,7 +16956,7 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
16957
16956
|
formatted = val;
|
|
16958
16957
|
}
|
|
16959
16958
|
onChange(name, formatted);
|
|
16960
|
-
|
|
16959
|
+
validate(formatted);
|
|
16961
16960
|
setAmountInWords(numberToWords(rawValue, format));
|
|
16962
16961
|
break;
|
|
16963
16962
|
case "number1":
|
|
@@ -16984,12 +16983,12 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
16984
16983
|
case "gst":
|
|
16985
16984
|
val = val.toUpperCase().slice(0, 15);
|
|
16986
16985
|
onChange(name, val);
|
|
16987
|
-
|
|
16986
|
+
validate(val);
|
|
16988
16987
|
break;
|
|
16989
16988
|
case "pan":
|
|
16990
16989
|
val = val.toUpperCase().slice(0, 10);
|
|
16991
16990
|
onChange(name, val);
|
|
16992
|
-
|
|
16991
|
+
validate(val);
|
|
16993
16992
|
break;
|
|
16994
16993
|
case "password":
|
|
16995
16994
|
val = val.slice(0, maxLength || 20);
|
|
@@ -16999,10 +16998,6 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
16999
16998
|
onChange(name, val);
|
|
17000
16999
|
}
|
|
17001
17000
|
};
|
|
17002
|
-
const handleBlur = () => {
|
|
17003
|
-
setTouched(true);
|
|
17004
|
-
validate(value);
|
|
17005
|
-
};
|
|
17006
17001
|
const handlePhoneChange = (value2, country) => {
|
|
17007
17002
|
setError("");
|
|
17008
17003
|
const selectedCountryCode = country.countryCode.toUpperCase();
|
|
@@ -17116,65 +17111,105 @@ To suppress this warning, you need to explicitly provide the \`palette.${key}Cha
|
|
|
17116
17111
|
children: button.loader ? /* @__PURE__ */ jsxRuntimeExports.jsx(MytekLoader, { inline: true }) : button.label
|
|
17117
17112
|
}
|
|
17118
17113
|
)
|
|
17119
|
-
] }) }) :
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17126
|
-
|
|
17127
|
-
|
|
17128
|
-
|
|
17129
|
-
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
|
|
17139
|
-
|
|
17140
|
-
|
|
17141
|
-
suffix &&
|
|
17142
|
-
|
|
17143
|
-
|
|
17144
|
-
|
|
17145
|
-
|
|
17146
|
-
|
|
17147
|
-
)
|
|
17148
|
-
isPassword &&
|
|
17149
|
-
|
|
17150
|
-
|
|
17151
|
-
|
|
17152
|
-
|
|
17153
|
-
|
|
17154
|
-
|
|
17155
|
-
|
|
17156
|
-
|
|
17157
|
-
|
|
17158
|
-
|
|
17159
|
-
|
|
17160
|
-
|
|
17161
|
-
)
|
|
17162
|
-
|
|
17163
|
-
|
|
17164
|
-
|
|
17165
|
-
|
|
17166
|
-
|
|
17167
|
-
|
|
17168
|
-
|
|
17169
|
-
|
|
17170
|
-
|
|
17171
|
-
|
|
17172
|
-
|
|
17173
|
-
|
|
17174
|
-
|
|
17175
|
-
|
|
17176
|
-
|
|
17177
|
-
|
|
17114
|
+
] }) }) : (
|
|
17115
|
+
// <>
|
|
17116
|
+
// <FormControl
|
|
17117
|
+
// type={isPassword ? (showPassword ? "text" : "password") : type}
|
|
17118
|
+
// placeholder={placeholder}
|
|
17119
|
+
// style={{
|
|
17120
|
+
// borderColor: "#12AB5B",
|
|
17121
|
+
// height: height || "40px",
|
|
17122
|
+
// borderTopRightRadius:
|
|
17123
|
+
// !isPassword && !button?.label && !suffix ? "0.375rem" : 0,
|
|
17124
|
+
// borderBottomRightRadius:
|
|
17125
|
+
// !isPassword && !button?.label && !suffix ? "0.375rem" : 0,
|
|
17126
|
+
// borderTopLeftRadius: prefix ? 0 : "0.375rem",
|
|
17127
|
+
// borderBottomLeftRadius: prefix ? 0 : "0.375rem",
|
|
17128
|
+
// }}
|
|
17129
|
+
// name={name}
|
|
17130
|
+
// value={value}
|
|
17131
|
+
// onChange={handleChange}
|
|
17132
|
+
// onBlur={handleBlur}
|
|
17133
|
+
// isInvalid={!!error}
|
|
17134
|
+
// disabled={disabled}
|
|
17135
|
+
// />
|
|
17136
|
+
// {suffix && (
|
|
17137
|
+
// <InputGroup.Text
|
|
17138
|
+
// style={{ backgroundColor: "#fff", borderColor: "#12AB5B" }}
|
|
17139
|
+
// >
|
|
17140
|
+
// {suffix}
|
|
17141
|
+
// </InputGroup.Text>
|
|
17142
|
+
// )}
|
|
17143
|
+
// {isPassword && (
|
|
17144
|
+
// <InputGroup.Text
|
|
17145
|
+
// onClick={() => setShowPassword(!showPassword)}
|
|
17146
|
+
// style={{
|
|
17147
|
+
// backgroundColor: "#fff",
|
|
17148
|
+
// borderColor: "#12AB5B",
|
|
17149
|
+
// cursor: "pointer",
|
|
17150
|
+
// userSelect: "none",
|
|
17151
|
+
// }}
|
|
17152
|
+
// disabled={disabled}
|
|
17153
|
+
// >
|
|
17154
|
+
// {showPassword ? <FiEye /> : <FiEyeOff />}
|
|
17155
|
+
// </InputGroup.Text>
|
|
17156
|
+
// )}
|
|
17157
|
+
// {button?.label && (
|
|
17158
|
+
// <Button
|
|
17159
|
+
// variant="primary"
|
|
17160
|
+
// onClick={button?.onClick}
|
|
17161
|
+
// disabled={enable}
|
|
17162
|
+
// style={{
|
|
17163
|
+
// backgroundColor: "#3B5AA1",
|
|
17164
|
+
// borderColor: "#12AB5B",
|
|
17165
|
+
// color: "white",
|
|
17166
|
+
// width: "80px",
|
|
17167
|
+
// }}
|
|
17168
|
+
// >
|
|
17169
|
+
// button.label
|
|
17170
|
+
// {/* {button.loader ?
|
|
17171
|
+
// <MytekLoader inline={true} />
|
|
17172
|
+
// : button.label} */}
|
|
17173
|
+
// </Button>
|
|
17174
|
+
// )}
|
|
17175
|
+
// </>
|
|
17176
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center border border-[#12AB5B] overflow-hidden rounded-md", children: [
|
|
17177
|
+
prefix && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 bg-white text-gray-700 border-r border-[#12AB5B]", children: prefix }),
|
|
17178
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17179
|
+
"input",
|
|
17180
|
+
{
|
|
17181
|
+
type: isPassword ? showPassword ? "text" : "password" : type,
|
|
17182
|
+
name,
|
|
17183
|
+
value,
|
|
17184
|
+
onChange: handleChange,
|
|
17185
|
+
disabled,
|
|
17186
|
+
placeholder,
|
|
17187
|
+
className: "flex-1 px-3 py-2 focus:outline-none",
|
|
17188
|
+
style: { height: height2 }
|
|
17189
|
+
}
|
|
17190
|
+
),
|
|
17191
|
+
suffix && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "px-2 bg-white text-gray-700 border-l border-[#12AB5B]", children: suffix }),
|
|
17192
|
+
isPassword && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17193
|
+
"button",
|
|
17194
|
+
{
|
|
17195
|
+
type: "button",
|
|
17196
|
+
onClick: () => setShowPassword(!showPassword),
|
|
17197
|
+
className: "px-2 bg-white text-gray-500 border-l border-[#12AB5B]",
|
|
17198
|
+
children: showPassword ? /* @__PURE__ */ jsxRuntimeExports.jsx(FiEye, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(FiEyeOff, {})
|
|
17199
|
+
}
|
|
17200
|
+
),
|
|
17201
|
+
(button == null ? void 0 : button.label) && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
17202
|
+
"button",
|
|
17203
|
+
{
|
|
17204
|
+
onClick: button == null ? void 0 : button.onClick,
|
|
17205
|
+
disabled: enable,
|
|
17206
|
+
className: `px-4 py-2 text-white ${backgroundColor2 || "bg-blue-600"} border-l border-[#12AB5B] rounded-r-md`,
|
|
17207
|
+
style: { height: height2 },
|
|
17208
|
+
children: button.loader ? "..." : button.label
|
|
17209
|
+
}
|
|
17210
|
+
)
|
|
17211
|
+
] })
|
|
17212
|
+
)
|
|
17178
17213
|
}
|
|
17179
17214
|
)
|
|
17180
17215
|
] }),
|