@emeraldemperaur/vector-sigma 1.4.17 → 1.4.18

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/lib/index.cjs CHANGED
@@ -41905,7 +41905,7 @@ const safeParseUuidFormat = (typeString) => {
41905
41905
  }
41906
41906
  };
41907
41907
  const UUIDInput = (_a) => {
41908
- var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = 'input-outline', size = "2", className } = _a, props = __rest$1(_a, ["alias", "type", "inputLabel", "width", "delimiter", "format", "placeholder", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "readOnly", "inputVariant", "size", "className"]);
41908
+ var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = 'uuid-outline', size = "2", className } = _a, props = __rest$1(_a, ["alias", "type", "inputLabel", "width", "delimiter", "format", "placeholder", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "readOnly", "inputVariant", "size", "className"]);
41909
41909
  const { setFieldValue, setFieldTouched } = formik.useFormikContext();
41910
41910
  const [field, meta] = formik.useField(alias);
41911
41911
  const hasError = Boolean(meta.touched && meta.error);
@@ -41921,23 +41921,16 @@ const UUIDInput = (_a) => {
41921
41921
  if (!value)
41922
41922
  return "";
41923
41923
  const clean = value.replace(/[^0-9a-fA-F]/g, "").toUpperCase().slice(0, maxHexChars);
41924
- let result = "";
41924
+ const parts = [];
41925
41925
  let currentIdx = 0;
41926
- for (let i = 0; i < activeFormat.length; i++) {
41927
- const chunkLen = activeFormat[i];
41928
- if (currentIdx < clean.length) {
41929
- const chunk = clean.substring(currentIdx, chunkLen);
41930
- result += chunk;
41931
- if (chunk.length === chunkLen && i < activeFormat.length - 1 && (currentIdx + chunkLen) < clean.length) {
41932
- result += delimiter;
41933
- }
41934
- currentIdx += chunkLen;
41935
- }
41936
- else {
41926
+ for (const len of activeFormat) {
41927
+ if (currentIdx >= clean.length)
41937
41928
  break;
41938
- }
41929
+ const chunk = clean.slice(currentIdx, currentIdx + len);
41930
+ parts.push(chunk);
41931
+ currentIdx += len;
41939
41932
  }
41940
- return result;
41933
+ return parts.join(delimiter);
41941
41934
  };
41942
41935
  const handleChange = (e) => {
41943
41936
  const val = e.target.value;
@@ -41951,10 +41944,10 @@ const UUIDInput = (_a) => {
41951
41944
  setTimeout(() => setCopied(false), 2000);
41952
41945
  }
41953
41946
  };
41954
- const variantClass = inputVariant !== 'input-outline' ? `input-${inputVariant}` : '';
41947
+ const variantClass = inputVariant !== 'uuid-outline' ? `input-${inputVariant}` : '';
41955
41948
  return (React.createElement(Column, { span: width, newLine: newRow },
41956
41949
  React.createElement(p$5, { direction: "column", gap: "2", style: { width: '100%' } },
41957
- React.createElement(u, Object.assign({ size: size, variant: "surface", color: hasError ? 'red' : undefined, className: `${variantClass} ${className || ''}` }, props),
41950
+ React.createElement(u, Object.assign({ size: size, name: `${alias}UUIDFormInput`, variant: "surface", color: hasError ? 'red' : undefined, className: `${variantClass} ${className || ''}` }, props),
41958
41951
  React.createElement("input", { id: `${alias}FormInput`, name: alias, "aria-describedby": `${alias}InputLabel`, value: field.value || '', onChange: handleChange, onBlur: () => setFieldTouched(alias, true), maxLength: maxTotalLength, readOnly: readOnly, placeholder: placeholder, autoComplete: "off", spellCheck: false, style: {
41959
41952
  flex: 1,
41960
41953
  border: 'none',
package/lib/index.esm.js CHANGED
@@ -41885,7 +41885,7 @@ const safeParseUuidFormat = (typeString) => {
41885
41885
  }
41886
41886
  };
41887
41887
  const UUIDInput = (_a) => {
41888
- var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = 'input-outline', size = "2", className } = _a, props = __rest$1(_a, ["alias", "type", "inputLabel", "width", "delimiter", "format", "placeholder", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "readOnly", "inputVariant", "size", "className"]);
41888
+ var { alias, type = "uuid", inputLabel, width, delimiter = "-", format = [8, 4, 4, 4, 12], placeholder = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX', newRow, isHinted, hintText, hintUrl, errorText, readOnly = false, inputVariant = 'uuid-outline', size = "2", className } = _a, props = __rest$1(_a, ["alias", "type", "inputLabel", "width", "delimiter", "format", "placeholder", "newRow", "isHinted", "hintText", "hintUrl", "errorText", "readOnly", "inputVariant", "size", "className"]);
41889
41889
  const { setFieldValue, setFieldTouched } = useFormikContext();
41890
41890
  const [field, meta] = useField(alias);
41891
41891
  const hasError = Boolean(meta.touched && meta.error);
@@ -41901,23 +41901,16 @@ const UUIDInput = (_a) => {
41901
41901
  if (!value)
41902
41902
  return "";
41903
41903
  const clean = value.replace(/[^0-9a-fA-F]/g, "").toUpperCase().slice(0, maxHexChars);
41904
- let result = "";
41904
+ const parts = [];
41905
41905
  let currentIdx = 0;
41906
- for (let i = 0; i < activeFormat.length; i++) {
41907
- const chunkLen = activeFormat[i];
41908
- if (currentIdx < clean.length) {
41909
- const chunk = clean.substring(currentIdx, chunkLen);
41910
- result += chunk;
41911
- if (chunk.length === chunkLen && i < activeFormat.length - 1 && (currentIdx + chunkLen) < clean.length) {
41912
- result += delimiter;
41913
- }
41914
- currentIdx += chunkLen;
41915
- }
41916
- else {
41906
+ for (const len of activeFormat) {
41907
+ if (currentIdx >= clean.length)
41917
41908
  break;
41918
- }
41909
+ const chunk = clean.slice(currentIdx, currentIdx + len);
41910
+ parts.push(chunk);
41911
+ currentIdx += len;
41919
41912
  }
41920
- return result;
41913
+ return parts.join(delimiter);
41921
41914
  };
41922
41915
  const handleChange = (e) => {
41923
41916
  const val = e.target.value;
@@ -41931,10 +41924,10 @@ const UUIDInput = (_a) => {
41931
41924
  setTimeout(() => setCopied(false), 2000);
41932
41925
  }
41933
41926
  };
41934
- const variantClass = inputVariant !== 'input-outline' ? `input-${inputVariant}` : '';
41927
+ const variantClass = inputVariant !== 'uuid-outline' ? `input-${inputVariant}` : '';
41935
41928
  return (React__default.createElement(Column, { span: width, newLine: newRow },
41936
41929
  React__default.createElement(p$5, { direction: "column", gap: "2", style: { width: '100%' } },
41937
- React__default.createElement(u, Object.assign({ size: size, variant: "surface", color: hasError ? 'red' : undefined, className: `${variantClass} ${className || ''}` }, props),
41930
+ React__default.createElement(u, Object.assign({ size: size, name: `${alias}UUIDFormInput`, variant: "surface", color: hasError ? 'red' : undefined, className: `${variantClass} ${className || ''}` }, props),
41938
41931
  React__default.createElement("input", { id: `${alias}FormInput`, name: alias, "aria-describedby": `${alias}InputLabel`, value: field.value || '', onChange: handleChange, onBlur: () => setFieldTouched(alias, true), maxLength: maxTotalLength, readOnly: readOnly, placeholder: placeholder, autoComplete: "off", spellCheck: false, style: {
41939
41932
  flex: 1,
41940
41933
  border: 'none',
@@ -15,7 +15,7 @@ interface UUIDInputProps {
15
15
  placeholder?: string;
16
16
  errorText?: ReactNode | string | null;
17
17
  className?: string;
18
- inputVariant?: 'input' | 'input-outline' | 'input-material' | 'input-neumorphic';
18
+ inputVariant?: 'uuid' | 'uuid-outline' | 'uuid' | 'uuid-neumorphic';
19
19
  readOnly?: boolean;
20
20
  size?: "1" | "2" | "3";
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeraldemperaur/vector-sigma",
3
- "version": "1.4.17",
3
+ "version": "1.4.18",
4
4
  "description": "Dynamic Form Orchestrator: NPM Package",
5
5
  "repository": {
6
6
  "type": "git",