@chekinapp/ui 0.0.106 → 0.0.108
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 +62 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -50
- package/dist/index.d.ts +50 -50
- package/dist/index.js +51 -42
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12081,7 +12081,8 @@ var checkIfEmpty = ({
|
|
|
12081
12081
|
if (value === 0 || defaultValue === 0) return false;
|
|
12082
12082
|
return !value && !defaultValue;
|
|
12083
12083
|
};
|
|
12084
|
-
var
|
|
12084
|
+
var checkInputValueIfEmpty = (value) => value.length === 0;
|
|
12085
|
+
var Input = React43.forwardRef(
|
|
12085
12086
|
({
|
|
12086
12087
|
value,
|
|
12087
12088
|
defaultValue,
|
|
@@ -12123,10 +12124,15 @@ var DashboardInput = React43.forwardRef(
|
|
|
12123
12124
|
const inputId = id ?? name ?? generatedId;
|
|
12124
12125
|
const errorId = `${inputId}-error`;
|
|
12125
12126
|
const { t } = useTranslation26();
|
|
12126
|
-
const
|
|
12127
|
+
const isEmptyControlled = typeof empty !== "undefined" || typeof value !== "undefined";
|
|
12128
|
+
const propsAreEmpty = checkIfEmpty({ empty, value, defaultValue });
|
|
12129
|
+
const [uncontrolledIsEmpty, setUncontrolledIsEmpty] = React43.useState(propsAreEmpty);
|
|
12130
|
+
const isEmpty = isEmptyControlled ? propsAreEmpty : uncontrolledIsEmpty;
|
|
12127
12131
|
const [inputType, setInputType] = React43.useState(type);
|
|
12128
12132
|
const [isPasswordRevealed, setIsPasswordRevealed] = React43.useState(false);
|
|
12129
12133
|
const [isFocused, setIsFocused] = React43.useState(false);
|
|
12134
|
+
const inputRef = React43.useRef(null);
|
|
12135
|
+
const combinedInputRef = useCombinedRef(inputRef, ref);
|
|
12130
12136
|
const prevInputType = usePrevious(inputType);
|
|
12131
12137
|
const isPasswordReveal = (prevInputType === "password" || type === "password") && !isEmpty;
|
|
12132
12138
|
const hasInvalidState = Boolean(invalid) || Boolean(error) && error !== "NONE";
|
|
@@ -12144,12 +12150,15 @@ var DashboardInput = React43.forwardRef(
|
|
|
12144
12150
|
setInputType(type);
|
|
12145
12151
|
}, [type]);
|
|
12146
12152
|
const handleChange = (event) => {
|
|
12147
|
-
if (readOnly || disabled
|
|
12148
|
-
|
|
12153
|
+
if (readOnly || disabled) return;
|
|
12154
|
+
if (!isEmptyControlled) {
|
|
12155
|
+
setUncontrolledIsEmpty(checkInputValueIfEmpty(event.currentTarget.value));
|
|
12156
|
+
}
|
|
12157
|
+
onChange?.(event);
|
|
12149
12158
|
};
|
|
12150
12159
|
const handleLabelClick = () => {
|
|
12151
|
-
if (readOnly || disabled) return;
|
|
12152
|
-
|
|
12160
|
+
if (readOnly || disabled || loading) return;
|
|
12161
|
+
inputRef.current?.focus();
|
|
12153
12162
|
};
|
|
12154
12163
|
const handleFocus = (event) => {
|
|
12155
12164
|
if (readOnly || disabled) return;
|
|
@@ -12217,7 +12226,7 @@ var DashboardInput = React43.forwardRef(
|
|
|
12217
12226
|
"input",
|
|
12218
12227
|
{
|
|
12219
12228
|
...props,
|
|
12220
|
-
ref,
|
|
12229
|
+
ref: combinedInputRef,
|
|
12221
12230
|
id: inputId,
|
|
12222
12231
|
name,
|
|
12223
12232
|
type: inputType,
|
|
@@ -12331,7 +12340,7 @@ var DashboardInput = React43.forwardRef(
|
|
|
12331
12340
|
);
|
|
12332
12341
|
}
|
|
12333
12342
|
);
|
|
12334
|
-
|
|
12343
|
+
Input.displayName = "Input";
|
|
12335
12344
|
|
|
12336
12345
|
// src/dashboard/select/Select.tsx
|
|
12337
12346
|
import * as React47 from "react";
|
|
@@ -12770,7 +12779,7 @@ function useSelectSearch({
|
|
|
12770
12779
|
|
|
12771
12780
|
// src/dashboard/select/Select.tsx
|
|
12772
12781
|
import { jsx as jsx149, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
12773
|
-
function
|
|
12782
|
+
function SelectInternal({
|
|
12774
12783
|
options = [],
|
|
12775
12784
|
value,
|
|
12776
12785
|
onChange,
|
|
@@ -13000,8 +13009,8 @@ function DashboardSelectInternal({
|
|
|
13000
13009
|
}
|
|
13001
13010
|
);
|
|
13002
13011
|
}
|
|
13003
|
-
var
|
|
13004
|
-
|
|
13012
|
+
var Select = React47.forwardRef(
|
|
13013
|
+
SelectInternal
|
|
13005
13014
|
);
|
|
13006
13015
|
|
|
13007
13016
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
@@ -13041,7 +13050,7 @@ function MultiSelectChip({
|
|
|
13041
13050
|
// src/dashboard/multi-select/MultiSelect.tsx
|
|
13042
13051
|
import { jsx as jsx151, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
13043
13052
|
var isValueSelected = (selected, option) => selected.some((item) => item.value === option.value);
|
|
13044
|
-
function
|
|
13053
|
+
function MultiSelectInternal({
|
|
13045
13054
|
options = [],
|
|
13046
13055
|
value,
|
|
13047
13056
|
onChange,
|
|
@@ -13443,16 +13452,16 @@ function DashboardMultiSelectInternal({
|
|
|
13443
13452
|
}
|
|
13444
13453
|
);
|
|
13445
13454
|
}
|
|
13446
|
-
var
|
|
13447
|
-
|
|
13455
|
+
var MultiSelect = React48.forwardRef(
|
|
13456
|
+
MultiSelectInternal
|
|
13448
13457
|
);
|
|
13449
13458
|
|
|
13450
13459
|
// src/dashboard/creatable-multi-select/CreatableMultiSelect.tsx
|
|
13451
13460
|
import * as React49 from "react";
|
|
13452
13461
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
13453
|
-
var
|
|
13454
|
-
function
|
|
13455
|
-
return /* @__PURE__ */ jsx152(
|
|
13462
|
+
var CreatableMultiSelect = React49.forwardRef(
|
|
13463
|
+
function CreatableMultiSelect2(props, ref) {
|
|
13464
|
+
return /* @__PURE__ */ jsx152(MultiSelect, { ref, ...props, isCreatable: true });
|
|
13456
13465
|
}
|
|
13457
13466
|
);
|
|
13458
13467
|
|
|
@@ -13558,7 +13567,7 @@ var DEFAULT_ITEM_HEIGHT = 60;
|
|
|
13558
13567
|
var DEFAULT_LIST_HEIGHT = 322;
|
|
13559
13568
|
var DEFAULT_OVERSCAN = 5;
|
|
13560
13569
|
var DEFAULT_LOAD_MORE_THRESHOLD = 5;
|
|
13561
|
-
function
|
|
13570
|
+
function InfiniteScrollSelectInternal({
|
|
13562
13571
|
options = [],
|
|
13563
13572
|
value,
|
|
13564
13573
|
onChange,
|
|
@@ -13837,8 +13846,8 @@ function DashboardInfiniteScrollSelectInternal({
|
|
|
13837
13846
|
}
|
|
13838
13847
|
);
|
|
13839
13848
|
}
|
|
13840
|
-
var
|
|
13841
|
-
|
|
13849
|
+
var InfiniteScrollSelect = React50.forwardRef(
|
|
13850
|
+
InfiniteScrollSelectInternal
|
|
13842
13851
|
);
|
|
13843
13852
|
|
|
13844
13853
|
// src/dashboard/textarea/Textarea.tsx
|
|
@@ -13852,8 +13861,8 @@ function getEmptyState(empty, value, defaultValue) {
|
|
|
13852
13861
|
if (value !== void 0) return !String(value);
|
|
13853
13862
|
return !defaultValue;
|
|
13854
13863
|
}
|
|
13855
|
-
var
|
|
13856
|
-
function
|
|
13864
|
+
var Textarea = React51.forwardRef(
|
|
13865
|
+
function Textarea2({
|
|
13857
13866
|
className,
|
|
13858
13867
|
textareaClassName,
|
|
13859
13868
|
label,
|
|
@@ -14650,8 +14659,8 @@ function dateFromParts(day, monthIndex, year) {
|
|
|
14650
14659
|
if (!isValidCalendarDate(yearNum, monthIndex, dayNum)) return null;
|
|
14651
14660
|
return new Date(yearNum, monthIndex, dayNum);
|
|
14652
14661
|
}
|
|
14653
|
-
var
|
|
14654
|
-
function
|
|
14662
|
+
var Datepicker = React53.forwardRef(
|
|
14663
|
+
function Datepicker2({
|
|
14655
14664
|
label,
|
|
14656
14665
|
value,
|
|
14657
14666
|
defaultValue,
|
|
@@ -15629,7 +15638,7 @@ function DateRangePopover({
|
|
|
15629
15638
|
|
|
15630
15639
|
// src/dashboard/date-range-picker/DateRangePicker.tsx
|
|
15631
15640
|
import { jsx as jsx162, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
15632
|
-
var
|
|
15641
|
+
var DateRangePicker = React57.forwardRef(function DateRangePicker2({
|
|
15633
15642
|
label,
|
|
15634
15643
|
value: externalValue,
|
|
15635
15644
|
defaultValue,
|
|
@@ -16069,14 +16078,14 @@ var FORMAT_SETTINGS = {
|
|
|
16069
16078
|
},
|
|
16070
16079
|
hours: { intervalUnit: "H", interval: 1, minTime: "00:00", maxTime: "23:00" }
|
|
16071
16080
|
};
|
|
16072
|
-
var
|
|
16073
|
-
function
|
|
16081
|
+
var TimePicker = React59.forwardRef(
|
|
16082
|
+
function TimePicker2({ format: formatName = "time", timeSettings, options, ...selectProps }, ref) {
|
|
16074
16083
|
const resolvedOptions = React59.useMemo(() => {
|
|
16075
16084
|
if (options) return options;
|
|
16076
16085
|
const settings = timeSettings ?? FORMAT_SETTINGS[formatName];
|
|
16077
16086
|
return buildOptions(settings);
|
|
16078
16087
|
}, [formatName, options, timeSettings]);
|
|
16079
|
-
return /* @__PURE__ */ jsx163(
|
|
16088
|
+
return /* @__PURE__ */ jsx163(Select, { ref, ...selectProps, options: resolvedOptions });
|
|
16080
16089
|
}
|
|
16081
16090
|
);
|
|
16082
16091
|
|
|
@@ -16088,8 +16097,8 @@ import { jsx as jsx164, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
|
16088
16097
|
function defaultDownload(url) {
|
|
16089
16098
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
16090
16099
|
}
|
|
16091
|
-
var
|
|
16092
|
-
function
|
|
16100
|
+
var FileInput = React60.forwardRef(
|
|
16101
|
+
function FileInput2({
|
|
16093
16102
|
label,
|
|
16094
16103
|
value,
|
|
16095
16104
|
onChange,
|
|
@@ -16258,7 +16267,7 @@ var DashboardFileInput = React60.forwardRef(
|
|
|
16258
16267
|
// src/dashboard/select-icons-box/SelectIconsBox.tsx
|
|
16259
16268
|
import * as React61 from "react";
|
|
16260
16269
|
import { jsx as jsx165, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
16261
|
-
function
|
|
16270
|
+
function SelectIconsBox({
|
|
16262
16271
|
children,
|
|
16263
16272
|
icons,
|
|
16264
16273
|
renderIcon,
|
|
@@ -18770,22 +18779,14 @@ export {
|
|
|
18770
18779
|
CopyString,
|
|
18771
18780
|
Counter,
|
|
18772
18781
|
CounterSize,
|
|
18782
|
+
CreatableMultiSelect,
|
|
18773
18783
|
CustomCheckboxDropdownGroup,
|
|
18774
18784
|
DEFAULT_DISPLAY_FORMAT,
|
|
18775
18785
|
DEVICE_BREAKPOINTS,
|
|
18776
|
-
DashboardCreatableMultiSelect,
|
|
18777
|
-
DashboardDateRangePicker,
|
|
18778
|
-
DashboardDatepicker,
|
|
18779
|
-
DashboardFileInput,
|
|
18780
|
-
DashboardInfiniteScrollSelect,
|
|
18781
|
-
DashboardInput,
|
|
18782
|
-
DashboardMultiSelect,
|
|
18783
|
-
DashboardSelect,
|
|
18784
|
-
DashboardSelectIconsBox,
|
|
18785
|
-
DashboardTextarea,
|
|
18786
|
-
DashboardTimePicker,
|
|
18787
18786
|
DataTable,
|
|
18787
|
+
DateRangePicker,
|
|
18788
18788
|
DateTableFilter,
|
|
18789
|
+
Datepicker,
|
|
18789
18790
|
DebouncedSearchInput,
|
|
18790
18791
|
DefaultSelectTrigger,
|
|
18791
18792
|
Dialog,
|
|
@@ -18838,6 +18839,7 @@ export {
|
|
|
18838
18839
|
ExpandableContent,
|
|
18839
18840
|
ExternalLink,
|
|
18840
18841
|
FieldErrorMessage,
|
|
18842
|
+
FileInput,
|
|
18841
18843
|
FileInputButton,
|
|
18842
18844
|
FormBox,
|
|
18843
18845
|
Content5 as FormBoxContent,
|
|
@@ -18853,7 +18855,9 @@ export {
|
|
|
18853
18855
|
IconsDropdown,
|
|
18854
18856
|
Image2 as Image,
|
|
18855
18857
|
ImageFullScreenView,
|
|
18858
|
+
InfiniteScrollSelect,
|
|
18856
18859
|
InfoBox,
|
|
18860
|
+
Input,
|
|
18857
18861
|
InputOTP,
|
|
18858
18862
|
InputOTPGroup,
|
|
18859
18863
|
InputOTPSeparator,
|
|
@@ -18883,6 +18887,7 @@ export {
|
|
|
18883
18887
|
Modal,
|
|
18884
18888
|
ModalButton,
|
|
18885
18889
|
ModalLoader,
|
|
18890
|
+
MultiSelect,
|
|
18886
18891
|
NumberedList,
|
|
18887
18892
|
OverlayLoader,
|
|
18888
18893
|
Pagination,
|
|
@@ -18912,6 +18917,8 @@ export {
|
|
|
18912
18917
|
SectionGroup,
|
|
18913
18918
|
SectionTag,
|
|
18914
18919
|
SectionTagColors,
|
|
18920
|
+
Select,
|
|
18921
|
+
SelectIconsBox,
|
|
18915
18922
|
Separator3 as Separator,
|
|
18916
18923
|
Sheet,
|
|
18917
18924
|
SheetClose,
|
|
@@ -18976,7 +18983,9 @@ export {
|
|
|
18976
18983
|
TabsContent,
|
|
18977
18984
|
TabsList,
|
|
18978
18985
|
TabsTrigger,
|
|
18986
|
+
Textarea,
|
|
18979
18987
|
ThreeDotsLoader,
|
|
18988
|
+
TimePicker,
|
|
18980
18989
|
Timeline,
|
|
18981
18990
|
TimelineConnector,
|
|
18982
18991
|
TimelineContent,
|