@react-form-builder/components-rsuite 7.15.0 → 8.1.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-tTp9fZXd.js +17 -0
- package/dist/InputCell-tTp9fZXd.js.map +1 -0
- package/dist/Labeled-8k9VvM4G.js +18 -0
- package/dist/Labeled-8k9VvM4G.js.map +1 -0
- package/dist/{WrappedInput-BRkBjl0z.js → WrappedInput-Cq5StStF.js} +2 -2
- package/dist/{WrappedInput-BRkBjl0z.js.map → WrappedInput-Cq5StStF.js.map} +1 -1
- package/dist/assets/styles.css +1 -0
- package/dist/assets/styles.ltr.css +319 -0
- package/dist/assets/styles.ltr.css.map +1 -0
- package/dist/assets/styles.rtl.css +319 -0
- package/dist/assets/styles.rtl.css.map +1 -0
- package/dist/autocomplete.js +2 -2
- package/dist/breadcrumb.js +32 -29
- package/dist/breadcrumb.js.map +1 -1
- package/dist/builder-view-with-css.js +4 -4
- package/dist/builder-view-with-css.js.map +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +2 -2
- package/dist/card.js +1 -1
- package/dist/checkbox.js +18 -28
- package/dist/checkbox.js.map +1 -1
- package/dist/container.d.ts +4 -0
- package/dist/container.js +15 -16
- package/dist/container.js.map +1 -1
- package/dist/css/formengine-rsuite.css +5 -1
- package/dist/css/rsuite-ltr.css +2 -0
- package/dist/css/rsuite-rtl.css +2 -0
- package/dist/css-loader.d.ts +2 -8
- package/dist/css-loader.js +12 -12
- package/dist/css-loader.js.map +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +34 -42
- package/dist/dropdown.js.map +1 -1
- package/dist/error-message.js +25 -21
- package/dist/error-message.js.map +1 -1
- package/dist/image.js +12 -13
- package/dist/image.js.map +1 -1
- package/dist/index.d.ts +15 -28
- package/dist/index.js +80 -81
- package/dist/input.js +2 -2
- package/dist/label.js +1 -1
- package/dist/link.js +1 -1
- package/dist/localization-wrapper.d.ts +1 -1
- package/dist/localization-wrapper.js +51 -50
- package/dist/localization-wrapper.js.map +1 -1
- package/dist/menu.js +2 -2
- package/dist/message.d.ts +1 -11
- package/dist/message.js +11 -12
- package/dist/message.js.map +1 -1
- package/dist/modal-layout.js +1 -1
- package/dist/modal.js +1 -1
- package/dist/number-format.js +3 -3
- package/dist/pattern-format.js +3 -3
- package/dist/placeholder.js +1 -1
- package/dist/radio-group.js +2 -2
- package/dist/rsuite-ltr.css-uDbh7We6.js +4 -0
- package/dist/rsuite-ltr.css-uDbh7We6.js.map +1 -0
- package/dist/rsuite-rtl.css-icqmWEF6.js +4 -0
- package/dist/rsuite-rtl.css-icqmWEF6.js.map +1 -0
- package/dist/schemas/rsuite-components.schema.json +1 -4
- package/dist/search.js +31 -42
- package/dist/search.js.map +1 -1
- package/dist/static-content.js +1 -1
- package/dist/tab.js +26 -33
- package/dist/tab.js.map +1 -1
- package/dist/tag-picker.js +2 -2
- package/dist/text-area.js +10 -10
- package/dist/text-area.js.map +1 -1
- package/dist/time-picker.js +2 -2
- package/dist/toggle.d.ts +1 -11
- package/dist/toggle.js +16 -18
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/uploader.js +3 -3
- package/dist/useTouchOnEvent-BPYbKiku.js.map +1 -1
- package/dist/view-with-css.js +4 -4
- package/dist/view-with-css.js.map +1 -1
- package/dist/wizard.d.ts +6 -8
- package/dist/wizard.js +129 -177
- package/dist/wizard.js.map +1 -1
- package/package.json +7 -7
- package/dist/InputCell-BDyUJFGm.js +0 -21
- package/dist/InputCell-BDyUJFGm.js.map +0 -1
- package/dist/Labeled-BWYRwMiY.js +0 -35
- package/dist/Labeled-BWYRwMiY.js.map +0 -1
- package/dist/formengine-rsuite.css-B1zD3_ue.js +0 -5
- package/dist/formengine-rsuite.css-B1zD3_ue.js.map +0 -1
- package/dist/rsuite-no-reset-rtl.min.css-B0vQWI16.js +0 -5
- package/dist/rsuite-no-reset-rtl.min.css-B0vQWI16.js.map +0 -1
- package/dist/rsuite-no-reset.min.css-bW1P11UK.js +0 -5
- package/dist/rsuite-no-reset.min.css-bW1P11UK.js.map +0 -1
package/dist/autocomplete.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as o, jsxs as i } from "
|
|
1
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
2
|
import { define as s, event as e, string as t, boolean as m, fn as p, array as u, toLabeledValues as f } from "@react-form-builder/core";
|
|
3
3
|
import { AutoComplete as c } from "rsuite";
|
|
4
4
|
import { i as d } from "./commonProperties-X-t50qaZ.js";
|
|
5
5
|
import { f as h } from "./categories-_98lyB3C.js";
|
|
6
|
-
import { L as g } from "./Labeled-
|
|
6
|
+
import { L as g } from "./Labeled-8k9VvM4G.js";
|
|
7
7
|
const C = () => /* @__PURE__ */ i(
|
|
8
8
|
"svg",
|
|
9
9
|
{
|
package/dist/breadcrumb.js
CHANGED
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createElement as
|
|
3
|
-
import { define as
|
|
4
|
-
import {
|
|
5
|
-
import { Checkbox as x, Breadcrumb as l } from "rsuite";
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as p, useMemo as f, createElement as h } from "react";
|
|
3
|
+
import { define as d, event as a, array as b, string as k, oneOf as C } from "@react-form-builder/core";
|
|
4
|
+
import { Checkbox as x, Breadcrumb as i } from "rsuite";
|
|
6
5
|
import { a as g } from "./commonProperties-X-t50qaZ.js";
|
|
7
6
|
import { s as y } from "./categories-_98lyB3C.js";
|
|
8
|
-
import B from "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
import { S as B, I as u } from "./InputCell-tTp9fZXd.js";
|
|
8
|
+
const I = "_checkbox_1itlt_1", _ = {
|
|
9
|
+
checkbox: I
|
|
10
|
+
}, E = ({ rowData: t, dataKey: e, rowIndex: n, onChange: o, ...r }) => {
|
|
11
|
+
const s = p((m, c) => {
|
|
12
|
+
t[e] = c, o?.(c, e, n);
|
|
13
|
+
}, [e, o, t, n]);
|
|
14
|
+
return /* @__PURE__ */ l(B, { ...r, children: /* @__PURE__ */ l(
|
|
15
|
+
x,
|
|
16
|
+
{
|
|
17
|
+
inline: !0,
|
|
18
|
+
checked: t[e] ?? !1,
|
|
19
|
+
onChange: s,
|
|
20
|
+
className: _.checkbox
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
23
|
+
}, N = (t) => t.map((e) => ({ title: e, href: e })), S = [
|
|
24
|
+
{ name: "title", input: u },
|
|
25
|
+
{ name: "href", title: "Url", input: u },
|
|
23
26
|
{ name: "active", input: E }
|
|
24
|
-
],
|
|
25
|
-
const o =
|
|
26
|
-
return /* @__PURE__ */ i
|
|
27
|
-
const { title:
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
], j = { display: "flex" }, v = ({ items: t, onItemClick: e, ...n }) => {
|
|
28
|
+
const o = f(() => (t ?? []).map((r) => () => e?.(r)), [t, e]);
|
|
29
|
+
return /* @__PURE__ */ l(i, { ...n, style: j, children: t?.map((r, s) => {
|
|
30
|
+
const { title: m = "", ...c } = r;
|
|
31
|
+
return /* @__PURE__ */ h(i.Item, { ...c, onClick: o[s], key: m }, m);
|
|
29
32
|
}) });
|
|
30
|
-
},
|
|
31
|
-
separator:
|
|
33
|
+
}, q = d(v, "RsBreadcrumb").name("Breadcrumb").category(y).props({
|
|
34
|
+
separator: k.default("/"),
|
|
32
35
|
maxItems: g,
|
|
33
|
-
items:
|
|
36
|
+
items: b.default(N(["one", "two", "three"])).withEditorProps({ columns: S }),
|
|
34
37
|
onItemClick: a,
|
|
35
38
|
onExpand: a
|
|
36
39
|
}).css({
|
|
37
40
|
justifyContent: C("left", "center", "right").default("left").radio().named("Alignment")
|
|
38
41
|
});
|
|
39
42
|
export {
|
|
40
|
-
|
|
43
|
+
q as rsBreadcrumb
|
|
41
44
|
};
|
|
42
45
|
//# sourceMappingURL=breadcrumb.js.map
|
package/dist/breadcrumb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sources":["../src/components/internal/CheckCell.tsx","../src/components/RsBreadcrumb.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sources":["../src/components/internal/CheckCell.tsx","../src/components/RsBreadcrumb.tsx"],"sourcesContent":["import {useCallback} from 'react'\nimport {Checkbox} from 'rsuite'\nimport styles from './CheckCell.module.css'\nimport type {InputCellProps} from './InputCellProps'\nimport {SCell} from './SCell'\n\n/**\n * The React component that displays the table cell with the checkbox.\n * @param props the React component properties.\n * @param props.rowData the row data.\n * @param props.dataKey the key name in {@link props.rowData}.\n * @param props.rowIndex the row index.\n * @param props.onChange the onChange event of the checkbox.\n * @param props.props the other properties of the component.\n * @returns the React element.\n */\nexport const CheckCell = ({rowData, dataKey, rowIndex, onChange, ...props}: InputCellProps) => {\n const handleChange = useCallback((_: unknown, checked: boolean) => {\n // eslint-disable-next-line react-hooks/immutability\n rowData[dataKey] = checked\n onChange?.(checked, dataKey, rowIndex)\n }, [dataKey, onChange, rowData, rowIndex])\n\n return (\n <SCell {...props}>\n <Checkbox\n inline\n checked={rowData[dataKey] ?? false}\n onChange={handleChange}\n className={styles.checkbox}\n />\n </SCell>\n )\n}\n","import {array, define, event, oneOf, string} from '@react-form-builder/core'\nimport {useMemo} from 'react'\nimport type {BreadcrumbProps} from 'rsuite'\nimport {Breadcrumb} from 'rsuite'\nimport {nonNegNumber} from '../commonProperties'\nimport {structureCategory} from './categories'\nimport {CheckCell} from './internal/CheckCell'\nimport {InputCell} from './internal/InputCell'\n\n/**\n * Props for a single breadcrumb item.\n */\nexport interface RsBreadcrumbItemProps {\n /**\n * Whether the breadcrumb item is active.\n */\n active?: boolean\n /**\n * URL for the breadcrumb item.\n */\n href?: string\n /**\n * Title text for the breadcrumb item.\n */\n title?: string\n}\n\n/**\n * Creates breadcrumb items from string data.\n * @param data the array of strings to convert to breadcrumb items.\n * @returns the array of breadcrumb items.\n */\nconst makeItems = (data: string[]) => data.map(title => ({title, href: title}))\n\n/**\n * Props for the RsBreadcrumb component.\n */\nexport interface RsBreadcrumbProps extends BreadcrumbProps {\n /**\n * Array of breadcrumb items to display.\n */\n items: RsBreadcrumbItemProps[]\n /**\n * Callback function when a breadcrumb item is clicked.\n */\n onItemClick: (item: RsBreadcrumbItemProps) => void\n}\n\n/**\n * Column definitions for breadcrumb item editor.\n */\nconst columns = [\n {name: 'title', input: InputCell},\n {name: 'href', title: 'Url', input: InputCell},\n {name: 'active', input: CheckCell}\n] as const\n\n/**\n * Container style for breadcrumb component.\n */\nconst containerStyle = {display: 'flex'} as const\n\n/**\n * Breadcrumb component for navigation.\n * @param props the component props.\n * @param props.items - the array of breadcrumb items to display.\n * @param props.onItemClick - the callback function when a breadcrumb item is clicked.\n * @param props.separator the separator between breadcrumb items.\n * @param props.maxItems the maximum number of breadcrumb items to display.\n * @param props.onExpand the callback function when breadcrumb is expanded.\n * @param props.justifyContent the CSS justify-content property for alignment.\n * @returns the React element.\n */\nconst RsBreadcrumb = ({items, onItemClick, ...props}: RsBreadcrumbProps) => {\n const clickHandlers = useMemo(() => (items ?? []).map((it) => {\n return () => onItemClick?.(it)\n }), [items, onItemClick])\n\n return (\n <Breadcrumb {...props} style={containerStyle}>\n {items?.map((item, idx) => {\n const {title = '', ...itemProps} = item\n return (\n <Breadcrumb.Item {...itemProps} onClick={clickHandlers[idx]} key={title}>\n {title}\n </Breadcrumb.Item>)\n })}\n </Breadcrumb>\n )\n}\n\nexport const rsBreadcrumb = define(RsBreadcrumb, 'RsBreadcrumb')\n .name('Breadcrumb')\n .category(structureCategory)\n .props({\n separator: string.default('/'),\n maxItems: nonNegNumber,\n items: array\n .default(makeItems(['one', 'two', 'three']))\n .withEditorProps({columns}),\n onItemClick: event,\n onExpand: event\n })\n .css({\n justifyContent: oneOf('left', 'center', 'right')\n .default('left').radio().named('Alignment'),\n })\n"],"names":["CheckCell","rowData","dataKey","rowIndex","onChange","props","handleChange","useCallback","_","checked","jsx","SCell","Checkbox","styles","makeItems","data","title","columns","InputCell","containerStyle","RsBreadcrumb","items","onItemClick","clickHandlers","useMemo","it","Breadcrumb","item","idx","itemProps","createElement","rsBreadcrumb","define","structureCategory","string","nonNegNumber","array","event","oneOf"],"mappings":";;;;;;;;;GAgBaA,IAAY,CAAC,EAAC,SAAAC,GAAS,SAAAC,GAAS,UAAAC,GAAU,UAAAC,GAAU,GAAGC,QAA2B;AAC7F,QAAMC,IAAeC,EAAY,CAACC,GAAYC,MAAqB;AAEjE,IAAAR,EAAQC,CAAO,IAAIO,GACnBL,IAAWK,GAASP,GAASC,CAAQ;AAAA,EACvC,GAAG,CAACD,GAASE,GAAUH,GAASE,CAAQ,CAAC;AAEzC,SACE,gBAAAO,EAACC,GAAA,EAAO,GAAGN,GACT,UAAA,gBAAAK;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,QAAM;AAAA,MACN,SAASX,EAAQC,CAAO,KAAK;AAAA,MAC7B,UAAUI;AAAA,MACV,WAAWO,EAAO;AAAA,IAAA;AAAA,EAAA,GAEtB;AAEJ,GCDMC,IAAY,CAACC,MAAmBA,EAAK,IAAI,QAAU,EAAC,OAAAC,GAAO,MAAMA,EAAA,EAAO,GAmBxEC,IAAU;AAAA,EACd,EAAC,MAAM,SAAS,OAAOC,EAAA;AAAA,EACvB,EAAC,MAAM,QAAQ,OAAO,OAAO,OAAOA,EAAA;AAAA,EACpC,EAAC,MAAM,UAAU,OAAOlB,EAAA;AAC1B,GAKMmB,IAAiB,EAAC,SAAS,OAAA,GAa3BC,IAAe,CAAC,EAAC,OAAAC,GAAO,aAAAC,GAAa,GAAGjB,QAA8B;AAC1E,QAAMkB,IAAgBC,EAAQ,OAAOH,KAAS,IAAI,IAAI,CAACI,MAC9C,MAAMH,IAAcG,CAAE,CAC9B,GAAG,CAACJ,GAAOC,CAAW,CAAC;AAExB,SACE,gBAAAZ,EAACgB,GAAA,EAAY,GAAGrB,GAAO,OAAOc,GAC3B,UAAAE,GAAO,IAAI,CAACM,GAAMC,MAAQ;AACzB,UAAM,EAAC,OAAAZ,IAAQ,IAAI,GAAGa,MAAaF;AACnC,WACE,gBAAAG,EAACJ,EAAW,MAAX,EAAiB,GAAGG,GAAW,SAASN,EAAcK,CAAG,GAAG,KAAKZ,EAAA,GAC/DA,CACH;AAAA,EACJ,CAAC,EAAA,CACH;AAEJ,GAEae,IAAeC,EAAOZ,GAAc,cAAc,EAC5D,KAAK,YAAY,EACjB,SAASa,CAAiB,EAC1B,MAAM;AAAA,EACL,WAAWC,EAAO,QAAQ,GAAG;AAAA,EAC7B,UAAUC;AAAA,EACV,OAAOC,EACJ,QAAQtB,EAAU,CAAC,OAAO,OAAO,OAAO,CAAC,CAAC,EAC1C,gBAAgB,EAAC,SAAAG,GAAQ;AAAA,EAC5B,aAAaoB;AAAA,EACb,UAAUA;AACZ,CAAC,EACA,IAAI;AAAA,EACH,gBAAgBC,EAAM,QAAQ,UAAU,OAAO,EAC5C,QAAQ,MAAM,EAAE,MAAA,EAAQ,MAAM,WAAW;AAC9C,CAAC;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BuilderView as o, BiDi as r } from "@react-form-builder/core";
|
|
2
2
|
import { RsLocalizationWrapper as i } from "./localization-wrapper.js";
|
|
3
|
-
import { ltrCssLoader as
|
|
4
|
-
import { components as
|
|
3
|
+
import { ltrCssLoader as t, rtlCssLoader as e } from "./css-loader.js";
|
|
4
|
+
import { components as s } from "./definitions.js";
|
|
5
5
|
import { r as p } from "./rSuiteComponentsDescriptions-lX1mwx9_.js";
|
|
6
|
-
const
|
|
6
|
+
const C = new o(s).withViewerWrapper(i).withCssLoader(r.LTR, t).withCssLoader(r.RTL, e).withComponentLibraryDescription(p);
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
C as builderViewWithCss
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=builder-view-with-css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder-view-with-css.js","sources":["../src/builderViewWithCss.ts"],"sourcesContent":["import {BiDi, BuilderView} from '@react-form-builder/core'\nimport {RsLocalizationWrapper} from './components/RsLocalizationWrapper'\nimport {
|
|
1
|
+
{"version":3,"file":"builder-view-with-css.js","sources":["../src/builderViewWithCss.ts"],"sourcesContent":["import {BiDi, BuilderView} from '@react-form-builder/core'\nimport {RsLocalizationWrapper} from './components/RsLocalizationWrapper'\nimport {ltrCssLoader, rtlCssLoader} from './cssLoader'\nimport {components} from './definitions'\nimport {rSuiteComponentsDescriptions} from './i18n/rSuiteComponentsDescriptions'\n\n/**\n * An assembled set of rSuite components metadata, ready to be passed as a property to the FormBuilder.\n * This view contains CSS loaders.\n */\nexport const builderViewWithCss = new BuilderView(components)\n .withViewerWrapper(RsLocalizationWrapper)\n .withCssLoader(BiDi.LTR, ltrCssLoader)\n .withCssLoader(BiDi.RTL, rtlCssLoader)\n .withComponentLibraryDescription(rSuiteComponentsDescriptions)\n"],"names":["builderViewWithCss","BuilderView","components","RsLocalizationWrapper","BiDi","ltrCssLoader","rtlCssLoader","rSuiteComponentsDescriptions"],"mappings":";;;;;AAUO,MAAMA,IAAqB,IAAIC,EAAYC,CAAU,EACzD,kBAAkBC,CAAqB,EACvC,cAAcC,EAAK,KAAKC,CAAY,EACpC,cAAcD,EAAK,KAAKE,CAAY,EACpC,gCAAgCC,CAA4B;"}
|
package/dist/button.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as l } from "
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { define as s, event as i, string as t, boolean as e, disabled as d, oneOf as u, useBuilderValue as f } from "@react-form-builder/core";
|
|
3
3
|
import { Button as c } from "rsuite";
|
|
4
4
|
import { s as m, c as p } from "./commonProperties-X-t50qaZ.js";
|
package/dist/calendar.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as a } from "
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { define as s, date as o, event as l, string as i, boolean as r } from "@react-form-builder/core";
|
|
3
3
|
import { Calendar as n } from "rsuite";
|
|
4
4
|
import { r as m } from "./commonProperties-X-t50qaZ.js";
|
|
5
5
|
import { f as u } from "./categories-_98lyB3C.js";
|
|
6
|
-
import { L as C } from "./Labeled-
|
|
6
|
+
import { L as C } from "./Labeled-8k9VvM4G.js";
|
|
7
7
|
const c = ({ label: t, style: d, className: f, ...e }) => /* @__PURE__ */ a(C, { label: t, style: d, className: f, passAriaToChildren: !0, children: e.readOnly ? /* @__PURE__ */ a(n, { ...e, onChange: void 0 }) : /* @__PURE__ */ a(n, { ...e }) }), x = s(c, "RsCalendar").name("Calendar").category(u).props({
|
|
8
8
|
label: i,
|
|
9
9
|
bordered: r.default(!1),
|
package/dist/card.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as d, jsxs as f } from "
|
|
1
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import { define as i, event as m, string as o, node as s, boolean as r } from "@react-form-builder/core";
|
|
3
3
|
import { useMemo as u } from "react";
|
|
4
4
|
import { Panel as p } from "rsuite";
|
package/dist/checkbox.js
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import a from "@
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return /* @__PURE__ */ n(l, { ...e });
|
|
19
|
-
}, R = i(b, "RsCheckbox").name("Checkbox").category(c).props({
|
|
20
|
-
children: r.default("Checkbox"),
|
|
21
|
-
checked: o.valued.default(!0).uncontrolledValue(!1),
|
|
22
|
-
disabled: m.default(!1),
|
|
23
|
-
readOnly: s,
|
|
24
|
-
indeterminate: o,
|
|
25
|
-
inline: o.default(!1),
|
|
26
|
-
title: r,
|
|
27
|
-
onChange: d
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { define as s, event as a, string as o, boolean as e, disabled as l } from "@react-form-builder/core";
|
|
3
|
+
import n from "clsx";
|
|
4
|
+
import { Checkbox as i } from "rsuite";
|
|
5
|
+
import { r as f } from "./commonProperties-X-t50qaZ.js";
|
|
6
|
+
import { f as d } from "./categories-_98lyB3C.js";
|
|
7
|
+
const m = "_checkbox_qe1fs_1", b = {
|
|
8
|
+
checkbox: m
|
|
9
|
+
}, h = ({ className: c, ...r }) => /* @__PURE__ */ t(i, { ...r, className: n(b.checkbox, c) }), y = s(h, "RsCheckbox").name("Checkbox").category(d).props({
|
|
10
|
+
children: o.default("Checkbox"),
|
|
11
|
+
checked: e.valued.uncontrolledValue(!1),
|
|
12
|
+
disabled: l.default(!1),
|
|
13
|
+
readOnly: f,
|
|
14
|
+
indeterminate: e,
|
|
15
|
+
inline: e.default(!1),
|
|
16
|
+
title: o,
|
|
17
|
+
onChange: a
|
|
28
18
|
});
|
|
29
19
|
export {
|
|
30
|
-
|
|
20
|
+
y as rsCheckbox
|
|
31
21
|
};
|
|
32
22
|
//# sourceMappingURL=checkbox.js.map
|
package/dist/checkbox.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../src/components/RsCheckbox.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../src/components/RsCheckbox.tsx"],"sourcesContent":["import {boolean, define, disabled, event, string} from '@react-form-builder/core'\nimport cx from 'clsx'\nimport type {CheckboxProps} from 'rsuite'\nimport {Checkbox} from 'rsuite'\nimport {readOnly} from '../commonProperties'\nimport {fieldsCategory} from './categories'\nimport styles from './RsCheckbox.module.css'\n\nconst RsCheckbox = ({className, ...props}: CheckboxProps<any>) => {\n return <Checkbox {...props} className={cx(styles.checkbox, className)}/>\n}\n\nexport const rsCheckbox = define(RsCheckbox, 'RsCheckbox')\n .name('Checkbox')\n .category(fieldsCategory)\n .props({\n children: string.default('Checkbox'),\n checked: boolean\n .valued.uncontrolledValue(false),\n disabled: disabled.default(false),\n readOnly,\n indeterminate: boolean,\n inline: boolean.default(false),\n title: string,\n onChange: event,\n })\n"],"names":["RsCheckbox","className","props","jsx","Checkbox","cx","styles","rsCheckbox","define","fieldsCategory","string","boolean","disabled","readOnly","event"],"mappings":";;;;;;;;GAQMA,IAAa,CAAC,EAAC,WAAAC,GAAW,GAAGC,QAC1B,gBAAAC,EAACC,KAAU,GAAGF,GAAO,WAAWG,EAAGC,EAAO,UAAUL,CAAS,GAAE,GAG3DM,IAAaC,EAAOR,GAAY,YAAY,EACtD,KAAK,UAAU,EACf,SAASS,CAAc,EACvB,MAAM;AAAA,EACL,UAAUC,EAAO,QAAQ,UAAU;AAAA,EACnC,SAASC,EACN,OAAO,kBAAkB,EAAK;AAAA,EACjC,UAAUC,EAAS,QAAQ,EAAK;AAAA,EAChC,UAAAC;AAAA,EACA,eAAeF;AAAA,EACf,QAAQA,EAAQ,QAAQ,EAAK;AAAA,EAC7B,OAAOD;AAAA,EACP,UAAUI;AACZ,CAAC;"}
|
package/dist/container.d.ts
CHANGED
package/dist/container.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import i from "@
|
|
3
|
-
import
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { containerStyles as e, forwardRef as s, define as i, readOnly as c, disabled as d, node as l } from "@react-form-builder/core";
|
|
3
|
+
import m from "clsx";
|
|
4
4
|
import { s as f } from "./categories-_98lyB3C.js";
|
|
5
|
-
const p =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
readOnly: d
|
|
5
|
+
const p = "_container_tc619_1", y = {
|
|
6
|
+
container: p
|
|
7
|
+
}, { flexDirection: u, gap: x } = e, C = s((n, r) => {
|
|
8
|
+
const { disabled: g, readOnly: b, className: o, ...t } = n;
|
|
9
|
+
return /* @__PURE__ */ a("div", { ...t, className: m(y.container, o), ref: r });
|
|
10
|
+
}), D = i(C, "RsContainer").name("Container").category(f).kind("container").props({
|
|
11
|
+
children: l,
|
|
12
|
+
disabled: d,
|
|
13
|
+
readOnly: c
|
|
15
14
|
}).css({
|
|
16
15
|
...e,
|
|
17
|
-
flexDirection:
|
|
18
|
-
gap:
|
|
16
|
+
flexDirection: u.default("column"),
|
|
17
|
+
gap: x.default("10px")
|
|
19
18
|
});
|
|
20
19
|
export {
|
|
21
|
-
|
|
20
|
+
D as rsContainer
|
|
22
21
|
};
|
|
23
22
|
//# sourceMappingURL=container.js.map
|
package/dist/container.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sources":["../src/components/RsContainer.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"container.js","sources":["../src/components/RsContainer.tsx"],"sourcesContent":["import {containerStyles, define, disabled, forwardRef, node, readOnly} from '@react-form-builder/core'\nimport cx from 'clsx'\nimport type {ForwardedRef, ReactNode} from 'react'\nimport {structureCategory} from './categories'\nimport styles from './RsContainer.module.css'\n\nconst {flexDirection, gap} = containerStyles\n\n/**\n * Props for the RsContainer component.\n */\nexport interface RsContainerProps {\n /**\n * Whether the container is disabled.\n */\n disabled?: boolean\n /**\n * Whether the container is read only.\n */\n readOnly?: boolean\n /**\n * Children elements of the container.\n */\n children?: ReactNode\n /**\n * CSS class name.\n */\n className?: string\n}\n\n/**\n * Container component with flex layout.\n * @param props the component props.\n * @returns the React element.\n */\nconst RsContainer = forwardRef((props: RsContainerProps, ref: ForwardedRef<any>) => {\n const {disabled, readOnly, className, ...otherProps} = props\n return <div {...otherProps} className={cx(styles.container, className)} ref={ref}/>\n})\n\nexport const rsContainer = define(RsContainer, 'RsContainer')\n .name('Container')\n .category(structureCategory)\n .kind('container')\n .props({\n children: node,\n disabled: disabled,\n readOnly: readOnly,\n })\n .css({\n ...containerStyles,\n flexDirection: flexDirection.default('column'),\n gap: gap.default('10px')\n })\n"],"names":["flexDirection","gap","containerStyles","RsContainer","forwardRef","props","ref","disabled","readOnly","className","otherProps","jsx","cx","styles","rsContainer","define","structureCategory","node"],"mappings":";;;;;;GAMM,EAAC,eAAAA,GAAe,KAAAC,EAAA,IAAOC,GA6BvBC,IAAcC,EAAW,CAACC,GAAyBC,MAA2B;AAClF,QAAM,EAAC,UAAAC,GAAU,UAAAC,GAAU,WAAAC,GAAW,GAAGC,MAAcL;AACvD,SAAO,gBAAAM,EAAC,OAAA,EAAK,GAAGD,GAAY,WAAWE,EAAGC,EAAO,WAAWJ,CAAS,GAAG,KAAAH,EAAA,CAAS;AACnF,CAAC,GAEYQ,IAAcC,EAAOZ,GAAa,aAAa,EACzD,KAAK,WAAW,EAChB,SAASa,CAAiB,EAC1B,KAAK,WAAW,EAChB,MAAM;AAAA,EACL,UAAUC;AAAA,EACV,UAAAV;AAAA,EACA,UAAAC;AACF,CAAC,EACA,IAAI;AAAA,EACH,GAAGN;AAAA,EACH,eAAeF,EAAc,QAAQ,QAAQ;AAAA,EAC7C,KAAKC,EAAI,QAAQ,MAAM;AACzB,CAAC;"}
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
.rs-toast-provider,
|
|
286
|
-
.optimajet-formviewer,
|
|
286
|
+
.optimajet-formviewer .rsuite,
|
|
287
287
|
.rs-modal,
|
|
288
288
|
.rs-picker-popup,
|
|
289
289
|
.rs-picker-popup-date,
|
|
@@ -309,3 +309,7 @@
|
|
|
309
309
|
.rs-theme-dark .rs-divider-horizontal.rs-divider-with-text:before {
|
|
310
310
|
border-top: 1px solid var(--rs-text-secondary);
|
|
311
311
|
}
|
|
312
|
+
|
|
313
|
+
button.rs-tag-icon-close.rs-btn-close > svg {
|
|
314
|
+
color: var(--rs-text-secondary);
|
|
315
|
+
}
|
package/dist/css-loader.d.ts
CHANGED
|
@@ -1,19 +1,13 @@
|
|
|
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
1
|
/**
|
|
8
2
|
* Loads the Left-To-Right (LTR) CSS for the "rsuite" library.
|
|
9
3
|
* @returns the Promise that resolves when the LTR CSS has been loaded successfully.
|
|
10
4
|
*/
|
|
11
|
-
export declare const ltrCssLoader: () => Promise<void
|
|
5
|
+
export declare const ltrCssLoader: () => Promise<() => Promise<void>>;
|
|
12
6
|
|
|
13
7
|
/**
|
|
14
8
|
* Loads the Right-to-Left (RTL) CSS for the "rsuite" library.
|
|
15
9
|
* @returns the Promise that resolves when the RTL CSS has been loaded successfully.
|
|
16
10
|
*/
|
|
17
|
-
export declare const rtlCssLoader: () => Promise<void
|
|
11
|
+
export declare const rtlCssLoader: () => Promise<() => Promise<void>>;
|
|
18
12
|
|
|
19
13
|
export { }
|
package/dist/css-loader.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { BiDi as
|
|
2
|
-
const
|
|
3
|
-
[
|
|
4
|
-
[
|
|
1
|
+
import { BiDi as e, loadResource as a, unloadResource as t } from "@react-form-builder/core";
|
|
2
|
+
const r = {
|
|
3
|
+
[e.LTR]: "rsuite-ltr-css",
|
|
4
|
+
[e.RTL]: "rsuite-rtl-css"
|
|
5
5
|
}, i = async () => {
|
|
6
|
-
const
|
|
7
|
-
await r
|
|
6
|
+
const s = (await import("./rsuite-ltr.css-uDbh7We6.js")).default;
|
|
7
|
+
return await a(r[e.LTR], s, "stylesheet"), t(r[e.RTL]), () => new Promise((o) => {
|
|
8
|
+
t(r[e.LTR]), o();
|
|
9
|
+
});
|
|
8
10
|
}, c = async () => {
|
|
9
|
-
const
|
|
10
|
-
await r
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
await r("form-engine-css", t, "stylesheet");
|
|
11
|
+
const s = (await import("./rsuite-rtl.css-icqmWEF6.js")).default;
|
|
12
|
+
return await a(r[e.RTL], s, "stylesheet"), t(r[e.LTR]), () => new Promise((o) => {
|
|
13
|
+
t(r[e.RTL]), o();
|
|
14
|
+
});
|
|
14
15
|
};
|
|
15
16
|
export {
|
|
16
|
-
n as formEngineRsuiteCssLoader,
|
|
17
17
|
i as ltrCssLoader,
|
|
18
18
|
c as rtlCssLoader
|
|
19
19
|
};
|
package/dist/css-loader.js.map
CHANGED
|
@@ -1 +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-
|
|
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-ltr.css?url')).default\n await loadResource(resourceIds[BiDi.LTR], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.RTL])\n\n return () => {\n return new Promise<void>(resolve => {\n unloadResource(resourceIds[BiDi.LTR])\n resolve()\n })\n }\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-rtl.css?url')).default\n await loadResource(resourceIds[BiDi.RTL], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.LTR])\n\n return () => {\n return new Promise<void>(resolve => {\n unloadResource(resourceIds[BiDi.RTL])\n resolve()\n })\n }\n}\n"],"names":["resourceIds","BiDi","ltrCssLoader","href","loadResource","unloadResource","resolve","rtlCssLoader"],"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,8BAAkC,GAAG;AAChE,eAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC5DE,EAAeL,EAAYC,EAAK,GAAG,CAAC,GAE7B,MACE,IAAI,QAAc,CAAAK,MAAW;AAClC,IAAAD,EAAeL,EAAYC,EAAK,GAAG,CAAC,GACpCK,EAAA;AAAA,EACF,CAAC;AAEL,GAMaC,IAAe,YAAY;AACtC,QAAMJ,KAAQ,MAAM,OAAO,8BAAkC,GAAG;AAChE,eAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC5DE,EAAeL,EAAYC,EAAK,GAAG,CAAC,GAE7B,MACE,IAAI,QAAc,CAAAK,MAAW;AAClC,IAAAD,EAAeL,EAAYC,EAAK,GAAG,CAAC,GACpCK,EAAA;AAAA,EACF,CAAC;AAEL;"}
|
package/dist/date-picker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as f } from "
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
2
|
import { define as b, date as n, string as r, event as e, boolean as t, number as m, disabled as C, oneOf as T, useComponentData as y } from "@react-form-builder/core";
|
|
3
3
|
import { useMemo as p, useEffect as k } from "react";
|
|
4
4
|
import { DatePicker as w } from "rsuite";
|
|
@@ -6,7 +6,7 @@ import { s as M, p as O, r as P } from "./commonProperties-X-t50qaZ.js";
|
|
|
6
6
|
import { f as v, t as x } from "./dateTimeUtils-C2AEniv5.js";
|
|
7
7
|
import { f as V } from "./categories-_98lyB3C.js";
|
|
8
8
|
import { u as N } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
|
-
import { L as A } from "./Labeled-
|
|
9
|
+
import { L as A } from "./Labeled-8k9VvM4G.js";
|
|
10
10
|
const u = (o) => {
|
|
11
11
|
if (typeof o == "string") {
|
|
12
12
|
const a = new Date(o);
|
package/dist/divider.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as i } from "
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { define as o, boolean as r, string as e } from "@react-form-builder/core";
|
|
3
3
|
import { Divider as t } from "rsuite";
|
|
4
4
|
import { a as n } from "./categories-_98lyB3C.js";
|
package/dist/dropdown.js
CHANGED
|
@@ -1,56 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { define as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { Loader as P, InputPicker as
|
|
5
|
-
import { b as
|
|
6
|
-
import { u as
|
|
7
|
-
import { f as
|
|
1
|
+
import { jsx as o, jsxs as g, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { define as C, array as D, toLabeledValues as h, string as k, boolean as w } from "@react-form-builder/core";
|
|
3
|
+
import { useCallback as y } from "react";
|
|
4
|
+
import { Loader as P, InputPicker as A } from "rsuite";
|
|
5
|
+
import { b as F } from "./commonProperties-X-t50qaZ.js";
|
|
6
|
+
import { u as R, a as _ } from "./hooks-DMVtrI-b.js";
|
|
7
|
+
import { f as j } from "./categories-_98lyB3C.js";
|
|
8
8
|
import { u as I } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
|
-
import { L as S } from "./Labeled-
|
|
10
|
-
import T from "
|
|
11
|
-
const E =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
padding-block: 10px;
|
|
20
|
-
}
|
|
21
|
-
`, M = ({
|
|
22
|
-
data: t,
|
|
23
|
-
label: a,
|
|
24
|
-
onLoadData: n,
|
|
25
|
-
onSearch: s,
|
|
26
|
-
onOpen: i,
|
|
9
|
+
import { L as S } from "./Labeled-8k9VvM4G.js";
|
|
10
|
+
import T from "clsx";
|
|
11
|
+
const v = "_loader_pu0ca_1", E = {
|
|
12
|
+
loader: v
|
|
13
|
+
}, M = ({ className: r, ...e }) => /* @__PURE__ */ o(P, { ...e, className: T(E.loader, r) }), N = ({
|
|
14
|
+
data: r,
|
|
15
|
+
label: e,
|
|
16
|
+
onLoadData: s,
|
|
17
|
+
onSearch: n,
|
|
18
|
+
onOpen: l,
|
|
27
19
|
value: d = "",
|
|
28
|
-
className:
|
|
20
|
+
className: i,
|
|
29
21
|
preload: p,
|
|
30
22
|
disableVirtualized: m,
|
|
31
|
-
...
|
|
23
|
+
...a
|
|
32
24
|
}) => {
|
|
33
|
-
const { loading:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
] }), [
|
|
37
|
-
return /* @__PURE__ */ o(S, { label:
|
|
38
|
-
|
|
25
|
+
const { loading: t, ...c } = R({ data: r, onLoadData: s, onSearch: n, onOpen: l, value: d, preload: p, disableVirtualized: m }), u = I(a, "onClean"), f = _(), b = y((L) => /* @__PURE__ */ g(x, { children: [
|
|
26
|
+
L,
|
|
27
|
+
t && /* @__PURE__ */ o(M, {})
|
|
28
|
+
] }), [t]);
|
|
29
|
+
return /* @__PURE__ */ o(S, { label: e, className: i, passAriaToChildren: !0, children: /* @__PURE__ */ o(
|
|
30
|
+
A,
|
|
39
31
|
{
|
|
40
|
-
...
|
|
32
|
+
...a,
|
|
41
33
|
...c,
|
|
42
|
-
onClean:
|
|
34
|
+
onClean: u,
|
|
43
35
|
renderMenu: b,
|
|
44
|
-
ref:
|
|
36
|
+
ref: f
|
|
45
37
|
}
|
|
46
38
|
) });
|
|
47
|
-
},
|
|
48
|
-
...
|
|
49
|
-
preload:
|
|
50
|
-
label:
|
|
51
|
-
data:
|
|
39
|
+
}, U = C(N, "RsDropdown").name("Dropdown").category(j).props({
|
|
40
|
+
...F,
|
|
41
|
+
preload: w.default(!1),
|
|
42
|
+
label: k.default("Select"),
|
|
43
|
+
data: D.default(h(["a", "b", "c"]))
|
|
52
44
|
});
|
|
53
45
|
export {
|
|
54
|
-
|
|
46
|
+
U as rsDropdown
|
|
55
47
|
};
|
|
56
48
|
//# sourceMappingURL=dropdown.js.map
|
package/dist/dropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sources":["../src/components/internal/SLoader.tsx","../src/components/RsDropdown.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"dropdown.js","sources":["../src/components/internal/SLoader.tsx","../src/components/RsDropdown.tsx"],"sourcesContent":["import cx from 'clsx'\nimport type {LoaderProps} from 'rsuite'\nimport {Loader} from 'rsuite'\nimport styles from './SLoader.module.css'\n\n/**\n * Styled loader.\n * @param props the component props.\n * @param props.className the CSS class name.\n * @returns the React element.\n */\nexport const SLoader = ({className, ...props}: LoaderProps) => {\n return <Loader {...props} className={cx(styles.loader, className)}/>\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 {...props}\n {...loadProps}\n onClean={onClean}\n renderMenu={renderMenu}\n ref={inputRef}\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","className","props","jsx","Loader","cx","styles","RsDropdown","data","label","onLoadData","onSearch","onOpen","value","preload","disableVirtualized","loading","loadProps","useLoadData","onClean","useTouchOnEvent","inputRef","useFixAriaAttributesForInputPicker","renderMenu","useCallback","menu","jsxs","Fragment","Labeled","InputPicker","rsDropdown","define","fieldsCategory","pickerProps","boolean","string","array","toLabeledValues"],"mappings":";;;;;;;;;;;;GAWaA,IAAU,CAAC,EAAC,WAAAC,GAAW,GAAGC,QAC9B,gBAAAC,EAACC,KAAQ,GAAGF,GAAO,WAAWG,EAAGC,EAAO,QAAQL,CAAS,GAAE,GCmC9DM,IAAa,CAAC;AAAA,EACE,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAZ;AAAA,EACA,SAAAa;AAAA,EACA,oBAAAC;AAAA,EACA,GAAGb;AACL,MAAuB;AACzC,QAAM,EAAC,SAAAc,GAAS,GAAGC,EAAA,IAAaC,EAAY,EAAC,MAAAV,GAAM,YAAAE,GAAY,UAAAC,GAAU,QAAAC,GAAQ,OAAAC,GAAO,SAAAC,GAAS,oBAAAC,GAAmB,GAC9GI,IAAUC,EAAgBlB,GAAO,SAAS,GAC1CmB,IAAWC,EAAA,GAEXC,IAAaC,EAAY,CAACC,MAAoB,gBAAAC,EAAAC,GAAA,EACjD,UAAA;AAAA,IAAAF;AAAA,IACAT,uBAAYhB,GAAA,CAAA,CAAO;AAAA,EAAA,GACtB,GAAK,CAACgB,CAAO,CAAC;AAEd,SACE,gBAAAb,EAACyB,GAAA,EAAQ,OAAAnB,GAAc,WAAAR,GAAsB,oBAAoB,IAC/D,UAAA,gBAAAE;AAAA,IAAC0B;AAAA,IAAA;AAAA,MACE,GAAG3B;AAAA,MACH,GAAGe;AAAA,MACJ,SAAAE;AAAA,MACA,YAAAI;AAAA,MACA,KAAKF;AAAA,IAAA;AAAA,EAAA,GAET;AAEJ,GAEaS,IAAaC,EAAOxB,GAAY,YAAY,EACtD,KAAK,UAAU,EACf,SAASyB,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;"}
|