@react-form-builder/components-rsuite 7.8.0 → 7.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InputCell-BDyUJFGm.js +21 -0
- package/dist/{InputCell-f4236002.js.map → InputCell-BDyUJFGm.js.map} +1 -1
- package/dist/{Labeled-751c2353.js → Labeled-BWYRwMiY.js} +1 -1
- package/dist/{Labeled-751c2353.js.map → Labeled-BWYRwMiY.js.map} +1 -1
- package/dist/WrappedInput-BRkBjl0z.js +11 -0
- package/dist/{WrappedInput-bc5a6d33.js.map → WrappedInput-BRkBjl0z.js.map} +1 -1
- package/dist/autocomplete.d.ts +2 -2
- package/dist/autocomplete.js +12 -15
- package/dist/autocomplete.js.map +1 -1
- package/dist/breadcrumb.d.ts +2 -2
- package/dist/breadcrumb.js +31 -31
- package/dist/breadcrumb.js.map +1 -1
- package/dist/builder-view-with-css.js +5 -61
- package/dist/builder-view-with-css.js.map +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +7 -7
- package/dist/button.js.map +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +9 -12
- package/dist/calendar.js.map +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +10 -10
- package/dist/card.js.map +1 -1
- package/dist/{categories-7064b279.js → categories-_98lyB3C.js} +3 -3
- package/dist/{categories-7064b279.js.map → categories-_98lyB3C.js.map} +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +19 -23
- package/dist/checkbox.js.map +1 -1
- package/dist/{commonProperties-d849cd5b.js → commonProperties-ETOgvhCH.js} +7 -7
- package/dist/{commonProperties-d849cd5b.js.map → commonProperties-ETOgvhCH.js.map} +1 -1
- package/dist/components-descriptions.d.ts +2 -2
- package/dist/components-descriptions.js +1 -1
- package/dist/container.js +4 -4
- package/dist/container.js.map +1 -1
- package/dist/css-loader.js +3 -3
- package/dist/css-loader.js.map +1 -1
- package/dist/date-picker.d.ts +1 -1
- package/dist/date-picker.js +25 -29
- package/dist/date-picker.js.map +1 -1
- package/dist/dateTimeUtils-C2AEniv5.js +25 -0
- package/dist/{dateTimeUtils-b07ce438.js.map → dateTimeUtils-C2AEniv5.js.map} +1 -1
- package/dist/definitions.js +2 -55
- package/dist/definitions.js.map +1 -1
- package/dist/divider.js +6 -6
- package/dist/divider.js.map +1 -1
- package/dist/dropdown.d.ts +3 -3
- package/dist/dropdown.js +10 -11
- package/dist/dropdown.js.map +1 -1
- package/dist/error-message.d.ts +1 -1
- package/dist/error-message.js +2 -2
- package/dist/error-message.js.map +1 -1
- package/dist/{formengine-rsuite-cbc1d3ae.js → formengine-rsuite.css-DkGUHOws.js} +1 -1
- package/dist/formengine-rsuite.css-DkGUHOws.js.map +1 -0
- package/dist/header.d.ts +6 -6
- package/dist/header.js +2 -2
- package/dist/header.js.map +1 -1
- package/dist/hooks-DMVtrI-b.js +50 -0
- package/dist/hooks-DMVtrI-b.js.map +1 -0
- package/dist/image.d.ts +1 -1
- package/dist/image.js +8 -8
- package/dist/image.js.map +1 -1
- package/dist/index.d.ts +1526 -36
- package/dist/index.js +95 -116
- package/dist/index.js.map +1 -1
- package/dist/input.d.ts +1 -1
- package/dist/input.js +11 -13
- package/dist/input.js.map +1 -1
- package/dist/label.js +2 -2
- package/dist/label.js.map +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +7 -7
- package/dist/link.js.map +1 -1
- package/dist/localization-wrapper.d.ts +1 -1
- package/dist/localization-wrapper.js +52 -185
- package/dist/localization-wrapper.js.map +1 -1
- package/dist/menu.d.ts +2 -2
- package/dist/menu.js +20 -21
- package/dist/menu.js.map +1 -1
- package/dist/message.d.ts +2 -2
- package/dist/message.js +4 -4
- package/dist/modal-layout.d.ts +1 -1
- package/dist/modal-layout.js +2 -2
- package/dist/modal-layout.js.map +1 -1
- package/dist/modal.d.ts +1 -1
- package/dist/modal.js +13 -13
- package/dist/modal.js.map +1 -1
- package/dist/models.js +2 -56
- package/dist/models.js.map +1 -1
- package/dist/number-format.d.ts +2 -2
- package/dist/number-format.js +22 -25
- package/dist/number-format.js.map +1 -1
- package/dist/pattern-format.d.ts +2 -2
- package/dist/pattern-format.js +22 -25
- package/dist/pattern-format.js.map +1 -1
- package/dist/placeholder.js +3 -3
- package/dist/placeholder.js.map +1 -1
- package/dist/progress.js +6 -6
- package/dist/progress.js.map +1 -1
- package/dist/r-suite-components.d.ts +1 -1
- package/dist/r-suite-components.js +5 -22
- package/dist/r-suite-components.js.map +1 -1
- package/dist/rSuiteComponentsDescriptions-lX1mwx9_.js +67 -0
- package/dist/rSuiteComponentsDescriptions-lX1mwx9_.js.map +1 -0
- package/dist/radio-group.d.ts +1 -1
- package/dist/radio-group.js +10 -13
- package/dist/radio-group.js.map +1 -1
- package/dist/{rsuite-no-reset-rtl.min-af106e5c.js → rsuite-no-reset-rtl.min.css-B0vQWI16.js} +1 -1
- package/dist/rsuite-no-reset-rtl.min.css-B0vQWI16.js.map +1 -0
- package/dist/{rsuite-no-reset.min-3caeeea0.js → rsuite-no-reset.min.css-bW1P11UK.js} +1 -1
- package/dist/rsuite-no-reset.min.css-bW1P11UK.js.map +1 -0
- package/dist/search.d.ts +3 -3
- package/dist/search.js +33 -38
- package/dist/search.js.map +1 -1
- package/dist/static-content.js +4 -4
- package/dist/static-content.js.map +1 -1
- package/dist/stats.html +4 -0
- package/dist/tab.d.ts +2 -2
- package/dist/tab.js +29 -33
- package/dist/tab.js.map +1 -1
- package/dist/tag-picker.d.ts +1 -1
- package/dist/tag-picker.js +28 -31
- package/dist/tag-picker.js.map +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +10 -13
- package/dist/text-area.js.map +1 -1
- package/dist/time-picker.d.ts +2 -2
- package/dist/time-picker.js +39 -41
- package/dist/time-picker.js.map +1 -1
- package/dist/toggle.d.ts +2 -2
- package/dist/toggle.js +17 -20
- package/dist/toggle.js.map +1 -1
- package/dist/tooltip.d.ts +2 -2
- package/dist/tooltip.js +6 -6
- package/dist/tooltip.js.map +1 -1
- package/dist/uploader.d.ts +1 -1
- package/dist/uploader.js +30 -33
- package/dist/uploader.js.map +1 -1
- package/dist/useTouchOnEvent-BPYbKiku.js +12 -0
- package/dist/{useTouchOnEvent-2be3c60d.js.map → useTouchOnEvent-BPYbKiku.js.map} +1 -1
- package/dist/view-with-css.js +5 -62
- package/dist/view-with-css.js.map +1 -1
- package/dist/view.js +3 -57
- package/dist/view.js.map +1 -1
- package/dist/wizard.d.ts +4 -6
- package/dist/wizard.js +145 -162
- package/dist/wizard.js.map +1 -1
- package/package.json +6 -3
- package/dist/InputCell-f4236002.js +0 -21
- package/dist/WrappedInput-bc5a6d33.js +0 -11
- package/dist/dateTimeUtils-b07ce438.js +0 -26
- package/dist/formengine-rsuite-cbc1d3ae.js.map +0 -1
- package/dist/hooks-ff273a8a.js +0 -53
- package/dist/hooks-ff273a8a.js.map +0 -1
- package/dist/rSuiteComponentsDescriptions-d616cdc1.js +0 -17911
- package/dist/rSuiteComponentsDescriptions-d616cdc1.js.map +0 -1
- package/dist/rsuite-no-reset-rtl.min-af106e5c.js.map +0 -1
- package/dist/rsuite-no-reset.min-3caeeea0.js.map +0 -1
- package/dist/useTouchOnEvent-2be3c60d.js +0 -12
package/dist/checkbox.js
CHANGED
|
@@ -1,36 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import a from "@emotion/styled";
|
|
3
|
-
import { define as d, string as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { Checkbox as
|
|
6
|
-
import { r as
|
|
7
|
-
import { f as
|
|
8
|
-
import { r as
|
|
9
|
-
|
|
10
|
-
const b = a(l)`
|
|
3
|
+
import { define as i, event as d, string as r, boolean as o, disabled as m } from "@react-form-builder/core";
|
|
4
|
+
import { useMemo as f } from "react";
|
|
5
|
+
import { Checkbox as t } from "rsuite";
|
|
6
|
+
import { r as s } from "./commonProperties-ETOgvhCH.js";
|
|
7
|
+
import { f as c } from "./categories-_98lyB3C.js";
|
|
8
|
+
import { r as h } from "./Labeled-BWYRwMiY.js";
|
|
9
|
+
const u = a(t)`
|
|
11
10
|
&.required label::after {
|
|
12
|
-
${
|
|
11
|
+
${h};
|
|
13
12
|
}
|
|
14
|
-
`,
|
|
15
|
-
const
|
|
16
|
-
() =>
|
|
17
|
-
var r;
|
|
18
|
-
return (r = e.children) != null && r.length ? b : l;
|
|
19
|
-
},
|
|
13
|
+
`, b = (e) => {
|
|
14
|
+
const l = f(
|
|
15
|
+
() => e.children?.length ? u : t,
|
|
20
16
|
[e.children]
|
|
21
17
|
);
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
},
|
|
24
|
-
children:
|
|
18
|
+
return /* @__PURE__ */ n(l, { ...e });
|
|
19
|
+
}, R = i(b, "RsCheckbox").name("Checkbox").category(c).props({
|
|
20
|
+
children: r.default("Checkbox"),
|
|
25
21
|
checked: o.valued.default(!0).uncontrolledValue(!1),
|
|
26
22
|
disabled: m.default(!1),
|
|
27
|
-
readOnly:
|
|
23
|
+
readOnly: s,
|
|
28
24
|
indeterminate: o,
|
|
29
25
|
inline: o.default(!1),
|
|
30
|
-
title:
|
|
31
|
-
onChange:
|
|
26
|
+
title: r,
|
|
27
|
+
onChange: d
|
|
32
28
|
});
|
|
33
29
|
export {
|
|
34
|
-
|
|
30
|
+
R as rsCheckbox
|
|
35
31
|
};
|
|
36
32
|
//# 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 styled from '@emotion/styled'\nimport {boolean, define, disabled, event, string} from '@react-form-builder/core'\nimport {useMemo} from 'react'\nimport type {CheckboxProps} from 'rsuite'\nimport {Checkbox} from 'rsuite'\nimport {readOnly} from '../commonProperties'\nimport {fieldsCategory} from './categories'\nimport {requiredStyle} from './internal/Labeled'\n\nconst SCheckbox = styled(Checkbox)`\n &.required label::after {\n ${requiredStyle};\n }\n`\n\nconst RsCheckbox = (props: CheckboxProps<any>) => {\n const Component = useMemo(\n () => (props.children as string)?.length ? SCheckbox : Checkbox,\n [props.children])\n return <Component {...props}/>\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.default(true).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":["SCheckbox","styled","Checkbox","requiredStyle","RsCheckbox","props","Component","useMemo","
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../src/components/RsCheckbox.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport {boolean, define, disabled, event, string} from '@react-form-builder/core'\nimport {useMemo} from 'react'\nimport type {CheckboxProps} from 'rsuite'\nimport {Checkbox} from 'rsuite'\nimport {readOnly} from '../commonProperties'\nimport {fieldsCategory} from './categories'\nimport {requiredStyle} from './internal/Labeled'\n\nconst SCheckbox = styled(Checkbox)`\n &.required label::after {\n ${requiredStyle};\n }\n`\n\nconst RsCheckbox = (props: CheckboxProps<any>) => {\n const Component = useMemo(\n () => (props.children as string)?.length ? SCheckbox : Checkbox,\n [props.children])\n return <Component {...props}/>\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.default(true).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":["SCheckbox","styled","Checkbox","requiredStyle","RsCheckbox","props","Component","useMemo","jsx","rsCheckbox","define","fieldsCategory","string","boolean","disabled","readOnly","event"],"mappings":";;;;;;;;AASA,MAAMA,IAAYC,EAAOC,CAAQ;AAAA;AAAA,MAE3BC,CAAa;AAAA;AAAA,GAIbC,IAAa,CAACC,MAA8B;AAChD,QAAMC,IAAYC;AAAA,IAChB,MAAOF,EAAM,UAAqB,SAASL,IAAYE;AAAA,IACvD,CAACG,EAAM,QAAQ;AAAA,EAAA;AACjB,SAAO,gBAAAG,EAACF,GAAA,EAAW,GAAGD,EAAA,CAAM;AAC9B,GAEaI,IAAaC,EAAON,GAAY,YAAY,EACtD,KAAK,UAAU,EACf,SAASO,CAAc,EACvB,MAAM;AAAA,EACL,UAAUC,EAAO,QAAQ,UAAU;AAAA,EACnC,SAASC,EACN,OAAO,QAAQ,EAAI,EAAE,kBAAkB,EAAK;AAAA,EAC/C,UAAUC,EAAS,QAAQ,EAAK;AAAA,EAChC,UAAAC;AAAA,EACA,eAAeF;AAAA,EACf,QAAQA,EAAQ,QAAQ,EAAK;AAAA,EAC7B,OAAOD;AAAA,EACP,UAAUI;AACZ,CAAC;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const c =
|
|
1
|
+
import { event as e, readOnly as i, disabled as o, oneOf as a, string as t, number as r, color as f, boolean as l, array as s, toLabeledValues as u } from "@react-form-builder/core";
|
|
2
|
+
const c = r.withEditorProps({ min: 0 }), p = r.withEditorProps({ min: 1 }), b = a(
|
|
3
3
|
"bottomStart",
|
|
4
4
|
"bottomEnd",
|
|
5
5
|
"topStart",
|
|
@@ -22,11 +22,11 @@ const c = o.withEditorProps({ min: 0 }), p = o.withEditorProps({ min: 1 }), b =
|
|
|
22
22
|
textAlign: a("start", "center", "end").default("start").radio(),
|
|
23
23
|
fontSize: c.default(14),
|
|
24
24
|
fontWeight: a("lighter", "normal", "bold").default("normal"),
|
|
25
|
-
color:
|
|
26
|
-
}, n =
|
|
25
|
+
color: f
|
|
26
|
+
}, n = i.default(!1), g = {
|
|
27
27
|
placeholder: t,
|
|
28
28
|
size: d,
|
|
29
|
-
disabled:
|
|
29
|
+
disabled: o.default(!1),
|
|
30
30
|
readOnly: n,
|
|
31
31
|
onChange: e
|
|
32
32
|
}, E = a("h1", "h2", "h3", "h4", "h5", "h6").default("h4").withEditorProps({ creatable: !1 }), S = {
|
|
@@ -46,7 +46,7 @@ const c = o.withEditorProps({ min: 0 }), p = o.withEditorProps({ min: 1 }), b =
|
|
|
46
46
|
data: s,
|
|
47
47
|
cleanable: l.default(!0),
|
|
48
48
|
creatable: l.default(!1),
|
|
49
|
-
disabled:
|
|
49
|
+
disabled: o.default(!1),
|
|
50
50
|
readOnly: n,
|
|
51
51
|
groupBy: t.default(""),
|
|
52
52
|
disableVirtualized: l,
|
|
@@ -71,4 +71,4 @@ export {
|
|
|
71
71
|
d as s,
|
|
72
72
|
m as t
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=commonProperties-
|
|
74
|
+
//# sourceMappingURL=commonProperties-ETOgvhCH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commonProperties-
|
|
1
|
+
{"version":3,"file":"commonProperties-ETOgvhCH.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.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,\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,QAAQC,EAAgB,CAAC,SAAS,SAAS,OAAO,CAAC,CAAC;AAAA,EACjE,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;AAAA,EACN,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;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { ComponentLibraryDescription } from '@react-form-builder/core';
|
|
2
|
+
import { LanguageFullCode } from '@react-form-builder/core';
|
|
3
3
|
|
|
4
4
|
export declare const rSuiteComponentsDescriptions: Record<LanguageFullCode, ComponentLibraryDescription>;
|
|
5
5
|
|
package/dist/container.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import i from "@emotion/styled";
|
|
3
|
-
import { forwardRef as a, define as s,
|
|
4
|
-
import {
|
|
3
|
+
import { containerStyles as e, forwardRef as a, define as s, readOnly as d, disabled as l, node as c } from "@react-form-builder/core";
|
|
4
|
+
import { s as f } from "./categories-_98lyB3C.js";
|
|
5
5
|
const p = i.div`
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
@@ -9,9 +9,9 @@ const p = i.div`
|
|
|
9
9
|
const { disabled: x, readOnly: C, ...n } = r;
|
|
10
10
|
return /* @__PURE__ */ t(p, { ...n, ref: o });
|
|
11
11
|
}), R = s(u, "RsContainer").name("Container").category(f).kind("container").props({
|
|
12
|
-
children:
|
|
12
|
+
children: c,
|
|
13
13
|
disabled: l,
|
|
14
|
-
readOnly:
|
|
14
|
+
readOnly: d
|
|
15
15
|
}).css({
|
|
16
16
|
...e,
|
|
17
17
|
flexDirection: m.default("column"),
|
package/dist/container.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sources":["../src/components/RsContainer.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport {containerStyles, define, disabled, forwardRef, node, readOnly} from '@react-form-builder/core'\nimport type {ForwardedRef, ReactNode} from 'react'\nimport {structureCategory} from './categories'\n\nconst SDiv = styled.div`\n display: flex;\n flex-direction: column;\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\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, ...otherProps} = props\n return <SDiv {...otherProps} 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":["SDiv","styled","flexDirection","gap","containerStyles","RsContainer","forwardRef","props","ref","disabled","readOnly","otherProps","jsx","rsContainer","define","structureCategory","node"],"mappings":";;;;AAKA,MAAMA,IAAOC,EAAO;AAAA;AAAA;AAAA,GAId,EAAC,eAAAC,GAAe,KAAAC,
|
|
1
|
+
{"version":3,"file":"container.js","sources":["../src/components/RsContainer.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport {containerStyles, define, disabled, forwardRef, node, readOnly} from '@react-form-builder/core'\nimport type {ForwardedRef, ReactNode} from 'react'\nimport {structureCategory} from './categories'\n\nconst SDiv = styled.div`\n display: flex;\n flex-direction: column;\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\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, ...otherProps} = props\n return <SDiv {...otherProps} 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":["SDiv","styled","flexDirection","gap","containerStyles","RsContainer","forwardRef","props","ref","disabled","readOnly","otherProps","jsx","rsContainer","define","structureCategory","node"],"mappings":";;;;AAKA,MAAMA,IAAOC,EAAO;AAAA;AAAA;AAAA,GAId,EAAC,eAAAC,GAAe,KAAAC,EAAA,IAAOC,GAyBvBC,IAAcC,EAAW,CAACC,GAAyBC,MAA2B;AAClF,QAAM,EAAC,UAAAC,GAAU,UAAAC,GAAU,GAAGC,MAAcJ;AAC5C,SAAO,gBAAAK,EAACZ,GAAA,EAAM,GAAGW,GAAY,KAAAH,EAAA,CAAS;AACxC,CAAC,GAEYK,IAAcC,EAAOT,GAAa,aAAa,EACzD,KAAK,WAAW,EAChB,SAASU,CAAiB,EAC1B,KAAK,WAAW,EAChB,MAAM;AAAA,EACL,UAAUC;AAAA,EACV,UAAAP;AAAA,EACA,UAAAC;AACF,CAAC,EACA,IAAI;AAAA,EACH,GAAGN;AAAA,EACH,eAAeF,EAAc,QAAQ,QAAQ;AAAA,EAC7C,KAAKC,EAAI,QAAQ,MAAM;AACzB,CAAC;"}
|
package/dist/css-loader.js
CHANGED
|
@@ -3,13 +3,13 @@ const e = {
|
|
|
3
3
|
[s.LTR]: "rsuite-ltr-css",
|
|
4
4
|
[s.RTL]: "rsuite-rtl-css"
|
|
5
5
|
}, i = async () => {
|
|
6
|
-
const t = (await import("./rsuite-no-reset.min-
|
|
6
|
+
const t = (await import("./rsuite-no-reset.min.css-bW1P11UK.js")).default;
|
|
7
7
|
await r(e[s.LTR], t, "stylesheet"), a(e[s.RTL]);
|
|
8
8
|
}, c = async () => {
|
|
9
|
-
const t = (await import("./rsuite-no-reset-rtl.min-
|
|
9
|
+
const t = (await import("./rsuite-no-reset-rtl.min.css-B0vQWI16.js")).default;
|
|
10
10
|
await r(e[s.RTL], t, "stylesheet"), a(e[s.LTR]);
|
|
11
11
|
}, n = async () => {
|
|
12
|
-
const t = (await import("./formengine-rsuite-
|
|
12
|
+
const t = (await import("./formengine-rsuite.css-DkGUHOws.js")).default;
|
|
13
13
|
await r("form-engine-css", t, "stylesheet");
|
|
14
14
|
};
|
|
15
15
|
export {
|
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-no-reset.min.css?url')).default\n await loadResource(resourceIds[BiDi.LTR], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.RTL])\n}\n\n/**\n * Loads the Right-to-Left (RTL) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the RTL CSS has been loaded successfully.\n */\nexport const rtlCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset-rtl.min.css?url')).default\n await loadResource(resourceIds[BiDi.RTL], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.LTR])\n}\n\n/**\n * Loads FormEngine specific styles over \"rsuite\" library.\n * @returns the Promise that resolves when the custom styles have been loaded successfully.\n */\nexport const formEngineRsuiteCssLoader = async () => {\n const href = (await import('../public/css/formengine-rsuite.css?url')).default\n await loadResource('form-engine-css', href, 'stylesheet')\n}\n"],"names":["resourceIds","BiDi","ltrCssLoader","href","loadResource","unloadResource","rtlCssLoader","formEngineRsuiteCssLoader"],"mappings":";AAEA,MAAMA,IAAoC;AAAA,EACxC,CAACC,EAAK,GAAG,GAAG;AAAA,EACZ,CAACA,EAAK,GAAG,GAAG;AACd,GAMaC,IAAe,YAAY;AACtC,QAAMC,KAAQ,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"css-loader.js","sources":["../src/cssLoader.ts"],"sourcesContent":["import {BiDi, loadResource, unloadResource} from '@react-form-builder/core'\n\nconst resourceIds: Record<BiDi, string> = {\n [BiDi.LTR]: 'rsuite-ltr-css',\n [BiDi.RTL]: 'rsuite-rtl-css'\n}\n\n/**\n * Loads the Left-To-Right (LTR) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the LTR CSS has been loaded successfully.\n */\nexport const ltrCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset.min.css?url')).default\n await loadResource(resourceIds[BiDi.LTR], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.RTL])\n}\n\n/**\n * Loads the Right-to-Left (RTL) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the RTL CSS has been loaded successfully.\n */\nexport const rtlCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset-rtl.min.css?url')).default\n await loadResource(resourceIds[BiDi.RTL], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.LTR])\n}\n\n/**\n * Loads FormEngine specific styles over \"rsuite\" library.\n * @returns the Promise that resolves when the custom styles have been loaded successfully.\n */\nexport const formEngineRsuiteCssLoader = async () => {\n const href = (await import('../public/css/formengine-rsuite.css?url')).default\n await loadResource('form-engine-css', href, 'stylesheet')\n}\n"],"names":["resourceIds","BiDi","ltrCssLoader","href","loadResource","unloadResource","rtlCssLoader","formEngineRsuiteCssLoader"],"mappings":";AAEA,MAAMA,IAAoC;AAAA,EACxC,CAACC,EAAK,GAAG,GAAG;AAAA,EACZ,CAACA,EAAK,GAAG,GAAG;AACd,GAMaC,IAAe,YAAY;AACtC,QAAMC,KAAQ,MAAM,OAAO,uCAA2C,GAAG;AACzE,QAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC5DE,EAAeL,EAAYC,EAAK,GAAG,CAAC;AACtC,GAMaK,IAAe,YAAY;AACtC,QAAMH,KAAQ,MAAM,OAAO,2CAA+C,GAAG;AAC7E,QAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC5DE,EAAeL,EAAYC,EAAK,GAAG,CAAC;AACtC,GAMaM,IAA4B,YAAY;AACnD,QAAMJ,KAAQ,MAAM,OAAO,qCAAyC,GAAG;AACvE,QAAMC,EAAa,mBAAmBD,GAAM,YAAY;AAC1D;"}
|
package/dist/date-picker.d.ts
CHANGED
package/dist/date-picker.js
CHANGED
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { define as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { DatePicker as
|
|
5
|
-
import {
|
|
6
|
-
import { f as
|
|
7
|
-
import { f as
|
|
8
|
-
import { u as
|
|
9
|
-
import { L as
|
|
10
|
-
|
|
11
|
-
import "@emotion/react";
|
|
12
|
-
import "@emotion/styled";
|
|
13
|
-
const c = (o) => {
|
|
1
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { define as b, date as n, boolean as t, string as r, event as e, number as m, disabled as C, oneOf as T, useComponentData as y } from "@react-form-builder/core";
|
|
3
|
+
import { useMemo as p, useEffect as k } from "react";
|
|
4
|
+
import { DatePicker as w } from "rsuite";
|
|
5
|
+
import { s as M, p as O, r as P } from "./commonProperties-ETOgvhCH.js";
|
|
6
|
+
import { f as v, t as x } from "./dateTimeUtils-C2AEniv5.js";
|
|
7
|
+
import { f as V } from "./categories-_98lyB3C.js";
|
|
8
|
+
import { u as N } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
|
+
import { L as A } from "./Labeled-BWYRwMiY.js";
|
|
10
|
+
const u = (o) => {
|
|
14
11
|
if (typeof o == "string") {
|
|
15
12
|
const a = new Date(o);
|
|
16
13
|
return isNaN(a.getTime()) ? (console.error("Invalid date string:", o), null) : a;
|
|
17
14
|
}
|
|
18
15
|
return o;
|
|
19
|
-
},
|
|
20
|
-
const i =
|
|
21
|
-
return
|
|
22
|
-
var d;
|
|
16
|
+
}, F = ({ label: o, value: a, className: c, format: l, defaultValue: D, ...s }) => {
|
|
17
|
+
const i = y(), g = p(() => x(l), [l]), h = N(s, "onClean"), E = p(() => u(a), [a]);
|
|
18
|
+
return k(() => {
|
|
23
19
|
if (typeof a == "string") {
|
|
24
|
-
const
|
|
25
|
-
|
|
20
|
+
const d = u(a);
|
|
21
|
+
d instanceof Date && i.field?.setValue(d);
|
|
26
22
|
}
|
|
27
|
-
}, [a, i]), /* @__PURE__ */
|
|
28
|
-
},
|
|
23
|
+
}, [a, i]), /* @__PURE__ */ f(A, { label: o, className: c, passAriaToChildren: !0, children: /* @__PURE__ */ f(w, { ...s, value: E ?? D ?? null, format: g, onClean: h }) });
|
|
24
|
+
}, q = b(F, "RsDatePicker").name("DatePicker").category(V).props({
|
|
29
25
|
label: r.default("Date"),
|
|
30
26
|
appearance: T("default", "subtle").withEditorProps({ creatable: !1 }),
|
|
31
27
|
calendarDefaultDate: n,
|
|
32
28
|
cleanable: t.default(!1),
|
|
33
29
|
defaultOpen: t.default(!1),
|
|
34
30
|
defaultValue: n,
|
|
35
|
-
disabled:
|
|
36
|
-
readOnly:
|
|
31
|
+
disabled: C.default(!1),
|
|
32
|
+
readOnly: P,
|
|
37
33
|
editable: t.default(!0),
|
|
38
|
-
format: r.validated(
|
|
34
|
+
format: r.validated(v, {
|
|
39
35
|
code: "INVALID_DATE_FORMAT",
|
|
40
36
|
message: "The provided date format is invalid"
|
|
41
37
|
}).withEditorProps({ placeholder: "yyyy-MM-dd" }),
|
|
42
38
|
isoWeek: t.default(!1),
|
|
43
|
-
limitEndYear:
|
|
44
|
-
limitStartYear:
|
|
39
|
+
limitEndYear: m,
|
|
40
|
+
limitStartYear: m,
|
|
45
41
|
oneTap: t,
|
|
46
42
|
onChange: e,
|
|
47
43
|
onChangeCalendarDate: e,
|
|
@@ -62,14 +58,14 @@ const c = (o) => {
|
|
|
62
58
|
onToggleTimeDropdown: e,
|
|
63
59
|
open: t.default(void 0),
|
|
64
60
|
placeholder: r,
|
|
65
|
-
placement:
|
|
61
|
+
placement: O,
|
|
66
62
|
preventOverflow: t.default(!1),
|
|
67
63
|
showMeridiem: t.default(!1),
|
|
68
64
|
showWeekNumbers: t.default(!1),
|
|
69
|
-
size:
|
|
65
|
+
size: M,
|
|
70
66
|
value: n.valued
|
|
71
67
|
});
|
|
72
68
|
export {
|
|
73
|
-
|
|
69
|
+
q as rsDatePicker
|
|
74
70
|
};
|
|
75
71
|
//# sourceMappingURL=date-picker.js.map
|
package/dist/date-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sources":["../src/components/RsDatePicker.tsx"],"sourcesContent":["import {boolean, date, define, disabled, event, number, oneOf, string, useComponentData} from '@react-form-builder/core'\nimport {useEffect, useMemo} from 'react'\nimport type {DatePickerProps} from 'rsuite'\nimport {DatePicker} from 'rsuite'\nimport {placement, readOnly, size} from '../commonProperties'\nimport {formatValidator, toSafeFormat} from '../dateTimeUtils'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\n\n/**\n * Props for the RsDatePicker component.\n */\nexport interface RsDatePickerProps extends DatePickerProps {\n /**\n * Label for the date picker.\n */\n label: string\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: Date | null) => void\n /**\n * @deprecated\n */\n inline?: boolean\n}\n\n/**\n * Returns the date converted to Date format.\n * @param value the date value in string or Date format.\n * @returns the date converted to Date format.\n */\nconst parseDateValue = (value: any) => {\n if (typeof value === 'string') {\n const parsedDate = new Date(value)\n if (!isNaN(parsedDate.getTime())) {\n return parsedDate\n }\n console.error('Invalid date string:', value)\n return null\n }\n return value\n}\n\n/**\n * Date picker component with label support.\n * @param props the component props.\n * @param props.label the label for the date picker.\n * @param props.value the value of the date picker.\n * @param props.className the CSS class name.\n * @param props.format the format of the date.\n * @param props.defaultValue the default value of the date picker.\n * @param props.props the additional date picker props.\n * @returns the React element.\n */\nconst RsDatePicker = ({label, value, className, format, defaultValue, ...props}: RsDatePickerProps) => {\n const componentData = useComponentData()\n const safeFormat = useMemo(() => toSafeFormat(format), [format])\n const onClean = useTouchOnEvent(props, 'onClean')\n const parsedValue = useMemo(() => parseDateValue(value), [value])\n\n useEffect(() => {\n if (typeof (value as unknown) === 'string') {\n const parsed = parseDateValue(value)\n if (parsed instanceof Date) {\n componentData.field?.setValue(parsed)\n }\n }\n }, [value, componentData])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <DatePicker {...props} value={parsedValue ?? defaultValue ?? null} format={safeFormat} onClean={onClean}/>\n </Labeled>\n )\n}\n\nexport const rsDatePicker = define(RsDatePicker, 'RsDatePicker')\n .name('DatePicker')\n .category(fieldsCategory)\n .props({\n label: string.default('Date'),\n appearance: oneOf('default', 'subtle').withEditorProps({creatable: false}),\n calendarDefaultDate: date,\n cleanable: boolean.default(false),\n defaultOpen: boolean.default(false),\n defaultValue: date,\n disabled: disabled.default(false),\n readOnly,\n editable: boolean.default(true),\n format: string.validated(formatValidator, {\n code: 'INVALID_DATE_FORMAT',\n message: 'The provided date format is invalid'\n }).withEditorProps({placeholder: 'yyyy-MM-dd'}),\n isoWeek: boolean.default(false),\n limitEndYear: number,\n limitStartYear: number,\n oneTap: boolean,\n onChange: event,\n onChangeCalendarDate: event,\n onClean: event,\n onClose: event,\n onEnter: event,\n onEntered: event,\n onEntering: event,\n onExit: event,\n onExited: event,\n onExiting: event,\n onNextMonth: event,\n onOk: event,\n onOpen: event,\n onPrevMonth: event,\n onSelect: event,\n onToggleMonthDropdown: event,\n onToggleTimeDropdown: event,\n open: boolean.default(undefined),\n placeholder: string,\n placement: placement,\n preventOverflow: boolean.default(false),\n showMeridiem: boolean.default(false),\n showWeekNumbers: boolean.default(false),\n size: size,\n value: date.valued\n })\n"],"names":["parseDateValue","value","parsedDate","RsDatePicker","label","className","format","defaultValue","props","componentData","useComponentData","safeFormat","useMemo","toSafeFormat","onClean","useTouchOnEvent","parsedValue","useEffect","parsed","
|
|
1
|
+
{"version":3,"file":"date-picker.js","sources":["../src/components/RsDatePicker.tsx"],"sourcesContent":["import {boolean, date, define, disabled, event, number, oneOf, string, useComponentData} from '@react-form-builder/core'\nimport {useEffect, useMemo} from 'react'\nimport type {DatePickerProps} from 'rsuite'\nimport {DatePicker} from 'rsuite'\nimport {placement, readOnly, size} from '../commonProperties'\nimport {formatValidator, toSafeFormat} from '../dateTimeUtils'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\n\n/**\n * Props for the RsDatePicker component.\n */\nexport interface RsDatePickerProps extends DatePickerProps {\n /**\n * Label for the date picker.\n */\n label: string\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: Date | null) => void\n /**\n * @deprecated\n */\n inline?: boolean\n}\n\n/**\n * Returns the date converted to Date format.\n * @param value the date value in string or Date format.\n * @returns the date converted to Date format.\n */\nconst parseDateValue = (value: any) => {\n if (typeof value === 'string') {\n const parsedDate = new Date(value)\n if (!isNaN(parsedDate.getTime())) {\n return parsedDate\n }\n console.error('Invalid date string:', value)\n return null\n }\n return value\n}\n\n/**\n * Date picker component with label support.\n * @param props the component props.\n * @param props.label the label for the date picker.\n * @param props.value the value of the date picker.\n * @param props.className the CSS class name.\n * @param props.format the format of the date.\n * @param props.defaultValue the default value of the date picker.\n * @param props.props the additional date picker props.\n * @returns the React element.\n */\nconst RsDatePicker = ({label, value, className, format, defaultValue, ...props}: RsDatePickerProps) => {\n const componentData = useComponentData()\n const safeFormat = useMemo(() => toSafeFormat(format), [format])\n const onClean = useTouchOnEvent(props, 'onClean')\n const parsedValue = useMemo(() => parseDateValue(value), [value])\n\n useEffect(() => {\n if (typeof (value as unknown) === 'string') {\n const parsed = parseDateValue(value)\n if (parsed instanceof Date) {\n componentData.field?.setValue(parsed)\n }\n }\n }, [value, componentData])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <DatePicker {...props} value={parsedValue ?? defaultValue ?? null} format={safeFormat} onClean={onClean}/>\n </Labeled>\n )\n}\n\nexport const rsDatePicker = define(RsDatePicker, 'RsDatePicker')\n .name('DatePicker')\n .category(fieldsCategory)\n .props({\n label: string.default('Date'),\n appearance: oneOf('default', 'subtle').withEditorProps({creatable: false}),\n calendarDefaultDate: date,\n cleanable: boolean.default(false),\n defaultOpen: boolean.default(false),\n defaultValue: date,\n disabled: disabled.default(false),\n readOnly,\n editable: boolean.default(true),\n format: string.validated(formatValidator, {\n code: 'INVALID_DATE_FORMAT',\n message: 'The provided date format is invalid'\n }).withEditorProps({placeholder: 'yyyy-MM-dd'}),\n isoWeek: boolean.default(false),\n limitEndYear: number,\n limitStartYear: number,\n oneTap: boolean,\n onChange: event,\n onChangeCalendarDate: event,\n onClean: event,\n onClose: event,\n onEnter: event,\n onEntered: event,\n onEntering: event,\n onExit: event,\n onExited: event,\n onExiting: event,\n onNextMonth: event,\n onOk: event,\n onOpen: event,\n onPrevMonth: event,\n onSelect: event,\n onToggleMonthDropdown: event,\n onToggleTimeDropdown: event,\n open: boolean.default(undefined),\n placeholder: string,\n placement: placement,\n preventOverflow: boolean.default(false),\n showMeridiem: boolean.default(false),\n showWeekNumbers: boolean.default(false),\n size: size,\n value: date.valued\n })\n"],"names":["parseDateValue","value","parsedDate","RsDatePicker","label","className","format","defaultValue","props","componentData","useComponentData","safeFormat","useMemo","toSafeFormat","onClean","useTouchOnEvent","parsedValue","useEffect","parsed","Labeled","jsx","DatePicker","rsDatePicker","define","fieldsCategory","string","oneOf","date","boolean","disabled","readOnly","formatValidator","number","event","placement","size"],"mappings":";;;;;;;;;AAkCA,MAAMA,IAAiB,CAACC,MAAe;AACrC,MAAI,OAAOA,KAAU,UAAU;AAC7B,UAAMC,IAAa,IAAI,KAAKD,CAAK;AACjC,WAAK,MAAMC,EAAW,QAAA,CAAS,KAG/B,QAAQ,MAAM,wBAAwBD,CAAK,GACpC,QAHEC;AAAA,EAIX;AACA,SAAOD;AACT,GAaME,IAAe,CAAC,EAAC,OAAAC,GAAO,OAAAH,GAAO,WAAAI,GAAW,QAAAC,GAAQ,cAAAC,GAAc,GAAGC,QAA8B;AACrG,QAAMC,IAAgBC,EAAA,GAChBC,IAAaC,EAAQ,MAAMC,EAAaP,CAAM,GAAG,CAACA,CAAM,CAAC,GACzDQ,IAAUC,EAAgBP,GAAO,SAAS,GAC1CQ,IAAcJ,EAAQ,MAAMZ,EAAeC,CAAK,GAAG,CAACA,CAAK,CAAC;AAEhE,SAAAgB,EAAU,MAAM;AACd,QAAI,OAAQhB,KAAsB,UAAU;AAC1C,YAAMiB,IAASlB,EAAeC,CAAK;AACnC,MAAIiB,aAAkB,QACpBT,EAAc,OAAO,SAASS,CAAM;AAAA,IAExC;AAAA,EACF,GAAG,CAACjB,GAAOQ,CAAa,CAAC,qBAGtBU,GAAA,EAAQ,OAAAf,GAAc,WAAAC,GAAsB,oBAAoB,IAC/D,UAAA,gBAAAe,EAACC,GAAA,EAAY,GAAGb,GAAO,OAAOQ,KAAeT,KAAgB,MAAM,QAAQI,GAAY,SAAAG,GAAiB,GAC1G;AAEJ,GAEaQ,IAAeC,EAAOpB,GAAc,cAAc,EAC5D,KAAK,YAAY,EACjB,SAASqB,CAAc,EACvB,MAAM;AAAA,EACL,OAAOC,EAAO,QAAQ,MAAM;AAAA,EAC5B,YAAYC,EAAM,WAAW,QAAQ,EAAE,gBAAgB,EAAC,WAAW,IAAM;AAAA,EACzE,qBAAqBC;AAAA,EACrB,WAAWC,EAAQ,QAAQ,EAAK;AAAA,EAChC,aAAaA,EAAQ,QAAQ,EAAK;AAAA,EAClC,cAAcD;AAAA,EACd,UAAUE,EAAS,QAAQ,EAAK;AAAA,EAChC,UAAAC;AAAA,EACA,UAAUF,EAAQ,QAAQ,EAAI;AAAA,EAC9B,QAAQH,EAAO,UAAUM,GAAiB;AAAA,IACxC,MAAM;AAAA,IACN,SAAS;AAAA,EAAA,CACV,EAAE,gBAAgB,EAAC,aAAa,cAAa;AAAA,EAC9C,SAASH,EAAQ,QAAQ,EAAK;AAAA,EAC9B,cAAcI;AAAA,EACd,gBAAgBA;AAAA,EAChB,QAAQJ;AAAA,EACR,UAAUK;AAAA,EACV,sBAAsBA;AAAA,EACtB,SAASA;AAAA,EACT,SAASA;AAAA,EACT,SAASA;AAAA,EACT,WAAWA;AAAA,EACX,YAAYA;AAAA,EACZ,QAAQA;AAAA,EACR,UAAUA;AAAA,EACV,WAAWA;AAAA,EACX,aAAaA;AAAA,EACb,MAAMA;AAAA,EACN,QAAQA;AAAA,EACR,aAAaA;AAAA,EACb,UAAUA;AAAA,EACV,uBAAuBA;AAAA,EACvB,sBAAsBA;AAAA,EACtB,MAAML,EAAQ,QAAQ,MAAS;AAAA,EAC/B,aAAaH;AAAA,EACb,WAAAS;AAAA,EACA,iBAAiBN,EAAQ,QAAQ,EAAK;AAAA,EACtC,cAAcA,EAAQ,QAAQ,EAAK;AAAA,EACnC,iBAAiBA,EAAQ,QAAQ,EAAK;AAAA,EACtC,MAAAO;AAAA,EACA,OAAOR,EAAK;AACd,CAAC;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { format as e } from "date-fns";
|
|
2
|
+
const n = (r) => {
|
|
3
|
+
const t = r?.trim();
|
|
4
|
+
if (t) {
|
|
5
|
+
try {
|
|
6
|
+
e(/* @__PURE__ */ new Date(), t);
|
|
7
|
+
} catch {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
}, m = (r) => {
|
|
13
|
+
const t = r?.trim();
|
|
14
|
+
if (!t) return !0;
|
|
15
|
+
try {
|
|
16
|
+
return e(/* @__PURE__ */ new Date(), t), !0;
|
|
17
|
+
} catch {
|
|
18
|
+
return !1;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
m as f,
|
|
23
|
+
n as t
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=dateTimeUtils-C2AEniv5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateTimeUtils-
|
|
1
|
+
{"version":3,"file":"dateTimeUtils-C2AEniv5.js","sources":["../src/dateTimeUtils.ts"],"sourcesContent":["import {format as formatDate} from 'date-fns'\n\n/**\n * Checks whether the format is valid and returns it trimmed.\n * @param format the date format.\n * @returns the trimmed date format or undefined.\n */\nexport const toSafeFormat = (format?: string) => {\n const trimmed = format?.trim()\n if (!trimmed) return undefined\n\n try {\n // fixes RSuite issue v5.64.2, check on never version\n formatDate(new Date(), trimmed)\n } catch (e) {\n return undefined\n }\n\n return trimmed\n}\n\n/**\n * Checks whether the format is valid.\n * @param format the date format.\n * @returns true if the format is a valid, false otherwise.\n */\nexport const formatValidator = (format?: string) => {\n const trimmed = format?.trim()\n if (!trimmed) return true\n\n try {\n formatDate(new Date(), trimmed)\n return true\n } catch (e) {\n return false\n }\n}\n"],"names":["toSafeFormat","format","trimmed","formatDate","formatValidator"],"mappings":";AAOO,MAAMA,IAAe,CAACC,MAAoB;AAC/C,QAAMC,IAAUD,GAAQ,KAAA;AACxB,MAAKC,GAEL;AAAA,QAAI;AAEFC,MAAAA,EAAW,oBAAI,KAAA,GAAQD,CAAO;AAAA,IAChC,QAAY;AACV;AAAA,IACF;AAEA,WAAOA;AAAA;AACT,GAOaE,IAAkB,CAACH,MAAoB;AAClD,QAAMC,IAAUD,GAAQ,KAAA;AACxB,MAAI,CAACC,EAAS,QAAO;AAErB,MAAI;AACFC,WAAAA,EAAW,oBAAI,KAAA,GAAQD,CAAO,GACvB;AAAA,EACT,QAAY;AACV,WAAO;AAAA,EACT;AACF;"}
|
package/dist/definitions.js
CHANGED
|
@@ -1,59 +1,6 @@
|
|
|
1
1
|
import { rSuiteComponents as t } from "./r-suite-components.js";
|
|
2
|
-
|
|
3
|
-
import "./wizard.js";
|
|
4
|
-
import "@emotion/react/jsx-runtime";
|
|
5
|
-
import "@emotion/css";
|
|
6
|
-
import "@emotion/styled";
|
|
7
|
-
import "@react-form-builder/core";
|
|
8
|
-
import "react";
|
|
9
|
-
import "rsuite";
|
|
10
|
-
import "./hooks-ff273a8a.js";
|
|
11
|
-
import "./InputCell-f4236002.js";
|
|
12
|
-
import "./autocomplete.js";
|
|
13
|
-
import "./commonProperties-d849cd5b.js";
|
|
14
|
-
import "./Labeled-751c2353.js";
|
|
15
|
-
import "@emotion/react";
|
|
16
|
-
import "./breadcrumb.js";
|
|
17
|
-
import "./button.js";
|
|
18
|
-
import "./calendar.js";
|
|
19
|
-
import "./card.js";
|
|
20
|
-
import "./header.js";
|
|
21
|
-
import "./checkbox.js";
|
|
22
|
-
import "./container.js";
|
|
23
|
-
import "./date-picker.js";
|
|
24
|
-
import "./dateTimeUtils-b07ce438.js";
|
|
25
|
-
import "date-fns";
|
|
26
|
-
import "./useTouchOnEvent-2be3c60d.js";
|
|
27
|
-
import "./divider.js";
|
|
28
|
-
import "./dropdown.js";
|
|
29
|
-
import "./error-message.js";
|
|
30
|
-
import "./image.js";
|
|
31
|
-
import "./input.js";
|
|
32
|
-
import "@rsuite/icons";
|
|
33
|
-
import "./label.js";
|
|
34
|
-
import "./link.js";
|
|
35
|
-
import "./menu.js";
|
|
36
|
-
import "./message.js";
|
|
37
|
-
import "./modal.js";
|
|
38
|
-
import "./modal-layout.js";
|
|
39
|
-
import "./number-format.js";
|
|
40
|
-
import "react-number-format";
|
|
41
|
-
import "./WrappedInput-bc5a6d33.js";
|
|
42
|
-
import "./pattern-format.js";
|
|
43
|
-
import "./placeholder.js";
|
|
44
|
-
import "./progress.js";
|
|
45
|
-
import "./radio-group.js";
|
|
46
|
-
import "./search.js";
|
|
47
|
-
import "./static-content.js";
|
|
48
|
-
import "./tab.js";
|
|
49
|
-
import "./tag-picker.js";
|
|
50
|
-
import "./text-area.js";
|
|
51
|
-
import "./time-picker.js";
|
|
52
|
-
import "./toggle.js";
|
|
53
|
-
import "./tooltip.js";
|
|
54
|
-
import "./uploader.js";
|
|
55
|
-
const mo = t.map((o) => o.build());
|
|
2
|
+
const n = t.map((o) => o.build());
|
|
56
3
|
export {
|
|
57
|
-
|
|
4
|
+
n as components
|
|
58
5
|
};
|
|
59
6
|
//# sourceMappingURL=definitions.js.map
|
package/dist/definitions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sources":["../src/definitions.ts"],"sourcesContent":["import {rSuiteComponents} from './rSuiteComponents'\n\nexport const components = rSuiteComponents.map(def => def.build())\n"],"names":["components","rSuiteComponents","def"],"mappings":"
|
|
1
|
+
{"version":3,"file":"definitions.js","sources":["../src/definitions.ts"],"sourcesContent":["import {rSuiteComponents} from './rSuiteComponents'\n\nexport const components = rSuiteComponents.map(def => def.build())\n"],"names":["components","rSuiteComponents","def"],"mappings":";AAEO,MAAMA,IAAaC,EAAiB,IAAI,CAAAC,MAAOA,EAAI,OAAO;"}
|
package/dist/divider.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { define as o,
|
|
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
|
-
import {
|
|
5
|
-
const s = { width: 24, height: 24 }, c = () => /* @__PURE__ */ i("svg", { style: s, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("line", { x1: "4", y1: "10", x2: "16", y2: "10", stroke: "#9CA3AF", strokeWidth: "2", strokeLinecap: "round" }) }),
|
|
6
|
-
children:
|
|
7
|
-
vertical:
|
|
4
|
+
import { a as n } from "./categories-_98lyB3C.js";
|
|
5
|
+
const s = { width: 24, height: 24 }, c = () => /* @__PURE__ */ i("svg", { style: s, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ i("line", { x1: "4", y1: "10", x2: "16", y2: "10", stroke: "#9CA3AF", strokeWidth: "2", strokeLinecap: "round" }) }), p = o(t, "RsDivider").name("Divider").category(n).icon(c).props({
|
|
6
|
+
children: e,
|
|
7
|
+
vertical: r
|
|
8
8
|
});
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
p as rsDivider
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=divider.js.map
|
package/dist/divider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sources":["../src/components/RsDivider.tsx"],"sourcesContent":["import {boolean, define, string} from '@react-form-builder/core'\nimport {Divider} from 'rsuite'\nimport {staticCategory} from './categories'\n\nconst iconStyle = {width: 24, height: 24}\n\nconst Icon = () => (\n <svg style={iconStyle} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"4\" y1=\"10\" x2=\"16\" y2=\"10\" stroke=\"#9CA3AF\" strokeWidth=\"2\" strokeLinecap=\"round\"/>\n </svg>\n)\n\nexport const rsDivider = define(Divider, 'RsDivider')\n .name('Divider')\n .category(staticCategory)\n .icon(Icon)\n .props({\n children: string,\n vertical: boolean,\n })\n"],"names":["iconStyle","Icon","jsx","rsDivider","define","Divider","staticCategory","string","boolean"],"mappings":";;;;AAIA,MAAMA,IAAY,EAAC,OAAO,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"divider.js","sources":["../src/components/RsDivider.tsx"],"sourcesContent":["import {boolean, define, string} from '@react-form-builder/core'\nimport {Divider} from 'rsuite'\nimport {staticCategory} from './categories'\n\nconst iconStyle = {width: 24, height: 24}\n\nconst Icon = () => (\n <svg style={iconStyle} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"4\" y1=\"10\" x2=\"16\" y2=\"10\" stroke=\"#9CA3AF\" strokeWidth=\"2\" strokeLinecap=\"round\"/>\n </svg>\n)\n\nexport const rsDivider = define(Divider, 'RsDivider')\n .name('Divider')\n .category(staticCategory)\n .icon(Icon)\n .props({\n children: string,\n vertical: boolean,\n })\n"],"names":["iconStyle","Icon","jsx","rsDivider","define","Divider","staticCategory","string","boolean"],"mappings":";;;;AAIA,MAAMA,IAAY,EAAC,OAAO,IAAI,QAAQ,GAAA,GAEhCC,IAAO,MACX,gBAAAC,EAAC,OAAA,EAAI,OAAOF,GAAW,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAC3D,UAAA,gBAAAE,EAAC,QAAA,EAAK,IAAG,KAAI,IAAG,MAAK,IAAG,MAAK,IAAG,MAAK,QAAO,WAAU,aAAY,KAAI,eAAc,QAAA,CAAO,GAC7F,GAGWC,IAAYC,EAAOC,GAAS,WAAW,EACjD,KAAK,SAAS,EACd,SAASC,CAAc,EACvB,KAAKL,CAAI,EACT,MAAM;AAAA,EACL,UAAUM;AAAA,EACV,UAAUC;AACZ,CAAC;"}
|
package/dist/dropdown.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Definer } from '@react-form-builder/core';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { InputPickerProps } from 'rsuite';
|
|
3
|
+
import { ItemDataType } from 'rsuite/esm/internals/types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The callback function for loading data into the component.
|
|
@@ -14,7 +14,7 @@ declare type LoadCallback = (newData: ItemDataType[]) => void;
|
|
|
14
14
|
* @param loadCallback the callback function called to set the data in the component.
|
|
15
15
|
* @param currentDataLength the length of the data already loaded.
|
|
16
16
|
*/
|
|
17
|
-
declare type LoadDataHandler = (searchKeyword: string, loadCallback: LoadCallback, currentDataLength: number) =>
|
|
17
|
+
declare type LoadDataHandler = (searchKeyword: string, loadCallback: LoadCallback, currentDataLength: number) => void;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Interface for load data props.
|
package/dist/dropdown.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { jsxs as y, Fragment as k, jsx as o } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { define as x,
|
|
2
|
+
import { define as x, array as L, string as h, boolean as w, toLabeledValues as C } from "@react-form-builder/core";
|
|
3
3
|
import { useCallback as D } from "react";
|
|
4
4
|
import { Loader as P, InputPicker as j } from "rsuite";
|
|
5
|
-
import { b as v } from "./commonProperties-
|
|
6
|
-
import { u as A, a as F } from "./hooks-
|
|
7
|
-
import { f as R } from "./categories-
|
|
8
|
-
import { u as I } from "./useTouchOnEvent-
|
|
9
|
-
import { L as S } from "./Labeled-
|
|
5
|
+
import { b as v } from "./commonProperties-ETOgvhCH.js";
|
|
6
|
+
import { u as A, a as F } from "./hooks-DMVtrI-b.js";
|
|
7
|
+
import { f as R } from "./categories-_98lyB3C.js";
|
|
8
|
+
import { u as I } from "./useTouchOnEvent-BPYbKiku.js";
|
|
9
|
+
import { L as S } from "./Labeled-BWYRwMiY.js";
|
|
10
10
|
import T from "@emotion/styled";
|
|
11
|
-
import "@emotion/react";
|
|
12
11
|
const E = T(P)`
|
|
13
12
|
&& {
|
|
14
13
|
display: flex;
|
|
@@ -45,13 +44,13 @@ const E = T(P)`
|
|
|
45
44
|
renderMenu: b
|
|
46
45
|
}
|
|
47
46
|
) });
|
|
48
|
-
},
|
|
47
|
+
}, Q = x(M, "RsDropdown").name("Dropdown").category(R).props({
|
|
49
48
|
...v,
|
|
50
|
-
preload:
|
|
49
|
+
preload: w.default(!1),
|
|
51
50
|
label: h.default("Select"),
|
|
52
|
-
data:
|
|
51
|
+
data: L.default(C(["a", "b", "c"]))
|
|
53
52
|
});
|
|
54
53
|
export {
|
|
55
|
-
|
|
54
|
+
Q as rsDropdown
|
|
56
55
|
};
|
|
57
56
|
//# 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 styled from '@emotion/styled'\nimport {Loader} from 'rsuite'\n\nexport const SLoader = styled(Loader)`\n && {\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: 0;\n background: var(--rs-bg-overlay);\n width: 100%;\n padding-block: 10px;\n }\n`\n","import {array, boolean, define, string, toLabeledValues} from '@react-form-builder/core'\nimport type {ReactNode} from 'react'\nimport {useCallback} from 'react'\nimport type {InputPickerProps} from 'rsuite'\nimport {InputPicker} from 'rsuite'\nimport {pickerProps} from '../commonProperties'\nimport type {LoadDataProps} from '../hooks'\nimport {useFixAriaAttributesForInputPicker, useLoadData} from '../hooks'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\nimport {SLoader} from './internal/SLoader'\n\n/**\n * Props for the RsDropdown component.\n */\nexport interface RsDropdownProps extends InputPickerProps, LoadDataProps {\n /**\n * The label for the dropdown.\n */\n label: string\n /**\n * The htmlSize attribute defines the width of the «input> element.\n */\n htmlSize?: number\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: any) => void\n}\n\n/**\n * Dropdown component with label and data loading support.\n * @param props the component props.\n * @param props.data the data for the dropdown.\n * @param props.label the label for the dropdown.\n * @param props.onLoadData the callback for loading data.\n * @param props.onSearch the callback for search.\n * @param props.onOpen the callback for open.\n * @param props.value the value of the dropdown.\n * @param props.className the css class name.\n * @param props.preload whether to preload data.\n * @param props.disableVirtualized whether to disable virtualization.\n * @param props.props the additional dropdown props.\n * @returns the React element.\n */\nconst RsDropdown = ({\n data,\n label,\n onLoadData,\n onSearch,\n onOpen,\n value = '',\n className,\n preload,\n disableVirtualized,\n ...props\n }: RsDropdownProps) => {\n const {loading, ...loadProps} = useLoadData({data, onLoadData, onSearch, onOpen, value, preload, disableVirtualized})\n const onClean = useTouchOnEvent(props, 'onClean')\n const inputRef = useFixAriaAttributesForInputPicker()\n\n const renderMenu = useCallback((menu: ReactNode) => <>\n {menu}\n {loading && <SLoader/>}\n </>, [loading])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <InputPicker\n ref={inputRef}\n {...props}\n {...loadProps}\n onClean={onClean}\n renderMenu={renderMenu}\n />\n </Labeled>\n )\n}\n\nexport const rsDropdown = define(RsDropdown, 'RsDropdown')\n .name('Dropdown')\n .category(fieldsCategory)\n .props({\n ...pickerProps,\n preload: boolean.default(false),\n label: string.default('Select'),\n data: array.default(toLabeledValues(['a', 'b', 'c']))\n })\n"],"names":["SLoader","styled","Loader","RsDropdown","data","label","onLoadData","onSearch","onOpen","value","className","preload","disableVirtualized","props","loading","loadProps","useLoadData","onClean","useTouchOnEvent","inputRef","useFixAriaAttributesForInputPicker","renderMenu","useCallback","menu","jsxs","Fragment","jsx","Labeled","InputPicker","rsDropdown","define","fieldsCategory","pickerProps","boolean","string","array","toLabeledValues"],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.js","sources":["../src/components/internal/SLoader.tsx","../src/components/RsDropdown.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport {Loader} from 'rsuite'\n\nexport const SLoader = styled(Loader)`\n && {\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: 0;\n background: var(--rs-bg-overlay);\n width: 100%;\n padding-block: 10px;\n }\n`\n","import {array, boolean, define, string, toLabeledValues} from '@react-form-builder/core'\nimport type {ReactNode} from 'react'\nimport {useCallback} from 'react'\nimport type {InputPickerProps} from 'rsuite'\nimport {InputPicker} from 'rsuite'\nimport {pickerProps} from '../commonProperties'\nimport type {LoadDataProps} from '../hooks'\nimport {useFixAriaAttributesForInputPicker, useLoadData} from '../hooks'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\nimport {SLoader} from './internal/SLoader'\n\n/**\n * Props for the RsDropdown component.\n */\nexport interface RsDropdownProps extends InputPickerProps, LoadDataProps {\n /**\n * The label for the dropdown.\n */\n label: string\n /**\n * The htmlSize attribute defines the width of the «input> element.\n */\n htmlSize?: number\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: any) => void\n}\n\n/**\n * Dropdown component with label and data loading support.\n * @param props the component props.\n * @param props.data the data for the dropdown.\n * @param props.label the label for the dropdown.\n * @param props.onLoadData the callback for loading data.\n * @param props.onSearch the callback for search.\n * @param props.onOpen the callback for open.\n * @param props.value the value of the dropdown.\n * @param props.className the css class name.\n * @param props.preload whether to preload data.\n * @param props.disableVirtualized whether to disable virtualization.\n * @param props.props the additional dropdown props.\n * @returns the React element.\n */\nconst RsDropdown = ({\n data,\n label,\n onLoadData,\n onSearch,\n onOpen,\n value = '',\n className,\n preload,\n disableVirtualized,\n ...props\n }: RsDropdownProps) => {\n const {loading, ...loadProps} = useLoadData({data, onLoadData, onSearch, onOpen, value, preload, disableVirtualized})\n const onClean = useTouchOnEvent(props, 'onClean')\n const inputRef = useFixAriaAttributesForInputPicker()\n\n const renderMenu = useCallback((menu: ReactNode) => <>\n {menu}\n {loading && <SLoader/>}\n </>, [loading])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <InputPicker\n ref={inputRef}\n {...props}\n {...loadProps}\n onClean={onClean}\n renderMenu={renderMenu}\n />\n </Labeled>\n )\n}\n\nexport const rsDropdown = define(RsDropdown, 'RsDropdown')\n .name('Dropdown')\n .category(fieldsCategory)\n .props({\n ...pickerProps,\n preload: boolean.default(false),\n label: string.default('Select'),\n data: array.default(toLabeledValues(['a', 'b', 'c']))\n })\n"],"names":["SLoader","styled","Loader","RsDropdown","data","label","onLoadData","onSearch","onOpen","value","className","preload","disableVirtualized","props","loading","loadProps","useLoadData","onClean","useTouchOnEvent","inputRef","useFixAriaAttributesForInputPicker","renderMenu","useCallback","menu","jsxs","Fragment","jsx","Labeled","InputPicker","rsDropdown","define","fieldsCategory","pickerProps","boolean","string","array","toLabeledValues"],"mappings":";;;;;;;;;;AAGO,MAAMA,IAAUC,EAAOC,CAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GC4C9BC,IAAa,CAAC;AAAA,EACE,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,GAAGC;AACL,MAAuB;AACzC,QAAM,EAAC,SAAAC,GAAS,GAAGC,EAAA,IAAaC,EAAY,EAAC,MAAAZ,GAAM,YAAAE,GAAY,UAAAC,GAAU,QAAAC,GAAQ,OAAAC,GAAO,SAAAE,GAAS,oBAAAC,GAAmB,GAC9GK,IAAUC,EAAgBL,GAAO,SAAS,GAC1CM,IAAWC,EAAA,GAEXC,IAAaC,EAAY,CAACC,MAAoB,gBAAAC,EAAAC,GAAA,EACjD,UAAA;AAAA,IAAAF;AAAA,IACAT,uBAAYd,GAAA,CAAA,CAAO;AAAA,EAAA,GACtB,GAAK,CAACc,CAAO,CAAC;AAEd,SACE,gBAAAY,EAACC,GAAA,EAAQ,OAAAtB,GAAc,WAAAK,GAAsB,oBAAoB,IAC/D,UAAA,gBAAAgB;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,KAAKT;AAAA,MACJ,GAAGN;AAAA,MACH,GAAGE;AAAA,MACJ,SAAAE;AAAA,MACA,YAAAI;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ,GAEaQ,IAAaC,EAAO3B,GAAY,YAAY,EACtD,KAAK,UAAU,EACf,SAAS4B,CAAc,EACvB,MAAM;AAAA,EACL,GAAGC;AAAA,EACH,SAASC,EAAQ,QAAQ,EAAK;AAAA,EAC9B,OAAOC,EAAO,QAAQ,QAAQ;AAAA,EAC9B,MAAMC,EAAM,QAAQC,EAAgB,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;AACtD,CAAC;"}
|
package/dist/error-message.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Definer } from '@react-form-builder/core';
|
|
2
2
|
import { ErrorWrapperProps } from '@react-form-builder/core';
|
|
3
|
-
import
|
|
3
|
+
import { TypeAttributes } from 'rsuite/esm/internals/types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Metadata builder for rSuite-based error display component.
|
package/dist/error-message.js
CHANGED
|
@@ -3,8 +3,8 @@ import { cx as c } from "@emotion/css";
|
|
|
3
3
|
import e from "@emotion/styled";
|
|
4
4
|
import { define as p, string as l, useAriaErrorMessage as d } from "@react-form-builder/core";
|
|
5
5
|
import { Form as g } from "rsuite";
|
|
6
|
-
import { p as f } from "./commonProperties-
|
|
7
|
-
import {
|
|
6
|
+
import { p as f } from "./commonProperties-ETOgvhCH.js";
|
|
7
|
+
import { a as h } from "./categories-_98lyB3C.js";
|
|
8
8
|
const x = e.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|