lkd-web-kit 0.7.7 → 0.7.9
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/components/MyCheckboxGroup/index.cjs +24 -0
- package/dist/components/MyCheckboxGroup/index.js +20 -0
- package/dist/form/base/FormCheckbox.cjs +7 -1
- package/dist/form/base/FormCheckbox.js +7 -1
- package/dist/form/base/FormCheckboxGroup.cjs +17 -0
- package/dist/form/base/FormCheckboxGroup.js +13 -0
- package/dist/index.cjs +11 -7
- package/dist/index.d.ts +16 -0
- package/dist/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const core = require('@mantine/core');
|
|
7
|
+
|
|
8
|
+
const MyCheckboxGroup = ({
|
|
9
|
+
options,
|
|
10
|
+
orientation = "horizontal",
|
|
11
|
+
gap = "md",
|
|
12
|
+
...checkboxGroupProps
|
|
13
|
+
}) => {
|
|
14
|
+
const Container = orientation === "horizontal" ? core.Group : core.Stack;
|
|
15
|
+
return /* @__PURE__ */ jsxRuntime.jsx(core.CheckboxGroup, { ...checkboxGroupProps, children: /* @__PURE__ */ jsxRuntime.jsx(Container, { gap, children: options.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
16
|
+
core.Checkbox,
|
|
17
|
+
{
|
|
18
|
+
...option
|
|
19
|
+
},
|
|
20
|
+
String(option.value) || String(index)
|
|
21
|
+
)) }) });
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.MyCheckboxGroup = MyCheckboxGroup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { CheckboxGroup, Group, Stack, Checkbox } from '@mantine/core';
|
|
3
|
+
|
|
4
|
+
const MyCheckboxGroup = ({
|
|
5
|
+
options,
|
|
6
|
+
orientation = "horizontal",
|
|
7
|
+
gap = "md",
|
|
8
|
+
...checkboxGroupProps
|
|
9
|
+
}) => {
|
|
10
|
+
const Container = orientation === "horizontal" ? Group : Stack;
|
|
11
|
+
return /* @__PURE__ */ jsx(CheckboxGroup, { ...checkboxGroupProps, children: /* @__PURE__ */ jsx(Container, { gap, children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
12
|
+
Checkbox,
|
|
13
|
+
{
|
|
14
|
+
...option
|
|
15
|
+
},
|
|
16
|
+
String(option.value) || String(index)
|
|
17
|
+
)) }) });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { MyCheckboxGroup };
|
|
@@ -10,7 +10,13 @@ const FormCheckbox = withController.withController(({ field, props }) => /* @__P
|
|
|
10
10
|
core.Checkbox,
|
|
11
11
|
{
|
|
12
12
|
...field,
|
|
13
|
-
checked: field.value,
|
|
13
|
+
checked: Boolean(field.value),
|
|
14
|
+
onChange: (e) => {
|
|
15
|
+
if (props.value)
|
|
16
|
+
field.onChange(e.currentTarget.checked ? props.value : "");
|
|
17
|
+
else
|
|
18
|
+
field.onChange(e.currentTarget.checked);
|
|
19
|
+
},
|
|
14
20
|
...props
|
|
15
21
|
}
|
|
16
22
|
));
|
|
@@ -6,7 +6,13 @@ const FormCheckbox = withController(({ field, props }) => /* @__PURE__ */ jsx(
|
|
|
6
6
|
Checkbox,
|
|
7
7
|
{
|
|
8
8
|
...field,
|
|
9
|
-
checked: field.value,
|
|
9
|
+
checked: Boolean(field.value),
|
|
10
|
+
onChange: (e) => {
|
|
11
|
+
if (props.value)
|
|
12
|
+
field.onChange(e.currentTarget.checked ? props.value : "");
|
|
13
|
+
else
|
|
14
|
+
field.onChange(e.currentTarget.checked);
|
|
15
|
+
},
|
|
10
16
|
...props
|
|
11
17
|
}
|
|
12
18
|
));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
const index = require('../../components/MyCheckboxGroup/index.cjs');
|
|
7
|
+
const withController = require('../../hocs/withController.cjs');
|
|
8
|
+
|
|
9
|
+
const FormCheckboxGroup = withController.withController(({ field, props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10
|
+
index.MyCheckboxGroup,
|
|
11
|
+
{
|
|
12
|
+
...field,
|
|
13
|
+
...props
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
exports.FormCheckboxGroup = FormCheckboxGroup;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { MyCheckboxGroup } from '../../components/MyCheckboxGroup/index.js';
|
|
3
|
+
import { withController } from '../../hocs/withController.js';
|
|
4
|
+
|
|
5
|
+
const FormCheckboxGroup = withController(({ field, props }) => /* @__PURE__ */ jsx(
|
|
6
|
+
MyCheckboxGroup,
|
|
7
|
+
{
|
|
8
|
+
...field,
|
|
9
|
+
...props
|
|
10
|
+
}
|
|
11
|
+
));
|
|
12
|
+
|
|
13
|
+
export { FormCheckboxGroup };
|
package/dist/index.cjs
CHANGED
|
@@ -19,10 +19,11 @@ const index$b = require('./components/SelectInfinity/index.cjs');
|
|
|
19
19
|
const index$c = require('./components/MyMultiSelect/index.cjs');
|
|
20
20
|
const index$d = require('./components/MyMonthPickerInput/index.cjs');
|
|
21
21
|
const index$e = require('./components/MyDateInput/index.cjs');
|
|
22
|
+
const index$f = require('./components/MyCheckboxGroup/index.cjs');
|
|
22
23
|
const httpStatus = require('./consts/http-status.cjs');
|
|
23
24
|
const revalidate = require('./consts/revalidate.cjs');
|
|
24
|
-
const index$
|
|
25
|
-
const index$
|
|
25
|
+
const index$g = require('./contexts/NavigationHistoryContext/index.cjs');
|
|
26
|
+
const index$h = require('./contexts/PageDataContext/index.cjs');
|
|
26
27
|
const Form = require('./form/Form.cjs');
|
|
27
28
|
const FormButtonSubmit = require('./form/FormButtonSubmit.cjs');
|
|
28
29
|
const zodValidator = require('./form/utils/zodValidator.cjs');
|
|
@@ -41,6 +42,7 @@ const FormTimeInput = require('./form/base/FormTimeInput.cjs');
|
|
|
41
42
|
const FormMultiSelect = require('./form/base/FormMultiSelect.cjs');
|
|
42
43
|
const FormMonthPickerInput = require('./form/base/FormMonthPickerInput.cjs');
|
|
43
44
|
const FormDateInput = require('./form/base/FormDateInput.cjs');
|
|
45
|
+
const FormCheckboxGroup = require('./form/base/FormCheckboxGroup.cjs');
|
|
44
46
|
const withController = require('./hocs/withController.cjs');
|
|
45
47
|
const withModalManager = require('./hocs/withModalManager.cjs');
|
|
46
48
|
const useBreakpoint = require('./hooks/useBreakpoint.cjs');
|
|
@@ -80,13 +82,14 @@ exports.InfinitySelect = index$b.InfinitySelect;
|
|
|
80
82
|
exports.MyMultiSelect = index$c.MyMultiSelect;
|
|
81
83
|
exports.MyMonthPickerInput = index$d.MyMonthPickerInput;
|
|
82
84
|
exports.MyDateInput = index$e.MyDateInput;
|
|
85
|
+
exports.MyCheckboxGroup = index$f.MyCheckboxGroup;
|
|
83
86
|
exports.HttpStatus = httpStatus.HttpStatus;
|
|
84
87
|
exports.Revalidate = revalidate.Revalidate;
|
|
85
|
-
exports.NavigationHistoryProvider = index$
|
|
86
|
-
exports.QP_BACK_URL_NAME = index$
|
|
87
|
-
exports.useNavigationHistory = index$
|
|
88
|
-
exports.PageDataProvider = index$
|
|
89
|
-
exports.usePageData = index$
|
|
88
|
+
exports.NavigationHistoryProvider = index$g.NavigationHistoryProvider;
|
|
89
|
+
exports.QP_BACK_URL_NAME = index$g.QP_BACK_URL_NAME;
|
|
90
|
+
exports.useNavigationHistory = index$g.useNavigationHistory;
|
|
91
|
+
exports.PageDataProvider = index$h.PageDataProvider;
|
|
92
|
+
exports.usePageData = index$h.usePageData;
|
|
90
93
|
exports.Form = Form.Form;
|
|
91
94
|
exports.FormButtonSubmit = FormButtonSubmit.FormButtonSubmit;
|
|
92
95
|
exports.zodValidator = zodValidator.zodValidator;
|
|
@@ -107,6 +110,7 @@ exports.timeInputToNumber = FormTimeInput.timeInputToNumber;
|
|
|
107
110
|
exports.FormMultiSelect = FormMultiSelect.FormMultiSelect;
|
|
108
111
|
exports.FormMonthPickerInput = FormMonthPickerInput.FormMonthPickerInput;
|
|
109
112
|
exports.FormDateInput = FormDateInput.FormDateInput;
|
|
113
|
+
exports.FormCheckboxGroup = FormCheckboxGroup.FormCheckboxGroup;
|
|
110
114
|
exports.withController = withController.withController;
|
|
111
115
|
exports.withModalManager = withModalManager.withModalManager;
|
|
112
116
|
exports.useBreakpoint = useBreakpoint.useBreakpoint;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { BoxProps } from '@mantine/core';
|
|
|
3
3
|
import { ButtonProps } from '@mantine/core';
|
|
4
4
|
import { CenterProps } from '@mantine/core';
|
|
5
5
|
import { ChangeEventHandler } from 'react';
|
|
6
|
+
import { CheckboxGroupProps } from '@mantine/core';
|
|
6
7
|
import { CheckboxProps } from '@mantine/core';
|
|
7
8
|
import { ComboboxItem } from '@mantine/core';
|
|
8
9
|
import { ComboboxProps } from '@mantine/core';
|
|
@@ -123,6 +124,12 @@ export declare const FormCheckbox: FC<CheckboxProps & WithControllerProps & {
|
|
|
123
124
|
onValueChange?: ChangeEventHandler<HTMLInputElement> | undefined;
|
|
124
125
|
}>;
|
|
125
126
|
|
|
127
|
+
export declare const FormCheckboxGroup: FC<MyCheckboxGroupProps & WithControllerProps & {
|
|
128
|
+
onValueChange?: ((value: string[]) => void) | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
|
|
131
|
+
export declare type FormCheckboxGroupProps = MyCheckboxGroupProps & WithControllerProps;
|
|
132
|
+
|
|
126
133
|
export declare type FormCheckboxProps = CheckboxProps & WithControllerProps;
|
|
127
134
|
|
|
128
135
|
export declare const FormDateInput: FC<WithControllerProps & MyDateInputProps & {
|
|
@@ -380,6 +387,15 @@ export declare type ModalManagerWrapperProps<T extends object = object> = T & {
|
|
|
380
387
|
removeModal: () => void;
|
|
381
388
|
};
|
|
382
389
|
|
|
390
|
+
export declare const MyCheckboxGroup: ({ options, orientation, gap, ...checkboxGroupProps }: MyCheckboxGroupProps) => JSX.Element;
|
|
391
|
+
|
|
392
|
+
export declare interface MyCheckboxGroupProps extends Omit<CheckboxGroupProps, 'children'> {
|
|
393
|
+
options: CheckboxProps[];
|
|
394
|
+
orientation?: 'horizontal' | 'vertical';
|
|
395
|
+
gap?: MantineSpacing;
|
|
396
|
+
disabled?: boolean;
|
|
397
|
+
}
|
|
398
|
+
|
|
383
399
|
export declare const MyDateInput: (props: MyDateInputProps) => JSX.Element;
|
|
384
400
|
|
|
385
401
|
export declare interface MyDateInputProps extends DateInputProps {
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { InfinitySelect } from './components/SelectInfinity/index.js';
|
|
|
15
15
|
export { MyMultiSelect } from './components/MyMultiSelect/index.js';
|
|
16
16
|
export { MyMonthPickerInput } from './components/MyMonthPickerInput/index.js';
|
|
17
17
|
export { MyDateInput } from './components/MyDateInput/index.js';
|
|
18
|
+
export { MyCheckboxGroup } from './components/MyCheckboxGroup/index.js';
|
|
18
19
|
export { HttpStatus } from './consts/http-status.js';
|
|
19
20
|
export { Revalidate } from './consts/revalidate.js';
|
|
20
21
|
export { NavigationHistoryProvider, QP_BACK_URL_NAME, useNavigationHistory } from './contexts/NavigationHistoryContext/index.js';
|
|
@@ -37,6 +38,7 @@ export { FormTimeInput, numberToTimeInput, timeInputToNumber } from './form/base
|
|
|
37
38
|
export { FormMultiSelect } from './form/base/FormMultiSelect.js';
|
|
38
39
|
export { FormMonthPickerInput } from './form/base/FormMonthPickerInput.js';
|
|
39
40
|
export { FormDateInput } from './form/base/FormDateInput.js';
|
|
41
|
+
export { FormCheckboxGroup } from './form/base/FormCheckboxGroup.js';
|
|
40
42
|
export { withController } from './hocs/withController.js';
|
|
41
43
|
export { withModalManager } from './hocs/withModalManager.js';
|
|
42
44
|
export { useBreakpoint } from './hooks/useBreakpoint.js';
|