@react-form-builder/components-rsuite 7.7.0 → 7.8.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.
Files changed (166) hide show
  1. package/dist/InputCell-f4236002.js +21 -0
  2. package/dist/InputCell-f4236002.js.map +1 -0
  3. package/dist/Labeled-751c2353.js +35 -0
  4. package/dist/Labeled-751c2353.js.map +1 -0
  5. package/dist/WrappedInput-bc5a6d33.js +11 -0
  6. package/dist/WrappedInput-bc5a6d33.js.map +1 -0
  7. package/dist/autocomplete.d.ts +30 -0
  8. package/dist/autocomplete.js +62 -0
  9. package/dist/autocomplete.js.map +1 -0
  10. package/dist/breadcrumb.d.ts +38 -0
  11. package/dist/breadcrumb.js +42 -0
  12. package/dist/breadcrumb.js.map +1 -0
  13. package/dist/builder-view-with-css.d.ts +9 -0
  14. package/dist/builder-view-with-css.js +66 -0
  15. package/dist/builder-view-with-css.js.map +1 -0
  16. package/dist/button.d.ts +6 -0
  17. package/dist/button.js +23 -0
  18. package/dist/button.js.map +1 -0
  19. package/dist/calendar.d.ts +20 -0
  20. package/dist/calendar.js +24 -0
  21. package/dist/calendar.js.map +1 -0
  22. package/dist/card.d.ts +20 -0
  23. package/dist/card.js +30 -0
  24. package/dist/card.js.map +1 -0
  25. package/dist/categories-7064b279.js +8 -0
  26. package/dist/categories-7064b279.js.map +1 -0
  27. package/dist/checkbox.d.ts +6 -0
  28. package/dist/checkbox.js +36 -0
  29. package/dist/checkbox.js.map +1 -0
  30. package/dist/commonProperties-d849cd5b.js +74 -0
  31. package/dist/commonProperties-d849cd5b.js.map +1 -0
  32. package/dist/components-descriptions.d.ts +6 -0
  33. package/dist/components-descriptions.js +5 -0
  34. package/dist/components-descriptions.js.map +1 -0
  35. package/dist/container.d.ts +25 -0
  36. package/dist/container.js +23 -0
  37. package/dist/container.js.map +1 -0
  38. package/dist/css/rsuite-no-reset-rtl.min.css +1 -1
  39. package/dist/css/rsuite-no-reset.min.css +1 -1
  40. package/dist/css-loader.d.ts +19 -0
  41. package/dist/css-loader.js +20 -0
  42. package/dist/css-loader.js.map +1 -0
  43. package/dist/date-picker.d.ts +25 -0
  44. package/dist/date-picker.js +75 -0
  45. package/dist/date-picker.js.map +1 -0
  46. package/dist/dateTimeUtils-b07ce438.js +26 -0
  47. package/dist/dateTimeUtils-b07ce438.js.map +1 -0
  48. package/dist/definitions.d.ts +5 -0
  49. package/dist/definitions.js +59 -0
  50. package/dist/definitions.js.map +1 -0
  51. package/dist/divider.d.ts +11 -0
  52. package/dist/divider.js +12 -0
  53. package/dist/divider.js.map +1 -0
  54. package/dist/dropdown.d.ts +58 -0
  55. package/dist/dropdown.js +57 -0
  56. package/dist/dropdown.js.map +1 -0
  57. package/dist/error-message.d.ts +20 -0
  58. package/dist/error-message.js +28 -0
  59. package/dist/error-message.js.map +1 -0
  60. package/dist/header.d.ts +69 -0
  61. package/dist/header.js +20 -0
  62. package/dist/header.js.map +1 -0
  63. package/dist/hooks-ff273a8a.js +53 -0
  64. package/dist/hooks-ff273a8a.js.map +1 -0
  65. package/dist/image.d.ts +22 -0
  66. package/dist/image.js +41 -0
  67. package/dist/image.js.map +1 -0
  68. package/dist/images/logo.svg +20 -0
  69. package/dist/index.d.ts +3 -0
  70. package/dist/index.js +116 -19516
  71. package/dist/index.js.map +1 -1
  72. package/dist/input.d.ts +32 -0
  73. package/dist/input.js +28 -0
  74. package/dist/input.js.map +1 -0
  75. package/dist/label.d.ts +47 -0
  76. package/dist/label.js +16 -0
  77. package/dist/label.js.map +1 -0
  78. package/dist/link.d.ts +56 -0
  79. package/dist/link.js +20 -0
  80. package/dist/link.js.map +1 -0
  81. package/dist/localization-wrapper.d.ts +164 -0
  82. package/dist/localization-wrapper.js +246 -0
  83. package/dist/localization-wrapper.js.map +1 -0
  84. package/dist/menu.d.ts +35 -0
  85. package/dist/menu.js +50 -0
  86. package/dist/menu.js.map +1 -0
  87. package/dist/message.d.ts +16 -0
  88. package/dist/message.js +18 -0
  89. package/dist/message.js.map +1 -0
  90. package/dist/modal-layout.d.ts +28 -0
  91. package/dist/modal-layout.js +21 -0
  92. package/dist/modal-layout.js.map +1 -0
  93. package/dist/modal.d.ts +16 -0
  94. package/dist/modal.js +27 -0
  95. package/dist/modal.js.map +1 -0
  96. package/dist/models.d.ts +8 -0
  97. package/dist/models.js +60 -0
  98. package/dist/models.js.map +1 -0
  99. package/dist/number-format.d.ts +25 -0
  100. package/dist/number-format.js +53 -0
  101. package/dist/number-format.js.map +1 -0
  102. package/dist/pattern-format.d.ts +25 -0
  103. package/dist/pattern-format.js +39 -0
  104. package/dist/pattern-format.js.map +1 -0
  105. package/dist/placeholder.d.ts +17 -0
  106. package/dist/placeholder.js +38 -0
  107. package/dist/placeholder.js.map +1 -0
  108. package/dist/progress.d.ts +14 -0
  109. package/dist/progress.js +27 -0
  110. package/dist/progress.js.map +1 -0
  111. package/dist/r-suite-components.d.ts +8 -0
  112. package/dist/r-suite-components.js +115 -0
  113. package/dist/r-suite-components.js.map +1 -0
  114. package/dist/rSuiteComponentsDescriptions-d616cdc1.js +17911 -0
  115. package/dist/rSuiteComponentsDescriptions-d616cdc1.js.map +1 -0
  116. package/dist/radio-group.d.ts +26 -0
  117. package/dist/radio-group.js +24 -0
  118. package/dist/radio-group.js.map +1 -0
  119. package/dist/rsuite-no-reset-rtl.min-af106e5c.js +5 -0
  120. package/dist/rsuite-no-reset-rtl.min-af106e5c.js.map +1 -0
  121. package/dist/rsuite-no-reset.min-3caeeea0.js +5 -0
  122. package/dist/rsuite-no-reset.min-3caeeea0.js.map +1 -0
  123. package/dist/search.d.ts +54 -0
  124. package/dist/search.js +60 -0
  125. package/dist/search.js.map +1 -0
  126. package/dist/static-content.d.ts +19 -0
  127. package/dist/static-content.js +15 -0
  128. package/dist/static-content.js.map +1 -0
  129. package/dist/tab.d.ts +39 -0
  130. package/dist/tab.js +59 -0
  131. package/dist/tab.js.map +1 -0
  132. package/dist/tag-picker.d.ts +21 -0
  133. package/dist/tag-picker.js +42 -0
  134. package/dist/tag-picker.js.map +1 -0
  135. package/dist/text-area.d.ts +24 -0
  136. package/dist/text-area.js +24 -0
  137. package/dist/text-area.js.map +1 -0
  138. package/dist/time-picker.d.ts +29 -0
  139. package/dist/time-picker.js +74 -0
  140. package/dist/time-picker.js.map +1 -0
  141. package/dist/toggle.d.ts +16 -0
  142. package/dist/toggle.js +29 -0
  143. package/dist/toggle.js.map +1 -0
  144. package/dist/tooltip.d.ts +29 -0
  145. package/dist/tooltip.js +37 -0
  146. package/dist/tooltip.js.map +1 -0
  147. package/dist/uploader.d.ts +20 -0
  148. package/dist/uploader.js +70 -0
  149. package/dist/uploader.js.map +1 -0
  150. package/dist/useTouchOnEvent-2be3c60d.js +12 -0
  151. package/dist/useTouchOnEvent-2be3c60d.js.map +1 -0
  152. package/dist/view-with-css.d.ts +9 -0
  153. package/dist/view-with-css.js +66 -0
  154. package/dist/view-with-css.js.map +1 -0
  155. package/dist/view.d.ts +8 -0
  156. package/dist/view.js +61 -0
  157. package/dist/view.js.map +1 -0
  158. package/dist/wizard.d.ts +88 -0
  159. package/dist/wizard.js +294 -0
  160. package/dist/wizard.js.map +1 -0
  161. package/package.json +191 -5
  162. package/dist/images/logo.png +0 -0
  163. package/dist/rsuite-no-reset-rtl.min-f9b04ca7.js +0 -5
  164. package/dist/rsuite-no-reset-rtl.min-f9b04ca7.js.map +0 -1
  165. package/dist/rsuite-no-reset.min-12eea714.js +0 -5
  166. package/dist/rsuite-no-reset.min-12eea714.js.map +0 -1
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Loads FormEngine specific styles over "rsuite" library.
3
+ * @returns the Promise that resolves when the custom styles have been loaded successfully.
4
+ */
5
+ export declare const formEngineRsuiteCssLoader: () => Promise<void>;
6
+
7
+ /**
8
+ * Loads the Left-To-Right (LTR) CSS for the "rsuite" library.
9
+ * @returns the Promise that resolves when the LTR CSS has been loaded successfully.
10
+ */
11
+ export declare const ltrCssLoader: () => Promise<void>;
12
+
13
+ /**
14
+ * Loads the Right-to-Left (RTL) CSS for the "rsuite" library.
15
+ * @returns the Promise that resolves when the RTL CSS has been loaded successfully.
16
+ */
17
+ export declare const rtlCssLoader: () => Promise<void>;
18
+
19
+ export { }
@@ -0,0 +1,20 @@
1
+ import { BiDi as s, loadResource as r, unloadResource as a } from "@react-form-builder/core";
2
+ const e = {
3
+ [s.LTR]: "rsuite-ltr-css",
4
+ [s.RTL]: "rsuite-rtl-css"
5
+ }, i = async () => {
6
+ const t = (await import("./rsuite-no-reset.min-3caeeea0.js")).default;
7
+ await r(e[s.LTR], t, "stylesheet"), a(e[s.RTL]);
8
+ }, c = async () => {
9
+ const t = (await import("./rsuite-no-reset-rtl.min-af106e5c.js")).default;
10
+ await r(e[s.RTL], t, "stylesheet"), a(e[s.LTR]);
11
+ }, n = async () => {
12
+ const t = (await import("./formengine-rsuite-cbc1d3ae.js")).default;
13
+ await r("form-engine-css", t, "stylesheet");
14
+ };
15
+ export {
16
+ n as formEngineRsuiteCssLoader,
17
+ i as ltrCssLoader,
18
+ c as rtlCssLoader
19
+ };
20
+ //# sourceMappingURL=css-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-loader.js","sources":["../src/cssLoader.ts"],"sourcesContent":["import {BiDi, loadResource, unloadResource} from '@react-form-builder/core'\n\nconst resourceIds: Record<BiDi, string> = {\n [BiDi.LTR]: 'rsuite-ltr-css',\n [BiDi.RTL]: 'rsuite-rtl-css'\n}\n\n/**\n * Loads the Left-To-Right (LTR) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the LTR CSS has been loaded successfully.\n */\nexport const ltrCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset.min.css?url')).default\n await loadResource(resourceIds[BiDi.LTR], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.RTL])\n}\n\n/**\n * Loads the Right-to-Left (RTL) CSS for the \"rsuite\" library.\n * @returns the Promise that resolves when the RTL CSS has been loaded successfully.\n */\nexport const rtlCssLoader = async () => {\n const href = (await import('../public/css/rsuite-no-reset-rtl.min.css?url')).default\n await loadResource(resourceIds[BiDi.RTL], href, 'stylesheet')\n unloadResource(resourceIds[BiDi.LTR])\n}\n\n/**\n * Loads FormEngine specific styles over \"rsuite\" library.\n * @returns the Promise that resolves when the custom styles have been loaded successfully.\n */\nexport const formEngineRsuiteCssLoader = async () => {\n const href = (await import('../public/css/formengine-rsuite.css?url')).default\n await loadResource('form-engine-css', href, 'stylesheet')\n}\n"],"names":["resourceIds","BiDi","ltrCssLoader","href","loadResource","unloadResource","rtlCssLoader","formEngineRsuiteCssLoader"],"mappings":";AAEA,MAAMA,IAAoC;AAAA,EACxC,CAACC,EAAK,GAAG,GAAG;AAAA,EACZ,CAACA,EAAK,GAAG,GAAG;AACd,GAMaC,IAAe,YAAY;AACtC,QAAMC,KAAQ,MAAM,OAAO,mCAA2C,GAAG;AACzE,QAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC7CE,EAAAL,EAAYC,EAAK,GAAG,CAAC;AACtC,GAMaK,IAAe,YAAY;AACtC,QAAMH,KAAQ,MAAM,OAAO,uCAA+C,GAAG;AAC7E,QAAMC,EAAaJ,EAAYC,EAAK,GAAG,GAAGE,GAAM,YAAY,GAC7CE,EAAAL,EAAYC,EAAK,GAAG,CAAC;AACtC,GAMaM,IAA4B,YAAY;AACnD,QAAMJ,KAAQ,MAAM,OAAO,iCAAyC,GAAG;AACjE,QAAAC,EAAa,mBAAmBD,GAAM,YAAY;AAC1D;"}
@@ -0,0 +1,25 @@
1
+ import type { DatePickerProps } from 'rsuite';
2
+ import { Definer } from '@react-form-builder/core';
3
+
4
+ export declare const rsDatePicker: Definer<RsDatePickerProps>;
5
+
6
+ /**
7
+ * Props for the RsDatePicker component.
8
+ */
9
+ export declare interface RsDatePickerProps extends DatePickerProps {
10
+ /**
11
+ * Label for the date picker.
12
+ */
13
+ label: string;
14
+ /**
15
+ * Called after the value has been changed.
16
+ * @param value the value.
17
+ */
18
+ onChange?: (value: Date | null) => void;
19
+ /**
20
+ * @deprecated
21
+ */
22
+ inline?: boolean;
23
+ }
24
+
25
+ export { }
@@ -0,0 +1,75 @@
1
+ import { jsx as m } from "@emotion/react/jsx-runtime";
2
+ import { define as C, string as r, oneOf as T, date as n, boolean as t, disabled as y, number as p, event as e, useComponentData as k } from "@react-form-builder/core";
3
+ import { useMemo as u, useEffect as w } from "react";
4
+ import { DatePicker as M } from "rsuite";
5
+ import { r as O, p as P, s as v } from "./commonProperties-d849cd5b.js";
6
+ import { f as x, t as V } from "./dateTimeUtils-b07ce438.js";
7
+ import { f as N } from "./categories-7064b279.js";
8
+ import { u as A } from "./useTouchOnEvent-2be3c60d.js";
9
+ import { L as F } from "./Labeled-751c2353.js";
10
+ import "date-fns";
11
+ import "@emotion/react";
12
+ import "@emotion/styled";
13
+ const c = (o) => {
14
+ if (typeof o == "string") {
15
+ const a = new Date(o);
16
+ return isNaN(a.getTime()) ? (console.error("Invalid date string:", o), null) : a;
17
+ }
18
+ return o;
19
+ }, I = ({ label: o, value: a, className: D, format: l, defaultValue: g, ...s }) => {
20
+ const i = k(), h = u(() => V(l), [l]), E = A(s, "onClean"), b = u(() => c(a), [a]);
21
+ return w(() => {
22
+ var d;
23
+ if (typeof a == "string") {
24
+ const f = c(a);
25
+ f instanceof Date && ((d = i.field) == null || d.setValue(f));
26
+ }
27
+ }, [a, i]), /* @__PURE__ */ m(F, { label: o, className: D, passAriaToChildren: !0, children: /* @__PURE__ */ m(M, { ...s, value: b ?? g ?? null, format: h, onClean: E }) });
28
+ }, J = C(I, "RsDatePicker").name("DatePicker").category(N).props({
29
+ label: r.default("Date"),
30
+ appearance: T("default", "subtle").withEditorProps({ creatable: !1 }),
31
+ calendarDefaultDate: n,
32
+ cleanable: t.default(!1),
33
+ defaultOpen: t.default(!1),
34
+ defaultValue: n,
35
+ disabled: y.default(!1),
36
+ readOnly: O,
37
+ editable: t.default(!0),
38
+ format: r.validated(x, {
39
+ code: "INVALID_DATE_FORMAT",
40
+ message: "The provided date format is invalid"
41
+ }).withEditorProps({ placeholder: "yyyy-MM-dd" }),
42
+ isoWeek: t.default(!1),
43
+ limitEndYear: p,
44
+ limitStartYear: p,
45
+ oneTap: t,
46
+ onChange: e,
47
+ onChangeCalendarDate: e,
48
+ onClean: e,
49
+ onClose: e,
50
+ onEnter: e,
51
+ onEntered: e,
52
+ onEntering: e,
53
+ onExit: e,
54
+ onExited: e,
55
+ onExiting: e,
56
+ onNextMonth: e,
57
+ onOk: e,
58
+ onOpen: e,
59
+ onPrevMonth: e,
60
+ onSelect: e,
61
+ onToggleMonthDropdown: e,
62
+ onToggleTimeDropdown: e,
63
+ open: t.default(void 0),
64
+ placeholder: r,
65
+ placement: P,
66
+ preventOverflow: t.default(!1),
67
+ showMeridiem: t.default(!1),
68
+ showWeekNumbers: t.default(!1),
69
+ size: v,
70
+ value: n.valued
71
+ });
72
+ export {
73
+ J as rsDatePicker
74
+ };
75
+ //# sourceMappingURL=date-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.js","sources":["../src/components/RsDatePicker.tsx"],"sourcesContent":["import {boolean, date, define, disabled, event, number, oneOf, string, useComponentData} from '@react-form-builder/core'\nimport {useEffect, useMemo} from 'react'\nimport type {DatePickerProps} from 'rsuite'\nimport {DatePicker} from 'rsuite'\nimport {placement, readOnly, size} from '../commonProperties'\nimport {formatValidator, toSafeFormat} from '../dateTimeUtils'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\n\n/**\n * Props for the RsDatePicker component.\n */\nexport interface RsDatePickerProps extends DatePickerProps {\n /**\n * Label for the date picker.\n */\n label: string\n /**\n * Called after the value has been changed.\n * @param value the value.\n */\n onChange?: (value: Date | null) => void\n /**\n * @deprecated\n */\n inline?: boolean\n}\n\n/**\n * Returns the date converted to Date format.\n * @param value the date value in string or Date format.\n * @returns the date converted to Date format.\n */\nconst parseDateValue = (value: any) => {\n if (typeof value === 'string') {\n const parsedDate = new Date(value)\n if (!isNaN(parsedDate.getTime())) {\n return parsedDate\n }\n console.error('Invalid date string:', value)\n return null\n }\n return value\n}\n\n/**\n * Date picker component with label support.\n * @param props the component props.\n * @param props.label the label for the date picker.\n * @param props.value the value of the date picker.\n * @param props.className the CSS class name.\n * @param props.format the format of the date.\n * @param props.defaultValue the default value of the date picker.\n * @param props.props the additional date picker props.\n * @returns the React element.\n */\nconst RsDatePicker = ({label, value, className, format, defaultValue, ...props}: RsDatePickerProps) => {\n const componentData = useComponentData()\n const safeFormat = useMemo(() => toSafeFormat(format), [format])\n const onClean = useTouchOnEvent(props, 'onClean')\n const parsedValue = useMemo(() => parseDateValue(value), [value])\n\n useEffect(() => {\n if (typeof (value as unknown) === 'string') {\n const parsed = parseDateValue(value)\n if (parsed instanceof Date) {\n componentData.field?.setValue(parsed)\n }\n }\n }, [value, componentData])\n\n return (\n <Labeled label={label} className={className} passAriaToChildren={true}>\n <DatePicker {...props} value={parsedValue ?? defaultValue ?? null} format={safeFormat} onClean={onClean}/>\n </Labeled>\n )\n}\n\nexport const rsDatePicker = define(RsDatePicker, 'RsDatePicker')\n .name('DatePicker')\n .category(fieldsCategory)\n .props({\n label: string.default('Date'),\n appearance: oneOf('default', 'subtle').withEditorProps({creatable: false}),\n calendarDefaultDate: date,\n cleanable: boolean.default(false),\n defaultOpen: boolean.default(false),\n defaultValue: date,\n disabled: disabled.default(false),\n readOnly,\n editable: boolean.default(true),\n format: string.validated(formatValidator, {\n code: 'INVALID_DATE_FORMAT',\n message: 'The provided date format is invalid'\n }).withEditorProps({placeholder: 'yyyy-MM-dd'}),\n isoWeek: boolean.default(false),\n limitEndYear: number,\n limitStartYear: number,\n oneTap: boolean,\n onChange: event,\n onChangeCalendarDate: event,\n onClean: event,\n onClose: event,\n onEnter: event,\n onEntered: event,\n onEntering: event,\n onExit: event,\n onExited: event,\n onExiting: event,\n onNextMonth: event,\n onOk: event,\n onOpen: event,\n onPrevMonth: event,\n onSelect: event,\n onToggleMonthDropdown: event,\n onToggleTimeDropdown: event,\n open: boolean.default(undefined),\n placeholder: string,\n placement: placement,\n preventOverflow: boolean.default(false),\n showMeridiem: boolean.default(false),\n showWeekNumbers: boolean.default(false),\n size: size,\n value: date.valued\n })\n"],"names":["parseDateValue","value","parsedDate","RsDatePicker","label","className","format","defaultValue","props","componentData","useComponentData","safeFormat","useMemo","toSafeFormat","onClean","useTouchOnEvent","parsedValue","useEffect","parsed","_a","Labeled","jsx","DatePicker","rsDatePicker","define","fieldsCategory","string","oneOf","date","boolean","disabled","readOnly","formatValidator","number","event","placement","size"],"mappings":";;;;;;;;;;;;AAkCA,MAAMA,IAAiB,CAACC,MAAe;AACjC,MAAA,OAAOA,KAAU,UAAU;AACvB,UAAAC,IAAa,IAAI,KAAKD,CAAK;AACjC,WAAK,MAAMC,EAAW,QAAS,CAAA,KAGvB,QAAA,MAAM,wBAAwBD,CAAK,GACpC,QAHEC;AAAA,EAIX;AACO,SAAAD;AACT,GAaME,IAAe,CAAC,EAAC,OAAAC,GAAO,OAAAH,GAAO,WAAAI,GAAW,QAAAC,GAAQ,cAAAC,GAAc,GAAGC,QAA8B;AACrG,QAAMC,IAAgBC,KAChBC,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;;AACV,QAAA,OAAQhB,KAAsB,UAAU;AACpC,YAAAiB,IAASlB,EAAeC,CAAK;AACnC,MAAIiB,aAAkB,UACNC,IAAAV,EAAA,UAAA,QAAAU,EAAO,SAASD;AAAA,IAElC;AAAA,EAAA,GACC,CAACjB,GAAOQ,CAAa,CAAC,qBAGtBW,GAAQ,EAAA,OAAAhB,GAAc,WAAAC,GAAsB,oBAAoB,IAC/D,UAAC,gBAAAgB,EAAAC,GAAA,EAAY,GAAGd,GAAO,OAAOQ,KAAeT,KAAgB,MAAM,QAAQI,GAAY,SAAAG,GAAiB,EAC1G,CAAA;AAEJ,GAEaS,IAAeC,EAAOrB,GAAc,cAAc,EAC5D,KAAK,YAAY,EACjB,SAASsB,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,EACV,CAAA,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,26 @@
1
+ import { format as r } from "date-fns";
2
+ const c = (t) => {
3
+ const e = t == null ? void 0 : t.trim();
4
+ if (e) {
5
+ try {
6
+ r(/* @__PURE__ */ new Date(), e);
7
+ } catch {
8
+ return;
9
+ }
10
+ return e;
11
+ }
12
+ }, u = (t) => {
13
+ const e = t == null ? void 0 : t.trim();
14
+ if (!e)
15
+ return !0;
16
+ try {
17
+ return r(/* @__PURE__ */ new Date(), e), !0;
18
+ } catch {
19
+ return !1;
20
+ }
21
+ };
22
+ export {
23
+ u as f,
24
+ c as t
25
+ };
26
+ //# sourceMappingURL=dateTimeUtils-b07ce438.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTimeUtils-b07ce438.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":";AAOa,MAAAA,IAAe,CAACC,MAAoB;AACzC,QAAAC,IAAUD,KAAAA,gBAAAA,EAAQ;AACxB,MAAKC,GAED;AAAA,QAAA;AAESC,MAAAA,EAAA,oBAAI,QAAQD,CAAO;AAAA,YACpB;AACH;AAAA,IACT;AAEO,WAAAA;AAAA;AACT,GAOaE,IAAkB,CAACH,MAAoB;AAC5C,QAAAC,IAAUD,KAAAA,gBAAAA,EAAQ;AACxB,MAAI,CAACC;AAAgB,WAAA;AAEjB,MAAA;AACSC,WAAAA,EAAA,oBAAI,QAAQD,CAAO,GACvB;AAAA,UACG;AACH,WAAA;AAAA,EACT;AACF;"}
@@ -0,0 +1,5 @@
1
+ import { BuilderComponent } from '@react-form-builder/core';
2
+
3
+ export declare const components: BuilderComponent[];
4
+
5
+ export { }
@@ -0,0 +1,59 @@
1
+ import { rSuiteComponents as t } from "./r-suite-components.js";
2
+ import "./categories-7064b279.js";
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());
56
+ export {
57
+ mo as components
58
+ };
59
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sources":["../src/definitions.ts"],"sourcesContent":["import {rSuiteComponents} from './rSuiteComponents'\n\nexport const components = rSuiteComponents.map(def => def.build())\n"],"names":["components","rSuiteComponents","def"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,KAAaC,EAAiB,IAAI,CAAOC,MAAAA,EAAI,MAAO,CAAA;"}
@@ -0,0 +1,11 @@
1
+ import { Definer } from '@react-form-builder/core';
2
+ import { DividerProps } from 'rsuite';
3
+ import { ElementType } from 'react';
4
+ import { JSX } from 'react';
5
+ import { PropsWithChildren } from 'react';
6
+ import { ReplaceProps } from 'rsuite/esm/internals/types/utils';
7
+ import { WithAsProps } from 'rsuite/esm/internals/types';
8
+
9
+ export declare const rsDivider: Definer<PropsWithChildren<ReplaceProps<ElementType<any, keyof JSX.IntrinsicElements>, WithAsProps<ElementType<any, keyof JSX.IntrinsicElements>> & DividerProps>>>;
10
+
11
+ export { }
@@ -0,0 +1,12 @@
1
+ import { jsx as i } from "@emotion/react/jsx-runtime";
2
+ import { define as o, string as r, boolean as e } from "@react-form-builder/core";
3
+ import { Divider as t } from "rsuite";
4
+ import { s as n } from "./categories-7064b279.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" }) }), a = o(t, "RsDivider").name("Divider").category(n).icon(c).props({
6
+ children: r,
7
+ vertical: e
8
+ });
9
+ export {
10
+ a as rsDivider
11
+ };
12
+ //# sourceMappingURL=divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.js","sources":["../src/components/RsDivider.tsx"],"sourcesContent":["import {boolean, define, string} from '@react-form-builder/core'\nimport {Divider} from 'rsuite'\nimport {staticCategory} from './categories'\n\nconst iconStyle = {width: 24, height: 24}\n\nconst Icon = () => (\n <svg style={iconStyle} viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <line x1=\"4\" y1=\"10\" x2=\"16\" y2=\"10\" stroke=\"#9CA3AF\" strokeWidth=\"2\" strokeLinecap=\"round\"/>\n </svg>\n)\n\nexport const rsDivider = define(Divider, 'RsDivider')\n .name('Divider')\n .category(staticCategory)\n .icon(Icon)\n .props({\n children: string,\n vertical: boolean,\n })\n"],"names":["iconStyle","Icon","jsx","rsDivider","define","Divider","staticCategory","string","boolean"],"mappings":";;;;AAIA,MAAMA,IAAY,EAAC,OAAO,IAAI,QAAQ,GAAE,GAElCC,IAAO,MACV,gBAAAC,EAAA,OAAA,EAAI,OAAOF,GAAW,SAAQ,aAAY,MAAK,QAAO,OAAM,8BAC3D,UAAC,gBAAAE,EAAA,QAAA,EAAK,IAAG,KAAI,IAAG,MAAK,IAAG,MAAK,IAAG,MAAK,QAAO,WAAU,aAAY,KAAI,eAAc,QAAA,CAAO,EAC7F,CAAA,GAGWC,IAAYC,EAAOC,GAAS,WAAW,EACjD,KAAK,SAAS,EACd,SAASC,CAAc,EACvB,KAAKL,CAAI,EACT,MAAM;AAAA,EACL,UAAUM;AAAA,EACV,UAAUC;AACZ,CAAC;"}
@@ -0,0 +1,58 @@
1
+ import { Definer } from '@react-form-builder/core';
2
+ import type { InputPickerProps } from 'rsuite';
3
+ import type { ItemDataType } from 'rsuite/esm/internals/types';
4
+
5
+ /**
6
+ * The callback function for loading data into the component.
7
+ * @param newData the new data to be loaded into the component.
8
+ */
9
+ declare type LoadCallback = (newData: ItemDataType[]) => void;
10
+
11
+ /**
12
+ * Describes a function that is called when data is to be loaded into the component.
13
+ * @param searchKeyword the current search value.
14
+ * @param loadCallback the callback function called to set the data in the component.
15
+ * @param currentDataLength the length of the data already loaded.
16
+ */
17
+ declare type LoadDataHandler = (searchKeyword: string, loadCallback: LoadCallback, currentDataLength: number) => {};
18
+
19
+ /**
20
+ * Interface for load data props.
21
+ */
22
+ declare interface LoadDataProps {
23
+ /**
24
+ * The callback function called when data should be load.
25
+ */
26
+ onLoadData?: LoadDataHandler;
27
+ /**
28
+ * Flag, if true, the data will be loaded in advance, before opening the dropdown, false otherwise.
29
+ */
30
+ preload?: boolean;
31
+ /**
32
+ * Flag, if true, the virtualized will be disabled, false otherwise.
33
+ */
34
+ disableVirtualized?: boolean;
35
+ }
36
+
37
+ export declare const rsDropdown: Definer<RsDropdownProps>;
38
+
39
+ /**
40
+ * Props for the RsDropdown component.
41
+ */
42
+ export declare interface RsDropdownProps extends InputPickerProps, LoadDataProps {
43
+ /**
44
+ * The label for the dropdown.
45
+ */
46
+ label: string;
47
+ /**
48
+ * The htmlSize attribute defines the width of the &laquo;input> element.
49
+ */
50
+ htmlSize?: number;
51
+ /**
52
+ * Called after the value has been changed.
53
+ * @param value the value.
54
+ */
55
+ onChange?: (value: any) => void;
56
+ }
57
+
58
+ export { }
@@ -0,0 +1,57 @@
1
+ import { jsxs as y, Fragment as k, jsx as o } from "@emotion/react/jsx-runtime";
2
+ import { define as x, boolean as L, string as h, array as w, toLabeledValues as C } from "@react-form-builder/core";
3
+ import { useCallback as D } from "react";
4
+ import { Loader as P, InputPicker as j } from "rsuite";
5
+ import { b as v } from "./commonProperties-d849cd5b.js";
6
+ import { u as A, a as F } from "./hooks-ff273a8a.js";
7
+ import { f as R } from "./categories-7064b279.js";
8
+ import { u as I } from "./useTouchOnEvent-2be3c60d.js";
9
+ import { L as S } from "./Labeled-751c2353.js";
10
+ import T from "@emotion/styled";
11
+ import "@emotion/react";
12
+ const E = T(P)`
13
+ && {
14
+ display: flex;
15
+ justify-content: center;
16
+ position: absolute;
17
+ bottom: 0;
18
+ background: var(--rs-bg-overlay);
19
+ width: 100%;
20
+ padding-block: 10px;
21
+ }
22
+ `, M = ({
23
+ data: t,
24
+ label: a,
25
+ onLoadData: n,
26
+ onSearch: s,
27
+ onOpen: i,
28
+ value: d = "",
29
+ className: l,
30
+ preload: p,
31
+ disableVirtualized: m,
32
+ ...r
33
+ }) => {
34
+ const { loading: e, ...c } = A({ data: t, onLoadData: n, onSearch: s, onOpen: i, value: d, preload: p, disableVirtualized: m }), f = I(r, "onClean"), u = F(), b = D((g) => /* @__PURE__ */ y(k, { children: [
35
+ g,
36
+ e && /* @__PURE__ */ o(E, {})
37
+ ] }), [e]);
38
+ return /* @__PURE__ */ o(S, { label: a, className: l, passAriaToChildren: !0, children: /* @__PURE__ */ o(
39
+ j,
40
+ {
41
+ ref: u,
42
+ ...r,
43
+ ...c,
44
+ onClean: f,
45
+ renderMenu: b
46
+ }
47
+ ) });
48
+ }, U = x(M, "RsDropdown").name("Dropdown").category(R).props({
49
+ ...v,
50
+ preload: L.default(!1),
51
+ label: h.default("Select"),
52
+ data: w.default(C(["a", "b", "c"]))
53
+ });
54
+ export {
55
+ U as rsDropdown
56
+ };
57
+ //# sourceMappingURL=dropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.js","sources":["../src/components/internal/SLoader.tsx","../src/components/RsDropdown.tsx"],"sourcesContent":["import styled from '@emotion/styled'\nimport {Loader} from 'rsuite'\n\nexport const SLoader = styled(Loader)`\n && {\n display: flex;\n justify-content: center;\n position: absolute;\n bottom: 0;\n background: var(--rs-bg-overlay);\n width: 100%;\n padding-block: 10px;\n }\n`\n","import {array, boolean, define, string, toLabeledValues} from '@react-form-builder/core'\nimport type {ReactNode} from 'react'\nimport {useCallback} from 'react'\nimport type {InputPickerProps} from 'rsuite'\nimport {InputPicker} from 'rsuite'\nimport {pickerProps} from '../commonProperties'\nimport type {LoadDataProps} from '../hooks'\nimport {useFixAriaAttributesForInputPicker, useLoadData} from '../hooks'\nimport {fieldsCategory} from './categories'\nimport {useTouchOnEvent} from './hooks/useTouchOnEvent'\nimport {Labeled} from './internal/Labeled'\nimport {SLoader} from './internal/SLoader'\n\n/**\n * Props for the RsDropdown component.\n */\nexport interface RsDropdownProps extends InputPickerProps, LoadDataProps {\n /**\n * The label for the dropdown.\n */\n label: string\n /**\n * The htmlSize attribute defines the width of the &laquo;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":";;;;;;;;;;;AAGa,MAAAA,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,EAAmB,CAAA,GAC9GK,IAAUC,EAAgBL,GAAO,SAAS,GAC1CM,IAAWC,KAEXC,IAAaC,EAAY,CAACC,MAC7B,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAAF;AAAA,IACAT,uBAAYd,GAAO,EAAA;AAAA,EAAA,GACtB,GAAK,CAACc,CAAO,CAAC;AAEd,SACG,gBAAAY,EAAAC,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,EAEJ,EAAA,CAAA;AAEJ,GAEaQ,IAAaC,EAAO3B,GAAY,YAAY,EACtD,KAAK,UAAU,EACf,SAAS4B,CAAc,EACvB,MAAM;AAAA,EACL,GAAGC;AAAA,EACH,SAASC,EAAQ,QAAQ,EAAK;AAAA,EAC9B,OAAOC,EAAO,QAAQ,QAAQ;AAAA,EAC9B,MAAMC,EAAM,QAAQC,EAAgB,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;AACtD,CAAC;"}
@@ -0,0 +1,20 @@
1
+ import { Definer } from '@react-form-builder/core';
2
+ import { ErrorWrapperProps } from '@react-form-builder/core';
3
+ import type { TypeAttributes } from 'rsuite/esm/internals/types';
4
+
5
+ /**
6
+ * Metadata builder for rSuite-based error display component.
7
+ */
8
+ export declare const rsErrorMessage: Definer<RsErrorMessageProps>;
9
+
10
+ /**
11
+ * The properties of RsErrorMessage component.
12
+ */
13
+ export declare interface RsErrorMessageProps extends ErrorWrapperProps {
14
+ /**
15
+ * The placement of an error message.
16
+ */
17
+ placement?: TypeAttributes.Placement8;
18
+ }
19
+
20
+ export { }
@@ -0,0 +1,28 @@
1
+ import { jsxs as i, jsx as n } from "@emotion/react/jsx-runtime";
2
+ import { cx as c } from "@emotion/css";
3
+ import e from "@emotion/styled";
4
+ import { define as p, string as l, useAriaErrorMessage as d } from "@react-form-builder/core";
5
+ import { Form as g } from "rsuite";
6
+ import { p as f } from "./commonProperties-d849cd5b.js";
7
+ import { s as h } from "./categories-7064b279.js";
8
+ const x = e.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ width: 100%;
12
+ height: 100%;
13
+ `, E = e(g.ErrorMessage)`
14
+ z-index: 6;
15
+ `, M = ({ error: r, children: o, placement: s, className: t }) => {
16
+ const a = r ? "rs-form-control-wrapper" : void 0, m = d();
17
+ return /* @__PURE__ */ i(x, { className: c(t, a), children: [
18
+ o,
19
+ /* @__PURE__ */ n(E, { show: !!r, placement: s ?? "bottomStart", id: m["aria-errormessage"], children: r })
20
+ ] });
21
+ }, R = p(M, "RsErrorMessage").name("Error message").category(h).props({
22
+ placement: f.default("bottomStart"),
23
+ className: l
24
+ }).componentRole("error-message").hideFromComponentPalette();
25
+ export {
26
+ R as rsErrorMessage
27
+ };
28
+ //# sourceMappingURL=error-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-message.js","sources":["../src/components/RsErrorMessage.tsx"],"sourcesContent":["import {cx} from '@emotion/css'\nimport styled from '@emotion/styled'\nimport type {ErrorWrapperProps} from '@react-form-builder/core'\nimport {define, string, useAriaErrorMessage} from '@react-form-builder/core'\nimport {Form} from 'rsuite'\nimport type {TypeAttributes} from 'rsuite/esm/internals/types'\nimport {placement} from '../commonProperties'\nimport {staticCategory} from './categories'\n\nconst SDiv = styled.div`\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n`\n\nconst SErrorMessage = styled(Form.ErrorMessage)`\n z-index: 6;\n`\n\n/**\n * The properties of RsErrorMessage component.\n */\nexport interface RsErrorMessageProps extends ErrorWrapperProps {\n /**\n * The placement of an error message.\n */\n placement?: TypeAttributes.Placement8\n}\n\nconst RsErrorMessage = ({error, children, placement, className}: RsErrorMessageProps) => {\n const divClassName = error ? 'rs-form-control-wrapper' : undefined\n const aria = useAriaErrorMessage()\n\n return <SDiv className={cx(className, divClassName)}>\n {children}\n <SErrorMessage show={Boolean(error)} placement={placement ?? 'bottomStart'} id={aria['aria-errormessage']}>\n {error}\n </SErrorMessage>\n </SDiv>\n}\n\n/**\n * Metadata builder for rSuite-based error display component.\n */\nexport const rsErrorMessage = define(RsErrorMessage, 'RsErrorMessage')\n .name('Error message')\n .category(staticCategory)\n .props({\n placement: placement.default('bottomStart'),\n className: string,\n })\n .componentRole('error-message')\n .hideFromComponentPalette()\n"],"names":["SDiv","styled","SErrorMessage","Form","RsErrorMessage","error","children","placement","className","divClassName","aria","useAriaErrorMessage","cx","jsx","rsErrorMessage","define","staticCategory","string"],"mappings":";;;;;;;AASA,MAAMA,IAAOC,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,GAOdC,IAAgBD,EAAOE,EAAK,YAAY;AAAA;AAAA,GAcxCC,IAAiB,CAAC,EAAC,OAAAC,GAAO,UAAAC,GAAU,WAAAC,GAAW,WAAAC,QAAoC;AACjF,QAAAC,IAAeJ,IAAQ,4BAA4B,QACnDK,IAAOC;AAEb,2BAAQX,GAAK,EAAA,WAAWY,EAAGJ,GAAWC,CAAY,GAC/C,UAAA;AAAA,IAAAH;AAAA,IACA,gBAAAO,EAAAX,GAAA,EAAc,MAAM,EAAQG,GAAQ,WAAWE,KAAa,eAAe,IAAIG,EAAK,mBAAmB,GACrG,UACHL,GAAA;AAAA,EACF,EAAA,CAAA;AACF,GAKaS,IAAiBC,EAAOX,GAAgB,gBAAgB,EAClE,KAAK,eAAe,EACpB,SAASY,CAAc,EACvB,MAAM;AAAA,EACL,WAAWT,EAAU,QAAQ,aAAa;AAAA,EAC1C,WAAWU;AACb,CAAC,EACA,cAAc,eAAe,EAC7B,yBAAyB;"}
@@ -0,0 +1,69 @@
1
+ import { Definer } from '@react-form-builder/core';
2
+ import { JSXElementConstructor } from 'react';
3
+ import { ReactElement } from 'react';
4
+
5
+ /**
6
+ * Common CSS block properties.
7
+ */
8
+ declare interface AreaProps {
9
+ /**
10
+ * The background color.
11
+ */
12
+ backgroundColor?: string;
13
+ }
14
+
15
+ /**
16
+ * React component that displays the header.
17
+ * @param props the React component properties.
18
+ * @param props.content the header text.
19
+ * @param props.headerSize the header size.
20
+ * @param props.props the other wrapped properties of the component.
21
+ * @returns the React element.
22
+ */
23
+ export declare const RsHeader: ({ content, headerSize, ...props }: RsHeaderProps) => ReactElement<{
24
+ alignment?: string | undefined;
25
+ fontSize?: number | undefined;
26
+ fontWeight?: string | undefined;
27
+ color?: string | undefined;
28
+ backgroundColor?: string | undefined;
29
+ }, string | JSXElementConstructor<any>>;
30
+
31
+ export declare const rsHeader: Definer<RsHeaderProps>;
32
+
33
+ /**
34
+ * Props for the RsHeader component.
35
+ */
36
+ export declare interface RsHeaderProps extends TextProps {
37
+ /**
38
+ * The content of the header.
39
+ */
40
+ content?: string;
41
+ /**
42
+ * The size of the header.
43
+ */
44
+ headerSize: string;
45
+ }
46
+
47
+ /**
48
+ * Common CSS text properties.
49
+ */
50
+ declare interface TextProps extends AreaProps {
51
+ /**
52
+ * The text alignment.
53
+ */
54
+ alignment?: string;
55
+ /**
56
+ * The font size.
57
+ */
58
+ fontSize?: number;
59
+ /**
60
+ * The font weight.
61
+ */
62
+ fontWeight?: string;
63
+ /**
64
+ * The color.
65
+ */
66
+ color?: string;
67
+ }
68
+
69
+ export { }
package/dist/header.js ADDED
@@ -0,0 +1,20 @@
1
+ import { define as s, string as n, color as d, useBuilderValue as c } from "@react-form-builder/core";
2
+ import { createElement as i } from "react";
3
+ import { h as l, t as m } from "./commonProperties-d849cd5b.js";
4
+ import { s as u } from "./categories-7064b279.js";
5
+ const e = "Header", f = ({ content: r, headerSize: t, ...o }) => {
6
+ const a = c(r, e);
7
+ return i(t, o, a);
8
+ }, { textAlign: p, color: g } = m, C = s(f, "RsHeader").name("Header").category(u).props({
9
+ content: n.required.default(e).dataBound,
10
+ headerSize: l
11
+ }).css({
12
+ backgroundColor: d,
13
+ textAlign: p,
14
+ color: g
15
+ });
16
+ export {
17
+ f as RsHeader,
18
+ C as rsHeader
19
+ };
20
+ //# sourceMappingURL=header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header.js","sources":["../src/components/RsHeader.tsx"],"sourcesContent":["import {color as backgroundColor, define, string, useBuilderValue} from '@react-form-builder/core'\nimport {createElement} from 'react'\nimport {headerSize, textStyles} from '../commonProperties'\nimport type {TextProps} from '../commonTypes'\nimport {staticCategory} from './categories'\n\nconst defaultContent = 'Header'\n\n/**\n * Props for the RsHeader component.\n */\nexport interface RsHeaderProps extends TextProps {\n /**\n * The content of the header.\n */\n content?: string\n /**\n * The size of the header.\n */\n headerSize: string\n}\n\n/**\n * React component that displays the header.\n * @param props the React component properties.\n * @param props.content the header text.\n * @param props.headerSize the header size.\n * @param props.props the other wrapped properties of the component.\n * @returns the React element.\n */\nexport const RsHeader = ({content, headerSize, ...props}: RsHeaderProps) => {\n const children = useBuilderValue(content, defaultContent)\n return createElement(headerSize, props, children)\n}\n\nconst {textAlign, color} = textStyles\n\nexport const rsHeader = define(RsHeader, 'RsHeader')\n .name('Header')\n .category(staticCategory)\n .props({\n content: string.required.default(defaultContent).dataBound,\n headerSize\n })\n .css({\n backgroundColor,\n textAlign,\n color\n })\n"],"names":["defaultContent","RsHeader","content","headerSize","props","children","useBuilderValue","createElement","textAlign","color","textStyles","rsHeader","define","staticCategory","string","backgroundColor"],"mappings":";;;;AAMA,MAAMA,IAAiB,UAwBVC,IAAW,CAAC,EAAC,SAAAC,GAAS,YAAAC,GAAY,GAAGC,QAA0B;AACpE,QAAAC,IAAWC,EAAgBJ,GAASF,CAAc;AACjD,SAAAO,EAAcJ,GAAYC,GAAOC,CAAQ;AAClD,GAEM,EAAC,WAAAG,GAAW,OAAAC,EAAS,IAAAC,GAEdC,IAAWC,EAAOX,GAAU,UAAU,EAChD,KAAK,QAAQ,EACb,SAASY,CAAc,EACvB,MAAM;AAAA,EACL,SAASC,EAAO,SAAS,QAAQd,CAAc,EAAE;AAAA,EACjD,YAAAG;AACF,CAAC,EACA,IAAI;AAAA,EAAA,iBACHY;AAAAA,EACA,WAAAP;AAAA,EACA,OAAAC;AACF,CAAC;"}
@@ -0,0 +1,53 @@
1
+ import { useState as S, useCallback as h, useEffect as m, useRef as z, useMemo as E } from "react";
2
+ const H = ({ data: s, onLoadData: e, value: t, preload: f, disableVirtualized: I, ...u }) => {
3
+ const [b, k] = S(""), [r, g] = S(s ?? []), [x, A] = S(!1), l = h((c) => c.value === t, [t]), n = h((c) => {
4
+ let i = r;
5
+ t && c.some(l) && (i = r.filter((V) => !l(V))), g([...i, ...c]), A(!1);
6
+ }, [r, l, t]);
7
+ m(() => {
8
+ f && (e == null || e("", n, 0));
9
+ }, [f, e]), m(() => {
10
+ const c = t && !(s != null && s.some(l)) ? [{ value: t, label: t }] : [];
11
+ g([
12
+ ...c,
13
+ ...s ?? []
14
+ ]);
15
+ }, [s]), m(() => {
16
+ b && (e && A(!0), e == null || e(b, n, 0));
17
+ }, [b]);
18
+ const C = {
19
+ onItemsRendered: ({ visibleStopIndex: c }) => {
20
+ e && c >= r.length - 1 && (A(!0), e(b, n, r.length));
21
+ }
22
+ }, M = h((c) => {
23
+ var i;
24
+ e && g([]), k(c), (i = u.onSearch) == null || i.call(u, c);
25
+ }, [e, u]), P = h(() => {
26
+ var c;
27
+ (c = u.onOpen) == null || c.call(u), !t && !f && (e == null || e("", n, 0));
28
+ }, [u, t, f, e, n]), R = h((c, i) => {
29
+ g([i, ...r]), k("");
30
+ }, [r]);
31
+ return { data: r, value: t, loading: x, listProps: C, onSearch: M, onOpen: P, onCreate: R, virtualized: !!e && I !== !0 };
32
+ };
33
+ function O(s) {
34
+ s && !s.hasAttribute("aria-hidden") && s.setAttribute("aria-hidden", "true");
35
+ }
36
+ const N = () => {
37
+ const s = z(null);
38
+ return m(() => {
39
+ var t, f;
40
+ const e = (f = (t = s.current) == null ? void 0 : t.root) == null ? void 0 : f.querySelector("input.rs-picker-search-input");
41
+ O(e);
42
+ }, []), s;
43
+ }, _ = (s, e) => {
44
+ const t = s == null ? void 0 : s.length;
45
+ return E(() => t ? s.map(e) : [], [s, t, e]);
46
+ };
47
+ export {
48
+ N as a,
49
+ _ as b,
50
+ O as s,
51
+ H as u
52
+ };
53
+ //# sourceMappingURL=hooks-ff273a8a.js.map