@react-form-builder/components-rsuite 8.0.0 → 9.0.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/autocomplete.js +5 -5
- package/dist/autocomplete.js.map +1 -1
- package/dist/breadcrumb.js +4 -4
- package/dist/breadcrumb.js.map +1 -1
- package/dist/builder-view-with-css.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{commonProperties-X-t50qaZ.js → commonProperties-DPbE7-nD.js} +7 -7
- package/dist/commonProperties-DPbE7-nD.js.map +1 -0
- package/dist/components-descriptions.js +1 -1
- package/dist/date-picker.js +1 -1
- package/dist/dropdown.js +9 -9
- package/dist/dropdown.js.map +1 -1
- package/dist/error-message.js +1 -1
- package/dist/header.js +1 -1
- package/dist/index.js +1 -1
- package/dist/input.js +1 -1
- package/dist/label.js +1 -1
- package/dist/link.js +1 -1
- package/dist/menu.js +2 -2
- package/dist/menu.js.map +1 -1
- package/dist/number-format.js +1 -1
- package/dist/pattern-format.js +1 -1
- package/dist/{rSuiteComponentsDescriptions-lX1mwx9_.js → rSuiteComponentsDescriptions-CaJ33mxP.js} +6 -6
- package/dist/{rSuiteComponentsDescriptions-lX1mwx9_.js.map → rSuiteComponentsDescriptions-CaJ33mxP.js.map} +1 -1
- package/dist/radio-group.js +4 -4
- package/dist/radio-group.js.map +1 -1
- package/dist/schemas/rsuite-components.schema.json +86 -13
- package/dist/search.js +1 -1
- package/dist/tab.js +4 -4
- package/dist/tab.js.map +1 -1
- package/dist/tag-picker.js +3 -3
- package/dist/tag-picker.js.map +1 -1
- package/dist/text-area.js +1 -1
- package/dist/time-picker.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/uploader.js +1 -1
- package/package.json +4 -4
- package/dist/commonProperties-X-t50qaZ.js.map +0 -1
package/dist/autocomplete.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
-
import { define as s, event as e, string as t, boolean as m, fn as p, array as u, toLabeledValues as
|
|
3
|
-
import { AutoComplete as
|
|
4
|
-
import { i as d } from "./commonProperties-
|
|
2
|
+
import { define as s, event as e, string as t, boolean as m, fn as p, array as u, toLabeledValues as c } from "@react-form-builder/core";
|
|
3
|
+
import { AutoComplete as f } from "rsuite";
|
|
4
|
+
import { i as d } from "./commonProperties-DPbE7-nD.js";
|
|
5
5
|
import { f as h } from "./categories-_98lyB3C.js";
|
|
6
6
|
import { L as g } from "./Labeled-8k9VvM4G.js";
|
|
7
7
|
const C = () => /* @__PURE__ */ i(
|
|
@@ -31,7 +31,7 @@ const C = () => /* @__PURE__ */ i(
|
|
|
31
31
|
)
|
|
32
32
|
]
|
|
33
33
|
}
|
|
34
|
-
), v = ({ label:
|
|
34
|
+
), v = ({ label: a, style: r, className: n, ...l }) => /* @__PURE__ */ o(g, { label: a, style: r, className: n, passAriaToChildren: !0, children: /* @__PURE__ */ o(f, { ...l }) }), x = `/**
|
|
35
35
|
* @param {string} value
|
|
36
36
|
* @param {ItemDataType} item
|
|
37
37
|
* @return {boolean}
|
|
@@ -39,7 +39,7 @@ const C = () => /* @__PURE__ */ i(
|
|
|
39
39
|
function filterBy(value, item) {`, B = s(v, "RsAutoComplete").name("AutoComplete").category(h).icon(C).props({
|
|
40
40
|
...d,
|
|
41
41
|
label: t.default("Input"),
|
|
42
|
-
data: u.default(
|
|
42
|
+
data: u.localize.default(c(["Item1", "Item2", "Item3"])),
|
|
43
43
|
defaultValue: t,
|
|
44
44
|
filterBy: p(x),
|
|
45
45
|
menuClassName: t,
|
package/dist/autocomplete.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.js","sources":["../src/components/RsAutocomplete.tsx"],"sourcesContent":["import {array, boolean, define, event, fn, string, toLabeledValues} from '@react-form-builder/core'\nimport type {CSSProperties} from 'react'\nimport type {AutoCompleteProps} from 'rsuite'\nimport {AutoComplete} from 'rsuite'\nimport {inputProps} from '../commonProperties'\nimport {fieldsCategory} from './categories'\nimport {Labeled} from './internal/Labeled'\n\nconst AutoCompleteIcon = () => <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\"\n viewBox=\"0 0 24 24\">\n <path stroke=\"#9ca3af\" strokeWidth=\"2\"\n d=\"M16.94 4H7.2c-1.12 0-1.68 0-2.1.22a2 2 0 0 0-.88.87C4 5.52 4 6.08 4 7.2v9.6c0 1.12 0 1.68.22 2.1.19.38.5.7.87.88.43.22.99.22 2.1.22h9.61c1.12 0 1.68 0 2.1-.22a2 2 0 0 0 .88-.87c.22-.43.22-.99.22-2.1v-6.15\"/>\n <path stroke=\"#9ca3af\" strokeWidth=\"2\"\n d=\"M9.81 12.33h.01m.5 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zm4.5 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0z\"/>\n</svg>\n\n/**\n * The properties of the RsAutoComplete component.\n */\nexport interface RsAutoCompleteProps extends AutoCompleteProps {\n /**\n * The component label.\n */\n label?: string\n /**\n * The component class name.\n */\n className?: string\n /**\n * The component styles.\n */\n style?: CSSProperties\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: string) => void\n}\n\nconst RsAutoComplete = ({label, style, className, ...props}: RsAutoCompleteProps) => {\n return <Labeled label={label} style={style} className={className} passAriaToChildren={true}>\n <AutoComplete {...props} />\n </Labeled>\n}\n\nconst filterByFnDescriptionBegin = `/**\n * @param {string} value\n * @param {ItemDataType} item\n * @return {boolean}\n */\nfunction filterBy(value, item) {`\n\nexport const rsAutoComplete = define(RsAutoComplete, 'RsAutoComplete')\n .name('AutoComplete')\n .category(fieldsCategory)\n .icon(AutoCompleteIcon)\n .props({\n ...inputProps,\n label: string.default('Input'),\n data: array.default(toLabeledValues(['Item1', 'Item2', 'Item3'])),\n defaultValue: string,\n filterBy: fn(filterByFnDescriptionBegin),\n menuClassName: string,\n onClose: event,\n onEnter: event,\n onEntering: event,\n onExit: event,\n onExited: event,\n onExiting: event,\n onSelect: event,\n selectOnEnter: boolean.default(true),\n value: string.valued.uncontrolledValue(''),\n })\n"],"names":["AutoCompleteIcon","jsxs","jsx","RsAutoComplete","label","style","className","props","Labeled","AutoComplete","filterByFnDescriptionBegin","rsAutoComplete","define","fieldsCategory","inputProps","string","array","toLabeledValues","fn","event","boolean"],"mappings":";;;;;;AAQA,MAAMA,IAAmB,MAAM,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IAAI,OAAM;AAAA,IAA6B,OAAM;AAAA,IAAK,QAAO;AAAA,IAAK,MAAK;AAAA,IAC/D,SAAQ;AAAA,IAC1C,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UAAK,QAAO;AAAA,UAAU,aAAY;AAAA,UAC7B,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MACR,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UAAK,QAAO;AAAA,UAAU,aAAY;AAAA,UAC7B,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IAA0F;AAAA,EAAA;AACpG,GAyBMC,IAAiB,CAAC,EAAC,OAAAC,GAAO,OAAAC,GAAO,WAAAC,GAAW,GAAGC,QAC5C,gBAAAL,EAACM,GAAA,EAAQ,OAAAJ,GAAc,OAAAC,GAAc,WAAAC,GAAsB,oBAAoB,IACpF,UAAA,gBAAAJ,EAACO,GAAA,EAAc,GAAGF,EAAA,CAAO,EAAA,CAC3B,GAGIG,IAA6B;AAAA;AAAA;AAAA;AAAA;AAAA,mCAOtBC,IAAiBC,EAAOT,GAAgB,gBAAgB,EAClE,KAAK,cAAc,EACnB,SAASU,CAAc,EACvB,KAAKb,CAAgB,EACrB,MAAM;AAAA,EACL,GAAGc;AAAA,EACH,OAAOC,EAAO,QAAQ,OAAO;AAAA,EAC7B,MAAMC,EAAM,QAAQC,EAAgB,CAAC,SAAS,SAAS,OAAO,CAAC,CAAC;AAAA,
|
|
1
|
+
{"version":3,"file":"autocomplete.js","sources":["../src/components/RsAutocomplete.tsx"],"sourcesContent":["import {array, boolean, define, event, fn, string, toLabeledValues} from '@react-form-builder/core'\nimport type {CSSProperties} from 'react'\nimport type {AutoCompleteProps} from 'rsuite'\nimport {AutoComplete} from 'rsuite'\nimport {inputProps} from '../commonProperties'\nimport {fieldsCategory} from './categories'\nimport {Labeled} from './internal/Labeled'\n\nconst AutoCompleteIcon = () => <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" fill=\"none\"\n viewBox=\"0 0 24 24\">\n <path stroke=\"#9ca3af\" strokeWidth=\"2\"\n d=\"M16.94 4H7.2c-1.12 0-1.68 0-2.1.22a2 2 0 0 0-.88.87C4 5.52 4 6.08 4 7.2v9.6c0 1.12 0 1.68.22 2.1.19.38.5.7.87.88.43.22.99.22 2.1.22h9.61c1.12 0 1.68 0 2.1-.22a2 2 0 0 0 .88-.87c.22-.43.22-.99.22-2.1v-6.15\"/>\n <path stroke=\"#9ca3af\" strokeWidth=\"2\"\n d=\"M9.81 12.33h.01m.5 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zm4.5 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0z\"/>\n</svg>\n\n/**\n * The properties of the RsAutoComplete component.\n */\nexport interface RsAutoCompleteProps extends AutoCompleteProps {\n /**\n * The component label.\n */\n label?: string\n /**\n * The component class name.\n */\n className?: string\n /**\n * The component styles.\n */\n style?: CSSProperties\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: string) => void\n}\n\nconst RsAutoComplete = ({label, style, className, ...props}: RsAutoCompleteProps) => {\n return <Labeled label={label} style={style} className={className} passAriaToChildren={true}>\n <AutoComplete {...props} />\n </Labeled>\n}\n\nconst filterByFnDescriptionBegin = `/**\n * @param {string} value\n * @param {ItemDataType} item\n * @return {boolean}\n */\nfunction filterBy(value, item) {`\n\nexport const rsAutoComplete = define(RsAutoComplete, 'RsAutoComplete')\n .name('AutoComplete')\n .category(fieldsCategory)\n .icon(AutoCompleteIcon)\n .props({\n ...inputProps,\n label: string.default('Input'),\n data: array.localize.default(toLabeledValues(['Item1', 'Item2', 'Item3'])),\n defaultValue: string,\n filterBy: fn(filterByFnDescriptionBegin),\n menuClassName: string,\n onClose: event,\n onEnter: event,\n onEntering: event,\n onExit: event,\n onExited: event,\n onExiting: event,\n onSelect: event,\n selectOnEnter: boolean.default(true),\n value: string.valued.uncontrolledValue(''),\n })\n"],"names":["AutoCompleteIcon","jsxs","jsx","RsAutoComplete","label","style","className","props","Labeled","AutoComplete","filterByFnDescriptionBegin","rsAutoComplete","define","fieldsCategory","inputProps","string","array","toLabeledValues","fn","event","boolean"],"mappings":";;;;;;AAQA,MAAMA,IAAmB,MAAM,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IAAI,OAAM;AAAA,IAA6B,OAAM;AAAA,IAAK,QAAO;AAAA,IAAK,MAAK;AAAA,IAC/D,SAAQ;AAAA,IAC1C,UAAA;AAAA,MAAA,gBAAAC;AAAA,QAAC;AAAA,QAAA;AAAA,UAAK,QAAO;AAAA,UAAU,aAAY;AAAA,UAC7B,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,MACR,gBAAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UAAK,QAAO;AAAA,UAAU,aAAY;AAAA,UAC7B,GAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IAA0F;AAAA,EAAA;AACpG,GAyBMC,IAAiB,CAAC,EAAC,OAAAC,GAAO,OAAAC,GAAO,WAAAC,GAAW,GAAGC,QAC5C,gBAAAL,EAACM,GAAA,EAAQ,OAAAJ,GAAc,OAAAC,GAAc,WAAAC,GAAsB,oBAAoB,IACpF,UAAA,gBAAAJ,EAACO,GAAA,EAAc,GAAGF,EAAA,CAAO,EAAA,CAC3B,GAGIG,IAA6B;AAAA;AAAA;AAAA;AAAA;AAAA,mCAOtBC,IAAiBC,EAAOT,GAAgB,gBAAgB,EAClE,KAAK,cAAc,EACnB,SAASU,CAAc,EACvB,KAAKb,CAAgB,EACrB,MAAM;AAAA,EACL,GAAGc;AAAA,EACH,OAAOC,EAAO,QAAQ,OAAO;AAAA,EAC7B,MAAMC,EAAM,SAAS,QAAQC,EAAgB,CAAC,SAAS,SAAS,OAAO,CAAC,CAAC;AAAA,EACzE,cAAcF;AAAA,EACd,UAAUG,EAAGR,CAA0B;AAAA,EACvC,eAAeK;AAAA,EACf,SAASI;AAAA,EACT,SAASA;AAAA,EACT,YAAYA;AAAA,EACZ,QAAQA;AAAA,EACR,UAAUA;AAAA,EACV,WAAWA;AAAA,EACX,UAAUA;AAAA,EACV,eAAeC,EAAQ,QAAQ,EAAI;AAAA,EACnC,OAAOL,EAAO,OAAO,kBAAkB,EAAE;AAC3C,CAAC;"}
|
package/dist/breadcrumb.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback as p, useMemo as f, createElement as h } from "react";
|
|
3
3
|
import { define as d, event as a, array as b, string as k, oneOf as C } from "@react-form-builder/core";
|
|
4
4
|
import { Checkbox as x, Breadcrumb as i } from "rsuite";
|
|
5
|
-
import { a as g } from "./commonProperties-
|
|
5
|
+
import { a as g } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { s as y } from "./categories-_98lyB3C.js";
|
|
7
7
|
import { S as B, I as u } from "./InputCell-tTp9fZXd.js";
|
|
8
8
|
const I = "_checkbox_1itlt_1", _ = {
|
|
@@ -30,16 +30,16 @@ const I = "_checkbox_1itlt_1", _ = {
|
|
|
30
30
|
const { title: m = "", ...c } = r;
|
|
31
31
|
return /* @__PURE__ */ h(i.Item, { ...c, onClick: o[s], key: m }, m);
|
|
32
32
|
}) });
|
|
33
|
-
},
|
|
33
|
+
}, U = d(v, "RsBreadcrumb").name("Breadcrumb").category(y).props({
|
|
34
34
|
separator: k.default("/"),
|
|
35
35
|
maxItems: g,
|
|
36
|
-
items: b.default(N(["one", "two", "three"])).withEditorProps({ columns: S }),
|
|
36
|
+
items: b.localize.default(N(["one", "two", "three"])).withEditorProps({ columns: S }),
|
|
37
37
|
onItemClick: a,
|
|
38
38
|
onExpand: a
|
|
39
39
|
}).css({
|
|
40
40
|
justifyContent: C("left", "center", "right").default("left").radio().named("Alignment")
|
|
41
41
|
});
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
U as rsBreadcrumb
|
|
44
44
|
};
|
|
45
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 {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,
|
|
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.localize\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,EAAM,SACV,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;"}
|
|
@@ -2,7 +2,7 @@ import { BuilderView as o, BiDi as r } from "@react-form-builder/core";
|
|
|
2
2
|
import { RsLocalizationWrapper as i } from "./localization-wrapper.js";
|
|
3
3
|
import { ltrCssLoader as t, rtlCssLoader as e } from "./css-loader.js";
|
|
4
4
|
import { components as s } from "./definitions.js";
|
|
5
|
-
import { r as p } from "./rSuiteComponentsDescriptions-
|
|
5
|
+
import { r as p } from "./rSuiteComponentsDescriptions-CaJ33mxP.js";
|
|
6
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
|
package/dist/button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
import { s as m, c as p } from "./commonProperties-
|
|
4
|
+
import { s as m, c as p } from "./commonProperties-DPbE7-nD.js";
|
|
5
5
|
import { a as B } from "./categories-_98lyB3C.js";
|
|
6
6
|
const o = "Button", b = ({ children: a, ...r }) => {
|
|
7
7
|
const n = f(a, o);
|
package/dist/calendar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
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
|
-
import { r as m } from "./commonProperties-
|
|
4
|
+
import { r as m } from "./commonProperties-DPbE7-nD.js";
|
|
5
5
|
import { f as u } from "./categories-_98lyB3C.js";
|
|
6
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({
|
package/dist/card.js
CHANGED
|
@@ -2,7 +2,7 @@ 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";
|
|
5
|
-
import { h as c } from "./commonProperties-
|
|
5
|
+
import { h as c } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { s as h } from "./categories-_98lyB3C.js";
|
|
7
7
|
import { RsHeader as C } from "./header.js";
|
|
8
8
|
const S = ({ title: e, headerSize: a, header: t }) => /* @__PURE__ */ f("div", { children: [
|
package/dist/checkbox.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { define as s, event as a, string as o, boolean as e, disabled as l } from "@react-form-builder/core";
|
|
3
3
|
import n from "clsx";
|
|
4
4
|
import { Checkbox as i } from "rsuite";
|
|
5
|
-
import { r as f } from "./commonProperties-
|
|
5
|
+
import { r as f } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { f as d } from "./categories-_98lyB3C.js";
|
|
7
7
|
const m = "_checkbox_qe1fs_1", b = {
|
|
8
8
|
checkbox: m
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { event as e, string as t, disabled as o, readOnly as i, oneOf as a, number as r, color as f, boolean as l, array as s, toLabeledValues as
|
|
2
|
-
const
|
|
1
|
+
import { event as e, string as t, disabled as o, readOnly as i, oneOf as a, number as r, color as f, boolean as l, array as s, toLabeledValues as c } from "@react-form-builder/core";
|
|
2
|
+
const u = r.withEditorProps({ min: 0 }), p = r.withEditorProps({ min: 1 }), b = a(
|
|
3
3
|
"bottomStart",
|
|
4
4
|
"bottomEnd",
|
|
5
5
|
"topStart",
|
|
@@ -20,7 +20,7 @@ const c = r.withEditorProps({ min: 0 }), p = r.withEditorProps({ min: 1 }), b =
|
|
|
20
20
|
"Large"
|
|
21
21
|
).default("md").withEditorProps({ creatable: !1 }), m = {
|
|
22
22
|
textAlign: a("start", "center", "end").default("start").radio(),
|
|
23
|
-
fontSize:
|
|
23
|
+
fontSize: u.default(14),
|
|
24
24
|
fontWeight: a("lighter", "normal", "bold").default("normal"),
|
|
25
25
|
color: f
|
|
26
26
|
}, n = i.default(!1), g = {
|
|
@@ -32,7 +32,7 @@ const c = r.withEditorProps({ min: 0 }), p = r.withEditorProps({ min: 1 }), b =
|
|
|
32
32
|
}, E = a("h1", "h2", "h3", "h4", "h5", "h6").default("h4").withEditorProps({ creatable: !1 }), S = {
|
|
33
33
|
activeKey: t.default("Item1"),
|
|
34
34
|
appearance: a("default", "tabs", "subtle", "pills").default("default").withEditorProps({ creatable: !1 }),
|
|
35
|
-
items: s.default(
|
|
35
|
+
items: s.localize.default(c(["Item1", "Item2", "Item3"])),
|
|
36
36
|
justified: l.default(!1),
|
|
37
37
|
onSelect: e,
|
|
38
38
|
reversed: l.default(!1),
|
|
@@ -43,7 +43,7 @@ const c = r.withEditorProps({ min: 0 }), p = r.withEditorProps({ min: 1 }), b =
|
|
|
43
43
|
placeholder: t,
|
|
44
44
|
placement: b,
|
|
45
45
|
size: d,
|
|
46
|
-
data: s,
|
|
46
|
+
data: s.localize,
|
|
47
47
|
cleanable: l.default(!0),
|
|
48
48
|
creatable: l.default(!1),
|
|
49
49
|
disabled: o.default(!1),
|
|
@@ -59,7 +59,7 @@ const c = r.withEditorProps({ min: 0 }), p = r.withEditorProps({ min: 1 }), b =
|
|
|
59
59
|
onSearch: e
|
|
60
60
|
}, y = a("red", "orange", "yellow", "green", "cyan", "blue", "violet").withEditorProps({ creatable: !1 });
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
u as a,
|
|
63
63
|
v as b,
|
|
64
64
|
y as c,
|
|
65
65
|
p as d,
|
|
@@ -71,4 +71,4 @@ export {
|
|
|
71
71
|
d as s,
|
|
72
72
|
m as t
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=commonProperties-
|
|
74
|
+
//# sourceMappingURL=commonProperties-DPbE7-nD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonProperties-DPbE7-nD.js","sources":["../src/commonProperties.ts"],"sourcesContent":["import {\n array,\n boolean,\n color,\n disabled,\n event,\n number,\n oneOf,\n readOnly as readOnlyProp,\n string,\n toLabeledValues\n} from '@react-form-builder/core'\nimport type {TypeAttributes} from 'rsuite/esm/internals/types'\n\ntype Placement = TypeAttributes.Placement;\n\nexport const nonNegNumber = number.withEditorProps({min: 0})\n\nexport const positiveNumber = number.withEditorProps({min: 1})\n\nexport const placement = oneOf<Placement>(\n 'bottomStart',\n 'bottomEnd',\n 'topStart',\n 'topEnd',\n 'leftStart',\n 'rightStart',\n 'leftEnd',\n 'rightEnd'\n)\n\nexport const size = oneOf(\n 'xs',\n 'sm',\n 'md',\n 'lg'\n).labeled(\n 'Extra small',\n 'Small',\n 'Medium',\n 'Large'\n).default('md')\n .withEditorProps({creatable: false})\n\nexport const textStyles = {\n textAlign: oneOf('start', 'center', 'end')\n .default('start')\n .radio(),\n fontSize: nonNegNumber.default(14),\n fontWeight: oneOf('lighter', 'normal', 'bold').default('normal'),\n color,\n}\n\nexport const readOnly = readOnlyProp.default(false)\n\nexport const inputProps = {\n placeholder: string,\n size,\n disabled: disabled.default(false),\n readOnly,\n onChange: event,\n}\n\nexport const headerSize = oneOf('h1', 'h2', 'h3', 'h4', 'h5', 'h6')\n .default('h4')\n .withEditorProps({creatable: false})\n\nexport const navProps = {\n activeKey: string.default('Item1'),\n appearance: oneOf('default', 'tabs', 'subtle', 'pills')\n .default('default')\n .withEditorProps({creatable: false}),\n items: array.localize.default(toLabeledValues(['Item1', 'Item2', 'Item3'])),\n justified: boolean.default(false),\n onSelect: event,\n reversed: boolean.default(false),\n vertical: boolean.default(false)\n}\n\nexport const pickerProps = {\n label: string,\n value: string.valued,\n placeholder: string,\n placement,\n size,\n data: array.localize,\n cleanable: boolean.default(true),\n creatable: boolean.default(false),\n disabled: disabled.default(false),\n readOnly,\n groupBy: string.default(''),\n disableVirtualized: boolean,\n onLoadData: event,\n onSelect: event,\n onClean: event,\n onClose: event,\n onCreate: event,\n onChange: event,\n onSearch: event,\n}\n\nexport const controlColor = oneOf('red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'violet')\n .withEditorProps({creatable: false})\n"],"names":["nonNegNumber","number","positiveNumber","placement","oneOf","size","textStyles","color","readOnly","readOnlyProp","inputProps","string","disabled","event","headerSize","navProps","array","toLabeledValues","boolean","pickerProps","controlColor"],"mappings":";AAgBO,MAAMA,IAAeC,EAAO,gBAAgB,EAAC,KAAK,GAAE,GAE9CC,IAAiBD,EAAO,gBAAgB,EAAC,KAAK,GAAE,GAEhDE,IAAYC;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,IAAOD;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,QAAQ,IAAI,EACX,gBAAgB,EAAC,WAAW,IAAM,GAExBE,IAAa;AAAA,EACxB,WAAWF,EAAM,SAAS,UAAU,KAAK,EACtC,QAAQ,OAAO,EACf,MAAA;AAAA,EACH,UAAUJ,EAAa,QAAQ,EAAE;AAAA,EACjC,YAAYI,EAAM,WAAW,UAAU,MAAM,EAAE,QAAQ,QAAQ;AAAA,EAC/D,OAAAG;AACF,GAEaC,IAAWC,EAAa,QAAQ,EAAK,GAErCC,IAAa;AAAA,EACxB,aAAaC;AAAA,EACb,MAAAN;AAAA,EACA,UAAUO,EAAS,QAAQ,EAAK;AAAA,EAChC,UAAAJ;AAAA,EACA,UAAUK;AACZ,GAEaC,IAAaV,EAAM,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI,EAC/D,QAAQ,IAAI,EACZ,gBAAgB,EAAC,WAAW,IAAM,GAExBW,IAAW;AAAA,EACtB,WAAWJ,EAAO,QAAQ,OAAO;AAAA,EACjC,YAAYP,EAAM,WAAW,QAAQ,UAAU,OAAO,EACnD,QAAQ,SAAS,EACjB,gBAAgB,EAAC,WAAW,IAAM;AAAA,EACrC,OAAOY,EAAM,SAAS,QAAQC,EAAgB,CAAC,SAAS,SAAS,OAAO,CAAC,CAAC;AAAA,EAC1E,WAAWC,EAAQ,QAAQ,EAAK;AAAA,EAChC,UAAUL;AAAA,EACV,UAAUK,EAAQ,QAAQ,EAAK;AAAA,EAC/B,UAAUA,EAAQ,QAAQ,EAAK;AACjC,GAEaC,IAAc;AAAA,EACzB,OAAOR;AAAA,EACP,OAAOA,EAAO;AAAA,EACd,aAAaA;AAAA,EACb,WAAAR;AAAA,EACA,MAAAE;AAAA,EACA,MAAMW,EAAM;AAAA,EACZ,WAAWE,EAAQ,QAAQ,EAAI;AAAA,EAC/B,WAAWA,EAAQ,QAAQ,EAAK;AAAA,EAChC,UAAUN,EAAS,QAAQ,EAAK;AAAA,EAChC,UAAAJ;AAAA,EACA,SAASG,EAAO,QAAQ,EAAE;AAAA,EAC1B,oBAAoBO;AAAA,EACpB,YAAYL;AAAA,EACZ,UAAUA;AAAA,EACV,SAASA;AAAA,EACT,SAASA;AAAA,EACT,UAAUA;AAAA,EACV,UAAUA;AAAA,EACV,UAAUA;AACZ,GAEaO,IAAehB,EAAM,OAAO,UAAU,UAAU,SAAS,QAAQ,QAAQ,QAAQ,EAC3F,gBAAgB,EAAC,WAAW,IAAM;"}
|
package/dist/date-picker.js
CHANGED
|
@@ -2,7 +2,7 @@ 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";
|
|
5
|
-
import { s as M, p as O, r as P } from "./commonProperties-
|
|
5
|
+
import { s as M, p as O, r as P } from "./commonProperties-DPbE7-nD.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";
|
package/dist/dropdown.js
CHANGED
|
@@ -2,15 +2,15 @@ import { jsx as o, jsxs as g, Fragment as x } from "react/jsx-runtime";
|
|
|
2
2
|
import { define as C, array as D, toLabeledValues as h, string as k, boolean as w } from "@react-form-builder/core";
|
|
3
3
|
import { useCallback as y } from "react";
|
|
4
4
|
import { Loader as P, InputPicker as A } from "rsuite";
|
|
5
|
-
import { b as F } from "./commonProperties-
|
|
5
|
+
import { b as F } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { u as R, a as _ } from "./hooks-DMVtrI-b.js";
|
|
7
7
|
import { f as j } from "./categories-_98lyB3C.js";
|
|
8
8
|
import { u as I } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
9
|
import { L as S } from "./Labeled-8k9VvM4G.js";
|
|
10
10
|
import T from "clsx";
|
|
11
|
-
const v = "_loader_pu0ca_1",
|
|
11
|
+
const v = "_loader_pu0ca_1", z = {
|
|
12
12
|
loader: v
|
|
13
|
-
},
|
|
13
|
+
}, E = ({ className: r, ...e }) => /* @__PURE__ */ o(P, { ...e, className: T(z.loader, r) }), M = ({
|
|
14
14
|
data: r,
|
|
15
15
|
label: e,
|
|
16
16
|
onLoadData: s,
|
|
@@ -19,28 +19,28 @@ const v = "_loader_pu0ca_1", E = {
|
|
|
19
19
|
value: d = "",
|
|
20
20
|
className: i,
|
|
21
21
|
preload: p,
|
|
22
|
-
disableVirtualized:
|
|
22
|
+
disableVirtualized: c,
|
|
23
23
|
...a
|
|
24
24
|
}) => {
|
|
25
|
-
const { loading: t, ...
|
|
25
|
+
const { loading: t, ...m } = R({ data: r, onLoadData: s, onSearch: n, onOpen: l, value: d, preload: p, disableVirtualized: c }), u = I(a, "onClean"), f = _(), b = y((L) => /* @__PURE__ */ g(x, { children: [
|
|
26
26
|
L,
|
|
27
|
-
t && /* @__PURE__ */ o(
|
|
27
|
+
t && /* @__PURE__ */ o(E, {})
|
|
28
28
|
] }), [t]);
|
|
29
29
|
return /* @__PURE__ */ o(S, { label: e, className: i, passAriaToChildren: !0, children: /* @__PURE__ */ o(
|
|
30
30
|
A,
|
|
31
31
|
{
|
|
32
32
|
...a,
|
|
33
|
-
...
|
|
33
|
+
...m,
|
|
34
34
|
onClean: u,
|
|
35
35
|
renderMenu: b,
|
|
36
36
|
ref: f
|
|
37
37
|
}
|
|
38
38
|
) });
|
|
39
|
-
}, U = C(
|
|
39
|
+
}, U = C(M, "RsDropdown").name("Dropdown").category(j).props({
|
|
40
40
|
...F,
|
|
41
41
|
preload: w.default(!1),
|
|
42
42
|
label: k.default("Select"),
|
|
43
|
-
data: D.default(h(["a", "b", "c"]))
|
|
43
|
+
data: D.localize.default(h(["a", "b", "c"]))
|
|
44
44
|
});
|
|
45
45
|
export {
|
|
46
46
|
U as rsDropdown
|
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 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;
|
|
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.localize.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,SAAS,QAAQC,EAAgB,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;AAC/D,CAAC;"}
|
package/dist/error-message.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs as n, jsx as c } from "react/jsx-runtime";
|
|
|
2
2
|
import { define as i, string as p, useAriaErrorMessage as l } from "@react-form-builder/core";
|
|
3
3
|
import g from "clsx";
|
|
4
4
|
import { Form as f } from "rsuite";
|
|
5
|
-
import { p as M } from "./commonProperties-
|
|
5
|
+
import { p as M } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { a as d } from "./categories-_98lyB3C.js";
|
|
7
7
|
const E = "_container_1imzc_1", _ = "_errorMessage_1imzc_8", e = {
|
|
8
8
|
container: E,
|
package/dist/header.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { define as s, string as n, color as d, useBuilderValue as c } from "@react-form-builder/core";
|
|
2
2
|
import { createElement as i } from "react";
|
|
3
|
-
import { h as l, t as m } from "./commonProperties-
|
|
3
|
+
import { h as l, t as m } from "./commonProperties-DPbE7-nD.js";
|
|
4
4
|
import { a as u } from "./categories-_98lyB3C.js";
|
|
5
5
|
const e = "Header", f = ({ content: r, headerSize: t, ...o }) => {
|
|
6
6
|
const a = c(r, e);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e, e as t } from "./rSuiteComponentsDescriptions-
|
|
1
|
+
import { r as e, e as t } from "./rSuiteComponentsDescriptions-CaJ33mxP.js";
|
|
2
2
|
import { RsLocalizationWrapper as p } from "./localization-wrapper.js";
|
|
3
3
|
import { ltrCssLoader as x, rtlCssLoader as f } from "./css-loader.js";
|
|
4
4
|
import { rSuiteComponents as i } from "./r-suite-components.js";
|
package/dist/input.js
CHANGED
|
@@ -3,7 +3,7 @@ import { define as C, string as s, boolean as g, oneOf as y, useComponentData as
|
|
|
3
3
|
import { Visible as V, EyeClose as k } from "@rsuite/icons";
|
|
4
4
|
import { useState as L, useCallback as j } from "react";
|
|
5
5
|
import { InputGroup as n, Input as p } from "rsuite";
|
|
6
|
-
import { i as P } from "./commonProperties-
|
|
6
|
+
import { i as P } from "./commonProperties-DPbE7-nD.js";
|
|
7
7
|
import { f as R } from "./categories-_98lyB3C.js";
|
|
8
8
|
import { L as S } from "./Labeled-8k9VvM4G.js";
|
|
9
9
|
const B = ({ style: u, className: d, label: o, passwordMask: m, showPasswordAriaLabel: f, type: c, value: r, ...a }) => {
|
package/dist/label.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { define as s, string as l, useBuilderValue as n } from "@react-form-builder/core";
|
|
3
|
-
import { t as m } from "./commonProperties-
|
|
3
|
+
import { t as m } from "./commonProperties-DPbE7-nD.js";
|
|
4
4
|
import { a as c } from "./categories-_98lyB3C.js";
|
|
5
5
|
const e = "Label", i = ({ text: t, ...o }) => {
|
|
6
6
|
const a = n(t, e);
|
package/dist/link.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { define as d, event as f, string as t, node as c, boolean as m, oneOf as e } from "@react-form-builder/core";
|
|
3
|
-
import { t as p } from "./commonProperties-
|
|
3
|
+
import { t as p } from "./commonProperties-DPbE7-nD.js";
|
|
4
4
|
import { a as k } from "./categories-_98lyB3C.js";
|
|
5
5
|
const x = ({ text: o, download: n, downloadFilename: a, content: r, children: i, ...l }) => /* @__PURE__ */ s("a", { ...l, download: a ?? n, children: r === "text" ? o : i }), g = d(x, "RsLink").name("Link").category(k).props({
|
|
6
6
|
content: e("text", "custom").default("text").radio(),
|
package/dist/menu.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { define as f, array as d, oneOf as h, useComponentData as v } from "@react-form-builder/core";
|
|
3
3
|
import { useCallback as y } from "react";
|
|
4
4
|
import { Nav as i } from "rsuite";
|
|
5
|
-
import { n as b } from "./commonProperties-
|
|
5
|
+
import { n as b } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { a as P } from "./categories-_98lyB3C.js";
|
|
7
7
|
import { I as m } from "./InputCell-tTp9fZXd.js";
|
|
8
8
|
const g = (a) => a.map((t) => ({ title: t, href: `#${t}` })), w = /* @__PURE__ */ new Set([
|
|
@@ -41,7 +41,7 @@ const g = (a) => a.map((t) => ({ title: t, href: `#${t}` })), w = /* @__PURE__ *
|
|
|
41
41
|
activeKey: I.default("Home"),
|
|
42
42
|
...K,
|
|
43
43
|
itemsAs: h(...c).labeled(...c).default("a").withEditorProps({ creatable: !1 }),
|
|
44
|
-
items: d.default(g(["Home", "News", "Products"])).withEditorProps({ columns: D })
|
|
44
|
+
items: d.localize.default(g(["Home", "News", "Products"])).withEditorProps({ columns: D })
|
|
45
45
|
});
|
|
46
46
|
export {
|
|
47
47
|
S as rsMenu
|
package/dist/menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sources":["../src/components/RsMenu.tsx"],"sourcesContent":["import {array, define, oneOf, useComponentData} from '@react-form-builder/core'\nimport type {ElementType, SyntheticEvent} from 'react'\nimport {useCallback} from 'react'\nimport type {NavProps} from 'rsuite'\nimport {Nav} from 'rsuite'\nimport {navProps} from '../commonProperties'\nimport {staticCategory} from './categories'\nimport {InputCell} from './internal/InputCell'\n\n/**\n * Menu item for RsMenu component.\n */\nexport type MenuItem = {\n /**\n * The href for the menu item.\n */\n href?: string\n /**\n * The title for the menu item.\n */\n title?: string\n}\n\nconst makeItems = (data: string[]) => data.map(title => ({title, href: `#${title}`}))\n\nconst suitableReactElementTypes = new Set([\n 'a',\n 'button',\n 'div',\n 'span',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'p',\n 'b',\n 'em',\n 'i',\n 'q',\n 's',\n 'u',\n 'input',\n 'label',\n 'section',\n 'article',\n 'nav',\n 'pre'\n])\n\n/**\n * Props for the RsMenu component.\n */\nexport interface RsMenuProps extends NavProps {\n /**\n * The items for the menu.\n */\n items?: MenuItem[],\n /**\n * The element type for menu items.\n */\n itemsAs: ElementType\n}\n\n/**\n * Menu component with navigation support.\n * @param props the component props.\n * @param props.onSelect the callback when menu item is selected.\n * @param props.items the items for the menu.\n * @param props.itemsAs the element type for menu items.\n * @param props.props the additional menu props.\n * @returns the React element.\n */\nconst RsMenu = ({onSelect, items, itemsAs, ...props}: RsMenuProps) => {\n const componentData = useComponentData()\n\n const onNavSelect: NavProps['onSelect'] = useCallback((eventKey: any, event: SyntheticEvent) => {\n componentData.userDefinedProps ??= {}\n componentData.userDefinedProps.activeKey = eventKey\n onSelect?.(eventKey, event)\n }, [componentData, onSelect])\n\n if (!items?.length) return null\n\n return <Nav onSelect={onNavSelect} {...props}>\n {items.map(({title, href}, index) =>\n <Nav.Item key={index} href={href} as={itemsAs} eventKey={title} active={title === props.activeKey}>\n {title}\n </Nav.Item>)\n }\n </Nav>\n}\n\nconst columns = [\n {name: 'title', input: InputCell},\n {name: 'href', title: 'Url', input: InputCell}\n] as const\n\nconst {activeKey, ...props} = navProps\n\nconst tags = [...suitableReactElementTypes]\n\nexport const rsMenu = define(RsMenu, 'RsMenu')\n .name('Menu')\n .category(staticCategory)\n .props({\n activeKey: activeKey.default('Home'),\n ...props,\n itemsAs: oneOf(...tags)\n .labeled(...tags)\n .default('a')\n .withEditorProps({creatable: false}),\n items: array\n .default(makeItems(['Home', 'News', 'Products']))\n .withEditorProps({columns}),\n })\n"],"names":["makeItems","data","title","suitableReactElementTypes","RsMenu","onSelect","items","itemsAs","props","componentData","useComponentData","onNavSelect","useCallback","eventKey","event","jsx","Nav","href","index","columns","InputCell","activeKey","navProps","tags","rsMenu","define","staticCategory","oneOf","array"],"mappings":";;;;;;;AAuBA,MAAMA,IAAY,CAACC,MAAmBA,EAAK,IAAI,CAAAC,OAAU,EAAC,OAAAA,GAAO,MAAM,IAAIA,CAAK,GAAA,EAAI,GAE9EC,wBAAgC,IAAI;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAyBKC,IAAS,CAAC,EAAC,UAAAC,GAAU,OAAAC,GAAO,SAAAC,GAAS,GAAGC,QAAwB;AACpE,QAAMC,IAAgBC,EAAA,GAEhBC,IAAoCC,EAAY,CAACC,GAAeC,MAA0B;AAC9F,IAAAL,EAAc,qBAAqB,CAAA,GACnCA,EAAc,iBAAiB,YAAYI,GAC3CR,IAAWQ,GAAUC,CAAK;AAAA,EAC5B,GAAG,CAACL,GAAeJ,CAAQ,CAAC;AAE5B,SAAKC,GAAO,SAEL,gBAAAS,EAACC,GAAA,EAAI,UAAUL,GAAc,GAAGH,GACpC,UAAAF,EAAM,IAAI,CAAC,EAAC,OAAAJ,GAAO,MAAAe,EAAA,GAAOC,MACzB,gBAAAH,EAACC,EAAI,MAAJ,EAAqB,MAAAC,GAAY,IAAIV,GAAS,UAAUL,GAAO,QAAQA,MAAUM,EAAM,WACrF,UAAAN,EAAA,GADYgB,CAEf,CAAW,GAEf,IAR2B;AAS7B,GAEMC,IAAU;AAAA,EACd,EAAC,MAAM,SAAS,OAAOC,EAAA;AAAA,EACvB,EAAC,MAAM,QAAQ,OAAO,OAAO,OAAOA,EAAA;AACtC,GAEM,EAAC,WAAAC,GAAW,GAAGb,EAAA,IAASc,GAExBC,IAAO,CAAC,GAAGpB,CAAyB,GAE7BqB,IAASC,EAAOrB,GAAQ,QAAQ,EAC1C,KAAK,MAAM,EACX,SAASsB,CAAc,EACvB,MAAM;AAAA,EACL,WAAWL,EAAU,QAAQ,MAAM;AAAA,EACnC,GAAGb;AAAA,EACH,SAASmB,EAAM,GAAGJ,CAAI,EACnB,QAAQ,GAAGA,CAAI,EACf,QAAQ,GAAG,EACX,gBAAgB,EAAC,WAAW,IAAM;AAAA,EACrC,OAAOK,
|
|
1
|
+
{"version":3,"file":"menu.js","sources":["../src/components/RsMenu.tsx"],"sourcesContent":["import {array, define, oneOf, useComponentData} from '@react-form-builder/core'\nimport type {ElementType, SyntheticEvent} from 'react'\nimport {useCallback} from 'react'\nimport type {NavProps} from 'rsuite'\nimport {Nav} from 'rsuite'\nimport {navProps} from '../commonProperties'\nimport {staticCategory} from './categories'\nimport {InputCell} from './internal/InputCell'\n\n/**\n * Menu item for RsMenu component.\n */\nexport type MenuItem = {\n /**\n * The href for the menu item.\n */\n href?: string\n /**\n * The title for the menu item.\n */\n title?: string\n}\n\nconst makeItems = (data: string[]) => data.map(title => ({title, href: `#${title}`}))\n\nconst suitableReactElementTypes = new Set([\n 'a',\n 'button',\n 'div',\n 'span',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'p',\n 'b',\n 'em',\n 'i',\n 'q',\n 's',\n 'u',\n 'input',\n 'label',\n 'section',\n 'article',\n 'nav',\n 'pre'\n])\n\n/**\n * Props for the RsMenu component.\n */\nexport interface RsMenuProps extends NavProps {\n /**\n * The items for the menu.\n */\n items?: MenuItem[],\n /**\n * The element type for menu items.\n */\n itemsAs: ElementType\n}\n\n/**\n * Menu component with navigation support.\n * @param props the component props.\n * @param props.onSelect the callback when menu item is selected.\n * @param props.items the items for the menu.\n * @param props.itemsAs the element type for menu items.\n * @param props.props the additional menu props.\n * @returns the React element.\n */\nconst RsMenu = ({onSelect, items, itemsAs, ...props}: RsMenuProps) => {\n const componentData = useComponentData()\n\n const onNavSelect: NavProps['onSelect'] = useCallback((eventKey: any, event: SyntheticEvent) => {\n componentData.userDefinedProps ??= {}\n componentData.userDefinedProps.activeKey = eventKey\n onSelect?.(eventKey, event)\n }, [componentData, onSelect])\n\n if (!items?.length) return null\n\n return <Nav onSelect={onNavSelect} {...props}>\n {items.map(({title, href}, index) =>\n <Nav.Item key={index} href={href} as={itemsAs} eventKey={title} active={title === props.activeKey}>\n {title}\n </Nav.Item>)\n }\n </Nav>\n}\n\nconst columns = [\n {name: 'title', input: InputCell},\n {name: 'href', title: 'Url', input: InputCell}\n] as const\n\nconst {activeKey, ...props} = navProps\n\nconst tags = [...suitableReactElementTypes]\n\nexport const rsMenu = define(RsMenu, 'RsMenu')\n .name('Menu')\n .category(staticCategory)\n .props({\n activeKey: activeKey.default('Home'),\n ...props,\n itemsAs: oneOf(...tags)\n .labeled(...tags)\n .default('a')\n .withEditorProps({creatable: false}),\n items: array.localize\n .default(makeItems(['Home', 'News', 'Products']))\n .withEditorProps({columns}),\n })\n"],"names":["makeItems","data","title","suitableReactElementTypes","RsMenu","onSelect","items","itemsAs","props","componentData","useComponentData","onNavSelect","useCallback","eventKey","event","jsx","Nav","href","index","columns","InputCell","activeKey","navProps","tags","rsMenu","define","staticCategory","oneOf","array"],"mappings":";;;;;;;AAuBA,MAAMA,IAAY,CAACC,MAAmBA,EAAK,IAAI,CAAAC,OAAU,EAAC,OAAAA,GAAO,MAAM,IAAIA,CAAK,GAAA,EAAI,GAE9EC,wBAAgC,IAAI;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAyBKC,IAAS,CAAC,EAAC,UAAAC,GAAU,OAAAC,GAAO,SAAAC,GAAS,GAAGC,QAAwB;AACpE,QAAMC,IAAgBC,EAAA,GAEhBC,IAAoCC,EAAY,CAACC,GAAeC,MAA0B;AAC9F,IAAAL,EAAc,qBAAqB,CAAA,GACnCA,EAAc,iBAAiB,YAAYI,GAC3CR,IAAWQ,GAAUC,CAAK;AAAA,EAC5B,GAAG,CAACL,GAAeJ,CAAQ,CAAC;AAE5B,SAAKC,GAAO,SAEL,gBAAAS,EAACC,GAAA,EAAI,UAAUL,GAAc,GAAGH,GACpC,UAAAF,EAAM,IAAI,CAAC,EAAC,OAAAJ,GAAO,MAAAe,EAAA,GAAOC,MACzB,gBAAAH,EAACC,EAAI,MAAJ,EAAqB,MAAAC,GAAY,IAAIV,GAAS,UAAUL,GAAO,QAAQA,MAAUM,EAAM,WACrF,UAAAN,EAAA,GADYgB,CAEf,CAAW,GAEf,IAR2B;AAS7B,GAEMC,IAAU;AAAA,EACd,EAAC,MAAM,SAAS,OAAOC,EAAA;AAAA,EACvB,EAAC,MAAM,QAAQ,OAAO,OAAO,OAAOA,EAAA;AACtC,GAEM,EAAC,WAAAC,GAAW,GAAGb,EAAA,IAASc,GAExBC,IAAO,CAAC,GAAGpB,CAAyB,GAE7BqB,IAASC,EAAOrB,GAAQ,QAAQ,EAC1C,KAAK,MAAM,EACX,SAASsB,CAAc,EACvB,MAAM;AAAA,EACL,WAAWL,EAAU,QAAQ,MAAM;AAAA,EACnC,GAAGb;AAAA,EACH,SAASmB,EAAM,GAAGJ,CAAI,EACnB,QAAQ,GAAGA,CAAI,EACf,QAAQ,GAAG,EACX,gBAAgB,EAAC,WAAW,IAAM;AAAA,EACrC,OAAOK,EAAM,SACV,QAAQ5B,EAAU,CAAC,QAAQ,QAAQ,UAAU,CAAC,CAAC,EAC/C,gBAAgB,EAAC,SAAAmB,GAAQ;AAC9B,CAAC;"}
|
package/dist/number-format.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { define as f, string as o, array as p, number as h, oneOf as S, boolean as n, isString as b } from "@react-form-builder/core";
|
|
3
3
|
import { useCallback as g } from "react";
|
|
4
4
|
import { NumericFormat as N } from "react-number-format";
|
|
5
|
-
import { a as w, i as x } from "./commonProperties-
|
|
5
|
+
import { a as w, i as x } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { f as y } from "./categories-_98lyB3C.js";
|
|
7
7
|
import { L as F } from "./Labeled-8k9VvM4G.js";
|
|
8
8
|
import { W as D } from "./WrappedInput-Cq5StStF.js";
|
package/dist/pattern-format.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { define as u, string as a, boolean as d } from "@react-form-builder/core";
|
|
3
3
|
import { useCallback as c } from "react";
|
|
4
4
|
import { PatternFormat as g } from "react-number-format";
|
|
5
|
-
import { i as h } from "./commonProperties-
|
|
5
|
+
import { i as h } from "./commonProperties-DPbE7-nD.js";
|
|
6
6
|
import { f as k } from "./categories-_98lyB3C.js";
|
|
7
7
|
import { L as F } from "./Labeled-8k9VvM4G.js";
|
|
8
8
|
import { W as P } from "./WrappedInput-Cq5StStF.js";
|