@gisce/react-ooui 2.0.0-alpha.61 → 2.0.0-alpha.63

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 (246) hide show
  1. package/dist/react-ooui.es.js +5 -2
  2. package/dist/react-ooui.es.js.map +1 -1
  3. package/dist/widgets/views/Tree/treeComponents.d.ts.map +1 -1
  4. package/package.json +6 -8
  5. package/src/ConnectionProvider.ts +0 -16
  6. package/src/__tests__/iconMapper.test.ts +0 -30
  7. package/src/__tests__/searchFilterHelper.spec.ts +0 -386
  8. package/src/actionbar/ActionButton.tsx +0 -40
  9. package/src/actionbar/AttachmentsButton.tsx +0 -132
  10. package/src/actionbar/AttachmentsButtonWrapper.tsx +0 -157
  11. package/src/actionbar/ButtonWithBadge.tsx +0 -44
  12. package/src/actionbar/ChangeViewButton.tsx +0 -137
  13. package/src/actionbar/DashboardActionBar.tsx +0 -63
  14. package/src/actionbar/DropdownButton.tsx +0 -124
  15. package/src/actionbar/FormActionBar.tsx +0 -491
  16. package/src/actionbar/GraphActionBar.tsx +0 -67
  17. package/src/actionbar/NewButton.tsx +0 -46
  18. package/src/actionbar/SearchBar.tsx +0 -73
  19. package/src/actionbar/TreeActionBar.tsx +0 -383
  20. package/src/common/ButtonWithTooltip.tsx +0 -18
  21. package/src/common/DatePicker.tsx +0 -98
  22. package/src/common/Field.tsx +0 -93
  23. package/src/common/SelectAllRecordsRow.tsx +0 -94
  24. package/src/common/TimePicker.tsx +0 -38
  25. package/src/context/ActionViewContext.tsx +0 -213
  26. package/src/context/ConfigContext.tsx +0 -28
  27. package/src/context/ContentRootContext.tsx +0 -461
  28. package/src/context/DashboardActionContext.tsx +0 -44
  29. package/src/context/FormContext.tsx +0 -79
  30. package/src/context/FormModalContext.tsx +0 -28
  31. package/src/context/LocaleContext.tsx +0 -50
  32. package/src/context/One2manyContext.tsx +0 -45
  33. package/src/context/TabManagerContext.tsx +0 -117
  34. package/src/helpers/containerHelper.ts +0 -145
  35. package/src/helpers/dayjs.ts +0 -21
  36. package/src/helpers/dynamicColumnsHelper.ts +0 -73
  37. package/src/helpers/errorHelper.ts +0 -27
  38. package/src/helpers/filesHelper.ts +0 -41
  39. package/src/helpers/formHelper.ts +0 -301
  40. package/src/helpers/iconMapper.ts +0 -164
  41. package/src/helpers/logInfoHelper.tsx +0 -30
  42. package/src/helpers/one2manyHelper.ts +0 -194
  43. package/src/helpers/searchHelper.ts +0 -196
  44. package/src/helpers/timeHelper.ts +0 -58
  45. package/src/helpers/treeHelper.tsx +0 -226
  46. package/src/helpers/viewHelper.ts +0 -23
  47. package/src/hooks/useEffectDebugger.ts +0 -43
  48. package/src/hooks/useExport.ts +0 -439
  49. package/src/hooks/useFetchViews.ts +0 -0
  50. package/src/hooks/useSearch.ts +0 -434
  51. package/src/hooks/useWindowDimensions.ts +0 -33
  52. package/src/index.ts +0 -168
  53. package/src/locales/ca_ES.tsx +0 -99
  54. package/src/locales/en_US.tsx +0 -96
  55. package/src/locales/es_ES.tsx +0 -101
  56. package/src/stories/Binary.stories.tsx +0 -23
  57. package/src/stories/Boolean.stories.tsx +0 -22
  58. package/src/stories/Button.stories.tsx +0 -130
  59. package/src/stories/Char.stories.tsx +0 -76
  60. package/src/stories/FiberGrid.stories.tsx +0 -109
  61. package/src/stories/Float.stories.tsx +0 -22
  62. package/src/stories/FloatTime.stories.tsx +0 -32
  63. package/src/stories/Image.stories.tsx +0 -25
  64. package/src/stories/Integer.stories.tsx +0 -22
  65. package/src/stories/Label.stories.tsx +0 -100
  66. package/src/stories/Many2one.stories.tsx +0 -31
  67. package/src/stories/One2many.stories.tsx +0 -288
  68. package/src/stories/ProgressBar.stories.tsx +0 -22
  69. package/src/stories/Reference.stories.tsx +0 -43
  70. package/src/stories/Selection.stories.tsx +0 -34
  71. package/src/stories/Separator.stories.tsx +0 -53
  72. package/src/stories/Text.stories.tsx +0 -35
  73. package/src/stories/Time.stories.tsx +0 -31
  74. package/src/stories/Utils.stories.tsx +0 -14
  75. package/src/stories/containers/Group.stories.tsx +0 -84
  76. package/src/stories/containers/NewLine.stories.tsx +0 -52
  77. package/src/stories/containers/Notebook.stories.tsx +0 -188
  78. package/src/stories/custom/Avatar.stories.tsx +0 -22
  79. package/src/stories/custom/ButtonGroup.stories.tsx +0 -74
  80. package/src/stories/custom/CodeEditor.stories.tsx +0 -25
  81. package/src/stories/custom/Comments.stories.tsx +0 -197
  82. package/src/stories/custom/Indicator.stories.tsx +0 -36
  83. package/src/stories/custom/Markdown.stories.tsx +0 -38
  84. package/src/stories/custom/MultiCheckbox.stories.tsx +0 -60
  85. package/src/stories/custom/Radio.stories.tsx +0 -68
  86. package/src/stories/custom/Steps.stories.tsx +0 -43
  87. package/src/stories/custom/Switch.stories.tsx +0 -23
  88. package/src/stories/custom/Tag.stories.tsx +0 -66
  89. package/src/stories/custom/Tags.stories.tsx +0 -74
  90. package/src/stories/dashboard/Dashboard.stories.tsx +0 -23
  91. package/src/stories/dashboard/DashboardGrid.stories.tsx +0 -43
  92. package/src/stories/forms/ActivacioContracteForm.stories.tsx +0 -25
  93. package/src/stories/forms/Attachment.stories.tsx +0 -24
  94. package/src/stories/forms/CUPSForm.stories.tsx +0 -25
  95. package/src/stories/forms/Company.stories.tsx +0 -25
  96. package/src/stories/forms/CrmCaseForm.stories.tsx +0 -25
  97. package/src/stories/forms/Documents.stories.tsx +0 -25
  98. package/src/stories/forms/FormWithGridFiber.stories.tsx +0 -25
  99. package/src/stories/forms/FormWithLinks.stories.tsx +0 -30
  100. package/src/stories/forms/Lead.stories.tsx +0 -25
  101. package/src/stories/forms/ModContractForm.stories.tsx +0 -26
  102. package/src/stories/forms/PartnersForm.stories.tsx +0 -25
  103. package/src/stories/forms/PolissaForm.stories.tsx +0 -25
  104. package/src/stories/forms/PreferencesForm.stories.tsx +0 -691
  105. package/src/stories/forms/Signatures.stories.tsx +0 -25
  106. package/src/stories/forms/Switching.stories.tsx +0 -25
  107. package/src/stories/graphs/GraphIndicator.stories.tsx +0 -20
  108. package/src/stories/graphs/PieGraph.stories.tsx +0 -78
  109. package/src/stories/mocks/index.ts +0 -46
  110. package/src/stories/mocks/mockProvider.ts +0 -189
  111. package/src/stories/mocks/models/activacioContracte.ts +0 -112
  112. package/src/stories/mocks/models/attachment.ts +0 -1326
  113. package/src/stories/mocks/models/butlleti.ts +0 -296
  114. package/src/stories/mocks/models/company.ts +0 -135
  115. package/src/stories/mocks/models/crm_case.ts +0 -595
  116. package/src/stories/mocks/models/cups.ts +0 -937
  117. package/src/stories/mocks/models/document.ts +0 -223
  118. package/src/stories/mocks/models/factura.ts +0 -2713
  119. package/src/stories/mocks/models/form_with_gridfiber.ts +0 -141
  120. package/src/stories/mocks/models/hist_autoconsum.ts +0 -146
  121. package/src/stories/mocks/models/lead.ts +0 -2101
  122. package/src/stories/mocks/models/modcontractual.ts +0 -952
  123. package/src/stories/mocks/models/partner.ts +0 -1340
  124. package/src/stories/mocks/models/polissa.ts +0 -3127
  125. package/src/stories/mocks/models/res_partner_category.ts +0 -15
  126. package/src/stories/mocks/models/signatura.ts +0 -558
  127. package/src/stories/mocks/models/switching.ts +0 -767
  128. package/src/stories/modals/FormModal.stories.tsx +0 -36
  129. package/src/stories/modals/SearchModal.stories.tsx +0 -37
  130. package/src/stories/trees/FacturesTree.stories.tsx +0 -16
  131. package/src/stories/ui/ActionBar.stories.tsx +0 -21
  132. package/src/stories/ui/FavouriteButton.stories.tsx +0 -16
  133. package/src/stories/ui/GoToResourceModal.stories.tsx +0 -25
  134. package/src/stories/views/ActionView.stories.tsx +0 -28
  135. package/src/stories/views/SearchTree.stories.tsx +0 -1064
  136. package/src/stories/views/Tab.stories.tsx +0 -93
  137. package/src/stories/views/TabsAndContent.stories.tsx +0 -88
  138. package/src/stories/views/Tree.stories.jsx +0 -178
  139. package/src/stories/views/searchFilter/DateRangePicker.stories.tsx +0 -22
  140. package/src/stories/views/searchFilter/DateTimeRangePicker.stories.tsx +0 -23
  141. package/src/stories/views/searchFilter/PairFields.stories.tsx +0 -23
  142. package/src/stories/views/searchFilter/SearchFilter.stories.tsx +0 -165
  143. package/src/stories/views/searchFilter/examples/PartnersSearchFilter.stories.tsx +0 -409
  144. package/src/types/index.ts +0 -392
  145. package/src/ui/ActionErrorDialog.tsx +0 -24
  146. package/src/ui/ConfirmDialog.tsx +0 -28
  147. package/src/ui/ErrorAlert.tsx +0 -37
  148. package/src/ui/FavouriteButton.tsx +0 -271
  149. package/src/ui/FormErrorsDialog.tsx +0 -17
  150. package/src/ui/GenericErrorDialog.tsx +0 -16
  151. package/src/ui/GoToResourceModal.tsx +0 -76
  152. package/src/ui/InfoDialog.tsx +0 -13
  153. package/src/ui/RefreshItemDialog.tsx +0 -29
  154. package/src/ui/RemoveItemDialog.tsx +0 -20
  155. package/src/ui/TitleHeader.tsx +0 -117
  156. package/src/ui/UnlinkItemDialog.tsx +0 -20
  157. package/src/ui/UnsavedChangesDialog.tsx +0 -29
  158. package/src/ui/WarningDialog.tsx +0 -17
  159. package/src/views/ActionView.tsx +0 -526
  160. package/src/views/CurrentTabContent.tsx +0 -21
  161. package/src/views/RootView.tsx +0 -509
  162. package/src/views/TabContent.tsx +0 -31
  163. package/src/views/TabSelector.tsx +0 -31
  164. package/src/views/Welcome.tsx +0 -18
  165. package/src/views/actionViews/DashboardActionView.tsx +0 -52
  166. package/src/views/actionViews/FormActionView.tsx +0 -70
  167. package/src/views/actionViews/GraphActionView.tsx +0 -152
  168. package/src/views/actionViews/TreeActionView.tsx +0 -87
  169. package/src/views/tabs/Tab.tsx +0 -82
  170. package/src/widgets/WidgetFactory.tsx +0 -142
  171. package/src/widgets/base/Binary.tsx +0 -145
  172. package/src/widgets/base/Boolean.tsx +0 -44
  173. package/src/widgets/base/Button.tsx +0 -77
  174. package/src/widgets/base/Char.tsx +0 -157
  175. package/src/widgets/base/Date.tsx +0 -12
  176. package/src/widgets/base/DateTime.tsx +0 -12
  177. package/src/widgets/base/Email.tsx +0 -27
  178. package/src/widgets/base/Float.tsx +0 -38
  179. package/src/widgets/base/FloatTime.tsx +0 -73
  180. package/src/widgets/base/Image.tsx +0 -120
  181. package/src/widgets/base/Integer.tsx +0 -55
  182. package/src/widgets/base/Label.tsx +0 -56
  183. package/src/widgets/base/LinkInput.tsx +0 -106
  184. package/src/widgets/base/MultiSelection.tsx +0 -90
  185. package/src/widgets/base/ProgressBar.tsx +0 -38
  186. package/src/widgets/base/Reference.tsx +0 -115
  187. package/src/widgets/base/ReferenceTree.tsx +0 -62
  188. package/src/widgets/base/Selection.tsx +0 -71
  189. package/src/widgets/base/Separator.tsx +0 -25
  190. package/src/widgets/base/Text.tsx +0 -162
  191. package/src/widgets/base/Time.tsx +0 -40
  192. package/src/widgets/base/Url.tsx +0 -26
  193. package/src/widgets/base/many2one/Many2one.tsx +0 -322
  194. package/src/widgets/base/many2one/Many2oneSuffix.tsx +0 -232
  195. package/src/widgets/base/many2one/Many2oneSuffixModal.tsx +0 -42
  196. package/src/widgets/base/many2one/Many2oneTree.tsx +0 -18
  197. package/src/widgets/base/one2many/One2many.tsx +0 -100
  198. package/src/widgets/base/one2many/One2manyInput.tsx +0 -724
  199. package/src/widgets/base/one2many/One2manyTopBar.tsx +0 -158
  200. package/src/widgets/containers/Container.tsx +0 -99
  201. package/src/widgets/containers/Group.tsx +0 -37
  202. package/src/widgets/containers/Notebook.tsx +0 -52
  203. package/src/widgets/custom/Avatar.tsx +0 -40
  204. package/src/widgets/custom/ButtonGroup.tsx +0 -169
  205. package/src/widgets/custom/CodeEditor.tsx +0 -32
  206. package/src/widgets/custom/Comments.tsx +0 -147
  207. package/src/widgets/custom/FiberGrid.tsx +0 -48
  208. package/src/widgets/custom/Indicator.tsx +0 -66
  209. package/src/widgets/custom/Markdown.tsx +0 -32
  210. package/src/widgets/custom/MultiCheckbox.tsx +0 -165
  211. package/src/widgets/custom/Radio.tsx +0 -47
  212. package/src/widgets/custom/Steps.tsx +0 -56
  213. package/src/widgets/custom/Switch.tsx +0 -26
  214. package/src/widgets/custom/Tag.tsx +0 -53
  215. package/src/widgets/custom/Tags.tsx +0 -164
  216. package/src/widgets/custom/Timeline.tsx +0 -196
  217. package/src/widgets/modals/ExportModal.tsx +0 -75
  218. package/src/widgets/modals/FormModal.tsx +0 -125
  219. package/src/widgets/modals/SearchModal.tsx +0 -130
  220. package/src/widgets/modals/TranslationModal.tsx +0 -202
  221. package/src/widgets/views/Dashboard/Dashboard.tsx +0 -381
  222. package/src/widgets/views/Dashboard/DashboardForm.tsx +0 -30
  223. package/src/widgets/views/Dashboard/DashboardTree.tsx +0 -238
  224. package/src/widgets/views/Dashboard/dashboardHelper.ts +0 -79
  225. package/src/widgets/views/DashboardGrid/DashboardGrid.tsx +0 -53
  226. package/src/widgets/views/DashboardGrid/DashboardGrid.types.ts +0 -4
  227. package/src/widgets/views/DashboardGrid/DashboardGridItem.tsx +0 -62
  228. package/src/widgets/views/DashboardGrid/DashboardGridItem.types.ts +0 -10
  229. package/src/widgets/views/DashboardGrid/index.ts +0 -4
  230. package/src/widgets/views/Form.tsx +0 -1152
  231. package/src/widgets/views/Graph/Graph.tsx +0 -145
  232. package/src/widgets/views/Graph/GraphChart.tsx +0 -113
  233. package/src/widgets/views/Graph/GraphDefaults.ts +0 -170
  234. package/src/widgets/views/Graph/GraphIndicator.tsx +0 -421
  235. package/src/widgets/views/Graph/useGraphData.tsx +0 -176
  236. package/src/widgets/views/SearchTree.tsx +0 -367
  237. package/src/widgets/views/Tree/Tree.tsx +0 -295
  238. package/src/widgets/views/Tree/index.ts +0 -1
  239. package/src/widgets/views/Tree/treeComponents.tsx +0 -276
  240. package/src/widgets/views/searchFilter/DateRangePicker.tsx +0 -16
  241. package/src/widgets/views/searchFilter/DateTimeRangePicker.tsx +0 -87
  242. package/src/widgets/views/searchFilter/PairFields.tsx +0 -56
  243. package/src/widgets/views/searchFilter/SearchBottomBar.tsx +0 -54
  244. package/src/widgets/views/searchFilter/SearchField.tsx +0 -63
  245. package/src/widgets/views/searchFilter/SearchFilter.tsx +0 -160
  246. package/src/widgets/views/searchFilter/SearchParams.tsx +0 -35
@@ -1,31 +0,0 @@
1
- // @ts-ignore
2
- import React, { useState } from "react";
3
-
4
- import { TimeInput } from "../widgets/base/Time";
5
- import { Time as TimeOoui } from "@gisce/ooui";
6
-
7
- import LocaleProvider from "../context/LocaleContext";
8
-
9
- export default {
10
- title: "Components/Widgets/Base/Time",
11
- };
12
-
13
- export const Default = (): React.ReactElement => {
14
- const ooui = new TimeOoui({
15
- name: "field",
16
- string: "Lorem ipsum",
17
- });
18
-
19
- const [value, setValue] = useState<string>("23:12:34");
20
-
21
- const onChange = (value: string) => {
22
- console.log(value);
23
- setValue(value);
24
- };
25
-
26
- return (
27
- <LocaleProvider lang="en_US">
28
- <TimeInput ooui={ooui} onChange={onChange} value={value} />
29
- </LocaleProvider>
30
- );
31
- };
@@ -1,14 +0,0 @@
1
- // @ts-ignore
2
- import React from "react";
3
- import { CustomTag } from "../widgets/custom/Tag";
4
- import { colorFromString } from "../helpers/formHelper";
5
-
6
- export default {
7
- title: "Components/Pure",
8
- };
9
-
10
- export const CustomTagWithColor = (): React.ReactElement => {
11
- const text = "Hacker";
12
- const color = colorFromString(text);
13
- return <CustomTag color={color}>{text}</CustomTag>;
14
- };
@@ -1,84 +0,0 @@
1
- import React from "react";
2
-
3
- import { withKnobs, number, text } from "@storybook/addon-knobs";
4
- import LocaleProvider from "../../context/LocaleContext";
5
-
6
- import { Form } from "antd";
7
- import { Form as FormOoui, Group as GroupOoui } from "@gisce/ooui";
8
- import { Group } from "../..";
9
-
10
- export default {
11
- title: "Components/Widgets/Containers/Group",
12
- decorators: [withKnobs],
13
- };
14
-
15
- const archTemplate = [
16
- `<form><group name="group" label="{label}" colspan="{colspan}" col="{col}">`,
17
- `</group></form>`,
18
- ];
19
-
20
- const field = '<field name="name"/>';
21
-
22
- const fields = {
23
- name: {
24
- string: "Field",
25
- type: "char",
26
- },
27
- };
28
-
29
- export const Default = (): React.ReactElement => {
30
- const label = text("Label", undefined) || undefined;
31
- const col = number("Columns", 4) || 4;
32
- const colspan = number("Colspan", 4) || 4;
33
- const num_fields = number("Number of widgets", 2) || 2;
34
-
35
- const arch = [
36
- archTemplate[0]
37
- .replace("{label}", label)
38
- .replace("{colspan}", colspan.toString())
39
- .replace("{col}", col.toString()),
40
- ];
41
-
42
- let fieldsXml = "";
43
- for (let i = 0; i < num_fields; i += 1) {
44
- fieldsXml += field;
45
- }
46
- arch.push(fieldsXml);
47
- arch.push(archTemplate[1]);
48
-
49
- const formOoui = new FormOoui(fields);
50
- formOoui.parse(arch.join(""));
51
- const groupOoui = formOoui.findById("group") as GroupOoui;
52
- groupOoui.label = label;
53
-
54
- return (
55
- <LocaleProvider lang="en_US">
56
- <Form>
57
- <Group ooui={groupOoui} />
58
- </Form>
59
- </LocaleProvider>
60
- );
61
- };
62
-
63
- export const WithIcon = (): React.ReactElement => {
64
- const ooui = new GroupOoui({
65
- string: "General",
66
- icon: "home",
67
- });
68
- return (
69
- <LocaleProvider lang="en_US">
70
- <Group ooui={ooui} />
71
- </LocaleProvider>
72
- );
73
- };
74
-
75
- export const OnlyIcon = (): React.ReactElement => {
76
- const ooui = new GroupOoui({
77
- icon: "home",
78
- });
79
- return (
80
- <LocaleProvider lang="en_US">
81
- <Group ooui={ooui} />
82
- </LocaleProvider>
83
- );
84
- };
@@ -1,52 +0,0 @@
1
- import React from "react";
2
-
3
- import { Form } from "../..";
4
-
5
- import LocaleProvider from "../../context/LocaleContext";
6
-
7
- export default {
8
- component: Form,
9
- title: "Components/Widgets/Containers/NewLineExample",
10
- };
11
-
12
- const Template = (args: any) => (
13
- <LocaleProvider lang="en_US">
14
- <Form {...args} />
15
- </LocaleProvider>
16
- );
17
- export const Default = Template.bind({});
18
- Default.args = {
19
- initialValues: {
20
- name: "John Appleseed",
21
- login: "john",
22
- context_lang: "ca_ES",
23
- context_tz: "Europe/Madrid",
24
- password: "MaskedPassword",
25
- signature: "John Appleseed\n___\nReach me at +34973748312",
26
- },
27
- arch: `
28
- <form string="Users">
29
- <group colspan="4" col="4">
30
- <field name="name"/>
31
- <newline/>
32
- <field name="login" readonly="1"/>
33
- </group>
34
- </form>`,
35
- fields: {
36
- login: {
37
- required: true,
38
- size: 64,
39
- string: "Login",
40
- type: "char",
41
- views: {},
42
- },
43
- name: {
44
- required: true,
45
- select: true,
46
- size: 64,
47
- string: "Name",
48
- type: "char",
49
- views: {},
50
- },
51
- },
52
- };
@@ -1,188 +0,0 @@
1
- import React from "react";
2
-
3
- import { withKnobs } from "@storybook/addon-knobs";
4
- import LocaleProvider from "../../context/LocaleContext";
5
-
6
- import { Form } from "antd";
7
- import { Form as FormOoui, Notebook as NotebookOoui } from "@gisce/ooui";
8
- import { Notebook } from "../..";
9
-
10
- export default {
11
- title: "Components/Widgets/Containers/Notebook",
12
- decorators: [withKnobs],
13
- };
14
-
15
- const arch = `<form><notebook name="notebook">
16
- <page string="General">
17
- <field name="name" />
18
- </page>
19
- <page string="Secondary">
20
- <field name="surname" />
21
- </page>
22
- </notebook>
23
- </form>`;
24
-
25
- const testArch = `<form><notebook name="notebook"><page string="Corbes">
26
- <group colspan="4">
27
- <group string="Validada" colspan="2">
28
- <field name="name" string="Última corba"/>
29
- <field name="surname" string="Format"/>
30
- </group>
31
- <group string="Facturada" colspan="2">
32
- <field name="name" string="Última corba"/>
33
- <field name="surname" string="Format"/>
34
- </group>
35
- <group string="Autoconsumida" colspan="2">
36
- <field name="name" string="Última corba"/>
37
- <field name="surname" string="Format"/>
38
- </group>
39
- <group string="Generada Neta" colspan="2">
40
- <field name="name" string="Última corba"/>
41
- <field name="surname" string="Format"/>
42
- </group>
43
- <group string="Quart-Horària" colspan="2">
44
- <field name="name" string="Última corba"/>
45
- <field name="surname" string="Format"/>
46
- </group>
47
- </group>
48
- </page></notebook>
49
- </form>`;
50
-
51
- const fields = {
52
- name: {
53
- string: "Field of page 1",
54
- type: "char",
55
- },
56
- surname: {
57
- string: "Field of page 2",
58
- type: "char",
59
- },
60
- };
61
-
62
- export const Default = (): React.ReactElement => {
63
- const formOoui = new FormOoui(fields);
64
- formOoui.parse(arch);
65
- const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
66
-
67
- return (
68
- <LocaleProvider lang="en_US">
69
- <Form>
70
- <Notebook ooui={notebookOoui} />
71
- </Form>
72
- </LocaleProvider>
73
- );
74
- };
75
-
76
- export const Test = (): React.ReactElement => {
77
- const formOoui = new FormOoui(fields);
78
- formOoui.parse(testArch);
79
- const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
80
-
81
- return (
82
- <LocaleProvider lang="en_US">
83
- <Form>
84
- <Notebook ooui={notebookOoui} />
85
- </Form>
86
- </LocaleProvider>
87
- );
88
- };
89
-
90
- export const BottomPosition = (): React.ReactElement => {
91
- const arch = `<form>
92
- <notebook name="notebook" tabpos="bottom">
93
- <page string="General">
94
- <field name="name" />
95
- </page>
96
- <page string="Secondary">
97
- <field name="surname" />
98
- </page>
99
- </notebook>
100
- </form>`;
101
-
102
- const formOoui = new FormOoui(fields);
103
- formOoui.parse(arch);
104
- const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
105
-
106
- return (
107
- <LocaleProvider lang="en_US">
108
- <Form>
109
- <Notebook ooui={notebookOoui} />
110
- </Form>
111
- </LocaleProvider>
112
- );
113
- };
114
-
115
- export const LeftPosition = (): React.ReactElement => {
116
- const arch = `<form>
117
- <notebook name="notebook" tabpos="left">
118
- <page string="General">
119
- <field name="name" />
120
- </page>
121
- <page string="Secondary">
122
- <field name="surname" />
123
- </page>
124
- </notebook>
125
- </form>`;
126
-
127
- const formOoui = new FormOoui(fields);
128
- formOoui.parse(arch);
129
- const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
130
-
131
- return (
132
- <LocaleProvider lang="en_US">
133
- <Form>
134
- <Notebook ooui={notebookOoui} />
135
- </Form>
136
- </LocaleProvider>
137
- );
138
- };
139
-
140
- export const IconTabs = (): React.ReactElement => {
141
- const arch = `<form>
142
- <notebook name="notebook">
143
- <page string="Home" icon="home">
144
- <field name="name" />
145
- </page>
146
- <page string="Attributes" icon="project">
147
- <field name="surname" />
148
- </page>
149
- </notebook>
150
- </form>`;
151
-
152
- const formOoui = new FormOoui(fields);
153
- formOoui.parse(arch);
154
- const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
155
-
156
- return (
157
- <LocaleProvider lang="en_US">
158
- <Form>
159
- <Notebook ooui={notebookOoui} />
160
- </Form>
161
- </LocaleProvider>
162
- );
163
- };
164
-
165
- export const IconTablerTabs = (): React.ReactElement => {
166
- const arch = `<form>
167
- <notebook name="notebook">
168
- <page string="Home" icon="bolt">
169
- <field name="name" />
170
- </page>
171
- <page string="Attributes" icon="address-book">
172
- <field name="surname" />
173
- </page>
174
- </notebook>
175
- </form>`;
176
-
177
- const formOoui = new FormOoui(fields);
178
- formOoui.parse(arch);
179
- const notebookOoui = formOoui.findById("notebook") as NotebookOoui;
180
-
181
- return (
182
- <LocaleProvider lang="en_US">
183
- <Form>
184
- <Notebook ooui={notebookOoui} />
185
- </Form>
186
- </LocaleProvider>
187
- );
188
- };
@@ -1,22 +0,0 @@
1
- import React, { useState } from "react";
2
-
3
- import { Avatar as AvatarOoui } from "@gisce/ooui";
4
- import Avatar from "../../widgets/custom/Avatar";
5
- import LocaleProvider from "../../context/LocaleContext";
6
-
7
- export default {
8
- title: "Components/Widgets/Custom/Avatar",
9
- };
10
-
11
- export const Default = (): React.ReactElement => {
12
- const ooui = new AvatarOoui({
13
- name: "user",
14
- string: "Lorem ipsum",
15
- });
16
- const value = "John Wick";
17
- return (
18
- <LocaleProvider lang="en_US">
19
- <Avatar ooui={ooui} value={value} />
20
- </LocaleProvider>
21
- );
22
- };
@@ -1,74 +0,0 @@
1
- import React from "react";
2
-
3
- import { Dropdown, Menu } from "antd";
4
- import { DownOutlined, UserOutlined } from "@ant-design/icons";
5
- import {
6
- ButtonGroup as ButtonGroupOoui,
7
- Button as ButtonOoui,
8
- } from "@gisce/ooui";
9
- import { ButtonGroup } from "../../widgets/custom/ButtonGroup";
10
-
11
- import LocaleProvider from "../../context/LocaleContext";
12
-
13
- export default {
14
- title: "Components/Widgets/Custom/ButtonGroup",
15
- };
16
-
17
- export const OnlyAntComponents = (): React.ReactElement => {
18
- const overlay = (
19
- <Menu>
20
- <Menu.Item icon={<UserOutlined />}>Button 1</Menu.Item>
21
- <Menu.Item icon={<UserOutlined />}>Button 2</Menu.Item>
22
- </Menu>
23
- );
24
-
25
- return (
26
- <LocaleProvider lang="en_US">
27
- <Dropdown.Button overlay={overlay} icon={<DownOutlined />}>
28
- Default button
29
- </Dropdown.Button>
30
- </LocaleProvider>
31
- );
32
- };
33
-
34
- export const Default = (): React.ReactElement => {
35
- const btn1 = new ButtonOoui({
36
- name: "btn1",
37
- icon: "gtk-execute",
38
- string: "Button 1",
39
- buttonType: "object",
40
- });
41
- const btn2 = new ButtonOoui({
42
- name: "btn2",
43
- readonly: true,
44
- buttonType: "object",
45
- icon: "gtk-execute",
46
- string: "Button 2",
47
- });
48
- const btn3 = new ButtonOoui({
49
- name: "btn3",
50
- buttonType: "object",
51
- icon: "gtk-about",
52
- string: "Button 3",
53
- confirm: "Are you sure?",
54
- });
55
- const btn4 = new ButtonOoui({
56
- name: "btn4",
57
- buttonType: "object",
58
- icon: "gtk-dialog-warning",
59
- string: "Button 4",
60
- confirm: "Are you sure?",
61
- danger: true,
62
- });
63
- const buttonGroup = new ButtonGroupOoui({
64
- name: "btnGroup",
65
- default: "btn1",
66
- });
67
- buttonGroup.container.rows[0].push(...[btn1, btn2, btn3, btn4]);
68
-
69
- return (
70
- <LocaleProvider lang="en_US">
71
- <ButtonGroup ooui={buttonGroup} />
72
- </LocaleProvider>
73
- );
74
- };
@@ -1,25 +0,0 @@
1
- import React from "react";
2
-
3
- import { CodeEditor } from "../../widgets/custom/CodeEditor";
4
- import { CodeEditor as CodeEditorOoui } from "@gisce/ooui";
5
-
6
- import LocaleProvider from "../../context/LocaleContext";
7
-
8
- export default {
9
- title: "Components/Widgets/Custom/CodeEditor",
10
- };
11
-
12
- export const Default = (): React.ReactElement => {
13
- const ooui = new CodeEditorOoui({
14
- name: "code",
15
- string: "Code",
16
- height: 400,
17
- widget_props: "{'lang': 'xml'}",
18
- });
19
-
20
- return (
21
- <LocaleProvider lang="en_US">
22
- <CodeEditor ooui={ooui} />
23
- </LocaleProvider>
24
- );
25
- };
@@ -1,197 +0,0 @@
1
- // @ts-ignore
2
- import React from "react";
3
- import LocaleProvider from "../../context/LocaleContext";
4
- import {
5
- Comments,
6
- CommentsTimeline,
7
- EventsType,
8
- } from "../../widgets/custom/Comments";
9
-
10
- export default {
11
- title: "Components/Widgets/Custom/Comments",
12
- };
13
-
14
- export const Default = (): React.ReactElement => {
15
- const data = [
16
- {
17
- id: 1,
18
- text:
19
- "Totam odit eum distinctio tempore. Numquam illo dolorum laboriosam vel illum. Sunt saepe ab nihil soluta placeat ullam.\n" +
20
- "Eius ea enim ut. Unde consequatur ducimus esse ullam. Odio fugit reprehenderit sunt.\n" +
21
- "Recusandae a aliquid. Iusto quisquam temporibus a assumenda aut fuga. Tenetur cum quis saepe et alias delectus quos.\n" +
22
- "Corporis adipisci eaque quod. Aperiam voluptatum doloribus accusamus suscipit.\n" +
23
- "Iste corporis non quisquam adipisci fuga. Aperiam possimus est ratione modi dicta. Cum consequatur eius harum ea eius omnis.\n" +
24
- "Eveniet sit iste sed commodi cumque. Quis ipsam maxime quam eveniet.\n" +
25
- "Repellat officia praesentium adipisci aspernatur impedit. Voluptas architecto autem vero et praesentium dignissimos.\n" +
26
- "Nisi ex sapiente incidunt eveniet mollitia. Iure libero natus perferendis voluptate iure fuga.\n" +
27
- "Vel voluptate cumque laudantium. Reiciendis sapiente eaque neque exercitationem inventore nam.",
28
- author: "Ciríaco Pelayo Camps",
29
- email: "ciraco@example.com",
30
- date: "2023-04-01 10:00:00",
31
- isSender: true,
32
- isAuthor: false,
33
- },
34
- {
35
- id: 2,
36
- text:
37
- "Dicta eligendi pariatur ratione ipsam accusantium. Ad minus nesciunt optio id ipsum.\n" +
38
- "Incidunt eligendi doloremque molestias. Voluptate sapiente nulla veritatis.\n" +
39
- "Nostrum minima ad repudiandae optio laborum.\n" +
40
- "Adipisci sint quasi laudantium explicabo ab nostrum. Rerum nemo itaque officia. Velit accusamus itaque accusantium ducimus quidem quae cum.\n" +
41
- "Sequi possimus harum maxime. Qui laboriosam voluptate pariatur laudantium nam quo. Vel dolorum magni nam iusto sapiente animi quaerat. Debitis minus temporibus molestias quae accusamus.\n" +
42
- "Nobis ab adipisci laborum doloremque impedit quo. Tempore cumque accusamus voluptates. In non facere in.\n" +
43
- "Laboriosam exercitationem possimus quo sequi. Aspernatur quia consequuntur aspernatur repudiandae molestiae modi. Vero esse nisi dicta nihil accusantium nesciunt.\n" +
44
- "Modi voluptatem excepturi. Architecto sapiente nobis quis ipsam. Doloremque ipsum pariatur dicta at.",
45
- author: "Plácido Baeza Vaquero",
46
- email: "placido@example.com",
47
- date: "2023-04-01 11:00:00",
48
- isSender: false,
49
- isAuthor: true,
50
- },
51
- {
52
- id: 3,
53
- text:
54
- "Amet tempora ipsum ipsum delectus.\n" +
55
- "Autem minus magnam in eveniet. Veniam voluptas deleniti eaque sequi autem.\n" +
56
- "Occaecati laborum ut voluptatum maxime iure cupiditate. Facere vitae aliquid.\n" +
57
- "Nemo nihil enim quia exercitationem. Quisquam aut autem magni occaecati velit.\n" +
58
- "Perferendis impedit iure nostrum ratione nemo distinctio.\n" +
59
- "Facilis deserunt amet officia accusantium qui. Non corporis rerum deleniti harum optio ipsa ducimus. Veniam saepe illo aspernatur id quae omnis.\n" +
60
- "Distinctio dolor sequi odio officia amet natus. Quidem quidem quibusdam animi alias quia distinctio.\n" +
61
- "Eum placeat expedita possimus eveniet. Fugit earum corrupti itaque. Ab expedita officiis numquam.\n" +
62
- "Quos optio iure quos minima deserunt assumenda beatae. Illo quod non aliquid.\n" +
63
- "Nobis odio reprehenderit ullam numquam. Beatae molestiae aperiam ratione.\n" +
64
- "Quidem perferendis minima animi ipsa natus aliquam. Exercitationem perferendis sequi assumenda. Eaque ducimus saepe deleniti eum iure itaque.",
65
- author: "Jorge Acosta Valverde",
66
- email: "jorge@example.com",
67
- date: "2023-04-01 11:30:00",
68
- isSender: false,
69
- isAuthor: false,
70
- },
71
- {
72
- id: 4,
73
- text:
74
- "Esse tempora amet consectetur asperiores dicta. Quidem est harum tempora voluptatum mollitia.\n" +
75
- "Voluptate reprehenderit sint vitae laborum animi placeat nihil. Maxime iure porro delectus voluptate. Molestiae dolorem natus alias ipsam consequuntur. Nisi nam exercitationem voluptas saepe occaecati.\n" +
76
- "Reprehenderit quam ex est vel.\n" +
77
- "Magnam quidem laudantium reprehenderit rerum nam ducimus perspiciatis. Vero omnis sed ducimus quidem dolores dolor illum.\n" +
78
- "Corrupti a iste praesentium. Exercitationem cum id neque.\n" +
79
- "Optio repellat excepturi sapiente alias iusto quaerat. Explicabo fuga cupiditate atque porro. Qui fuga ea quis porro id.\n" +
80
- "Natus optio ab reiciendis quae aperiam tempore. Voluptatem asperiores adipisci ullam nobis. Saepe quas odit rem ad autem cum consequatur.\n" +
81
- "Numquam deleniti veniam rem. Enim doloremque consectetur quas reprehenderit. Numquam unde a animi odio sequi.\n" +
82
- "Cum at eos fuga.\n" +
83
- "Vel exercitationem excepturi placeat. Quisquam neque quasi impedit at.",
84
- author: "Ciríaco Pelayo Camps",
85
- email: "ciraco@example.com",
86
- date: "2023-04-01 13:00:00",
87
- isSender: true,
88
- isAuthor: false,
89
- },
90
- ];
91
- return (
92
- <LocaleProvider lang="es_ES">
93
- <Comments data={data} />
94
- </LocaleProvider>
95
- );
96
- };
97
-
98
- export const Timeline = () => {
99
- const data = [
100
- {
101
- type: "action",
102
- event: {
103
- date: "2023-04-01 10:00",
104
- action: "Draft",
105
- },
106
- },
107
- {
108
- type: "comment",
109
- event: {
110
- id: 1,
111
- text:
112
- "Totam odit eum distinctio tempore. Numquam illo dolorum laboriosam vel illum. Sunt saepe ab nihil soluta placeat ullam.\n" +
113
- "Eius ea enim ut. Unde consequatur ducimus esse ullam. Odio fugit reprehenderit sunt.\n" +
114
- "Recusandae a aliquid. Iusto quisquam temporibus a assumenda aut fuga. Tenetur cum quis saepe et alias delectus quos.\n" +
115
- "Corporis adipisci eaque quod. Aperiam voluptatum doloribus accusamus suscipit.\n" +
116
- "Iste corporis non quisquam adipisci fuga. Aperiam possimus est ratione modi dicta. Cum consequatur eius harum ea eius omnis.\n" +
117
- "Eveniet sit iste sed commodi cumque. Quis ipsam maxime quam eveniet.\n" +
118
- "Repellat officia praesentium adipisci aspernatur impedit. Voluptas architecto autem vero et praesentium dignissimos.\n" +
119
- "Nisi ex sapiente incidunt eveniet mollitia. Iure libero natus perferendis voluptate iure fuga.\n" +
120
- "Vel voluptate cumque laudantium. Reiciendis sapiente eaque neque exercitationem inventore nam.",
121
- author: "Ciríaco Pelayo Camps",
122
- email: "ciraco@example.com",
123
- date: "2023-04-01 10:00:00",
124
- isSender: true,
125
- isAuthor: true,
126
- },
127
- },
128
- {
129
- type: "action",
130
- event: {
131
- date: "2023-04-01 10:10",
132
- action: "Open",
133
- },
134
- },
135
- {
136
- type: "comment",
137
- event: {
138
- id: 2,
139
- text:
140
- "Dicta eligendi pariatur ratione ipsam accusantium. Ad minus nesciunt optio id ipsum.\n" +
141
- "Incidunt eligendi doloremque molestias. Voluptate sapiente nulla veritatis.\n" +
142
- "Nostrum minima ad repudiandae optio laborum.\n" +
143
- "Adipisci sint quasi laudantium explicabo ab nostrum. Rerum nemo itaque officia. Velit accusamus itaque accusantium ducimus quidem quae cum.\n" +
144
- "Sequi possimus harum maxime. Qui laboriosam voluptate pariatur laudantium nam quo. Vel dolorum magni nam iusto sapiente animi quaerat. Debitis minus temporibus molestias quae accusamus.\n" +
145
- "Nobis ab adipisci laborum doloremque impedit quo. Tempore cumque accusamus voluptates. In non facere in.\n" +
146
- "Laboriosam exercitationem possimus quo sequi. Aspernatur quia consequuntur aspernatur repudiandae molestiae modi. Vero esse nisi dicta nihil accusantium nesciunt.\n" +
147
- "Modi voluptatem excepturi. Architecto sapiente nobis quis ipsam. Doloremque ipsum pariatur dicta at.",
148
- author: "Plácido Baeza Vaquero",
149
- email: "placido@example.com",
150
- date: "2023-04-01 11:00:00",
151
- isSender: false,
152
- isAuthor: false,
153
- },
154
- },
155
- {
156
- type: "comment",
157
- event: {
158
- id: 4,
159
- text:
160
- "Esse tempora amet consectetur asperiores dicta. Quidem est harum tempora voluptatum mollitia.\n" +
161
- "Voluptate reprehenderit sint vitae laborum animi placeat nihil. Maxime iure porro delectus voluptate. Molestiae dolorem natus alias ipsam consequuntur. Nisi nam exercitationem voluptas saepe occaecati.\n" +
162
- "Reprehenderit quam ex est vel.\n" +
163
- "Magnam quidem laudantium reprehenderit rerum nam ducimus perspiciatis. Vero omnis sed ducimus quidem dolores dolor illum.\n" +
164
- "Corrupti a iste praesentium. Exercitationem cum id neque.\n" +
165
- "Optio repellat excepturi sapiente alias iusto quaerat. Explicabo fuga cupiditate atque porro. Qui fuga ea quis porro id.\n" +
166
- "Natus optio ab reiciendis quae aperiam tempore. Voluptatem asperiores adipisci ullam nobis. Saepe quas odit rem ad autem cum consequatur.\n" +
167
- "Numquam deleniti veniam rem. Enim doloremque consectetur quas reprehenderit. Numquam unde a animi odio sequi.\n" +
168
- "Cum at eos fuga.\n" +
169
- "Vel exercitationem excepturi placeat. Quisquam neque quasi impedit at.",
170
- author: "Ciríaco Pelayo Camps",
171
- email: "ciraco@example.com",
172
- date: "2023-04-01 13:00:00",
173
- isSender: true,
174
- isAuthor: false,
175
- },
176
- },
177
- {
178
- type: "action",
179
- event: {
180
- action: "Pendent",
181
- date: "2023-04-01 13:05:00",
182
- },
183
- },
184
- {
185
- type: "action",
186
- event: {
187
- action: "Close",
188
- date: "2023-04-01 13:35:00",
189
- },
190
- },
191
- ] as EventsType[];
192
- return (
193
- <LocaleProvider lang="es_ES">
194
- <CommentsTimeline value={data} />
195
- </LocaleProvider>
196
- );
197
- };