@idds/react 1.1.94 → 1.1.96
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.cjs.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +236 -40
- package/dist/index.umd.js +2 -2
- package/dist/types/components/DatePicker.d.ts.map +1 -1
- package/dist/types/components/FileUpload.d.ts.map +1 -1
- package/dist/types/components/OneTimePassword.d.ts +31 -0
- package/dist/types/components/OneTimePassword.d.ts.map +1 -0
- package/dist/types/components/Pagination.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -810,112 +810,120 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
810
810
|
* This source code is licensed under the MIT license.
|
|
811
811
|
* See the LICENSE file in the root directory of this source tree.
|
|
812
812
|
*/
|
|
813
|
-
const __iconNode$
|
|
814
|
-
const IconAddressBook = createReactComponent("outline", "address-book", "AddressBook", __iconNode$
|
|
813
|
+
const __iconNode$w = [["path", { "d": "M20 6v12a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2z", "key": "svg-0" }], ["path", { "d": "M10 16h6", "key": "svg-1" }], ["path", { "d": "M13 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0", "key": "svg-2" }], ["path", { "d": "M4 8h3", "key": "svg-3" }], ["path", { "d": "M4 12h3", "key": "svg-4" }], ["path", { "d": "M4 16h3", "key": "svg-5" }]];
|
|
814
|
+
const IconAddressBook = createReactComponent("outline", "address-book", "AddressBook", __iconNode$w);
|
|
815
815
|
/**
|
|
816
816
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
817
817
|
*
|
|
818
818
|
* This source code is licensed under the MIT license.
|
|
819
819
|
* See the LICENSE file in the root directory of this source tree.
|
|
820
820
|
*/
|
|
821
|
-
const __iconNode$
|
|
822
|
-
const IconAlertCircle = createReactComponent("outline", "alert-circle", "AlertCircle", __iconNode$
|
|
821
|
+
const __iconNode$v = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 8v4", "key": "svg-1" }], ["path", { "d": "M12 16h.01", "key": "svg-2" }]];
|
|
822
|
+
const IconAlertCircle = createReactComponent("outline", "alert-circle", "AlertCircle", __iconNode$v);
|
|
823
823
|
/**
|
|
824
824
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
825
825
|
*
|
|
826
826
|
* This source code is licensed under the MIT license.
|
|
827
827
|
* See the LICENSE file in the root directory of this source tree.
|
|
828
828
|
*/
|
|
829
|
-
const __iconNode$
|
|
830
|
-
const IconAlertTriangle = createReactComponent("outline", "alert-triangle", "AlertTriangle", __iconNode$
|
|
829
|
+
const __iconNode$u = [["path", { "d": "M12 9v4", "key": "svg-0" }], ["path", { "d": "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z", "key": "svg-1" }], ["path", { "d": "M12 16h.01", "key": "svg-2" }]];
|
|
830
|
+
const IconAlertTriangle = createReactComponent("outline", "alert-triangle", "AlertTriangle", __iconNode$u);
|
|
831
831
|
/**
|
|
832
832
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
833
833
|
*
|
|
834
834
|
* This source code is licensed under the MIT license.
|
|
835
835
|
* See the LICENSE file in the root directory of this source tree.
|
|
836
836
|
*/
|
|
837
|
-
const __iconNode$
|
|
838
|
-
const IconArrowNarrowDown = createReactComponent("outline", "arrow-narrow-down", "ArrowNarrowDown", __iconNode$
|
|
837
|
+
const __iconNode$t = [["path", { "d": "M12 5l0 14", "key": "svg-0" }], ["path", { "d": "M16 15l-4 4", "key": "svg-1" }], ["path", { "d": "M8 15l4 4", "key": "svg-2" }]];
|
|
838
|
+
const IconArrowNarrowDown = createReactComponent("outline", "arrow-narrow-down", "ArrowNarrowDown", __iconNode$t);
|
|
839
839
|
/**
|
|
840
840
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
841
841
|
*
|
|
842
842
|
* This source code is licensed under the MIT license.
|
|
843
843
|
* See the LICENSE file in the root directory of this source tree.
|
|
844
844
|
*/
|
|
845
|
-
const __iconNode$
|
|
846
|
-
const IconArrowNarrowUp = createReactComponent("outline", "arrow-narrow-up", "ArrowNarrowUp", __iconNode$
|
|
845
|
+
const __iconNode$s = [["path", { "d": "M12 5l0 14", "key": "svg-0" }], ["path", { "d": "M16 9l-4 -4", "key": "svg-1" }], ["path", { "d": "M8 9l4 -4", "key": "svg-2" }]];
|
|
846
|
+
const IconArrowNarrowUp = createReactComponent("outline", "arrow-narrow-up", "ArrowNarrowUp", __iconNode$s);
|
|
847
847
|
/**
|
|
848
848
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
849
849
|
*
|
|
850
850
|
* This source code is licensed under the MIT license.
|
|
851
851
|
* See the LICENSE file in the root directory of this source tree.
|
|
852
852
|
*/
|
|
853
|
-
const __iconNode$
|
|
854
|
-
const IconCalendar = createReactComponent("outline", "calendar", "Calendar", __iconNode$
|
|
853
|
+
const __iconNode$r = [["path", { "d": "M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z", "key": "svg-0" }], ["path", { "d": "M16 3v4", "key": "svg-1" }], ["path", { "d": "M8 3v4", "key": "svg-2" }], ["path", { "d": "M4 11h16", "key": "svg-3" }], ["path", { "d": "M11 15h1", "key": "svg-4" }], ["path", { "d": "M12 15v3", "key": "svg-5" }]];
|
|
854
|
+
const IconCalendar = createReactComponent("outline", "calendar", "Calendar", __iconNode$r);
|
|
855
855
|
/**
|
|
856
856
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
857
857
|
*
|
|
858
858
|
* This source code is licensed under the MIT license.
|
|
859
859
|
* See the LICENSE file in the root directory of this source tree.
|
|
860
860
|
*/
|
|
861
|
-
const __iconNode$
|
|
862
|
-
const IconCheck = createReactComponent("outline", "check", "Check", __iconNode$
|
|
861
|
+
const __iconNode$q = [["path", { "d": "M5 12l5 5l10 -10", "key": "svg-0" }]];
|
|
862
|
+
const IconCheck = createReactComponent("outline", "check", "Check", __iconNode$q);
|
|
863
863
|
/**
|
|
864
864
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
865
865
|
*
|
|
866
866
|
* This source code is licensed under the MIT license.
|
|
867
867
|
* See the LICENSE file in the root directory of this source tree.
|
|
868
868
|
*/
|
|
869
|
-
const __iconNode$
|
|
870
|
-
const IconChevronDown = createReactComponent("outline", "chevron-down", "ChevronDown", __iconNode$
|
|
869
|
+
const __iconNode$p = [["path", { "d": "M6 9l6 6l6 -6", "key": "svg-0" }]];
|
|
870
|
+
const IconChevronDown = createReactComponent("outline", "chevron-down", "ChevronDown", __iconNode$p);
|
|
871
871
|
/**
|
|
872
872
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
873
873
|
*
|
|
874
874
|
* This source code is licensed under the MIT license.
|
|
875
875
|
* See the LICENSE file in the root directory of this source tree.
|
|
876
876
|
*/
|
|
877
|
-
const __iconNode$
|
|
878
|
-
const IconChevronLeft = createReactComponent("outline", "chevron-left", "ChevronLeft", __iconNode$
|
|
877
|
+
const __iconNode$o = [["path", { "d": "M15 6l-6 6l6 6", "key": "svg-0" }]];
|
|
878
|
+
const IconChevronLeft = createReactComponent("outline", "chevron-left", "ChevronLeft", __iconNode$o);
|
|
879
879
|
/**
|
|
880
880
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
881
881
|
*
|
|
882
882
|
* This source code is licensed under the MIT license.
|
|
883
883
|
* See the LICENSE file in the root directory of this source tree.
|
|
884
884
|
*/
|
|
885
|
-
const __iconNode$
|
|
886
|
-
const IconChevronRight = createReactComponent("outline", "chevron-right", "ChevronRight", __iconNode$
|
|
885
|
+
const __iconNode$n = [["path", { "d": "M9 6l6 6l-6 6", "key": "svg-0" }]];
|
|
886
|
+
const IconChevronRight = createReactComponent("outline", "chevron-right", "ChevronRight", __iconNode$n);
|
|
887
887
|
/**
|
|
888
888
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
889
889
|
*
|
|
890
890
|
* This source code is licensed under the MIT license.
|
|
891
891
|
* See the LICENSE file in the root directory of this source tree.
|
|
892
892
|
*/
|
|
893
|
-
const __iconNode$
|
|
894
|
-
const IconChevronUp = createReactComponent("outline", "chevron-up", "ChevronUp", __iconNode$
|
|
893
|
+
const __iconNode$m = [["path", { "d": "M6 15l6 -6l6 6", "key": "svg-0" }]];
|
|
894
|
+
const IconChevronUp = createReactComponent("outline", "chevron-up", "ChevronUp", __iconNode$m);
|
|
895
895
|
/**
|
|
896
896
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
897
897
|
*
|
|
898
898
|
* This source code is licensed under the MIT license.
|
|
899
899
|
* See the LICENSE file in the root directory of this source tree.
|
|
900
900
|
*/
|
|
901
|
-
const __iconNode$
|
|
902
|
-
const IconChevronsLeft = createReactComponent("outline", "chevrons-left", "ChevronsLeft", __iconNode$
|
|
901
|
+
const __iconNode$l = [["path", { "d": "M11 7l-5 5l5 5", "key": "svg-0" }], ["path", { "d": "M17 7l-5 5l5 5", "key": "svg-1" }]];
|
|
902
|
+
const IconChevronsLeft = createReactComponent("outline", "chevrons-left", "ChevronsLeft", __iconNode$l);
|
|
903
903
|
/**
|
|
904
904
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
905
905
|
*
|
|
906
906
|
* This source code is licensed under the MIT license.
|
|
907
907
|
* See the LICENSE file in the root directory of this source tree.
|
|
908
908
|
*/
|
|
909
|
-
const __iconNode$
|
|
910
|
-
const IconChevronsRight = createReactComponent("outline", "chevrons-right", "ChevronsRight", __iconNode$
|
|
909
|
+
const __iconNode$k = [["path", { "d": "M7 7l5 5l-5 5", "key": "svg-0" }], ["path", { "d": "M13 7l5 5l-5 5", "key": "svg-1" }]];
|
|
910
|
+
const IconChevronsRight = createReactComponent("outline", "chevrons-right", "ChevronsRight", __iconNode$k);
|
|
911
911
|
/**
|
|
912
912
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
913
913
|
*
|
|
914
914
|
* This source code is licensed under the MIT license.
|
|
915
915
|
* See the LICENSE file in the root directory of this source tree.
|
|
916
916
|
*/
|
|
917
|
-
const __iconNode$
|
|
918
|
-
const IconCircleCheck = createReactComponent("outline", "circle-check", "CircleCheck", __iconNode$
|
|
917
|
+
const __iconNode$j = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M9 12l2 2l4 -4", "key": "svg-1" }]];
|
|
918
|
+
const IconCircleCheck = createReactComponent("outline", "circle-check", "CircleCheck", __iconNode$j);
|
|
919
|
+
/**
|
|
920
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
921
|
+
*
|
|
922
|
+
* This source code is licensed under the MIT license.
|
|
923
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
924
|
+
*/
|
|
925
|
+
const __iconNode$i = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M10 10l4 4m0 -4l-4 4", "key": "svg-1" }]];
|
|
926
|
+
const IconCircleX = createReactComponent("outline", "circle-x", "CircleX", __iconNode$i);
|
|
919
927
|
/**
|
|
920
928
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
921
929
|
*
|
|
@@ -2835,9 +2843,9 @@ function FileUpload({
|
|
|
2835
2843
|
className: "ina-file-upload__file-icon--spinning"
|
|
2836
2844
|
}
|
|
2837
2845
|
) }),
|
|
2838
|
-
uploadedFile.status === "success" && /* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ jsx(
|
|
2839
|
-
uploadedFile.status === "error" && /* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--error", children: /* @__PURE__ */ jsx(
|
|
2840
|
-
uploadedFile.status === "idle" && /* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ jsx(
|
|
2846
|
+
uploadedFile.status === "success" && /* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ jsx(IconCircleCheck, { size: 16, stroke: "2" }) }),
|
|
2847
|
+
uploadedFile.status === "error" && /* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--error", children: /* @__PURE__ */ jsx(IconCircleX, { size: 16, stroke: "2" }) }),
|
|
2848
|
+
uploadedFile.status === "idle" && /* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-icon-wrapper ina-file-upload__file-icon-wrapper--success", children: /* @__PURE__ */ jsx(IconCircleCheck, { size: 16, stroke: "2" }) })
|
|
2841
2849
|
] }),
|
|
2842
2850
|
/* @__PURE__ */ jsxs("div", { className: "ina-file-upload__file-info", children: [
|
|
2843
2851
|
/* @__PURE__ */ jsx("div", { className: "ina-file-upload__file-name", children: sanitizeFileName(uploadedFile.file.name) }),
|
|
@@ -3602,8 +3610,18 @@ function Pagination({
|
|
|
3602
3610
|
if (totalPages <= 0) return null;
|
|
3603
3611
|
function renderPageNumbers() {
|
|
3604
3612
|
const pages = [];
|
|
3605
|
-
|
|
3606
|
-
|
|
3613
|
+
let start;
|
|
3614
|
+
let end;
|
|
3615
|
+
if (currentPage === 1) {
|
|
3616
|
+
start = 1;
|
|
3617
|
+
end = Math.min(3, totalPages);
|
|
3618
|
+
} else if (currentPage === totalPages) {
|
|
3619
|
+
start = Math.max(1, totalPages - 2);
|
|
3620
|
+
end = totalPages;
|
|
3621
|
+
} else {
|
|
3622
|
+
start = currentPage - 1;
|
|
3623
|
+
end = currentPage + 1;
|
|
3624
|
+
}
|
|
3607
3625
|
for (let i2 = start; i2 <= end; i2++) {
|
|
3608
3626
|
pages.push(renderPageButton(i2));
|
|
3609
3627
|
}
|
|
@@ -5187,6 +5205,163 @@ function TextArea({
|
|
|
5187
5205
|
] })
|
|
5188
5206
|
] });
|
|
5189
5207
|
}
|
|
5208
|
+
function OneTimePassword({
|
|
5209
|
+
value = "",
|
|
5210
|
+
onChange,
|
|
5211
|
+
length = 6,
|
|
5212
|
+
title,
|
|
5213
|
+
description,
|
|
5214
|
+
helperText,
|
|
5215
|
+
error = false,
|
|
5216
|
+
disabled = false,
|
|
5217
|
+
readonly = false,
|
|
5218
|
+
className = "",
|
|
5219
|
+
onComplete,
|
|
5220
|
+
autoFocus = false
|
|
5221
|
+
}) {
|
|
5222
|
+
const inputRefs = useRef([]);
|
|
5223
|
+
useEffect(() => {
|
|
5224
|
+
inputRefs.current = inputRefs.current.slice(0, length);
|
|
5225
|
+
}, [length]);
|
|
5226
|
+
useEffect(() => {
|
|
5227
|
+
if (autoFocus && inputRefs.current[0] && !disabled && !readonly) {
|
|
5228
|
+
inputRefs.current[0].focus();
|
|
5229
|
+
}
|
|
5230
|
+
}, [autoFocus, disabled, readonly]);
|
|
5231
|
+
useEffect(() => {
|
|
5232
|
+
const currentValue = value || "";
|
|
5233
|
+
if (currentValue.length < length && currentValue.length > 0) {
|
|
5234
|
+
const nextIndex = currentValue.length;
|
|
5235
|
+
if (inputRefs.current[nextIndex] && !disabled && !readonly) {
|
|
5236
|
+
inputRefs.current[nextIndex].focus();
|
|
5237
|
+
}
|
|
5238
|
+
}
|
|
5239
|
+
}, [value, length, disabled, readonly]);
|
|
5240
|
+
useEffect(() => {
|
|
5241
|
+
if (value && value.length === length && onComplete) {
|
|
5242
|
+
onComplete(value);
|
|
5243
|
+
}
|
|
5244
|
+
}, [value, length, onComplete]);
|
|
5245
|
+
const handleChange = (index, e) => {
|
|
5246
|
+
const inputValue = e.target.value;
|
|
5247
|
+
if (inputValue && !/^\d$/.test(inputValue)) {
|
|
5248
|
+
return;
|
|
5249
|
+
}
|
|
5250
|
+
const newValue = value.split("");
|
|
5251
|
+
newValue[index] = inputValue;
|
|
5252
|
+
const updatedValue = newValue.join("").slice(0, length);
|
|
5253
|
+
onChange(updatedValue);
|
|
5254
|
+
if (inputValue && index < length - 1) {
|
|
5255
|
+
const nextIndex = index + 1;
|
|
5256
|
+
if (inputRefs.current[nextIndex]) {
|
|
5257
|
+
inputRefs.current[nextIndex].focus();
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5260
|
+
};
|
|
5261
|
+
const handleKeyDown = (index, e) => {
|
|
5262
|
+
var _a, _b;
|
|
5263
|
+
if (e.key === "Backspace") {
|
|
5264
|
+
const currentValue = value || "";
|
|
5265
|
+
if (!currentValue[index] && index > 0) {
|
|
5266
|
+
const prevIndex = index - 1;
|
|
5267
|
+
if (inputRefs.current[prevIndex]) {
|
|
5268
|
+
inputRefs.current[prevIndex].focus();
|
|
5269
|
+
const newValue = value.split("");
|
|
5270
|
+
newValue[prevIndex] = "";
|
|
5271
|
+
onChange(newValue.join(""));
|
|
5272
|
+
}
|
|
5273
|
+
} else {
|
|
5274
|
+
const newValue = value.split("");
|
|
5275
|
+
newValue[index] = "";
|
|
5276
|
+
onChange(newValue.join(""));
|
|
5277
|
+
}
|
|
5278
|
+
}
|
|
5279
|
+
if (e.key === "ArrowLeft" && index > 0) {
|
|
5280
|
+
e.preventDefault();
|
|
5281
|
+
(_a = inputRefs.current[index - 1]) == null ? void 0 : _a.focus();
|
|
5282
|
+
}
|
|
5283
|
+
if (e.key === "ArrowRight" && index < length - 1) {
|
|
5284
|
+
e.preventDefault();
|
|
5285
|
+
(_b = inputRefs.current[index + 1]) == null ? void 0 : _b.focus();
|
|
5286
|
+
}
|
|
5287
|
+
if ((e.ctrlKey || e.metaKey) && e.key === "v") {
|
|
5288
|
+
e.preventDefault();
|
|
5289
|
+
navigator.clipboard.readText().then((text) => {
|
|
5290
|
+
const digits = text.replace(/\D/g, "").slice(0, length);
|
|
5291
|
+
if (digits) {
|
|
5292
|
+
onChange(digits);
|
|
5293
|
+
const focusIndex = Math.min(digits.length - 1, length - 1);
|
|
5294
|
+
if (inputRefs.current[focusIndex]) {
|
|
5295
|
+
inputRefs.current[focusIndex].focus();
|
|
5296
|
+
}
|
|
5297
|
+
}
|
|
5298
|
+
});
|
|
5299
|
+
}
|
|
5300
|
+
};
|
|
5301
|
+
const handleFocus = (index) => {
|
|
5302
|
+
if (inputRefs.current[index]) {
|
|
5303
|
+
inputRefs.current[index].select();
|
|
5304
|
+
}
|
|
5305
|
+
};
|
|
5306
|
+
const handleBlur = () => {
|
|
5307
|
+
};
|
|
5308
|
+
const handlePaste = (e) => {
|
|
5309
|
+
e.preventDefault();
|
|
5310
|
+
const pastedText = e.clipboardData.getData("text");
|
|
5311
|
+
const digits = pastedText.replace(/\D/g, "").slice(0, length);
|
|
5312
|
+
if (digits) {
|
|
5313
|
+
onChange(digits);
|
|
5314
|
+
const focusIndex = Math.min(digits.length - 1, length - 1);
|
|
5315
|
+
setTimeout(() => {
|
|
5316
|
+
if (inputRefs.current[focusIndex]) {
|
|
5317
|
+
inputRefs.current[focusIndex].focus();
|
|
5318
|
+
}
|
|
5319
|
+
}, 0);
|
|
5320
|
+
}
|
|
5321
|
+
};
|
|
5322
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx("ina-one-time-password", className), children: [
|
|
5323
|
+
title && /* @__PURE__ */ jsx("div", { className: "ina-one-time-password__title", children: title }),
|
|
5324
|
+
description && /* @__PURE__ */ jsx("div", { className: "ina-one-time-password__description", children: description }),
|
|
5325
|
+
/* @__PURE__ */ jsx("div", { className: "ina-one-time-password__container", children: Array.from({ length }).map((_, index) => {
|
|
5326
|
+
const digitValue = value[index] || "";
|
|
5327
|
+
return /* @__PURE__ */ jsx(
|
|
5328
|
+
"input",
|
|
5329
|
+
{
|
|
5330
|
+
ref: (el) => {
|
|
5331
|
+
inputRefs.current[index] = el;
|
|
5332
|
+
},
|
|
5333
|
+
type: "text",
|
|
5334
|
+
inputMode: "numeric",
|
|
5335
|
+
maxLength: 1,
|
|
5336
|
+
value: digitValue,
|
|
5337
|
+
onChange: (e) => handleChange(index, e),
|
|
5338
|
+
onKeyDown: (e) => handleKeyDown(index, e),
|
|
5339
|
+
onFocus: () => handleFocus(index),
|
|
5340
|
+
onBlur: handleBlur,
|
|
5341
|
+
onPaste: handlePaste,
|
|
5342
|
+
disabled,
|
|
5343
|
+
readOnly: readonly,
|
|
5344
|
+
className: clsx(
|
|
5345
|
+
"ina-one-time-password__input",
|
|
5346
|
+
error && "ina-one-time-password__input--error"
|
|
5347
|
+
),
|
|
5348
|
+
"aria-label": `Digit ${index + 1} of ${length}`
|
|
5349
|
+
},
|
|
5350
|
+
index
|
|
5351
|
+
);
|
|
5352
|
+
}) }),
|
|
5353
|
+
helperText && /* @__PURE__ */ jsx(
|
|
5354
|
+
"div",
|
|
5355
|
+
{
|
|
5356
|
+
className: clsx(
|
|
5357
|
+
"ina-one-time-password__helper-text",
|
|
5358
|
+
error && "ina-one-time-password__helper-text--error"
|
|
5359
|
+
),
|
|
5360
|
+
children: helperText
|
|
5361
|
+
}
|
|
5362
|
+
)
|
|
5363
|
+
] });
|
|
5364
|
+
}
|
|
5190
5365
|
const TimePicker = forwardRef(
|
|
5191
5366
|
({
|
|
5192
5367
|
defaultValue = "",
|
|
@@ -8779,11 +8954,28 @@ function DatePicker({
|
|
|
8779
8954
|
);
|
|
8780
8955
|
}
|
|
8781
8956
|
if (endDate) {
|
|
8782
|
-
|
|
8957
|
+
const endMonth = new Date(
|
|
8783
8958
|
endDate.getFullYear(),
|
|
8784
8959
|
endDate.getMonth(),
|
|
8785
8960
|
1
|
|
8786
8961
|
);
|
|
8962
|
+
if (targetMonth && targetMonth.getFullYear() === endMonth.getFullYear() && targetMonth.getMonth() === endMonth.getMonth()) {
|
|
8963
|
+
targetNextMonth = new Date(targetMonth);
|
|
8964
|
+
targetNextMonth.setMonth(targetNextMonth.getMonth() + 1);
|
|
8965
|
+
} else {
|
|
8966
|
+
targetNextMonth = endMonth;
|
|
8967
|
+
}
|
|
8968
|
+
}
|
|
8969
|
+
} else if (mode === "range" && parsedDates.length === 1) {
|
|
8970
|
+
const startDate = parsedDates[0];
|
|
8971
|
+
if (startDate) {
|
|
8972
|
+
targetMonth = new Date(
|
|
8973
|
+
startDate.getFullYear(),
|
|
8974
|
+
startDate.getMonth(),
|
|
8975
|
+
1
|
|
8976
|
+
);
|
|
8977
|
+
targetNextMonth = new Date(targetMonth);
|
|
8978
|
+
targetNextMonth.setMonth(targetNextMonth.getMonth() + 1);
|
|
8787
8979
|
}
|
|
8788
8980
|
} else if (parsedDates.length > 0) {
|
|
8789
8981
|
const targetDate = parsedDates[0];
|
|
@@ -8810,8 +9002,8 @@ function DatePicker({
|
|
|
8810
9002
|
setNextMonth(nextMonthDate);
|
|
8811
9003
|
} else if (mode === "range") {
|
|
8812
9004
|
const parsedDates2 = parseSelectedDates();
|
|
8813
|
-
const
|
|
8814
|
-
if (
|
|
9005
|
+
const hasNoDates = parsedDates2.length === 0;
|
|
9006
|
+
if (hasNoDates) {
|
|
8815
9007
|
const nextMonthDate = new Date(targetMonth);
|
|
8816
9008
|
nextMonthDate.setMonth(nextMonthDate.getMonth() + 1);
|
|
8817
9009
|
setNextMonth(nextMonthDate);
|
|
@@ -9397,7 +9589,7 @@ function DatePicker({
|
|
|
9397
9589
|
dayNames.map((day) => /* @__PURE__ */ jsx("div", { className: "ina-date-picker__day-header", children: day }, day)),
|
|
9398
9590
|
currentDays.map((day) => {
|
|
9399
9591
|
const styling = getDateStyling(day);
|
|
9400
|
-
return /* @__PURE__ */
|
|
9592
|
+
return /* @__PURE__ */ jsxs(
|
|
9401
9593
|
"button",
|
|
9402
9594
|
{
|
|
9403
9595
|
type: "button",
|
|
@@ -9406,7 +9598,10 @@ function DatePicker({
|
|
|
9406
9598
|
onMouseLeave: () => setHoveredDate(null),
|
|
9407
9599
|
disabled: styling.isDisabled,
|
|
9408
9600
|
className: styling.className + (!styling.isSelected && !styling.isInRange && !styling.isHovered && !styling.isHoveredEnd && !styling.isDisabled ? " ina-date-picker__day--hover" : ""),
|
|
9409
|
-
children:
|
|
9601
|
+
children: [
|
|
9602
|
+
day.date.getDate(),
|
|
9603
|
+
day.isToday && /* @__PURE__ */ jsx("span", { className: "ina-date-picker__today-label", children: "Hari ini" })
|
|
9604
|
+
]
|
|
9410
9605
|
},
|
|
9411
9606
|
`${day.date.getFullYear()}-${day.date.getMonth()}-${day.date.getDate()}`
|
|
9412
9607
|
);
|
|
@@ -9717,7 +9912,7 @@ function TabHorizontal({
|
|
|
9717
9912
|
value,
|
|
9718
9913
|
defaultValue,
|
|
9719
9914
|
onChange,
|
|
9720
|
-
size = "
|
|
9915
|
+
size = "sm",
|
|
9721
9916
|
variant = "outline",
|
|
9722
9917
|
fullWidth = false,
|
|
9723
9918
|
useBrandColor = false,
|
|
@@ -9794,7 +9989,7 @@ function TabVertical({
|
|
|
9794
9989
|
value,
|
|
9795
9990
|
defaultValue,
|
|
9796
9991
|
onChange,
|
|
9797
|
-
size = "
|
|
9992
|
+
size = "sm",
|
|
9798
9993
|
variant = "outline",
|
|
9799
9994
|
useBrandColor = false,
|
|
9800
9995
|
disabled = false,
|
|
@@ -9985,6 +10180,7 @@ export {
|
|
|
9985
10180
|
Modal,
|
|
9986
10181
|
MonthPicker,
|
|
9987
10182
|
MultipleChoiceGrid,
|
|
10183
|
+
OneTimePassword,
|
|
9988
10184
|
Pagination,
|
|
9989
10185
|
PasswordInput,
|
|
9990
10186
|
PhoneInput,
|