@react-form-builder/components-rsuite 7.7.0 → 7.9.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/dist/InputCell-BDyUJFGm.js +21 -0
- package/dist/InputCell-BDyUJFGm.js.map +1 -0
- package/dist/Labeled-BWYRwMiY.js +35 -0
- package/dist/Labeled-BWYRwMiY.js.map +1 -0
- package/dist/WrappedInput-BRkBjl0z.js +11 -0
- package/dist/WrappedInput-BRkBjl0z.js.map +1 -0
- package/dist/autocomplete.d.ts +30 -0
- package/dist/autocomplete.js +59 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/breadcrumb.d.ts +38 -0
- package/dist/breadcrumb.js +42 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/builder-view-with-css.d.ts +9 -0
- package/dist/builder-view-with-css.js +10 -0
- package/dist/builder-view-with-css.js.map +1 -0
- package/dist/button.d.ts +6 -0
- package/dist/button.js +23 -0
- package/dist/button.js.map +1 -0
- package/dist/calendar.d.ts +20 -0
- package/dist/calendar.js +21 -0
- package/dist/calendar.js.map +1 -0
- package/dist/card.d.ts +20 -0
- package/dist/card.js +30 -0
- package/dist/card.js.map +1 -0
- package/dist/categories-_98lyB3C.js +8 -0
- package/dist/categories-_98lyB3C.js.map +1 -0
- package/dist/checkbox.d.ts +6 -0
- package/dist/checkbox.js +32 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/commonProperties-ETOgvhCH.js +74 -0
- package/dist/commonProperties-ETOgvhCH.js.map +1 -0
- package/dist/components-descriptions.d.ts +6 -0
- package/dist/components-descriptions.js +5 -0
- package/dist/components-descriptions.js.map +1 -0
- package/dist/container.d.ts +25 -0
- package/dist/container.js +23 -0
- package/dist/container.js.map +1 -0
- package/dist/css/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/css/rsuite-no-reset.min.css +1 -1
- package/dist/css-loader.d.ts +19 -0
- package/dist/css-loader.js +20 -0
- package/dist/css-loader.js.map +1 -0
- package/dist/date-picker.d.ts +25 -0
- package/dist/date-picker.js +71 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/dateTimeUtils-C2AEniv5.js +25 -0
- package/dist/dateTimeUtils-C2AEniv5.js.map +1 -0
- package/dist/definitions.d.ts +5 -0
- package/dist/definitions.js +6 -0
- package/dist/definitions.js.map +1 -0
- package/dist/divider.d.ts +11 -0
- package/dist/divider.js +12 -0
- package/dist/divider.js.map +1 -0
- package/dist/dropdown.d.ts +58 -0
- package/dist/dropdown.js +56 -0
- package/dist/dropdown.js.map +1 -0
- package/dist/error-message.d.ts +20 -0
- package/dist/error-message.js +28 -0
- package/dist/error-message.js.map +1 -0
- package/dist/{formengine-rsuite-cbc1d3ae.js → formengine-rsuite.css-DkGUHOws.js} +1 -1
- package/dist/formengine-rsuite.css-DkGUHOws.js.map +1 -0
- package/dist/header.d.ts +69 -0
- package/dist/header.js +20 -0
- package/dist/header.js.map +1 -0
- package/dist/hooks-DMVtrI-b.js +50 -0
- package/dist/hooks-DMVtrI-b.js.map +1 -0
- package/dist/image.d.ts +22 -0
- package/dist/image.js +41 -0
- package/dist/image.js.map +1 -0
- package/dist/images/logo.svg +20 -0
- package/dist/index.d.ts +1529 -36
- package/dist/index.js +95 -19516
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +32 -0
- package/dist/input.js +26 -0
- package/dist/input.js.map +1 -0
- package/dist/label.d.ts +47 -0
- package/dist/label.js +16 -0
- package/dist/label.js.map +1 -0
- package/dist/link.d.ts +56 -0
- package/dist/link.js +20 -0
- package/dist/link.js.map +1 -0
- package/dist/localization-wrapper.d.ts +164 -0
- package/dist/localization-wrapper.js +113 -0
- package/dist/localization-wrapper.js.map +1 -0
- package/dist/menu.d.ts +35 -0
- package/dist/menu.js +49 -0
- package/dist/menu.js.map +1 -0
- package/dist/message.d.ts +16 -0
- package/dist/message.js +18 -0
- package/dist/message.js.map +1 -0
- package/dist/modal-layout.d.ts +28 -0
- package/dist/modal-layout.js +21 -0
- package/dist/modal-layout.js.map +1 -0
- package/dist/modal.d.ts +16 -0
- package/dist/modal.js +27 -0
- package/dist/modal.js.map +1 -0
- package/dist/models.d.ts +8 -0
- package/dist/models.js +6 -0
- package/dist/models.js.map +1 -0
- package/dist/number-format.d.ts +25 -0
- package/dist/number-format.js +50 -0
- package/dist/number-format.js.map +1 -0
- package/dist/pattern-format.d.ts +25 -0
- package/dist/pattern-format.js +36 -0
- package/dist/pattern-format.js.map +1 -0
- package/dist/placeholder.d.ts +17 -0
- package/dist/placeholder.js +38 -0
- package/dist/placeholder.js.map +1 -0
- package/dist/progress.d.ts +14 -0
- package/dist/progress.js +27 -0
- package/dist/progress.js.map +1 -0
- package/dist/r-suite-components.d.ts +8 -0
- package/dist/r-suite-components.js +98 -0
- package/dist/r-suite-components.js.map +1 -0
- package/dist/rSuiteComponentsDescriptions-lX1mwx9_.js +67 -0
- package/dist/rSuiteComponentsDescriptions-lX1mwx9_.js.map +1 -0
- package/dist/radio-group.d.ts +26 -0
- package/dist/radio-group.js +21 -0
- package/dist/radio-group.js.map +1 -0
- package/dist/rsuite-no-reset-rtl.min.css-B0vQWI16.js +5 -0
- package/dist/rsuite-no-reset-rtl.min.css-B0vQWI16.js.map +1 -0
- package/dist/rsuite-no-reset.min.css-bW1P11UK.js +5 -0
- package/dist/rsuite-no-reset.min.css-bW1P11UK.js.map +1 -0
- package/dist/search.d.ts +54 -0
- package/dist/search.js +55 -0
- package/dist/search.js.map +1 -0
- package/dist/static-content.d.ts +19 -0
- package/dist/static-content.js +15 -0
- package/dist/static-content.js.map +1 -0
- package/dist/stats.html +4 -0
- package/dist/tab.d.ts +39 -0
- package/dist/tab.js +55 -0
- package/dist/tab.js.map +1 -0
- package/dist/tag-picker.d.ts +21 -0
- package/dist/tag-picker.js +39 -0
- package/dist/tag-picker.js.map +1 -0
- package/dist/text-area.d.ts +24 -0
- package/dist/text-area.js +21 -0
- package/dist/text-area.js.map +1 -0
- package/dist/time-picker.d.ts +29 -0
- package/dist/time-picker.js +72 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toggle.d.ts +16 -0
- package/dist/toggle.js +26 -0
- package/dist/toggle.js.map +1 -0
- package/dist/tooltip.d.ts +29 -0
- package/dist/tooltip.js +37 -0
- package/dist/tooltip.js.map +1 -0
- package/dist/uploader.d.ts +20 -0
- package/dist/uploader.js +67 -0
- package/dist/uploader.js.map +1 -0
- package/dist/useTouchOnEvent-BPYbKiku.js +12 -0
- package/dist/useTouchOnEvent-BPYbKiku.js.map +1 -0
- package/dist/view-with-css.d.ts +9 -0
- package/dist/view-with-css.js +9 -0
- package/dist/view-with-css.js.map +1 -0
- package/dist/view.d.ts +8 -0
- package/dist/view.js +7 -0
- package/dist/view.js.map +1 -0
- package/dist/wizard.d.ts +86 -0
- package/dist/wizard.js +277 -0
- package/dist/wizard.js.map +1 -0
- package/package.json +195 -6
- package/dist/formengine-rsuite-cbc1d3ae.js.map +0 -1
- package/dist/images/logo.png +0 -0
- package/dist/rsuite-no-reset-rtl.min-f9b04ca7.js +0 -5
- package/dist/rsuite-no-reset-rtl.min-f9b04ca7.js.map +0 -1
- package/dist/rsuite-no-reset.min-12eea714.js +0 -5
- package/dist/rsuite-no-reset.min-12eea714.js.map +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads FormEngine specific styles over "rsuite" library.
|
|
3
|
+
* @returns the Promise that resolves when the custom styles have been loaded successfully.
|
|
4
|
+
*/
|
|
5
|
+
export declare const formEngineRsuiteCssLoader: () => Promise<void>;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Loads the Left-To-Right (LTR) CSS for the "rsuite" library.
|
|
9
|
+
* @returns the Promise that resolves when the LTR CSS has been loaded successfully.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ltrCssLoader: () => Promise<void>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Loads the Right-to-Left (RTL) CSS for the "rsuite" library.
|
|
15
|
+
* @returns the Promise that resolves when the RTL CSS has been loaded successfully.
|
|
16
|
+
*/
|
|
17
|
+
export declare const rtlCssLoader: () => Promise<void>;
|
|
18
|
+
|
|
19
|
+
export { }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BiDi as s, loadResource as r, unloadResource as a } from "@react-form-builder/core";
|
|
2
|
+
const e = {
|
|
3
|
+
[s.LTR]: "rsuite-ltr-css",
|
|
4
|
+
[s.RTL]: "rsuite-rtl-css"
|
|
5
|
+
}, i = async () => {
|
|
6
|
+
const t = (await import("./rsuite-no-reset.min.css-bW1P11UK.js")).default;
|
|
7
|
+
await r(e[s.LTR], t, "stylesheet"), a(e[s.RTL]);
|
|
8
|
+
}, c = async () => {
|
|
9
|
+
const t = (await import("./rsuite-no-reset-rtl.min.css-B0vQWI16.js")).default;
|
|
10
|
+
await r(e[s.RTL], t, "stylesheet"), a(e[s.LTR]);
|
|
11
|
+
}, n = async () => {
|
|
12
|
+
const t = (await import("./formengine-rsuite.css-DkGUHOws.js")).default;
|
|
13
|
+
await r("form-engine-css", t, "stylesheet");
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
n as formEngineRsuiteCssLoader,
|
|
17
|
+
i as ltrCssLoader,
|
|
18
|
+
c as rtlCssLoader
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=css-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-loader.js","sources":["../src/cssLoader.ts"],"sourcesContent":["import {BiDi, loadResource, unloadResource} from '@react-form-builder/core'\n\nconst resourceIds: Record<BiDi, string> = {\n [BiDi.LTR]: 'rsuite-ltr-css',\n [BiDi.RTL]: 'rsuite-rtl-css'\n}\n\n/**\n * Loads the Left-To-Right (LTR) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the LTR CSS has been loaded successfully.\n */\nexport const ltrCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset.min.css?url')).default\n await loadResource(resourceIds[BiDi.LTR], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.RTL])\n}\n\n/**\n * Loads the Right-to-Left (RTL) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the RTL CSS has been loaded successfully.\n */\nexport const rtlCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset-rtl.min.css?url')).default\n await loadResource(resourceIds[BiDi.RTL], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.LTR])\n}\n\n/**\n * Loads FormEngine specific styles over \"rsuite\" library.\n * @returns the Promise that resolves when the custom styles have been loaded successfully.\n */\nexport const formEngineRsuiteCssLoader = async () => {\n const href = (await import('../public/css/formengine-rsuite.css?url')).default\n await loadResource('form-engine-css', href, 'stylesheet')\n}\n"],"names":["resourceIds","BiDi","ltrCssLoader","href","loadResource","unloadResource","rtlCssLoader","formEngineRsuiteCssLoader"],"mappings":";AAEA,MAAMA,IAAoC;AAAA,EACxC,CAACC,EAAK,GAAG,GAAG;AAAA,EACZ,CAACA,EAAK,GAAG,GAAG;AACd,GAMaC,IAAe,YAAY;AACtC,QAAMC,KAAQ,MAAM,OAAO,uCAA2C,GAAG;AACzE,QAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC5DE,EAAeL,EAAYC,EAAK,GAAG,CAAC;AACtC,GAMaK,IAAe,YAAY;AACtC,QAAMH,KAAQ,MAAM,OAAO,2CAA+C,GAAG;AAC7E,QAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC5DE,EAAeL,EAAYC,EAAK,GAAG,CAAC;AACtC,GAMaM,IAA4B,YAAY;AACnD,QAAMJ,KAAQ,MAAM,OAAO,qCAAyC,GAAG;AACvE,QAAMC,EAAa,mBAAmBD,GAAM,YAAY;AAC1D;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DatePickerProps } from 'rsuite';
|
|
2
|
+
import { Definer } from '@react-form-builder/core';
|
|
3
|
+
|
|
4
|
+
export declare const rsDatePicker: Definer<RsDatePickerProps>;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props for the RsDatePicker component.
|
|
8
|
+
*/
|
|
9
|
+
export declare interface RsDatePickerProps extends DatePickerProps {
|
|
10
|
+
/**
|
|
11
|
+
* Label for the date picker.
|
|
12
|
+
*/
|
|
13
|
+
label: string;
|
|
14
|
+
/**
|
|
15
|
+
* Called after the value has been changed.
|
|
16
|
+
* @param value the value.
|
|
17
|
+
*/
|
|
18
|
+
onChange?: (value: Date | null) => void;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
22
|
+
inline?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { }
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { define as b, date as n, boolean as t, string as r, event as e, number as m, disabled as C, oneOf as T, useComponentData as y } from "@react-form-builder/core";
|
|
3
|
+
import { useMemo as p, useEffect as k } from "react";
|
|
4
|
+
import { DatePicker as w } from "rsuite";
|
|
5
|
+
import { s as M, p as O, r as P } from "./commonProperties-ETOgvhCH.js";
|
|
6
|
+
import { f as v, t as x } from "./dateTimeUtils-C2AEniv5.js";
|
|
7
|
+
import { f as V } from "./categories-_98lyB3C.js";
|
|
8
|
+
import { u as N } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
|
+
import { L as A } from "./Labeled-BWYRwMiY.js";
|
|
10
|
+
const u = (o) => {
|
|
11
|
+
if (typeof o == "string") {
|
|
12
|
+
const a = new Date(o);
|
|
13
|
+
return isNaN(a.getTime()) ? (console.error("Invalid date string:", o), null) : a;
|
|
14
|
+
}
|
|
15
|
+
return o;
|
|
16
|
+
}, F = ({ label: o, value: a, className: c, format: l, defaultValue: D, ...s }) => {
|
|
17
|
+
const i = y(), g = p(() => x(l), [l]), h = N(s, "onClean"), E = p(() => u(a), [a]);
|
|
18
|
+
return k(() => {
|
|
19
|
+
if (typeof a == "string") {
|
|
20
|
+
const d = u(a);
|
|
21
|
+
d instanceof Date && i.field?.setValue(d);
|
|
22
|
+
}
|
|
23
|
+
}, [a, i]), /* @__PURE__ */ f(A, { label: o, className: c, passAriaToChildren: !0, children: /* @__PURE__ */ f(w, { ...s, value: E ?? D ?? null, format: g, onClean: h }) });
|
|
24
|
+
}, q = b(F, "RsDatePicker").name("DatePicker").category(V).props({
|
|
25
|
+
label: r.default("Date"),
|
|
26
|
+
appearance: T("default", "subtle").withEditorProps({ creatable: !1 }),
|
|
27
|
+
calendarDefaultDate: n,
|
|
28
|
+
cleanable: t.default(!1),
|
|
29
|
+
defaultOpen: t.default(!1),
|
|
30
|
+
defaultValue: n,
|
|
31
|
+
disabled: C.default(!1),
|
|
32
|
+
readOnly: P,
|
|
33
|
+
editable: t.default(!0),
|
|
34
|
+
format: r.validated(v, {
|
|
35
|
+
code: "INVALID_DATE_FORMAT",
|
|
36
|
+
message: "The provided date format is invalid"
|
|
37
|
+
}).withEditorProps({ placeholder: "yyyy-MM-dd" }),
|
|
38
|
+
isoWeek: t.default(!1),
|
|
39
|
+
limitEndYear: m,
|
|
40
|
+
limitStartYear: m,
|
|
41
|
+
oneTap: t,
|
|
42
|
+
onChange: e,
|
|
43
|
+
onChangeCalendarDate: e,
|
|
44
|
+
onClean: e,
|
|
45
|
+
onClose: e,
|
|
46
|
+
onEnter: e,
|
|
47
|
+
onEntered: e,
|
|
48
|
+
onEntering: e,
|
|
49
|
+
onExit: e,
|
|
50
|
+
onExited: e,
|
|
51
|
+
onExiting: e,
|
|
52
|
+
onNextMonth: e,
|
|
53
|
+
onOk: e,
|
|
54
|
+
onOpen: e,
|
|
55
|
+
onPrevMonth: e,
|
|
56
|
+
onSelect: e,
|
|
57
|
+
onToggleMonthDropdown: e,
|
|
58
|
+
onToggleTimeDropdown: e,
|
|
59
|
+
open: t.default(void 0),
|
|
60
|
+
placeholder: r,
|
|
61
|
+
placement: O,
|
|
62
|
+
preventOverflow: t.default(!1),
|
|
63
|
+
showMeridiem: t.default(!1),
|
|
64
|
+
showWeekNumbers: t.default(!1),
|
|
65
|
+
size: M,
|
|
66
|
+
value: n.valued
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
q as rsDatePicker
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.js","sources":["../src/components/RsDatePicker.tsx"],"sourcesContent":["import {boolean, date, define, disabled, event, number, oneOf, string, useComponentData} from '@react-form-builder/core'\nimport {useEffect, useMemo} from 'react'\nimport type {DatePickerProps} from 'rsuite'\nimport {DatePicker} from 'rsuite'\nimport {placement, readOnly, size} from '../commonProperties'\nimport {formatValidator, toSafeFormat} from '../dateTimeUtils'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\n\n/**\n * Props for the RsDatePicker component.\n */\nexport interface RsDatePickerProps extends DatePickerProps {\n /**\n * Label for the date picker.\n */\n label: string\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: Date | null) => void\n /**\n * @deprecated\n */\n inline?: boolean\n}\n\n/**\n * Returns the date converted to Date format.\n * @param value the date value in string or Date format.\n * @returns the date converted to Date format.\n */\nconst parseDateValue = (value: any) => {\n if (typeof value === 'string') {\n const parsedDate = new Date(value)\n if (!isNaN(parsedDate.getTime())) {\n return parsedDate\n }\n console.error('Invalid date string:', value)\n return null\n }\n return value\n}\n\n/**\n * Date picker component with label support.\n * @param props the component props.\n * @param props.label the label for the date picker.\n * @param props.value the value of the date picker.\n * @param props.className the CSS class name.\n * @param props.format the format of the date.\n * @param props.defaultValue the default value of the date picker.\n * @param props.props the additional date picker props.\n * @returns the React element.\n */\nconst RsDatePicker = ({label, value, className, format, defaultValue, ...props}: RsDatePickerProps) => {\n const componentData = useComponentData()\n const safeFormat = useMemo(() => toSafeFormat(format), [format])\n const onClean = useTouchOnEvent(props, 'onClean')\n const parsedValue = useMemo(() => parseDateValue(value), [value])\n\n useEffect(() => {\n if (typeof (value as unknown) === 'string') {\n const parsed = parseDateValue(value)\n if (parsed instanceof Date) {\n componentData.field?.setValue(parsed)\n }\n }\n }, [value, componentData])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <DatePicker {...props} value={parsedValue ?? defaultValue ?? null} format={safeFormat} onClean={onClean}/>\n </Labeled>\n )\n}\n\nexport const rsDatePicker = define(RsDatePicker, 'RsDatePicker')\n .name('DatePicker')\n .category(fieldsCategory)\n .props({\n label: string.default('Date'),\n appearance: oneOf('default', 'subtle').withEditorProps({creatable: false}),\n calendarDefaultDate: date,\n cleanable: boolean.default(false),\n defaultOpen: boolean.default(false),\n defaultValue: date,\n disabled: disabled.default(false),\n readOnly,\n editable: boolean.default(true),\n format: string.validated(formatValidator, {\n code: 'INVALID_DATE_FORMAT',\n message: 'The provided date format is invalid'\n }).withEditorProps({placeholder: 'yyyy-MM-dd'}),\n isoWeek: boolean.default(false),\n limitEndYear: number,\n limitStartYear: number,\n oneTap: boolean,\n onChange: event,\n onChangeCalendarDate: event,\n onClean: event,\n onClose: event,\n onEnter: event,\n onEntered: event,\n onEntering: event,\n onExit: event,\n onExited: event,\n onExiting: event,\n onNextMonth: event,\n onOk: event,\n onOpen: event,\n onPrevMonth: event,\n onSelect: event,\n onToggleMonthDropdown: event,\n onToggleTimeDropdown: event,\n open: boolean.default(undefined),\n placeholder: string,\n placement: placement,\n preventOverflow: boolean.default(false),\n showMeridiem: boolean.default(false),\n showWeekNumbers: boolean.default(false),\n size: size,\n value: date.valued\n })\n"],"names":["parseDateValue","value","parsedDate","RsDatePicker","label","className","format","defaultValue","props","componentData","useComponentData","safeFormat","useMemo","toSafeFormat","onClean","useTouchOnEvent","parsedValue","useEffect","parsed","Labeled","jsx","DatePicker","rsDatePicker","define","fieldsCategory","string","oneOf","date","boolean","disabled","readOnly","formatValidator","number","event","placement","size"],"mappings":";;;;;;;;;AAkCA,MAAMA,IAAiB,CAACC,MAAe;AACrC,MAAI,OAAOA,KAAU,UAAU;AAC7B,UAAMC,IAAa,IAAI,KAAKD,CAAK;AACjC,WAAK,MAAMC,EAAW,QAAA,CAAS,KAG/B,QAAQ,MAAM,wBAAwBD,CAAK,GACpC,QAHEC;AAAA,EAIX;AACA,SAAOD;AACT,GAaME,IAAe,CAAC,EAAC,OAAAC,GAAO,OAAAH,GAAO,WAAAI,GAAW,QAAAC,GAAQ,cAAAC,GAAc,GAAGC,QAA8B;AACrG,QAAMC,IAAgBC,EAAA,GAChBC,IAAaC,EAAQ,MAAMC,EAAaP,CAAM,GAAG,CAACA,CAAM,CAAC,GACzDQ,IAAUC,EAAgBP,GAAO,SAAS,GAC1CQ,IAAcJ,EAAQ,MAAMZ,EAAeC,CAAK,GAAG,CAACA,CAAK,CAAC;AAEhE,SAAAgB,EAAU,MAAM;AACd,QAAI,OAAQhB,KAAsB,UAAU;AAC1C,YAAMiB,IAASlB,EAAeC,CAAK;AACnC,MAAIiB,aAAkB,QACpBT,EAAc,OAAO,SAASS,CAAM;AAAA,IAExC;AAAA,EACF,GAAG,CAACjB,GAAOQ,CAAa,CAAC,qBAGtBU,GAAA,EAAQ,OAAAf,GAAc,WAAAC,GAAsB,oBAAoB,IAC/D,UAAA,gBAAAe,EAACC,GAAA,EAAY,GAAGb,GAAO,OAAOQ,KAAeT,KAAgB,MAAM,QAAQI,GAAY,SAAAG,GAAiB,GAC1G;AAEJ,GAEaQ,IAAeC,EAAOpB,GAAc,cAAc,EAC5D,KAAK,YAAY,EACjB,SAASqB,CAAc,EACvB,MAAM;AAAA,EACL,OAAOC,EAAO,QAAQ,MAAM;AAAA,EAC5B,YAAYC,EAAM,WAAW,QAAQ,EAAE,gBAAgB,EAAC,WAAW,IAAM;AAAA,EACzE,qBAAqBC;AAAA,EACrB,WAAWC,EAAQ,QAAQ,EAAK;AAAA,EAChC,aAAaA,EAAQ,QAAQ,EAAK;AAAA,EAClC,cAAcD;AAAA,EACd,UAAUE,EAAS,QAAQ,EAAK;AAAA,EAChC,UAAAC;AAAA,EACA,UAAUF,EAAQ,QAAQ,EAAI;AAAA,EAC9B,QAAQH,EAAO,UAAUM,GAAiB;AAAA,IACxC,MAAM;AAAA,IACN,SAAS;AAAA,EAAA,CACV,EAAE,gBAAgB,EAAC,aAAa,cAAa;AAAA,EAC9C,SAASH,EAAQ,QAAQ,EAAK;AAAA,EAC9B,cAAcI;AAAA,EACd,gBAAgBA;AAAA,EAChB,QAAQJ;AAAA,EACR,UAAUK;AAAA,EACV,sBAAsBA;AAAA,EACtB,SAASA;AAAA,EACT,SAASA;AAAA,EACT,SAASA;AAAA,EACT,WAAWA;AAAA,EACX,YAAYA;AAAA,EACZ,QAAQA;AAAA,EACR,UAAUA;AAAA,EACV,WAAWA;AAAA,EACX,aAAaA;AAAA,EACb,MAAMA;AAAA,EACN,QAAQA;AAAA,EACR,aAAaA;AAAA,EACb,UAAUA;AAAA,EACV,uBAAuBA;AAAA,EACvB,sBAAsBA;AAAA,EACtB,MAAML,EAAQ,QAAQ,MAAS;AAAA,EAC/B,aAAaH;AAAA,EACb,WAAAS;AAAA,EACA,iBAAiBN,EAAQ,QAAQ,EAAK;AAAA,EACtC,cAAcA,EAAQ,QAAQ,EAAK;AAAA,EACnC,iBAAiBA,EAAQ,QAAQ,EAAK;AAAA,EACtC,MAAAO;AAAA,EACA,OAAOR,EAAK;AACd,CAAC;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { format as e } from "date-fns";
|
|
2
|
+
const n = (r) => {
|
|
3
|
+
const t = r?.trim();
|
|
4
|
+
if (t) {
|
|
5
|
+
try {
|
|
6
|
+
e(/* @__PURE__ */ new Date(), t);
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
}, m = (r) => {
|
|
13
|
+
const t = r?.trim();
|
|
14
|
+
if (!t) return !0;
|
|
15
|
+
try {
|
|
16
|
+
return e(/* @__PURE__ */ new Date(), t), !0;
|
|
17
|
+
} catch {
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
m as f,
|
|
23
|
+
n as t
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=dateTimeUtils-C2AEniv5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateTimeUtils-C2AEniv5.js","sources":["../src/dateTimeUtils.ts"],"sourcesContent":["import {format as formatDate} from 'date-fns'\n\n/**\n * Checks whether the format is valid and returns it trimmed.\n * @param format the date format.\n * @returns the trimmed date format or undefined.\n */\nexport const toSafeFormat = (format?: string) => {\n const trimmed = format?.trim()\n if (!trimmed) return undefined\n\n try {\n // fixes RSuite issue v5.64.2, check on never version\n formatDate(new Date(), trimmed)\n } catch (e) {\n return undefined\n }\n\n return trimmed\n}\n\n/**\n * Checks whether the format is valid.\n * @param format the date format.\n * @returns true if the format is a valid, false otherwise.\n */\nexport const formatValidator = (format?: string) => {\n const trimmed = format?.trim()\n if (!trimmed) return true\n\n try {\n formatDate(new Date(), trimmed)\n return true\n } catch (e) {\n return false\n }\n}\n"],"names":["toSafeFormat","format","trimmed","formatDate","formatValidator"],"mappings":";AAOO,MAAMA,IAAe,CAACC,MAAoB;AAC/C,QAAMC,IAAUD,GAAQ,KAAA;AACxB,MAAKC,GAEL;AAAA,QAAI;AAEFC,MAAAA,EAAW,oBAAI,KAAA,GAAQD,CAAO;AAAA,IAChC,QAAY;AACV;AAAA,IACF;AAEA,WAAOA;AAAA;AACT,GAOaE,IAAkB,CAACH,MAAoB;AAClD,QAAMC,IAAUD,GAAQ,KAAA;AACxB,MAAI,CAACC,EAAS,QAAO;AAErB,MAAI;AACFC,WAAAA,EAAW,oBAAI,KAAA,GAAQD,CAAO,GACvB;AAAA,EACT,QAAY;AACV,WAAO;AAAA,EACT;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sources":["../src/definitions.ts"],"sourcesContent":["import {rSuiteComponents} from './rSuiteComponents'\n\nexport const components = rSuiteComponents.map(def => def.build())\n"],"names":["components","rSuiteComponents","def"],"mappings":";AAEO,MAAMA,IAAaC,EAAiB,IAAI,CAAAC,MAAOA,EAAI,OAAO;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Definer } from '@react-form-builder/core';
|
|
2
|
+
import { DividerProps } from 'rsuite';
|
|
3
|
+
import { ElementType } from 'react';
|
|
4
|
+
import { JSX } from 'react';
|
|
5
|
+
import { PropsWithChildren } from 'react';
|
|
6
|
+
import { ReplaceProps } from 'rsuite/esm/internals/types/utils';
|
|
7
|
+
import { WithAsProps } from 'rsuite/esm/internals/types';
|
|
8
|
+
|
|
9
|
+
export declare const rsDivider: Definer<PropsWithChildren<ReplaceProps<ElementType<any, keyof JSX.IntrinsicElements>, WithAsProps<ElementType<any, keyof JSX.IntrinsicElements>> & DividerProps>>>;
|
|
10
|
+
|
|
11
|
+
export { }
|
package/dist/divider.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { define as o, boolean as r, string as e } from "@react-form-builder/core";
|
|
3
|
+
import { Divider as t } from "rsuite";
|
|
4
|
+
import { a as n } from "./categories-_98lyB3C.js";
|
|
5
|
+
const s = { width: 24, height: 24 }, c = () => /* @__PURE__ */ i("svg", { style: s, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("line", { x1: "4", y1: "10", x2: "16", y2: "10", stroke: "#9CA3AF", strokeWidth: "2", strokeLinecap: "round" }) }), p = o(t, "RsDivider").name("Divider").category(n).icon(c).props({
|
|
6
|
+
children: e,
|
|
7
|
+
vertical: r
|
|
8
|
+
});
|
|
9
|
+
export {
|
|
10
|
+
p as rsDivider
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=divider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"divider.js","sources":["../src/components/RsDivider.tsx"],"sourcesContent":["import {boolean, define, string} from '@react-form-builder/core'\nimport {Divider} from 'rsuite'\nimport {staticCategory} from './categories'\n\nconst iconStyle = {width: 24, height: 24}\n\nconst Icon = () => (\n <svg style={iconStyle} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"4\" y1=\"10\" x2=\"16\" y2=\"10\" stroke=\"#9CA3AF\" strokeWidth=\"2\" strokeLinecap=\"round\"/>\n </svg>\n)\n\nexport const rsDivider = define(Divider, 'RsDivider')\n .name('Divider')\n .category(staticCategory)\n .icon(Icon)\n .props({\n children: string,\n vertical: boolean,\n })\n"],"names":["iconStyle","Icon","jsx","rsDivider","define","Divider","staticCategory","string","boolean"],"mappings":";;;;AAIA,MAAMA,IAAY,EAAC,OAAO,IAAI,QAAQ,GAAA,GAEhCC,IAAO,MACX,gBAAAC,EAAC,OAAA,EAAI,OAAOF,GAAW,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAC3D,UAAA,gBAAAE,EAAC,QAAA,EAAK,IAAG,KAAI,IAAG,MAAK,IAAG,MAAK,IAAG,MAAK,QAAO,WAAU,aAAY,KAAI,eAAc,QAAA,CAAO,GAC7F,GAGWC,IAAYC,EAAOC,GAAS,WAAW,EACjD,KAAK,SAAS,EACd,SAASC,CAAc,EACvB,KAAKL,CAAI,EACT,MAAM;AAAA,EACL,UAAUM;AAAA,EACV,UAAUC;AACZ,CAAC;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Definer } from '@react-form-builder/core';
|
|
2
|
+
import { InputPickerProps } from 'rsuite';
|
|
3
|
+
import { ItemDataType } from 'rsuite/esm/internals/types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The callback function for loading data into the component.
|
|
7
|
+
* @param newData the new data to be loaded into the component.
|
|
8
|
+
*/
|
|
9
|
+
declare type LoadCallback = (newData: ItemDataType[]) => void;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Describes a function that is called when data is to be loaded into the component.
|
|
13
|
+
* @param searchKeyword the current search value.
|
|
14
|
+
* @param loadCallback the callback function called to set the data in the component.
|
|
15
|
+
* @param currentDataLength the length of the data already loaded.
|
|
16
|
+
*/
|
|
17
|
+
declare type LoadDataHandler = (searchKeyword: string, loadCallback: LoadCallback, currentDataLength: number) => void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Interface for load data props.
|
|
21
|
+
*/
|
|
22
|
+
declare interface LoadDataProps {
|
|
23
|
+
/**
|
|
24
|
+
* The callback function called when data should be load.
|
|
25
|
+
*/
|
|
26
|
+
onLoadData?: LoadDataHandler;
|
|
27
|
+
/**
|
|
28
|
+
* Flag, if true, the data will be loaded in advance, before opening the dropdown, false otherwise.
|
|
29
|
+
*/
|
|
30
|
+
preload?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Flag, if true, the virtualized will be disabled, false otherwise.
|
|
33
|
+
*/
|
|
34
|
+
disableVirtualized?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare const rsDropdown: Definer<RsDropdownProps>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Props for the RsDropdown component.
|
|
41
|
+
*/
|
|
42
|
+
export declare interface RsDropdownProps extends InputPickerProps, LoadDataProps {
|
|
43
|
+
/**
|
|
44
|
+
* The label for the dropdown.
|
|
45
|
+
*/
|
|
46
|
+
label: string;
|
|
47
|
+
/**
|
|
48
|
+
* The htmlSize attribute defines the width of the «input> element.
|
|
49
|
+
*/
|
|
50
|
+
htmlSize?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Called after the value has been changed.
|
|
53
|
+
* @param value the value.
|
|
54
|
+
*/
|
|
55
|
+
onChange?: (value: any) => void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { }
|
package/dist/dropdown.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs as y, Fragment as k, jsx as o } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { define as x, array as L, string as h, boolean as w, toLabeledValues as C } from "@react-form-builder/core";
|
|
3
|
+
import { useCallback as D } from "react";
|
|
4
|
+
import { Loader as P, InputPicker as j } from "rsuite";
|
|
5
|
+
import { b as v } from "./commonProperties-ETOgvhCH.js";
|
|
6
|
+
import { u as A, a as F } from "./hooks-DMVtrI-b.js";
|
|
7
|
+
import { f as R } from "./categories-_98lyB3C.js";
|
|
8
|
+
import { u as I } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
|
+
import { L as S } from "./Labeled-BWYRwMiY.js";
|
|
10
|
+
import T from "@emotion/styled";
|
|
11
|
+
const E = T(P)`
|
|
12
|
+
&& {
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
position: absolute;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
background: var(--rs-bg-overlay);
|
|
18
|
+
width: 100%;
|
|
19
|
+
padding-block: 10px;
|
|
20
|
+
}
|
|
21
|
+
`, M = ({
|
|
22
|
+
data: t,
|
|
23
|
+
label: a,
|
|
24
|
+
onLoadData: n,
|
|
25
|
+
onSearch: s,
|
|
26
|
+
onOpen: i,
|
|
27
|
+
value: d = "",
|
|
28
|
+
className: l,
|
|
29
|
+
preload: p,
|
|
30
|
+
disableVirtualized: m,
|
|
31
|
+
...r
|
|
32
|
+
}) => {
|
|
33
|
+
const { loading: e, ...c } = A({ data: t, onLoadData: n, onSearch: s, onOpen: i, value: d, preload: p, disableVirtualized: m }), f = I(r, "onClean"), u = F(), b = D((g) => /* @__PURE__ */ y(k, { children: [
|
|
34
|
+
g,
|
|
35
|
+
e && /* @__PURE__ */ o(E, {})
|
|
36
|
+
] }), [e]);
|
|
37
|
+
return /* @__PURE__ */ o(S, { label: a, className: l, passAriaToChildren: !0, children: /* @__PURE__ */ o(
|
|
38
|
+
j,
|
|
39
|
+
{
|
|
40
|
+
ref: u,
|
|
41
|
+
...r,
|
|
42
|
+
...c,
|
|
43
|
+
onClean: f,
|
|
44
|
+
renderMenu: b
|
|
45
|
+
}
|
|
46
|
+
) });
|
|
47
|
+
}, Q = x(M, "RsDropdown").name("Dropdown").category(R).props({
|
|
48
|
+
...v,
|
|
49
|
+
preload: w.default(!1),
|
|
50
|
+
label: h.default("Select"),
|
|
51
|
+
data: L.default(C(["a", "b", "c"]))
|
|
52
|
+
});
|
|
53
|
+
export {
|
|
54
|
+
Q as rsDropdown
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=dropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown.js","sources":["../src/components/internal/SLoader.tsx","../src/components/RsDropdown.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport {Loader} from 'rsuite'\n\nexport const SLoader = styled(Loader)`\n && {\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: 0;\n background: var(--rs-bg-overlay);\n width: 100%;\n padding-block: 10px;\n }\n`\n","import {array, boolean, define, string, toLabeledValues} from '@react-form-builder/core'\nimport type {ReactNode} from 'react'\nimport {useCallback} from 'react'\nimport type {InputPickerProps} from 'rsuite'\nimport {InputPicker} from 'rsuite'\nimport {pickerProps} from '../commonProperties'\nimport type {LoadDataProps} from '../hooks'\nimport {useFixAriaAttributesForInputPicker, useLoadData} from '../hooks'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\nimport {SLoader} from './internal/SLoader'\n\n/**\n * Props for the RsDropdown component.\n */\nexport interface RsDropdownProps extends InputPickerProps, LoadDataProps {\n /**\n * The label for the dropdown.\n */\n label: string\n /**\n * The htmlSize attribute defines the width of the «input> element.\n */\n htmlSize?: number\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: any) => void\n}\n\n/**\n * Dropdown component with label and data loading support.\n * @param props the component props.\n * @param props.data the data for the dropdown.\n * @param props.label the label for the dropdown.\n * @param props.onLoadData the callback for loading data.\n * @param props.onSearch the callback for search.\n * @param props.onOpen the callback for open.\n * @param props.value the value of the dropdown.\n * @param props.className the css class name.\n * @param props.preload whether to preload data.\n * @param props.disableVirtualized whether to disable virtualization.\n * @param props.props the additional dropdown props.\n * @returns the React element.\n */\nconst RsDropdown = ({\n data,\n label,\n onLoadData,\n onSearch,\n onOpen,\n value = '',\n className,\n preload,\n disableVirtualized,\n ...props\n }: RsDropdownProps) => {\n const {loading, ...loadProps} = useLoadData({data, onLoadData, onSearch, onOpen, value, preload, disableVirtualized})\n const onClean = useTouchOnEvent(props, 'onClean')\n const inputRef = useFixAriaAttributesForInputPicker()\n\n const renderMenu = useCallback((menu: ReactNode) => <>\n {menu}\n {loading && <SLoader/>}\n </>, [loading])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <InputPicker\n ref={inputRef}\n {...props}\n {...loadProps}\n onClean={onClean}\n renderMenu={renderMenu}\n />\n </Labeled>\n )\n}\n\nexport const rsDropdown = define(RsDropdown, 'RsDropdown')\n .name('Dropdown')\n .category(fieldsCategory)\n .props({\n ...pickerProps,\n preload: boolean.default(false),\n label: string.default('Select'),\n data: array.default(toLabeledValues(['a', 'b', 'c']))\n })\n"],"names":["SLoader","styled","Loader","RsDropdown","data","label","onLoadData","onSearch","onOpen","value","className","preload","disableVirtualized","props","loading","loadProps","useLoadData","onClean","useTouchOnEvent","inputRef","useFixAriaAttributesForInputPicker","renderMenu","useCallback","menu","jsxs","Fragment","jsx","Labeled","InputPicker","rsDropdown","define","fieldsCategory","pickerProps","boolean","string","array","toLabeledValues"],"mappings":";;;;;;;;;;AAGO,MAAMA,IAAUC,EAAOC,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GC4C9BC,IAAa,CAAC;AAAA,EACE,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,GAAGC;AACL,MAAuB;AACzC,QAAM,EAAC,SAAAC,GAAS,GAAGC,EAAA,IAAaC,EAAY,EAAC,MAAAZ,GAAM,YAAAE,GAAY,UAAAC,GAAU,QAAAC,GAAQ,OAAAC,GAAO,SAAAE,GAAS,oBAAAC,GAAmB,GAC9GK,IAAUC,EAAgBL,GAAO,SAAS,GAC1CM,IAAWC,EAAA,GAEXC,IAAaC,EAAY,CAACC,MAAoB,gBAAAC,EAAAC,GAAA,EACjD,UAAA;AAAA,IAAAF;AAAA,IACAT,uBAAYd,GAAA,CAAA,CAAO;AAAA,EAAA,GACtB,GAAK,CAACc,CAAO,CAAC;AAEd,SACE,gBAAAY,EAACC,GAAA,EAAQ,OAAAtB,GAAc,WAAAK,GAAsB,oBAAoB,IAC/D,UAAA,gBAAAgB;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,KAAKT;AAAA,MACJ,GAAGN;AAAA,MACH,GAAGE;AAAA,MACJ,SAAAE;AAAA,MACA,YAAAI;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEaQ,IAAaC,EAAO3B,GAAY,YAAY,EACtD,KAAK,UAAU,EACf,SAAS4B,CAAc,EACvB,MAAM;AAAA,EACL,GAAGC;AAAA,EACH,SAASC,EAAQ,QAAQ,EAAK;AAAA,EAC9B,OAAOC,EAAO,QAAQ,QAAQ;AAAA,EAC9B,MAAMC,EAAM,QAAQC,EAAgB,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;AACtD,CAAC;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Definer } from '@react-form-builder/core';
|
|
2
|
+
import { ErrorWrapperProps } from '@react-form-builder/core';
|
|
3
|
+
import { TypeAttributes } from 'rsuite/esm/internals/types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Metadata builder for rSuite-based error display component.
|
|
7
|
+
*/
|
|
8
|
+
export declare const rsErrorMessage: Definer<RsErrorMessageProps>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The properties of RsErrorMessage component.
|
|
12
|
+
*/
|
|
13
|
+
export declare interface RsErrorMessageProps extends ErrorWrapperProps {
|
|
14
|
+
/**
|
|
15
|
+
* The placement of an error message.
|
|
16
|
+
*/
|
|
17
|
+
placement?: TypeAttributes.Placement8;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsxs as i, jsx as n } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { cx as c } from "@emotion/css";
|
|
3
|
+
import e from "@emotion/styled";
|
|
4
|
+
import { define as p, string as l, useAriaErrorMessage as d } from "@react-form-builder/core";
|
|
5
|
+
import { Form as g } from "rsuite";
|
|
6
|
+
import { p as f } from "./commonProperties-ETOgvhCH.js";
|
|
7
|
+
import { a as h } from "./categories-_98lyB3C.js";
|
|
8
|
+
const x = e.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
`, E = e(g.ErrorMessage)`
|
|
14
|
+
z-index: 6;
|
|
15
|
+
`, M = ({ error: r, children: o, placement: s, className: t }) => {
|
|
16
|
+
const a = r ? "rs-form-control-wrapper" : void 0, m = d();
|
|
17
|
+
return /* @__PURE__ */ i(x, { className: c(t, a), children: [
|
|
18
|
+
o,
|
|
19
|
+
/* @__PURE__ */ n(E, { show: !!r, placement: s ?? "bottomStart", id: m["aria-errormessage"], children: r })
|
|
20
|
+
] });
|
|
21
|
+
}, R = p(M, "RsErrorMessage").name("Error message").category(h).props({
|
|
22
|
+
placement: f.default("bottomStart"),
|
|
23
|
+
className: l
|
|
24
|
+
}).componentRole("error-message").hideFromComponentPalette();
|
|
25
|
+
export {
|
|
26
|
+
R as rsErrorMessage
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=error-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-message.js","sources":["../src/components/RsErrorMessage.tsx"],"sourcesContent":["import {cx} from '@emotion/css'\nimport styled from '@emotion/styled'\nimport type {ErrorWrapperProps} from '@react-form-builder/core'\nimport {define, string, useAriaErrorMessage} from '@react-form-builder/core'\nimport {Form} from 'rsuite'\nimport type {TypeAttributes} from 'rsuite/esm/internals/types'\nimport {placement} from '../commonProperties'\nimport {staticCategory} from './categories'\n\nconst SDiv = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n`\n\nconst SErrorMessage = styled(Form.ErrorMessage)`\n z-index: 6;\n`\n\n/**\n * The properties of RsErrorMessage component.\n */\nexport interface RsErrorMessageProps extends ErrorWrapperProps {\n /**\n * The placement of an error message.\n */\n placement?: TypeAttributes.Placement8\n}\n\nconst RsErrorMessage = ({error, children, placement, className}: RsErrorMessageProps) => {\n const divClassName = error ? 'rs-form-control-wrapper' : undefined\n const aria = useAriaErrorMessage()\n\n return <SDiv className={cx(className, divClassName)}>\n {children}\n <SErrorMessage show={Boolean(error)} placement={placement ?? 'bottomStart'} id={aria['aria-errormessage']}>\n {error}\n </SErrorMessage>\n </SDiv>\n}\n\n/**\n * Metadata builder for rSuite-based error display component.\n */\nexport const rsErrorMessage = define(RsErrorMessage, 'RsErrorMessage')\n .name('Error message')\n .category(staticCategory)\n .props({\n placement: placement.default('bottomStart'),\n className: string,\n })\n .componentRole('error-message')\n .hideFromComponentPalette()\n"],"names":["SDiv","styled","SErrorMessage","Form","RsErrorMessage","error","children","placement","className","divClassName","aria","useAriaErrorMessage","cx","jsx","rsErrorMessage","define","staticCategory","string"],"mappings":";;;;;;;AASA,MAAMA,IAAOC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOdC,IAAgBD,EAAOE,EAAK,YAAY;AAAA;AAAA,GAcxCC,IAAiB,CAAC,EAAC,OAAAC,GAAO,UAAAC,GAAU,WAAAC,GAAW,WAAAC,QAAoC;AACvF,QAAMC,IAAeJ,IAAQ,4BAA4B,QACnDK,IAAOC,EAAA;AAEb,2BAAQX,GAAA,EAAK,WAAWY,EAAGJ,GAAWC,CAAY,GAC/C,UAAA;AAAA,IAAAH;AAAA,IACD,gBAAAO,EAACX,GAAA,EAAc,MAAM,EAAQG,GAAQ,WAAWE,KAAa,eAAe,IAAIG,EAAK,mBAAmB,GACrG,UAAAL,EAAA,CACH;AAAA,EAAA,GACF;AACF,GAKaS,IAAiBC,EAAOX,GAAgB,gBAAgB,EAClE,KAAK,eAAe,EACpB,SAASY,CAAc,EACvB,MAAM;AAAA,EACL,WAAWT,EAAU,QAAQ,aAAa;AAAA,EAC1C,WAAWU;AACb,CAAC,EACA,cAAc,eAAe,EAC7B,yBAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formengine-rsuite.css-DkGUHOws.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/header.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Definer } from '@react-form-builder/core';
|
|
2
|
+
import { JSXElementConstructor } from 'react';
|
|
3
|
+
import { ReactElement } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Common CSS block properties.
|
|
7
|
+
*/
|
|
8
|
+
declare interface AreaProps {
|
|
9
|
+
/**
|
|
10
|
+
* The background color.
|
|
11
|
+
*/
|
|
12
|
+
backgroundColor?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* React component that displays the header.
|
|
17
|
+
* @param props the React component properties.
|
|
18
|
+
* @param props.content the header text.
|
|
19
|
+
* @param props.headerSize the header size.
|
|
20
|
+
* @param props.props the other wrapped properties of the component.
|
|
21
|
+
* @returns the React element.
|
|
22
|
+
*/
|
|
23
|
+
export declare const RsHeader: ({ content, headerSize, ...props }: RsHeaderProps) => ReactElement< {
|
|
24
|
+
alignment?: string;
|
|
25
|
+
fontSize?: number;
|
|
26
|
+
fontWeight?: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
backgroundColor?: string;
|
|
29
|
+
}, string | JSXElementConstructor<any>>;
|
|
30
|
+
|
|
31
|
+
export declare const rsHeader: Definer<RsHeaderProps>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Props for the RsHeader component.
|
|
35
|
+
*/
|
|
36
|
+
export declare interface RsHeaderProps extends TextProps {
|
|
37
|
+
/**
|
|
38
|
+
* The content of the header.
|
|
39
|
+
*/
|
|
40
|
+
content?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The size of the header.
|
|
43
|
+
*/
|
|
44
|
+
headerSize: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Common CSS text properties.
|
|
49
|
+
*/
|
|
50
|
+
declare interface TextProps extends AreaProps {
|
|
51
|
+
/**
|
|
52
|
+
* The text alignment.
|
|
53
|
+
*/
|
|
54
|
+
alignment?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The font size.
|
|
57
|
+
*/
|
|
58
|
+
fontSize?: number;
|
|
59
|
+
/**
|
|
60
|
+
* The font weight.
|
|
61
|
+
*/
|
|
62
|
+
fontWeight?: string;
|
|
63
|
+
/**
|
|
64
|
+
* The color.
|
|
65
|
+
*/
|
|
66
|
+
color?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { }
|
package/dist/header.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { define as s, string as n, color as d, useBuilderValue as c } from "@react-form-builder/core";
|
|
2
|
+
import { createElement as i } from "react";
|
|
3
|
+
import { h as l, t as m } from "./commonProperties-ETOgvhCH.js";
|
|
4
|
+
import { a as u } from "./categories-_98lyB3C.js";
|
|
5
|
+
const e = "Header", f = ({ content: r, headerSize: t, ...o }) => {
|
|
6
|
+
const a = c(r, e);
|
|
7
|
+
return i(t, o, a);
|
|
8
|
+
}, { textAlign: p, color: g } = m, C = s(f, "RsHeader").name("Header").category(u).props({
|
|
9
|
+
content: n.required.default(e).dataBound,
|
|
10
|
+
headerSize: l
|
|
11
|
+
}).css({
|
|
12
|
+
backgroundColor: d,
|
|
13
|
+
textAlign: p,
|
|
14
|
+
color: g
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
f as RsHeader,
|
|
18
|
+
C as rsHeader
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../src/components/RsHeader.tsx"],"sourcesContent":["import {color as backgroundColor, define, string, useBuilderValue} from '@react-form-builder/core'\nimport {createElement} from 'react'\nimport {headerSize, textStyles} from '../commonProperties'\nimport type {TextProps} from '../commonTypes'\nimport {staticCategory} from './categories'\n\nconst defaultContent = 'Header'\n\n/**\n * Props for the RsHeader component.\n */\nexport interface RsHeaderProps extends TextProps {\n /**\n * The content of the header.\n */\n content?: string\n /**\n * The size of the header.\n */\n headerSize: string\n}\n\n/**\n * React component that displays the header.\n * @param props the React component properties.\n * @param props.content the header text.\n * @param props.headerSize the header size.\n * @param props.props the other wrapped properties of the component.\n * @returns the React element.\n */\nexport const RsHeader = ({content, headerSize, ...props}: RsHeaderProps) => {\n const children = useBuilderValue(content, defaultContent)\n return createElement(headerSize, props, children)\n}\n\nconst {textAlign, color} = textStyles\n\nexport const rsHeader = define(RsHeader, 'RsHeader')\n .name('Header')\n .category(staticCategory)\n .props({\n content: string.required.default(defaultContent).dataBound,\n headerSize\n })\n .css({\n backgroundColor,\n textAlign,\n color\n })\n"],"names":["defaultContent","RsHeader","content","headerSize","props","children","useBuilderValue","createElement","textAlign","color","textStyles","rsHeader","define","staticCategory","string","backgroundColor"],"mappings":";;;;AAMA,MAAMA,IAAiB,UAwBVC,IAAW,CAAC,EAAC,SAAAC,GAAS,YAAAC,GAAY,GAAGC,QAA0B;AAC1E,QAAMC,IAAWC,EAAgBJ,GAASF,CAAc;AACxD,SAAOO,EAAcJ,GAAYC,GAAOC,CAAQ;AAClD,GAEM,EAAC,WAAAG,GAAW,OAAAC,EAAA,IAASC,GAEdC,IAAWC,EAAOX,GAAU,UAAU,EAChD,KAAK,QAAQ,EACb,SAASY,CAAc,EACvB,MAAM;AAAA,EACL,SAASC,EAAO,SAAS,QAAQd,CAAc,EAAE;AAAA,EACjD,YAAAG;AACF,CAAC,EACA,IAAI;AAAA,EAAA,iBACHY;AAAAA,EACA,WAAAP;AAAA,EACA,OAAAC;AACF,CAAC;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { useState as A, useCallback as i, useEffect as g, useRef as R, useMemo as V } from "react";
|
|
2
|
+
const O = ({ data: t, onLoadData: e, value: s, preload: u, disableVirtualized: k, ...f }) => {
|
|
3
|
+
const [o, S] = A(""), [c, h] = A(t ?? []), [d, m] = A(!1), l = i((r) => r.value === s, [s]), n = i((r) => {
|
|
4
|
+
let b = c;
|
|
5
|
+
s && r.some(l) && (b = c.filter((P) => !l(P))), h([...b, ...r]), m(!1);
|
|
6
|
+
}, [c, l, s]);
|
|
7
|
+
g(() => {
|
|
8
|
+
u && e?.("", n, 0);
|
|
9
|
+
}, [u, e]), g(() => {
|
|
10
|
+
const r = s && !t?.some(l) ? [{ value: s, label: s }] : [];
|
|
11
|
+
h([
|
|
12
|
+
...r,
|
|
13
|
+
...t ?? []
|
|
14
|
+
]);
|
|
15
|
+
}, [t]), g(() => {
|
|
16
|
+
o && (e && m(!0), e?.(o, n, 0));
|
|
17
|
+
}, [o]);
|
|
18
|
+
const I = {
|
|
19
|
+
onItemsRendered: ({ visibleStopIndex: r }) => {
|
|
20
|
+
e && r >= c.length - 1 && (m(!0), e(o, n, c.length));
|
|
21
|
+
}
|
|
22
|
+
}, x = i((r) => {
|
|
23
|
+
e && h([]), S(r), f.onSearch?.(r);
|
|
24
|
+
}, [e, f]), C = i(() => {
|
|
25
|
+
f.onOpen?.(), !s && !u && e?.("", n, 0);
|
|
26
|
+
}, [f, s, u, e, n]), M = i((r, b) => {
|
|
27
|
+
h([b, ...c]), S("");
|
|
28
|
+
}, [c]);
|
|
29
|
+
return { data: c, value: s, loading: d, listProps: I, onSearch: x, onOpen: C, onCreate: M, virtualized: !!e && k !== !0 };
|
|
30
|
+
};
|
|
31
|
+
function p(t) {
|
|
32
|
+
t && !t.hasAttribute("aria-hidden") && t.setAttribute("aria-hidden", "true");
|
|
33
|
+
}
|
|
34
|
+
const q = () => {
|
|
35
|
+
const t = R(null);
|
|
36
|
+
return g(() => {
|
|
37
|
+
const e = t.current?.root?.querySelector("input.rs-picker-search-input");
|
|
38
|
+
p(e);
|
|
39
|
+
}, []), t;
|
|
40
|
+
}, F = (t, e) => {
|
|
41
|
+
const s = t?.length;
|
|
42
|
+
return V(() => s ? t.map(e) : [], [t, s, e]);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
q as a,
|
|
46
|
+
F as b,
|
|
47
|
+
p as s,
|
|
48
|
+
O as u
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=hooks-DMVtrI-b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks-DMVtrI-b.js","sources":["../src/hooks.ts"],"sourcesContent":["import {useCallback, useEffect, useMemo, useRef, useState} from 'react'\nimport type {InputPickerProps, PickerHandle} from 'rsuite'\nimport type {ValueType} from 'rsuite/esm/InputPicker/InputPicker'\nimport type {ItemDataType} from 'rsuite/esm/internals/types'\nimport type {ListProps} from 'rsuite/esm/internals/Windowing'\n\n/**\n * The callback function for loading data into the component.\n * @param newData the new data to be loaded into the component.\n */\nexport type LoadCallback = (newData: ItemDataType[]) => void\n\n/**\n * Describes a function that is called when data is to be loaded into the component.\n * @param searchKeyword the current search value.\n * @param loadCallback the callback function called to set the data in the component.\n * @param currentDataLength the length of the data already loaded.\n */\nexport type LoadDataHandler = (\n searchKeyword: string,\n loadCallback: LoadCallback,\n currentDataLength: number\n) => void\n\n\n/**\n * Interface for load data props.\n */\nexport interface LoadDataProps {\n /**\n * The callback function called when data should be load.\n */\n onLoadData?: LoadDataHandler\n /**\n * Flag, if true, the data will be loaded in advance, before opening the dropdown, false otherwise.\n */\n preload?: boolean\n /**\n * Flag, if true, the virtualized will be disabled, false otherwise.\n */\n disableVirtualized?: boolean\n}\n\n/**\n * Props for the useLoadData hook combining InputPickerProps and LoadDataProps.\n */\ninterface UseLoadDataProps extends Pick<InputPickerProps,\n 'data' | 'value' | 'onSearch' | 'onOpen' | 'onCreate'>, LoadDataProps {\n}\n\n/**\n * Implements data loading and infinite loader logic for RSuite picker components.\n * @param props the React component properties.\n * @param props.data the data for the picker.\n * @param props.onLoadData the callback function called when data should be load.\n * @param props.onSearch the callback function called when a search is performed.\n * @param props.onOpen the callback function called when the list is displayed.\n * @param props.value the current value of the component.\n * @param props.preload flag, if true, the data will be loaded in advance, before opening the dropdown, false otherwise.\n * @param props.disableVirtualized flag, if true, the virtualized will be disabled, false otherwise.\n * @returns the object with prepared properties for the picker.\n */\nexport const useLoadData = ({data: initialData, onLoadData, value, preload, disableVirtualized, ...props}: UseLoadDataProps) => {\n // TODO lint ignored, will be fixed after merger with #FE-619\n const [searchValue, setSearchValue] = useState('')\n const [data, setData] = useState<ItemDataType[]>(initialData ?? [])\n const [loading, setLoading] = useState(false)\n const hasValue = useCallback((item: ItemDataType) => item.value === value, [value])\n\n const loadCallback: LoadCallback = useCallback((newData) => {\n let filteredData = data\n\n if (value && newData.some(hasValue)) {\n filteredData = data.filter(item => !hasValue(item))\n }\n\n setData([...filteredData, ...newData])\n setLoading(false)\n }, [data, hasValue, value])\n\n useEffect(() => {\n if (preload) onLoadData?.('', loadCallback, 0)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [preload, onLoadData])\n\n useEffect(() => {\n const valueItem = value && !initialData?.some(hasValue) ? [{value, label: value}] : []\n setData([\n ...valueItem,\n ...(initialData ?? [])\n ])\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initialData])\n\n useEffect(() => {\n if (!searchValue) return\n if (onLoadData) setLoading(true)\n onLoadData?.(searchValue, loadCallback, 0)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [searchValue])\n\n const listProps: Partial<ListProps> = {\n onItemsRendered: ({visibleStopIndex}) => {\n if (onLoadData && (visibleStopIndex >= data.length - 1)) {\n setLoading(true)\n onLoadData(searchValue, loadCallback, data.length)\n }\n }\n }\n\n const onSearch = useCallback((value: string) => {\n if (onLoadData) setData([])\n setSearchValue(value)\n props.onSearch?.(value)\n }, [onLoadData, props])\n\n const onOpen = useCallback(() => {\n props.onOpen?.()\n if (!value && !preload) onLoadData?.('', loadCallback, 0)\n }, [props, value, preload, onLoadData, loadCallback])\n\n const onCreate: InputPickerProps['onCreate'] = useCallback((_: ValueType, item: ItemDataType) => {\n setData([item, ...data])\n setSearchValue('')\n }, [data])\n\n const virtualized = !!onLoadData && disableVirtualized !== true\n\n return {data, value, loading, listProps, onSearch, onOpen, onCreate, virtualized}\n}\n\n/**\n * Sets aria-hidden=\"true\" on the HTML element if the attribute is not already set.\n * @param element element on which to set the aria-hidden attribute to true.\n */\nexport function setAriaHiddenIfNotExists(element: Element | null | undefined) {\n if (element && !element.hasAttribute('aria-hidden')) {\n element.setAttribute('aria-hidden', 'true')\n }\n}\n\n/**\n * Adds aria-hidden to the internal input of the RSuite InputPicker.\n * @returns ref that should be set by the InputPicker component.\n */\nexport const useFixAriaAttributesForInputPicker = () => {\n const inputRef = useRef<PickerHandle>(null)\n useEffect(() => {\n const rsPickerSearch = inputRef.current?.root?.querySelector('input.rs-picker-search-input')\n setAriaHiddenIfNotExists(rsPickerSearch)\n }, [])\n return inputRef\n}\n\n/**\n * Returns the memoized conversion value over an array.\n * @param array the array.\n * @param mapFn the conversion function.\n * @returns the memoized conversion value over an array.\n */\nexport const useArrayMapMemo = <T, R>(array: T[] | undefined,\n mapFn: (item: T, index: number) => R) => {\n const length = array?.length\n return useMemo(() => {\n if (!length) return []\n return array.map(mapFn)\n }, [array, length, mapFn])\n}\n"],"names":["useLoadData","initialData","onLoadData","value","preload","disableVirtualized","props","searchValue","setSearchValue","useState","data","setData","loading","setLoading","hasValue","useCallback","item","loadCallback","newData","filteredData","useEffect","valueItem","listProps","visibleStopIndex","onSearch","onOpen","onCreate","_","setAriaHiddenIfNotExists","element","useFixAriaAttributesForInputPicker","inputRef","useRef","rsPickerSearch","useArrayMapMemo","array","mapFn","length","useMemo"],"mappings":";AA8DO,MAAMA,IAAc,CAAC,EAAC,MAAMC,GAAa,YAAAC,GAAY,OAAAC,GAAO,SAAAC,GAAS,oBAAAC,GAAoB,GAAGC,QAA6B;AAE9H,QAAM,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAE,GAC3C,CAACC,GAAMC,CAAO,IAAIF,EAAyBR,KAAe,CAAA,CAAE,GAC5D,CAACW,GAASC,CAAU,IAAIJ,EAAS,EAAK,GACtCK,IAAWC,EAAY,CAACC,MAAuBA,EAAK,UAAUb,GAAO,CAACA,CAAK,CAAC,GAE5Ec,IAA6BF,EAAY,CAACG,MAAY;AAC1D,QAAIC,IAAeT;AAEnB,IAAIP,KAASe,EAAQ,KAAKJ,CAAQ,MAChCK,IAAeT,EAAK,OAAO,CAAAM,MAAQ,CAACF,EAASE,CAAI,CAAC,IAGpDL,EAAQ,CAAC,GAAGQ,GAAc,GAAGD,CAAO,CAAC,GACrCL,EAAW,EAAK;AAAA,EAClB,GAAG,CAACH,GAAMI,GAAUX,CAAK,CAAC;AAE1B,EAAAiB,EAAU,MAAM;AACd,IAAIhB,KAASF,IAAa,IAAIe,GAAc,CAAC;AAAA,EAE/C,GAAG,CAACb,GAASF,CAAU,CAAC,GAExBkB,EAAU,MAAM;AACd,UAAMC,IAAYlB,KAAS,CAACF,GAAa,KAAKa,CAAQ,IAAI,CAAC,EAAC,OAAAX,GAAO,OAAOA,EAAA,CAAM,IAAI,CAAA;AACpF,IAAAQ,EAAQ;AAAA,MACN,GAAGU;AAAA,MACH,GAAIpB,KAAe,CAAA;AAAA,IAAC,CACrB;AAAA,EAEH,GAAG,CAACA,CAAW,CAAC,GAEhBmB,EAAU,MAAM;AACd,IAAKb,MACDL,OAAuB,EAAI,GAC/BA,IAAaK,GAAaU,GAAc,CAAC;AAAA,EAE3C,GAAG,CAACV,CAAW,CAAC;AAEhB,QAAMe,IAAgC;AAAA,IACpC,iBAAiB,CAAC,EAAC,kBAAAC,QAAsB;AACvC,MAAIrB,KAAeqB,KAAoBb,EAAK,SAAS,MACnDG,EAAW,EAAI,GACfX,EAAWK,GAAaU,GAAcP,EAAK,MAAM;AAAA,IAErD;AAAA,EAAA,GAGIc,IAAWT,EAAY,CAACZ,MAAkB;AAC9C,IAAID,KAAYS,EAAQ,EAAE,GAC1BH,EAAeL,CAAK,GACpBG,EAAM,WAAWH,CAAK;AAAA,EACxB,GAAG,CAACD,GAAYI,CAAK,CAAC,GAEhBmB,IAASV,EAAY,MAAM;AAC/B,IAAAT,EAAM,SAAA,GACF,CAACH,KAAS,CAACC,KAASF,IAAa,IAAIe,GAAc,CAAC;AAAA,EAC1D,GAAG,CAACX,GAAOH,GAAOC,GAASF,GAAYe,CAAY,CAAC,GAE9CS,IAAyCX,EAAY,CAACY,GAAcX,MAAuB;AAC/F,IAAAL,EAAQ,CAACK,GAAM,GAAGN,CAAI,CAAC,GACvBF,EAAe,EAAE;AAAA,EACnB,GAAG,CAACE,CAAI,CAAC;AAIT,SAAO,EAAC,MAAAA,GAAM,OAAAP,GAAO,SAAAS,GAAS,WAAAU,GAAW,UAAAE,GAAU,QAAAC,GAAQ,UAAAC,GAAU,aAFjD,CAAC,CAACxB,KAAcG,MAAuB,GAEU;AACvE;AAMO,SAASuB,EAAyBC,GAAqC;AAC5E,EAAIA,KAAW,CAACA,EAAQ,aAAa,aAAa,KAChDA,EAAQ,aAAa,eAAe,MAAM;AAE9C;AAMO,MAAMC,IAAqC,MAAM;AACtD,QAAMC,IAAWC,EAAqB,IAAI;AAC1C,SAAAZ,EAAU,MAAM;AACd,UAAMa,IAAiBF,EAAS,SAAS,MAAM,cAAc,8BAA8B;AAC3F,IAAAH,EAAyBK,CAAc;AAAA,EACzC,GAAG,CAAA,CAAE,GACEF;AACT,GAQaG,IAAkB,CAAOC,GACAC,MAAyC;AAC7E,QAAMC,IAASF,GAAO;AACtB,SAAOG,EAAQ,MACRD,IACEF,EAAM,IAAIC,CAAK,IADF,CAAA,GAEnB,CAACD,GAAOE,GAAQD,CAAK,CAAC;AAC3B;"}
|
package/dist/image.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { Definer } from '@react-form-builder/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Common CSS block properties.
|
|
6
|
+
*/
|
|
7
|
+
declare interface AreaProps {
|
|
8
|
+
/**
|
|
9
|
+
* The background color.
|
|
10
|
+
*/
|
|
11
|
+
backgroundColor?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare const rsImage: Definer<RsImageProps>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Props for the RsImage component.
|
|
18
|
+
*/
|
|
19
|
+
export declare interface RsImageProps extends ComponentProps<'img'>, AreaProps {
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { }
|