lkd-web-kit 0.8.0 → 0.8.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/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/components/EmptyState/index.cjs +38 -52
- package/dist/components/EmptyState/index.js +37 -48
- package/dist/components/Icon.cjs +46 -50
- package/dist/components/Icon.js +44 -46
- package/dist/components/InfinityLoadMoreButton/index.cjs +30 -42
- package/dist/components/InfinityLoadMoreButton/index.js +28 -38
- package/dist/components/InfinitySelect/index.cjs +126 -168
- package/dist/components/InfinitySelect/index.js +125 -164
- package/dist/components/MyCheckboxGroup/index.cjs +14 -22
- package/dist/components/MyCheckboxGroup/index.js +13 -18
- package/dist/components/MyDateInput/index.cjs +12 -18
- package/dist/components/MyDateInput/index.js +11 -14
- package/dist/components/MyDatePickerInput/CalendarIcon.cjs +45 -64
- package/dist/components/MyDatePickerInput/CalendarIcon.js +43 -61
- package/dist/components/MyDatePickerInput/index.cjs +12 -18
- package/dist/components/MyDatePickerInput/index.js +11 -14
- package/dist/components/MyDateTimePicker/index.cjs +12 -18
- package/dist/components/MyDateTimePicker/index.js +11 -14
- package/dist/components/MyMonthPickerInput/index.cjs +12 -18
- package/dist/components/MyMonthPickerInput/index.js +11 -14
- package/dist/components/MyMultiSelect/index.cjs +9 -9
- package/dist/components/MyMultiSelect/index.js +8 -5
- package/dist/components/MyNotifications/index.cjs +11 -17
- package/dist/components/MyNotifications/index.js +10 -13
- package/dist/components/MyNumberInput/index.cjs +9 -15
- package/dist/components/MyNumberInput/index.js +8 -11
- package/dist/components/MyRadioGroup/index.cjs +14 -22
- package/dist/components/MyRadioGroup/index.js +13 -18
- package/dist/components/MySelect/index.cjs +9 -15
- package/dist/components/MySelect/index.js +8 -11
- package/dist/components/MyTextInput/index.cjs +9 -15
- package/dist/components/MyTextInput/index.js +8 -11
- package/dist/components/MyTextarea/index.cjs +9 -15
- package/dist/components/MyTextarea/index.js +8 -11
- package/dist/components/MyTimeInput/index.cjs +9 -15
- package/dist/components/MyTimeInput/index.js +8 -11
- package/dist/components/NavItems.cjs +28 -38
- package/dist/components/NavItems.js +26 -34
- package/dist/consts/http-status.cjs +66 -69
- package/dist/consts/http-status.js +66 -65
- package/dist/consts/revalidate.cjs +10 -13
- package/dist/consts/revalidate.js +10 -9
- package/dist/contexts/NavigationHistoryContext/hook.cjs +41 -42
- package/dist/contexts/NavigationHistoryContext/hook.js +40 -38
- package/dist/contexts/NavigationHistoryContext/index.cjs +31 -28
- package/dist/contexts/NavigationHistoryContext/index.js +30 -24
- package/dist/contexts/PageDataContext/index.cjs +15 -18
- package/dist/contexts/PageDataContext/index.js +14 -14
- package/dist/form/Form.cjs +19 -28
- package/dist/form/Form.js +18 -24
- package/dist/form/FormSubmitButton.cjs +15 -27
- package/dist/form/FormSubmitButton.js +14 -23
- package/dist/form/base/FormCheckbox.cjs +15 -23
- package/dist/form/base/FormCheckbox.js +14 -19
- package/dist/form/base/FormCheckboxGroup.cjs +10 -16
- package/dist/form/base/FormCheckboxGroup.js +9 -12
- package/dist/form/base/FormDateInput.cjs +10 -16
- package/dist/form/base/FormDateInput.js +9 -12
- package/dist/form/base/FormDatePickerInput.cjs +10 -16
- package/dist/form/base/FormDatePickerInput.js +9 -12
- package/dist/form/base/FormDateTimePicker.cjs +10 -16
- package/dist/form/base/FormDateTimePicker.js +9 -12
- package/dist/form/base/FormMonthPickerInput.cjs +10 -16
- package/dist/form/base/FormMonthPickerInput.js +9 -12
- package/dist/form/base/FormMultiSelect.cjs +10 -10
- package/dist/form/base/FormMultiSelect.js +9 -6
- package/dist/form/base/FormNumberInput.cjs +12 -12
- package/dist/form/base/FormNumberInput.js +10 -8
- package/dist/form/base/FormRadioGroup.cjs +10 -16
- package/dist/form/base/FormRadioGroup.js +9 -12
- package/dist/form/base/FormSelect.cjs +10 -16
- package/dist/form/base/FormSelect.js +9 -12
- package/dist/form/base/FormSelectInfinity.cjs +15 -21
- package/dist/form/base/FormSelectInfinity.js +14 -17
- package/dist/form/base/FormTextInput.cjs +10 -16
- package/dist/form/base/FormTextInput.js +9 -12
- package/dist/form/base/FormTextarea.cjs +10 -10
- package/dist/form/base/FormTextarea.js +9 -6
- package/dist/form/base/FormTimeInput.cjs +18 -24
- package/dist/form/base/FormTimeInput.js +17 -20
- package/dist/form/utils/nullable-but-required.cjs +14 -17
- package/dist/form/utils/nullable-but-required.js +13 -13
- package/dist/form/utils/optional-but-required.cjs +14 -17
- package/dist/form/utils/optional-but-required.js +13 -13
- package/dist/form/utils/zodValidator.cjs +9 -13
- package/dist/form/utils/zodValidator.js +9 -9
- package/dist/hocs/withController.cjs +43 -54
- package/dist/hocs/withController.js +42 -50
- package/dist/hocs/withModalManager.cjs +29 -35
- package/dist/hocs/withModalManager.js +28 -31
- package/dist/hooks/useBreakpoint.cjs +8 -12
- package/dist/hooks/useBreakpoint.js +7 -8
- package/dist/hooks/useFetchNextPageOnScroll.cjs +13 -21
- package/dist/hooks/useFetchNextPageOnScroll.js +13 -17
- package/dist/hooks/useOnScrollProgress.cjs +33 -37
- package/dist/hooks/useOnScrollProgress.js +32 -33
- package/dist/hooks/useUpdateSearchParams.cjs +22 -22
- package/dist/hooks/useUpdateSearchParams.js +21 -18
- package/dist/hooks/useZodConfig.cjs +14 -19
- package/dist/hooks/useZodConfig.js +12 -15
- package/dist/index.cjs +130 -136
- package/dist/index.d.ts +13 -13
- package/dist/index.js +62 -61
- package/dist/mantine/breakpoints-with-px.cjs +9 -12
- package/dist/mantine/breakpoints-with-px.js +9 -8
- package/dist/mantine/my-default-theme.cjs +23 -42
- package/dist/mantine/my-default-theme.js +22 -38
- package/dist/mantine/to-tailwind-colors.cjs +9 -18
- package/dist/mantine/to-tailwind-colors.js +9 -14
- package/dist/utils/array/groupBy.cjs +30 -40
- package/dist/utils/array/groupBy.js +30 -36
- package/dist/utils/array/shuffleArray.cjs +11 -17
- package/dist/utils/array/shuffleArray.js +11 -13
- package/dist/utils/formatBytes.cjs +12 -11
- package/dist/utils/formatBytes.js +12 -7
- package/dist/utils/isInfinityEmpty.cjs +3 -6
- package/dist/utils/isInfinityEmpty.js +3 -2
- package/dist/utils/ky/addBodyJsonHook.cjs +9 -14
- package/dist/utils/ky/addBodyJsonHook.js +8 -10
- package/dist/utils/ky/parseJson.cjs +6 -9
- package/dist/utils/ky/parseJson.js +6 -5
- package/dist/utils/new-route.cjs +30 -39
- package/dist/utils/new-route.js +30 -35
- package/dist/utils/query-stringify.cjs +5 -8
- package/dist/utils/query-stringify.js +5 -4
- package/dist/utils/virtual-styles.cjs +21 -26
- package/dist/utils/virtual-styles.js +21 -22
- package/package.json +20 -19
- package/dist/node_modules/@mantine/notifications/styles.css +0 -42
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.cjs +0 -74
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +0 -45
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.cjs +0 -886
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +0 -872
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.cjs +0 -75
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +0 -68
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
|
|
5
|
-
function memo(getDeps, fn, opts) {
|
|
6
|
-
let deps = opts.initialDeps ?? [];
|
|
7
|
-
let result;
|
|
8
|
-
let isInitial = true;
|
|
9
|
-
function memoizedFunction() {
|
|
10
|
-
var _a, _b, _c;
|
|
11
|
-
let depTime;
|
|
12
|
-
if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
|
|
13
|
-
const newDeps = getDeps();
|
|
14
|
-
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
15
|
-
if (!depsChanged) {
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
deps = newDeps;
|
|
19
|
-
let resultTime;
|
|
20
|
-
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
|
|
21
|
-
result = fn(...newDeps);
|
|
22
|
-
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
|
|
23
|
-
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
24
|
-
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
25
|
-
const resultFpsPercentage = resultEndTime / 16;
|
|
26
|
-
const pad = (str, num) => {
|
|
27
|
-
str = String(str);
|
|
28
|
-
while (str.length < num) {
|
|
29
|
-
str = " " + str;
|
|
30
|
-
}
|
|
31
|
-
return str;
|
|
32
|
-
};
|
|
33
|
-
console.info(
|
|
34
|
-
`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
|
|
35
|
-
`
|
|
36
|
-
font-size: .6rem;
|
|
37
|
-
font-weight: bold;
|
|
38
|
-
color: hsl(${Math.max(
|
|
39
|
-
0,
|
|
40
|
-
Math.min(120 - 120 * resultFpsPercentage, 120)
|
|
41
|
-
)}deg 100% 31%);`,
|
|
42
|
-
opts == null ? void 0 : opts.key
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
46
|
-
opts.onChange(result);
|
|
47
|
-
}
|
|
48
|
-
isInitial = false;
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
memoizedFunction.updateDeps = (newDeps) => {
|
|
52
|
-
deps = newDeps;
|
|
53
|
-
};
|
|
54
|
-
return memoizedFunction;
|
|
55
|
-
}
|
|
56
|
-
function notUndefined(value, msg) {
|
|
57
|
-
if (value === void 0) {
|
|
58
|
-
throw new Error(`Unexpected undefined${""}`);
|
|
59
|
-
} else {
|
|
60
|
-
return value;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
const approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
64
|
-
const debounce = (targetWindow, fn, ms) => {
|
|
65
|
-
let timeoutId;
|
|
66
|
-
return function(...args) {
|
|
67
|
-
targetWindow.clearTimeout(timeoutId);
|
|
68
|
-
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
exports.approxEqual = approxEqual;
|
|
73
|
-
exports.debounce = debounce;
|
|
74
|
-
exports.memo = memo;
|
|
75
|
-
exports.notUndefined = notUndefined;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
function memo(getDeps, fn, opts) {
|
|
2
|
-
let deps = opts.initialDeps ?? [];
|
|
3
|
-
let result;
|
|
4
|
-
let isInitial = true;
|
|
5
|
-
function memoizedFunction() {
|
|
6
|
-
var _a, _b, _c;
|
|
7
|
-
let depTime;
|
|
8
|
-
if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
|
|
9
|
-
const newDeps = getDeps();
|
|
10
|
-
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
11
|
-
if (!depsChanged) {
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
deps = newDeps;
|
|
15
|
-
let resultTime;
|
|
16
|
-
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
|
|
17
|
-
result = fn(...newDeps);
|
|
18
|
-
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
|
|
19
|
-
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
20
|
-
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
21
|
-
const resultFpsPercentage = resultEndTime / 16;
|
|
22
|
-
const pad = (str, num) => {
|
|
23
|
-
str = String(str);
|
|
24
|
-
while (str.length < num) {
|
|
25
|
-
str = " " + str;
|
|
26
|
-
}
|
|
27
|
-
return str;
|
|
28
|
-
};
|
|
29
|
-
console.info(
|
|
30
|
-
`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
|
|
31
|
-
`
|
|
32
|
-
font-size: .6rem;
|
|
33
|
-
font-weight: bold;
|
|
34
|
-
color: hsl(${Math.max(
|
|
35
|
-
0,
|
|
36
|
-
Math.min(120 - 120 * resultFpsPercentage, 120)
|
|
37
|
-
)}deg 100% 31%);`,
|
|
38
|
-
opts == null ? void 0 : opts.key
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) {
|
|
42
|
-
opts.onChange(result);
|
|
43
|
-
}
|
|
44
|
-
isInitial = false;
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
47
|
-
memoizedFunction.updateDeps = (newDeps) => {
|
|
48
|
-
deps = newDeps;
|
|
49
|
-
};
|
|
50
|
-
return memoizedFunction;
|
|
51
|
-
}
|
|
52
|
-
function notUndefined(value, msg) {
|
|
53
|
-
if (value === void 0) {
|
|
54
|
-
throw new Error(`Unexpected undefined${""}`);
|
|
55
|
-
} else {
|
|
56
|
-
return value;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
60
|
-
const debounce = (targetWindow, fn, ms) => {
|
|
61
|
-
let timeoutId;
|
|
62
|
-
return function(...args) {
|
|
63
|
-
targetWindow.clearTimeout(timeoutId);
|
|
64
|
-
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export { approxEqual, debounce, memo, notUndefined };
|