react-science 19.5.0 → 19.6.0
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/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts +5 -2
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.d.ts.map +1 -1
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js +2 -2
- package/lib/components/color-picker/color-picker-dropdown/ColorPickerDropdown.js.map +1 -1
- package/lib/components/form/components/field_groups/fieldset.d.ts +9 -0
- package/lib/components/form/components/field_groups/fieldset.d.ts.map +1 -0
- package/lib/components/form/components/field_groups/fieldset.js +11 -0
- package/lib/components/form/components/field_groups/fieldset.js.map +1 -0
- package/lib/components/form/components/field_groups/index.d.ts +7 -0
- package/lib/components/form/components/field_groups/index.d.ts.map +1 -0
- package/lib/components/form/components/field_groups/index.js +5 -0
- package/lib/components/form/components/field_groups/index.js.map +1 -0
- package/lib/components/form/components/field_groups/svg_line_style.d.ts +40 -0
- package/lib/components/form/components/field_groups/svg_line_style.d.ts.map +1 -0
- package/lib/components/form/components/field_groups/svg_line_style.js +42 -0
- package/lib/components/form/components/field_groups/svg_line_style.js.map +1 -0
- package/lib/components/form/components/field_groups/svg_line_style.schema.d.ts +13 -0
- package/lib/components/form/components/field_groups/svg_line_style.schema.d.ts.map +1 -0
- package/lib/components/form/components/field_groups/svg_line_style.schema.js +14 -0
- package/lib/components/form/components/field_groups/svg_line_style.schema.js.map +1 -0
- package/lib/components/form/components/field_groups/svg_text_style.d.ts +41 -0
- package/lib/components/form/components/field_groups/svg_text_style.d.ts.map +1 -0
- package/lib/components/form/components/field_groups/svg_text_style.js +62 -0
- package/lib/components/form/components/field_groups/svg_text_style.js.map +1 -0
- package/lib/components/form/components/field_groups/svg_text_style.schema.d.ts +14 -0
- package/lib/components/form/components/field_groups/svg_text_style.schema.d.ts.map +1 -0
- package/lib/components/form/components/field_groups/svg_text_style.schema.js +8 -0
- package/lib/components/form/components/field_groups/svg_text_style.schema.js.map +1 -0
- package/lib/components/form/components/input/color_picker.d.ts +2 -1
- package/lib/components/form/components/input/color_picker.d.ts.map +1 -1
- package/lib/components/form/components/input/color_picker.js +2 -1
- package/lib/components/form/components/input/color_picker.js.map +1 -1
- package/lib/components/form/components/input_groups/form_group.d.ts +1 -1
- package/lib/components/form/components/input_groups/form_group.d.ts.map +1 -1
- package/lib/components/form/context/use_ts_form.d.ts +38 -2
- package/lib/components/form/context/use_ts_form.d.ts.map +1 -1
- package/lib/components/form/context/use_ts_form.js +2 -2
- package/lib/components/form/context/use_ts_form.js.map +1 -1
- package/lib/components/header/PanelHeader.d.ts.map +1 -1
- package/lib/components/header/PanelHeader.js +1 -0
- package/lib/components/header/PanelHeader.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/svg/styled/svg_styled_types.d.ts +7 -1
- package/lib/components/svg/styled/svg_styled_types.d.ts.map +1 -1
- package/lib/components/svg/styled/svg_styled_types.js +6 -1
- package/lib/components/svg/styled/svg_styled_types.js.map +1 -1
- package/lib/components/toolbar/Toolbar.d.ts.map +1 -1
- package/lib/components/toolbar/Toolbar.js +1 -0
- package/lib/components/toolbar/Toolbar.js.map +1 -1
- package/package.json +2 -2
- package/src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx +8 -3
- package/src/components/form/components/field_groups/fieldset.tsx +12 -0
- package/src/components/form/components/field_groups/index.ts +7 -0
- package/src/components/form/components/field_groups/svg_line_style.schema.ts +15 -0
- package/src/components/form/components/field_groups/svg_line_style.tsx +108 -0
- package/src/components/form/components/field_groups/svg_text_style.schema.ts +8 -0
- package/src/components/form/components/field_groups/svg_text_style.tsx +160 -0
- package/src/components/form/components/input/color_picker.tsx +12 -1
- package/src/components/form/components/input_groups/form_group.tsx +1 -1
- package/src/components/form/context/use_ts_form.ts +2 -2
- package/src/components/header/PanelHeader.tsx +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/svg/styled/svg_styled_types.ts +8 -4
- package/src/components/toolbar/Toolbar.tsx +1 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { PopoverProps } from '@blueprintjs/core';
|
|
2
2
|
import type { ColorPickerProps } from '../react-color/ColorPicker.js';
|
|
3
|
-
interface ColorPickerDropdownProps extends Pick<ColorPickerProps, 'color' | 'presetColors' | 'disableAlpha' | 'onChange' | 'onChangeComplete'> {
|
|
3
|
+
export interface ColorPickerDropdownProps extends Pick<ColorPickerProps, 'color' | 'presetColors' | 'disableAlpha' | 'onChange' | 'onChangeComplete'> {
|
|
4
4
|
popoverProps?: Omit<PopoverProps, 'content'>;
|
|
5
|
+
/**
|
|
6
|
+
* To link with label
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
5
9
|
}
|
|
6
10
|
export declare function ColorPickerDropdown(props: ColorPickerDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export {};
|
|
8
11
|
//# sourceMappingURL=ColorPickerDropdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerDropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAItE,
|
|
1
|
+
{"version":3,"file":"ColorPickerDropdown.d.ts","sourceRoot":"","sources":["../../../../src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAItE,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,gBAAgB,EAChB,OAAO,GAAG,cAAc,GAAG,cAAc,GAAG,UAAU,GAAG,kBAAkB,CAC5E;IACC,YAAY,CAAC,EAAE,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAE7C;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAiBD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAmBlE"}
|
|
@@ -18,8 +18,8 @@ const ColorPickerPreview = styled.div `
|
|
|
18
18
|
border-radius: 0.125rem;
|
|
19
19
|
`;
|
|
20
20
|
export function ColorPickerDropdown(props) {
|
|
21
|
-
const { color, popoverProps, ...otherProps } = props;
|
|
21
|
+
const { color, popoverProps, id, ...otherProps } = props;
|
|
22
22
|
const { hex } = colorHelper.toState(color || 'white');
|
|
23
|
-
return (_jsx(Popover, { targetProps: { style: { width: '100%' } }, content: _jsx(ColorPicker, { color: color, ...otherProps }), minimal: true, ...popoverProps, children: _jsx(ColorPickerRoot, { type: "button", children: _jsx(ColorPickerPreview, { children: _jsx(FixedColorPreview, { color: hex }) }) }) }));
|
|
23
|
+
return (_jsx(Popover, { targetProps: { style: { width: '100%' } }, content: _jsx(ColorPicker, { color: color, ...otherProps }), minimal: true, ...popoverProps, children: _jsx(ColorPickerRoot, { type: "button", id: id, children: _jsx(ColorPickerPreview, { children: _jsx(FixedColorPreview, { color: hex }) }) }) }));
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=ColorPickerDropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerDropdown.js","sourceRoot":"","sources":["../../../../src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"ColorPickerDropdown.js","sourceRoot":"","sources":["../../../../src/components/color-picker/color-picker-dropdown/ColorPickerDropdown.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAc/D,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAA;;;;;;;CAOpC,CAAC;AAEF,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;CAIpC,CAAC;AAEF,MAAM,UAAU,mBAAmB,CAAC,KAA+B;IACjE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAC;IAEzD,MAAM,EAAE,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC;IAEtD,OAAO,CACL,KAAC,OAAO,IACN,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EACzC,OAAO,EAAE,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,KAAM,UAAU,GAAI,EACtD,OAAO,WACH,YAAY,YAEhB,KAAC,eAAe,IAAC,IAAI,EAAC,QAAQ,EAAC,EAAE,EAAE,EAAE,YACnC,KAAC,kBAAkB,cACjB,KAAC,iBAAiB,IAAC,KAAK,EAAE,GAAG,GAAI,GACd,GACL,GACV,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const Fieldset: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
theme?: import("@emotion/react").Theme;
|
|
3
|
+
as?: React.ElementType;
|
|
4
|
+
}, import("react").DetailedHTMLProps<import("react").FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, {}>;
|
|
5
|
+
export declare const Legend: import("@emotion/styled").StyledComponent<{
|
|
6
|
+
theme?: import("@emotion/react").Theme;
|
|
7
|
+
as?: React.ElementType;
|
|
8
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLLegendElement>, HTMLLegendElement>, {}>;
|
|
9
|
+
//# sourceMappingURL=fieldset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/fieldset.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;2HAIpB,CAAC;AAEF,eAAO,MAAM,MAAM;;;+GAGlB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
export const Fieldset = styled.fieldset `
|
|
3
|
+
display: block;
|
|
4
|
+
border-top: 1px lightgrey groove;
|
|
5
|
+
min-inline-size: min-content;
|
|
6
|
+
`;
|
|
7
|
+
export const Legend = styled.legend `
|
|
8
|
+
display: block;
|
|
9
|
+
padding-inline-end: 5px;
|
|
10
|
+
`;
|
|
11
|
+
//# sourceMappingURL=fieldset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.js","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAA;;;;CAItC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;;;CAGlC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FieldGroupSVGTextStyleFields } from './svg_text_style.js';
|
|
2
|
+
export type { SVGTextStyleFieldsProps } from './svg_text_style.js';
|
|
3
|
+
export { svgTextStyleFieldsSchema } from './svg_text_style.schema.js';
|
|
4
|
+
export { FieldGroupSVGLineStyleFields } from './svg_line_style.js';
|
|
5
|
+
export type { SVGLineStyleFieldsProps } from './svg_line_style.js';
|
|
6
|
+
export { svgLineStyleFieldsSchema } from './svg_line_style.schema.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FieldGroupSVGTextStyleFields } from './svg_text_style.js';
|
|
2
|
+
export { svgTextStyleFieldsSchema } from './svg_text_style.schema.js';
|
|
3
|
+
export { FieldGroupSVGLineStyleFields } from './svg_line_style.js';
|
|
4
|
+
export { svgLineStyleFieldsSchema } from './svg_line_style.schema.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface SVGLineStyleFieldsProps {
|
|
2
|
+
label: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const FieldGroupSVGLineStyleFields: <TFormData, TFields extends import("@tanstack/form-core").DeepKeysOfType<TFormData, {
|
|
5
|
+
stroke: string;
|
|
6
|
+
strokeOpacity: string;
|
|
7
|
+
strokeWidth: string;
|
|
8
|
+
strokeDasharray: "solid" | "dashed" | "dotted" | "dashed-dot";
|
|
9
|
+
} | null | undefined> | {
|
|
10
|
+
stroke: import("@tanstack/form-core").DeepKeysOfType<TFormData, string>;
|
|
11
|
+
strokeOpacity: import("@tanstack/form-core").DeepKeysOfType<TFormData, string>;
|
|
12
|
+
strokeWidth: import("@tanstack/form-core").DeepKeysOfType<TFormData, string>;
|
|
13
|
+
strokeDasharray: import("@tanstack/form-core").DeepKeysOfType<TFormData, "solid" | "dashed" | "dotted" | "dashed-dot">;
|
|
14
|
+
}, TOnMount extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TFormSubmitMeta>(params: import("react").PropsWithChildren<NoInfer<SVGLineStyleFieldsProps> & {
|
|
15
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TFormSubmitMeta, {
|
|
16
|
+
readonly Input: typeof import("../input/input.tsx").Input;
|
|
17
|
+
readonly NumericInput: typeof import("../input/numeric_input.tsx").NumericInput;
|
|
18
|
+
readonly Checkbox: typeof import("../input/checkbox.tsx").Checkbox;
|
|
19
|
+
readonly Select: typeof import("../input/select.tsx").Select;
|
|
20
|
+
readonly Switch: typeof import("../input/switch.tsx").Switch;
|
|
21
|
+
readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
|
|
22
|
+
}, {
|
|
23
|
+
readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
|
|
24
|
+
readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
|
|
25
|
+
readonly Section: typeof import("../layout/Section.tsx").Section;
|
|
26
|
+
}> | import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/form-core").FieldsMap<unknown, TFormData>, any, any, any, any, any, any, any, any, any, any, TFormSubmitMeta, {
|
|
27
|
+
readonly Input: typeof import("../input/input.tsx").Input;
|
|
28
|
+
readonly NumericInput: typeof import("../input/numeric_input.tsx").NumericInput;
|
|
29
|
+
readonly Checkbox: typeof import("../input/checkbox.tsx").Checkbox;
|
|
30
|
+
readonly Select: typeof import("../input/select.tsx").Select;
|
|
31
|
+
readonly Switch: typeof import("../input/switch.tsx").Switch;
|
|
32
|
+
readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
|
|
33
|
+
}, {
|
|
34
|
+
readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
|
|
35
|
+
readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
|
|
36
|
+
readonly Section: typeof import("../layout/Section.tsx").Section;
|
|
37
|
+
}>;
|
|
38
|
+
fields: TFields;
|
|
39
|
+
}>) => ReturnType<import("react").FunctionComponent>;
|
|
40
|
+
//# sourceMappingURL=svg_line_style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_line_style.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_line_style.tsx"],"names":[],"mappings":"AA4BA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAaD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAqCvC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from '@emotion/styled';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { SVGStyledLine } from '../../../svg/index.js';
|
|
5
|
+
import { withFieldGroup } from '../../context/use_ts_form.js';
|
|
6
|
+
import { FormGroup } from '../input_groups/form_group.js';
|
|
7
|
+
import { Fieldset, Legend } from './fieldset.js';
|
|
8
|
+
import { svgLineStyleFieldsSchema } from './svg_line_style.schema.js';
|
|
9
|
+
// https://tanstack.com/form/latest/docs/framework/react/guides/form-composition#reusing-groups-of-fields-in-multiple-forms
|
|
10
|
+
// Default values are not used at runtime (same for props).
|
|
11
|
+
const defaultValues = {
|
|
12
|
+
stroke: '#000000',
|
|
13
|
+
strokeOpacity: '1',
|
|
14
|
+
strokeWidth: '1',
|
|
15
|
+
strokeDasharray: 'solid',
|
|
16
|
+
};
|
|
17
|
+
const inferSVGLineStyleFieldsProps = {
|
|
18
|
+
label: '',
|
|
19
|
+
};
|
|
20
|
+
const patternsOptions = [
|
|
21
|
+
{ label: 'Solid', value: 'solid' },
|
|
22
|
+
{ label: 'Dotted', value: 'dotted' },
|
|
23
|
+
{ label: 'Dashed', value: 'dashed' },
|
|
24
|
+
{ label: 'Dashed Dot', value: 'dashed-dot' },
|
|
25
|
+
];
|
|
26
|
+
export const FieldGroupSVGLineStyleFields = withFieldGroup({
|
|
27
|
+
defaultValues,
|
|
28
|
+
props: inferSVGLineStyleFieldsProps,
|
|
29
|
+
render({ group, label }) {
|
|
30
|
+
return (_jsxs(Fieldset, { children: [_jsx(Legend, { children: label }), _jsx(group.AppField, { name: "stroke", children: (field) => _jsx(field.ColorPicker, { label: "Color", disableAlpha: true }) }), _jsx(group.AppField, { name: "strokeOpacity", children: (field) => (_jsx(field.NumericInput, { label: "Opacity", min: 0, max: 1, minorStepSize: 0.01, step: 0.05, majorStepSize: 0.1 })) }), _jsx(group.AppField, { name: "strokeWidth", children: (field) => _jsx(field.NumericInput, { label: "Width" }) }), _jsx(group.AppField, { name: "strokeDasharray", children: (field) => _jsx(field.Select, { label: "Style", items: patternsOptions }) }), _jsx(FormGroup, { label: "Preview", children: _jsx(group.Subscribe, { selector: (state) => state.values, children: (values) => _jsx(LineStyleFieldPreview, { ...values }) }) })] }));
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const LineStyleFieldPreviewContainer = styled.div `
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
min-height: 30px;
|
|
37
|
+
`;
|
|
38
|
+
const LineStyleFieldPreview = memo(function TextStyleFieldPreview(props) {
|
|
39
|
+
const parsedValues = svgLineStyleFieldsSchema.parse(props);
|
|
40
|
+
return (_jsx(LineStyleFieldPreviewContainer, { children: _jsx("svg", { viewBox: "0 0 180 30", children: _jsx(SVGStyledLine, { x1: 0, x2: 180, y1: 15, y2: 15, ...parsedValues, opacity: 1 }) }) }));
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=svg_line_style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_line_style.js","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_line_style.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,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E,EAAE,KACF,YAAY,EAChB,OAAO,EAAE,CAAC,GACV,GACE,GACyB,CAClC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const svgLineStyleFieldsSchema: z.ZodObject<{
|
|
3
|
+
stroke: z.ZodString;
|
|
4
|
+
strokeOpacity: z.ZodCoercedNumber<string>;
|
|
5
|
+
strokeWidth: z.ZodCoercedNumber<string>;
|
|
6
|
+
strokeDasharray: z.ZodEnum<{
|
|
7
|
+
readonly solid: "solid";
|
|
8
|
+
readonly dashed: "dashed";
|
|
9
|
+
readonly dotted: "dotted";
|
|
10
|
+
readonly 'dashed-dot': "dashed-dot";
|
|
11
|
+
}>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
//# sourceMappingURL=svg_line_style.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_line_style.schema.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_line_style.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAUnC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SVGStyledLineStrokePattern } from '../../../svg/index.js';
|
|
3
|
+
export const svgLineStyleFieldsSchema = z.object({
|
|
4
|
+
stroke: z
|
|
5
|
+
.string()
|
|
6
|
+
.trim()
|
|
7
|
+
.regex(/^#[0-9a-fA-F]{6}$/, {
|
|
8
|
+
message: 'Color must be hexadecimal and should not contain alpha',
|
|
9
|
+
}),
|
|
10
|
+
strokeOpacity: z.coerce.number().min(0).max(1),
|
|
11
|
+
strokeWidth: z.coerce.number(),
|
|
12
|
+
strokeDasharray: z.enum(SVGStyledLineStrokePattern),
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=svg_line_style.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_line_style.schema.js","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_line_style.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,IAAI,EAAE;SACN,KAAK,CAAC,mBAAmB,EAAE;QAC1B,OAAO,EAAE,wDAAwD;KAClE,CAAC;IACJ,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACtD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAU;IACtC,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC;CACpD,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface SVGTextStyleFieldsProps {
|
|
2
|
+
label: string;
|
|
3
|
+
previewText?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const FieldGroupSVGTextStyleFields: <TFormData, TFields extends import("@tanstack/form-core").DeepKeysOfType<TFormData, {
|
|
6
|
+
fill: string;
|
|
7
|
+
fontSize: string;
|
|
8
|
+
fontStyle: "italic" | "normal";
|
|
9
|
+
fontWeight: "bold" | "normal";
|
|
10
|
+
} | null | undefined> | {
|
|
11
|
+
fill: import("@tanstack/form-core").DeepKeysOfType<TFormData, string>;
|
|
12
|
+
fontSize: import("@tanstack/form-core").DeepKeysOfType<TFormData, string>;
|
|
13
|
+
fontStyle: import("@tanstack/form-core").DeepKeysOfType<TFormData, "italic" | "normal">;
|
|
14
|
+
fontWeight: import("@tanstack/form-core").DeepKeysOfType<TFormData, "bold" | "normal">;
|
|
15
|
+
}, TOnMount extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/form-core").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/form-core").FormAsyncValidateOrFn<TFormData> | undefined, TFormSubmitMeta>(params: import("react").PropsWithChildren<NoInfer<SVGTextStyleFieldsProps> & {
|
|
16
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TFormSubmitMeta, {
|
|
17
|
+
readonly Input: typeof import("../input/input.tsx").Input;
|
|
18
|
+
readonly NumericInput: typeof import("../input/numeric_input.tsx").NumericInput;
|
|
19
|
+
readonly Checkbox: typeof import("../input/checkbox.tsx").Checkbox;
|
|
20
|
+
readonly Select: typeof import("../input/select.tsx").Select;
|
|
21
|
+
readonly Switch: typeof import("../input/switch.tsx").Switch;
|
|
22
|
+
readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
|
|
23
|
+
}, {
|
|
24
|
+
readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
|
|
25
|
+
readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
|
|
26
|
+
readonly Section: typeof import("../layout/Section.tsx").Section;
|
|
27
|
+
}> | import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/form-core").FieldsMap<unknown, TFormData>, any, any, any, any, any, any, any, any, any, any, TFormSubmitMeta, {
|
|
28
|
+
readonly Input: typeof import("../input/input.tsx").Input;
|
|
29
|
+
readonly NumericInput: typeof import("../input/numeric_input.tsx").NumericInput;
|
|
30
|
+
readonly Checkbox: typeof import("../input/checkbox.tsx").Checkbox;
|
|
31
|
+
readonly Select: typeof import("../input/select.tsx").Select;
|
|
32
|
+
readonly Switch: typeof import("../input/switch.tsx").Switch;
|
|
33
|
+
readonly ColorPicker: typeof import("../input/color_picker.tsx").ColorPicker;
|
|
34
|
+
}, {
|
|
35
|
+
readonly SubmitButton: typeof import("../input/submit_button.tsx").SubmitButton;
|
|
36
|
+
readonly ResetButton: typeof import("../input/reset_button.tsx").ResetButton;
|
|
37
|
+
readonly Section: typeof import("../layout/Section.tsx").Section;
|
|
38
|
+
}>;
|
|
39
|
+
fields: TFields;
|
|
40
|
+
}>) => ReturnType<import("react").FunctionComponent>;
|
|
41
|
+
//# sourceMappingURL=svg_text_style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_text_style.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_text_style.tsx"],"names":[],"mappings":"AA8BA,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDA4DvC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox } from '@blueprintjs/core';
|
|
3
|
+
import styled from '@emotion/styled';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { SVGStyledText } from '../../../svg/index.js';
|
|
6
|
+
import { withFieldGroup } from '../../context/use_ts_form.js';
|
|
7
|
+
import { FormGroup } from '../input_groups/form_group.js';
|
|
8
|
+
import { Fieldset, Legend } from './fieldset.js';
|
|
9
|
+
import { svgTextStyleFieldsSchema } from './svg_text_style.schema.js';
|
|
10
|
+
const TextStyleSwitchContainer = styled.div `
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
gap: 1rem;
|
|
14
|
+
`;
|
|
15
|
+
// https://tanstack.com/form/latest/docs/framework/react/guides/form-composition#reusing-groups-of-fields-in-multiple-forms
|
|
16
|
+
// Default values are not used at runtime (same for props).
|
|
17
|
+
const defaultValues = {
|
|
18
|
+
fill: '#000000',
|
|
19
|
+
fontSize: '16',
|
|
20
|
+
fontStyle: 'normal',
|
|
21
|
+
fontWeight: 'normal',
|
|
22
|
+
};
|
|
23
|
+
const inferSVGTextStyleFieldsProps = {
|
|
24
|
+
label: '',
|
|
25
|
+
};
|
|
26
|
+
export const FieldGroupSVGTextStyleFields = withFieldGroup({
|
|
27
|
+
defaultValues,
|
|
28
|
+
props: inferSVGTextStyleFieldsProps,
|
|
29
|
+
render: function SVGTextStyleFields({ group, label, previewText = 'Placeholder', }) {
|
|
30
|
+
return (_jsxs(Fieldset, { children: [_jsx(Legend, { children: label }), _jsx(group.AppField, { name: "fill", children: (field) => _jsx(field.ColorPicker, { label: "Color" }) }), _jsx(group.AppField, { name: "fontSize", children: (field) => _jsx(field.NumericInput, { label: "Font size" }) }), _jsx(FormGroup, { label: "Font style", children: _jsxs(TextStyleSwitchContainer, { children: [_jsx(group.Field, { name: "fontWeight", children: (field) => (_jsx(Checkbox, { labelElement: _jsx(BoldLabel, { children: "Bold" }), name: field.name, checked: fontWeightToBoolean(field.state.value), onChange: (e) => field.handleChange(booleanToFontWeight(e.target.checked)), onBlur: field.handleBlur })) }), _jsx(group.Field, { name: "fontStyle", children: (field) => (_jsx(Checkbox, { labelElement: _jsx(ItalicLabel, { children: "Italic" }), name: field.name, checked: fontStyleToBoolean(field.state.value), onChange: (e) => field.handleChange(booleanToFontStyle(e.target.checked)), onBlur: field.handleBlur })) })] }) }), _jsx(FormGroup, { label: "Preview", children: _jsx(group.Subscribe, { selector: (state) => state.values, children: (values) => (_jsx(TextStyleFieldPreview, { ...values, children: previewText })) }) })] }));
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
const TextStyleFieldPreviewContainer = styled.div `
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
min-height: 30px;
|
|
37
|
+
`;
|
|
38
|
+
const TextStyleFieldPreview = memo(function TextStyleFieldPreview(props) {
|
|
39
|
+
const parsedValues = svgTextStyleFieldsSchema.parse(props);
|
|
40
|
+
const svgHeight = Math.round(parsedValues.fontSize * 1.5);
|
|
41
|
+
const textY = Math.round(svgHeight / 4);
|
|
42
|
+
return (_jsx(TextStyleFieldPreviewContainer, { children: _jsx("svg", { height: svgHeight, width: "auto", children: _jsx(SVGStyledText, { dominantBaseline: "hanging", x: 0, y: textY, ...parsedValues, children: props.children }) }) }));
|
|
43
|
+
});
|
|
44
|
+
const BoldLabel = styled.span `
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
`;
|
|
47
|
+
const ItalicLabel = styled.span `
|
|
48
|
+
font-style: italic;
|
|
49
|
+
`;
|
|
50
|
+
function fontWeightToBoolean(weight) {
|
|
51
|
+
return weight === 'bold';
|
|
52
|
+
}
|
|
53
|
+
function booleanToFontWeight(weight) {
|
|
54
|
+
return weight ? 'bold' : 'normal';
|
|
55
|
+
}
|
|
56
|
+
function fontStyleToBoolean(weight) {
|
|
57
|
+
return weight === 'italic';
|
|
58
|
+
}
|
|
59
|
+
function booleanToFontStyle(weight) {
|
|
60
|
+
return weight ? 'italic' : 'normal';
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=svg_text_style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_text_style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C,CAAC,QAAQ,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const svgTextStyleFieldsSchema: z.ZodObject<{
|
|
3
|
+
fill: z.ZodString;
|
|
4
|
+
fontSize: z.ZodCoercedNumber<string>;
|
|
5
|
+
fontStyle: z.ZodEnum<{
|
|
6
|
+
italic: "italic";
|
|
7
|
+
normal: "normal";
|
|
8
|
+
}>;
|
|
9
|
+
fontWeight: z.ZodEnum<{
|
|
10
|
+
bold: "bold";
|
|
11
|
+
normal: "normal";
|
|
12
|
+
}>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
//# sourceMappingURL=svg_text_style.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_text_style.schema.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_text_style.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,wBAAwB;;;;;;;;;;;iBAKnC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const svgTextStyleFieldsSchema = z.object({
|
|
3
|
+
fill: z.string(),
|
|
4
|
+
fontSize: z.coerce.number(),
|
|
5
|
+
fontStyle: z.enum(['normal', 'italic']),
|
|
6
|
+
fontWeight: z.enum(['normal', 'bold']),
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=svg_text_style.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg_text_style.schema.js","sourceRoot":"","sources":["../../../../../src/components/form/components/field_groups/svg_text_style.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAU;IACnC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACvC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;CACvC,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ColorPickerDropdownProps } from '../../../color-picker/index.js';
|
|
1
2
|
import type { FormGroupInputProps } from '../input_groups/form_group.js';
|
|
2
|
-
type ColorPickerProps = Omit<FormGroupInputProps, 'placeholder'>;
|
|
3
|
+
type ColorPickerProps = Omit<FormGroupInputProps, 'placeholder'> & Pick<ColorPickerDropdownProps, 'presetColors' | 'disableAlpha' | 'popoverProps'>;
|
|
3
4
|
export declare function ColorPicker(props: ColorPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
5
|
export {};
|
|
5
6
|
//# sourceMappingURL=color_picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/color_picker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color_picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input/color_picker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAI/E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGzE,KAAK,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAC9D,IAAI,CACF,wBAAwB,EACxB,cAAc,GAAG,cAAc,GAAG,cAAc,CACjD,CAAC;AAEJ,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAmClD"}
|
|
@@ -4,6 +4,7 @@ import { useFieldContext } from '../../context/use_ts_form.js';
|
|
|
4
4
|
import { FormGroup } from '../input_groups/form_group.js';
|
|
5
5
|
export function ColorPicker(props) {
|
|
6
6
|
const { label, helpText, layout, fullWidth, required } = props;
|
|
7
|
+
const { presetColors, disableAlpha, popoverProps } = props;
|
|
7
8
|
const field = useFieldContext();
|
|
8
9
|
const error = field
|
|
9
10
|
.getMeta()
|
|
@@ -12,6 +13,6 @@ export function ColorPicker(props) {
|
|
|
12
13
|
function onChange(color) {
|
|
13
14
|
field.setValue(color.hex);
|
|
14
15
|
}
|
|
15
|
-
return (_jsx(FormGroup, { name: field.name, label: label, helpText: helpText, error: error, layout: layout, fullWidth: fullWidth, required: required, intent: error ? 'danger' : 'none', children: _jsx(ColorPickerDropdown, { color: { hex: field.state.value }, onChange: onChange }) }));
|
|
16
|
+
return (_jsx(FormGroup, { name: field.name, label: label, helpText: helpText, error: error, layout: layout, fullWidth: fullWidth, required: required, intent: error ? 'danger' : 'none', children: _jsx(ColorPickerDropdown, { id: field.name, color: { hex: field.state.value }, onChange: onChange, presetColors: presetColors, disableAlpha: disableAlpha, popoverProps: popoverProps }) }));
|
|
16
17
|
}
|
|
17
18
|
//# sourceMappingURL=color_picker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_picker.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input/color_picker.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"color_picker.js","sourceRoot":"","sources":["../../../../../src/components/form/components/input/color_picker.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAQ1D,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC/D,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE3D,MAAM,KAAK,GAAG,eAAe,EAAU,CAAC;IACxC,MAAM,KAAK,GAAG,KAAK;SAChB,OAAO,EAAE;SACT,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;SAC5B,EAAE,CAAC,CAAC,CAAC,CAAC;IAET,SAAS,QAAQ,CAAC,KAAmC;QACnD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CACL,KAAC,SAAS,IACR,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,YAEjC,KAAC,mBAAmB,IAClB,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,EACjC,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,GAC1B,GACQ,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form_group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input_groups/form_group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA+DhD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"form_group.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/components/input_groups/form_group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AA+DhD,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,cAAc;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CAkD9C"}
|
|
@@ -32,7 +32,43 @@ declare const withForm: <TFormData, TOnMount extends import("@tanstack/react-for
|
|
|
32
32
|
readonly ResetButton: typeof ResetButton;
|
|
33
33
|
readonly Section: typeof Section;
|
|
34
34
|
}>;
|
|
35
|
-
}
|
|
35
|
+
}>>, withFieldGroup: <TFieldGroupData, TSubmitMeta, TRenderProps extends object = {}>({ render, props, defaultValues, }: import("@tanstack/react-form").WithFieldGroupProps<TFieldGroupData, {
|
|
36
|
+
readonly Input: typeof Input;
|
|
37
|
+
readonly NumericInput: typeof NumericInput;
|
|
38
|
+
readonly Checkbox: typeof Checkbox;
|
|
39
|
+
readonly Select: typeof Select;
|
|
40
|
+
readonly Switch: typeof Switch;
|
|
41
|
+
readonly ColorPicker: typeof ColorPicker;
|
|
42
|
+
}, {
|
|
43
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
44
|
+
readonly ResetButton: typeof ResetButton;
|
|
45
|
+
readonly Section: typeof Section;
|
|
46
|
+
}, TSubmitMeta, TRenderProps>) => <TFormData, TFields extends import("@tanstack/react-form").DeepKeysOfType<TFormData, TFieldGroupData | null | undefined> | import("@tanstack/react-form").FieldsMap<TFormData, TFieldGroupData>, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TFormSubmitMeta>(params: import("react").PropsWithChildren<NoInfer<TRenderProps> & {
|
|
47
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, unknown extends TSubmitMeta ? TFormSubmitMeta : TSubmitMeta, {
|
|
48
|
+
readonly Input: typeof Input;
|
|
49
|
+
readonly NumericInput: typeof NumericInput;
|
|
50
|
+
readonly Checkbox: typeof Checkbox;
|
|
51
|
+
readonly Select: typeof Select;
|
|
52
|
+
readonly Switch: typeof Switch;
|
|
53
|
+
readonly ColorPicker: typeof ColorPicker;
|
|
54
|
+
}, {
|
|
55
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
56
|
+
readonly ResetButton: typeof ResetButton;
|
|
57
|
+
readonly Section: typeof Section;
|
|
58
|
+
}> | import("@tanstack/react-form").AppFieldExtendedReactFieldGroupApi<unknown, TFormData, string | import("@tanstack/react-form").FieldsMap<unknown, TFormData>, any, any, any, any, any, any, any, any, any, any, unknown extends TSubmitMeta ? TFormSubmitMeta : TSubmitMeta, {
|
|
59
|
+
readonly Input: typeof Input;
|
|
60
|
+
readonly NumericInput: typeof NumericInput;
|
|
61
|
+
readonly Checkbox: typeof Checkbox;
|
|
62
|
+
readonly Select: typeof Select;
|
|
63
|
+
readonly Switch: typeof Switch;
|
|
64
|
+
readonly ColorPicker: typeof ColorPicker;
|
|
65
|
+
}, {
|
|
66
|
+
readonly SubmitButton: typeof SubmitButton;
|
|
67
|
+
readonly ResetButton: typeof ResetButton;
|
|
68
|
+
readonly Section: typeof Section;
|
|
69
|
+
}>;
|
|
70
|
+
fields: TFields;
|
|
71
|
+
}>) => ReturnType<import("react").FunctionComponent>;
|
|
36
72
|
export declare const useForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import("@tanstack/react-form").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
37
73
|
readonly Input: typeof Input;
|
|
38
74
|
readonly NumericInput: typeof NumericInput;
|
|
@@ -45,5 +81,5 @@ export declare const useForm: <TFormData, TOnMount extends import("@tanstack/rea
|
|
|
45
81
|
readonly ResetButton: typeof ResetButton;
|
|
46
82
|
readonly Section: typeof Section;
|
|
47
83
|
}>;
|
|
48
|
-
export { useFieldContext, useFormContext, withForm };
|
|
84
|
+
export { useFieldContext, useFormContext, withFieldGroup, withForm };
|
|
49
85
|
//# sourceMappingURL=use_ts_form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_ts_form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/context/use_ts_form.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,QAAA,MAAQ,cAAc,2IAAE,eAAe,8KACb,CAAC;AAE3B,QAAA,MAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use_ts_form.d.ts","sourceRoot":"","sources":["../../../../src/components/form/context/use_ts_form.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,QAAA,MAAQ,cAAc,2IAAE,eAAe,8KACb,CAAC;AAE3B,QAAA,MAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;KAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDAgB1C,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;EAAa,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -9,7 +9,7 @@ import { SubmitButton } from '../components/input/submit_button.js';
|
|
|
9
9
|
import { Switch } from '../components/input/switch.js';
|
|
10
10
|
import { Section } from '../components/layout/Section.js';
|
|
11
11
|
const { useFormContext, useFieldContext, formContext, fieldContext } = createFormHookContexts();
|
|
12
|
-
const { useAppForm, withForm } = createFormHook({
|
|
12
|
+
const { useAppForm, withForm, withFieldGroup } = createFormHook({
|
|
13
13
|
fieldContext,
|
|
14
14
|
formContext,
|
|
15
15
|
formComponents: {
|
|
@@ -27,5 +27,5 @@ const { useAppForm, withForm } = createFormHook({
|
|
|
27
27
|
},
|
|
28
28
|
});
|
|
29
29
|
export const useForm = useAppForm;
|
|
30
|
-
export { useFieldContext, useFormContext, withForm };
|
|
30
|
+
export { useFieldContext, useFormContext, withFieldGroup, withForm };
|
|
31
31
|
//# sourceMappingURL=use_ts_form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_ts_form.js","sourceRoot":"","sources":["../../../../src/components/form/context/use_ts_form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAsC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,E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KAAK;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,MAAM;QACN,WAAW;KACZ;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelHeader.d.ts","sourceRoot":"","sources":["../../../src/components/header/PanelHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"PanelHeader.d.ts","sourceRoot":"","sources":["../../../src/components/header/PanelHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,UAAU,gBAAgB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAsBD,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,2CAiBlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelHeader.js","sourceRoot":"","sources":["../../../src/components/header/PanelHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMjC,CAAC;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"PanelHeader.js","sourceRoot":"","sources":["../../../src/components/header/PanelHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMjC,CAAC;AAEF,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;CAUrC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE5D,OAAO,CACL,MAAC,eAAe,eACd,KAAC,mBAAmB,cAAE,QAAQ,GAAuB,EACrD,KAAC,aAAa,IAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAI,EAC9C,eAAe,IAAI,CAClB,KAAC,MAAM,IACL,KAAK,EAAC,OAAO,EACb,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,KAAK,GACV,CACH,IACe,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -15,6 +15,7 @@ export * from './split_pane/index.js';
|
|
|
15
15
|
export * from './table/index.js';
|
|
16
16
|
export * from './toolbar/index.js';
|
|
17
17
|
export * from './form/context/use_ts_form.js';
|
|
18
|
+
export * from './form/components/field_groups/index.js';
|
|
18
19
|
export * from './activity_bar/index.js';
|
|
19
20
|
export * from './activity_panel/index.js';
|
|
20
21
|
export * from './utils/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
|
package/lib/components/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from './split_pane/index.js';
|
|
|
15
15
|
export * from './table/index.js';
|
|
16
16
|
export * from './toolbar/index.js';
|
|
17
17
|
export * from './form/context/use_ts_form.js';
|
|
18
|
+
export * from './form/components/field_groups/index.js';
|
|
18
19
|
export * from './activity_bar/index.js';
|
|
19
20
|
export * from './activity_panel/index.js';
|
|
20
21
|
export * from './utils/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cA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