@digi-frontend/dgate-api-documentation 1.0.31 → 1.0.32

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 (104) hide show
  1. package/.editorconfig +12 -12
  2. package/.prettierignore +7 -7
  3. package/.prettierrc +15 -15
  4. package/dist/{2e10bbdb265df50e.svg → 43595976d1fdccbf.svg} +4 -4
  5. package/dist/{8789eb84283ea95b.svg → 56dc416b683db280.svg} +5 -5
  6. package/dist/{bb8b87cace25e052.svg → 64efc2716808c4a4.svg} +3 -3
  7. package/dist/{d32ce84bbd78babd.svg → 72db3b05a96dd600.svg} +3 -3
  8. package/dist/{d501922060662842.svg → 844eba3f2e42a9eb.svg} +3 -3
  9. package/dist/_virtual/index3.js +1 -1
  10. package/dist/_virtual/index4.js +1 -1
  11. package/dist/_virtual/index5.js +1 -1
  12. package/dist/_virtual/index6.js +1 -1
  13. package/dist/{070dc6ecd197bc80.svg → a7568b270e175038.svg} +8 -8
  14. package/dist/{9bdff13f8d8fa48a.svg → af16a554be8c4d69.svg} +3 -3
  15. package/dist/{7f54eeb0bb2d1150.svg → b82c7612e73342f3.svg} +3 -3
  16. package/dist/node_modules/toposort/index.js +1 -1
  17. package/dist/node_modules/yup/index.esm.js +1 -1
  18. package/dist/src/assets/icons/AddRow.svg.js +1 -1
  19. package/dist/src/assets/icons/AddRow.svg.js.map +1 -1
  20. package/dist/src/assets/icons/CheckMarkSquare.svg.js +1 -1
  21. package/dist/src/assets/icons/CheckMarkSquare.svg.js.map +1 -1
  22. package/dist/src/assets/icons/CloseIcon.svg.js +1 -1
  23. package/dist/src/assets/icons/CloseIcon.svg.js.map +1 -1
  24. package/dist/src/assets/icons/DeleteIcon.svg.js +1 -1
  25. package/dist/src/assets/icons/DeleteIcon.svg.js.map +1 -1
  26. package/dist/src/assets/icons/DownArrow.svg.js +1 -1
  27. package/dist/src/assets/icons/DownArrow.svg.js.map +1 -1
  28. package/dist/src/assets/icons/EditIcon.svg.js +1 -1
  29. package/dist/src/assets/icons/EditIcon.svg.js.map +1 -1
  30. package/dist/src/assets/icons/UpArrow.svg.js +1 -1
  31. package/dist/src/assets/icons/UpArrow.svg.js.map +1 -1
  32. package/dist/src/assets/icons/deleteOutlinedIcon.svg.js +1 -1
  33. package/dist/src/assets/icons/deleteOutlinedIcon.svg.js.map +1 -1
  34. package/dist/src/components/Chips/Chips.js.map +1 -1
  35. package/dist/src/components/InfoForm/InfoForm.js +1 -1
  36. package/dist/src/components/InfoForm/InfoForm.js.map +1 -1
  37. package/dist/src/components/JsonInput/JsonInput.js.map +1 -1
  38. package/dist/src/components/LivePreview/LivePreview.js.map +1 -1
  39. package/dist/src/components/MethodAccordion/MethodAccordion.js.map +1 -1
  40. package/dist/src/components/SVGLoader/SVGLoader.js.map +1 -1
  41. package/dist/src/components/SectionHead/SectionHead.js.map +1 -1
  42. package/dist/src/components/SimpleLabelValue/SimpleLabelValue.js.map +1 -1
  43. package/dist/src/components/Tooltip/Tooltip.js.map +1 -1
  44. package/dist/src/components/dialog/index.js.map +1 -1
  45. package/dist/src/components/table/table.js.map +1 -1
  46. package/dist/src/components/table/tags-table.js +1 -1
  47. package/dist/src/components/table/tags-table.js.map +1 -1
  48. package/dist/src/constants/index.js.map +1 -1
  49. package/dist/src/constants/regex.js +1 -1
  50. package/dist/src/constants/regex.js.map +1 -1
  51. package/dist/src/helpers/layout.helper.js.map +1 -1
  52. package/dist/src/helpers/methodAccordion.helper.js.map +1 -1
  53. package/dist/src/layout/layout.js.map +1 -1
  54. package/dist/src/validator/form.scheme.js.map +1 -1
  55. package/dist/styles.css +335 -335
  56. package/package.json +43 -43
  57. package/rollup.config.js +35 -35
  58. package/src/assets/icons/AddRow.svg +3 -3
  59. package/src/assets/icons/CheckMarkSquare.svg +5 -5
  60. package/src/assets/icons/CloseIcon.svg +4 -4
  61. package/src/assets/icons/DeleteIcon.svg +3 -3
  62. package/src/assets/icons/DownArrow.svg +3 -3
  63. package/src/assets/icons/EditIcon.svg +3 -3
  64. package/src/assets/icons/UpArrow.svg +3 -3
  65. package/src/assets/icons/deleteOutlinedIcon.svg +8 -8
  66. package/src/assets/icons/index.ts +8 -8
  67. package/src/components/Chips/Chips.tsx +87 -87
  68. package/src/components/Chips/style.scss +147 -147
  69. package/src/components/InfoForm/InfoForm.module.scss +165 -165
  70. package/src/components/InfoForm/InfoForm.tsx +424 -426
  71. package/src/components/JsonInput/JsonInput.tsx +149 -149
  72. package/src/components/JsonInput/style.module.scss +133 -133
  73. package/src/components/LivePreview/LivePreview.module.scss +24 -24
  74. package/src/components/LivePreview/LivePreview.tsx +184 -184
  75. package/src/components/MethodAccordion/MethodAccordion.module.scss +338 -338
  76. package/src/components/MethodAccordion/MethodAccordion.tsx +515 -515
  77. package/src/components/SVGLoader/SVGLoader.tsx +94 -94
  78. package/src/components/SectionHead/SectionHead.scss +29 -29
  79. package/src/components/SectionHead/SectionHead.tsx +22 -22
  80. package/src/components/SimpleLabelValue/SimpleLabelValue.tsx +31 -31
  81. package/src/components/SimpleLabelValue/index.ts +1 -1
  82. package/src/components/SimpleLabelValue/style.scss +30 -30
  83. package/src/components/Tooltip/Tooltip.scss +133 -133
  84. package/src/components/Tooltip/Tooltip.tsx +85 -85
  85. package/src/components/_global.scss +337 -337
  86. package/src/components/dialog/dialog.ts +54 -54
  87. package/src/components/dialog/index.tsx +85 -85
  88. package/src/components/dialog/style.scss +104 -104
  89. package/src/components/table/style.scss +190 -190
  90. package/src/components/table/table.tsx +327 -327
  91. package/src/components/table/tags-table.tsx +348 -348
  92. package/src/constants/index.ts +93 -93
  93. package/src/constants/regex.ts +7 -7
  94. package/src/global.d.ts +13 -13
  95. package/src/helpers/layout.helper.ts +162 -162
  96. package/src/helpers/methodAccordion.helper.ts +19 -19
  97. package/src/index.ts +1 -1
  98. package/src/layout/layout.module.css +61 -61
  99. package/src/layout/layout.tsx +150 -150
  100. package/src/types/layout.type.ts +30 -30
  101. package/src/types/openApi.ts +108 -108
  102. package/src/types/transformedOpenApi.ts +52 -52
  103. package/src/validator/form.scheme.ts +70 -70
  104. package/tsconfig.json +33 -33
@@ -1,94 +1,94 @@
1
- import React, { useState, useEffect } from 'react'
2
- import parse from 'html-react-parser'
3
-
4
- // Utility function to create an SVG element from a string
5
- const createSvgElement = (svgString: string): SVGSVGElement | null => {
6
- const parser = new DOMParser()
7
- const doc = parser.parseFromString(svgString, 'image/svg+xml')
8
- return doc.querySelector('svg')
9
- }
10
-
11
- // Define the type for SVG attributes
12
- type SVGAttributes = React.SVGProps<SVGSVGElement>
13
-
14
- interface SVGLoaderProps extends SVGAttributes {
15
- src: string
16
- cache?: boolean
17
- }
18
-
19
- const SVGLoader: React.FC<SVGLoaderProps> | any = ({ src, cache = true, ...props }) => {
20
- const [svgMarkup, setSvgMarkup] = useState<string | null>(null)
21
-
22
- useEffect(() => {
23
- if (!src) return
24
- if (typeof src !== 'string') console.log({ src })
25
- const isUrl = src.startsWith('http') || src.startsWith('/')
26
-
27
- const cacheName = 'svg-cache'
28
-
29
- const fetchSvg = async () => {
30
- try {
31
- let svgString: string | null = null
32
-
33
- // Use the Cache API if caching is enabled
34
- if (cache && isUrl && 'caches' in window) {
35
- const cacheStorage = await caches.open(cacheName)
36
- const cachedResponse = await cacheStorage.match(src)
37
-
38
- // If SVG is found in cache, use it
39
- if (cachedResponse && cachedResponse.ok) {
40
- svgString = await cachedResponse.text()
41
- setSvgMarkup(svgString)
42
- return
43
- }
44
- }
45
-
46
- // If not cached, fetch from URL
47
- if (isUrl) {
48
- const response = await fetch(src)
49
-
50
- // Clone the response before consuming it
51
- const responseClone = response.clone()
52
-
53
- // Consume the response body for the SVG content
54
- svgString = await response.text()
55
-
56
- // Store the cloned response in the cache
57
- if (cache && 'caches' in window) {
58
- const cacheStorage = await caches.open(cacheName)
59
- await cacheStorage.put(src, responseClone)
60
- }
61
- } else {
62
- // If it's not a URL (it's inline), just use the source string
63
- svgString = src
64
- }
65
-
66
- // If we have valid SVG content, set it
67
- if (svgString) {
68
- const svg = createSvgElement(svgString)
69
- if (svg) {
70
- const svgStringWithProps = new XMLSerializer().serializeToString(svg)
71
- setSvgMarkup(svgStringWithProps)
72
- }
73
- }
74
- } catch (error) {
75
- console.error('Error loading SVG:', error)
76
- }
77
- }
78
-
79
- fetchSvg()
80
- }, [src, props])
81
-
82
- if (!svgMarkup) return null
83
-
84
- // Parse the SVG string and return it as JSX
85
- const parsedSvg = parse(svgMarkup)
86
- // Sometimes parse returns an array which includes the element
87
- const toBeClonedElement = Array.isArray(parsedSvg) ? parsedSvg.find((item) => React.isValidElement(item)) : parsedSvg
88
- // Clone the parsed SVG element to apply the props
89
- const clonedSvg = React.cloneElement(toBeClonedElement as React.ReactElement, props)
90
-
91
- return <>{clonedSvg}</>
92
- }
93
-
94
- export default SVGLoader
1
+ import React, { useState, useEffect } from 'react'
2
+ import parse from 'html-react-parser'
3
+
4
+ // Utility function to create an SVG element from a string
5
+ const createSvgElement = (svgString: string): SVGSVGElement | null => {
6
+ const parser = new DOMParser()
7
+ const doc = parser.parseFromString(svgString, 'image/svg+xml')
8
+ return doc.querySelector('svg')
9
+ }
10
+
11
+ // Define the type for SVG attributes
12
+ type SVGAttributes = React.SVGProps<SVGSVGElement>
13
+
14
+ interface SVGLoaderProps extends SVGAttributes {
15
+ src: string
16
+ cache?: boolean
17
+ }
18
+
19
+ const SVGLoader: React.FC<SVGLoaderProps> | any = ({ src, cache = true, ...props }) => {
20
+ const [svgMarkup, setSvgMarkup] = useState<string | null>(null)
21
+
22
+ useEffect(() => {
23
+ if (!src) return
24
+ if (typeof src !== 'string') console.log({ src })
25
+ const isUrl = src.startsWith('http') || src.startsWith('/')
26
+
27
+ const cacheName = 'svg-cache'
28
+
29
+ const fetchSvg = async () => {
30
+ try {
31
+ let svgString: string | null = null
32
+
33
+ // Use the Cache API if caching is enabled
34
+ if (cache && isUrl && 'caches' in window) {
35
+ const cacheStorage = await caches.open(cacheName)
36
+ const cachedResponse = await cacheStorage.match(src)
37
+
38
+ // If SVG is found in cache, use it
39
+ if (cachedResponse && cachedResponse.ok) {
40
+ svgString = await cachedResponse.text()
41
+ setSvgMarkup(svgString)
42
+ return
43
+ }
44
+ }
45
+
46
+ // If not cached, fetch from URL
47
+ if (isUrl) {
48
+ const response = await fetch(src)
49
+
50
+ // Clone the response before consuming it
51
+ const responseClone = response.clone()
52
+
53
+ // Consume the response body for the SVG content
54
+ svgString = await response.text()
55
+
56
+ // Store the cloned response in the cache
57
+ if (cache && 'caches' in window) {
58
+ const cacheStorage = await caches.open(cacheName)
59
+ await cacheStorage.put(src, responseClone)
60
+ }
61
+ } else {
62
+ // If it's not a URL (it's inline), just use the source string
63
+ svgString = src
64
+ }
65
+
66
+ // If we have valid SVG content, set it
67
+ if (svgString) {
68
+ const svg = createSvgElement(svgString)
69
+ if (svg) {
70
+ const svgStringWithProps = new XMLSerializer().serializeToString(svg)
71
+ setSvgMarkup(svgStringWithProps)
72
+ }
73
+ }
74
+ } catch (error) {
75
+ console.error('Error loading SVG:', error)
76
+ }
77
+ }
78
+
79
+ fetchSvg()
80
+ }, [src, props])
81
+
82
+ if (!svgMarkup) return null
83
+
84
+ // Parse the SVG string and return it as JSX
85
+ const parsedSvg = parse(svgMarkup)
86
+ // Sometimes parse returns an array which includes the element
87
+ const toBeClonedElement = Array.isArray(parsedSvg) ? parsedSvg.find((item) => React.isValidElement(item)) : parsedSvg
88
+ // Clone the parsed SVG element to apply the props
89
+ const clonedSvg = React.cloneElement(toBeClonedElement as React.ReactElement, props)
90
+
91
+ return <>{clonedSvg}</>
92
+ }
93
+
94
+ export default SVGLoader
@@ -1,29 +1,29 @@
1
- .containerTitleDrawer {
2
- height: 64px;
3
- min-height: 64px;
4
- display: flex;
5
- flex-direction: row;
6
- justify-content: space-between;
7
- align-items: center;
8
- background-color: #f1f2f6;
9
- padding: 0 30px 0 30px;
10
- width: 100%;
11
-
12
- span {
13
- color: #12131a;
14
- font-weight: 600;
15
- font-size: 18px;
16
- line-height: 25px;
17
- letter-spacing: 0em;
18
- }
19
-
20
- svg {
21
- path {
22
- stroke: #000 !important;
23
- }
24
- }
25
-
26
- .closeIcon {
27
- cursor: pointer;
28
- }
29
- }
1
+ .containerTitleDrawer {
2
+ height: 64px;
3
+ min-height: 64px;
4
+ display: flex;
5
+ flex-direction: row;
6
+ justify-content: space-between;
7
+ align-items: center;
8
+ background-color: #f1f2f6;
9
+ padding: 0 30px 0 30px;
10
+ width: 100%;
11
+
12
+ span {
13
+ color: #12131a;
14
+ font-weight: 600;
15
+ font-size: 18px;
16
+ line-height: 25px;
17
+ letter-spacing: 0em;
18
+ }
19
+
20
+ svg {
21
+ path {
22
+ stroke: #000 !important;
23
+ }
24
+ }
25
+
26
+ .closeIcon {
27
+ cursor: pointer;
28
+ }
29
+ }
@@ -1,22 +1,22 @@
1
- import React, { type JSX } from 'react'
2
- import './SectionHead.scss'
3
- import SVGLoader from '../SVGLoader/SVGLoader'
4
-
5
- type SectionHeadProps = {
6
- text: string | JSX.Element
7
- closeFunction?: () => void
8
- children?: JSX.Element
9
- className?: string
10
- }
11
-
12
- const SectionHead: React.FC<SectionHeadProps> = ({ text, closeFunction, children, className = '' }: SectionHeadProps): any => {
13
- return (
14
- <div className={`containerTitleDrawer ${className}`}>
15
- <span data-id={`${String(text)?.toUpperCase()?.replaceAll(' ', '_')}_ID`}>{text}</span>
16
- {children}
17
-
18
- {closeFunction && <SVGLoader className='closeIcon' onClick={closeFunction} width='1.5rem' height='1.5rem' />}
19
- </div>
20
- )
21
- }
22
- export default SectionHead
1
+ import React, { type JSX } from 'react'
2
+ import './SectionHead.scss'
3
+ import SVGLoader from '../SVGLoader/SVGLoader'
4
+
5
+ type SectionHeadProps = {
6
+ text: string | JSX.Element
7
+ closeFunction?: () => void
8
+ children?: JSX.Element
9
+ className?: string
10
+ }
11
+
12
+ const SectionHead: React.FC<SectionHeadProps> = ({ text, closeFunction, children, className = '' }: SectionHeadProps): any => {
13
+ return (
14
+ <div className={`containerTitleDrawer ${className}`}>
15
+ <span data-id={`${String(text)?.toUpperCase()?.replaceAll(' ', '_')}_ID`}>{text}</span>
16
+ {children}
17
+
18
+ {closeFunction && <SVGLoader className='closeIcon' onClick={closeFunction} width='1.5rem' height='1.5rem' />}
19
+ </div>
20
+ )
21
+ }
22
+ export default SectionHead
@@ -1,31 +1,31 @@
1
- import React from 'react'
2
- import './style.scss'
3
-
4
- type SimpleLabelValueProps = {
5
- label?: string | JSX.Element
6
- value?: string | number | JSX.Element | JSX.Element[]
7
- color?: string
8
- className?: string
9
- dataId?: string
10
- }
11
-
12
- const SimpleLabelValue: React.FC<SimpleLabelValueProps> = ({
13
- label,
14
- value,
15
- color,
16
- className = '',
17
- dataId,
18
- }: SimpleLabelValueProps) => {
19
- const dataIdLabel =
20
- typeof label === 'string' ? label?.toUpperCase()?.replaceAll(' ', '_') + '_LABEL_ID' : dataId
21
- return (
22
- <div className={`drawerItemContainer ${className}`}>
23
- <span className="title" data-id={dataIdLabel}>
24
- {label}
25
- </span>
26
- <span className={`text ${color ? `color-${color}` : ''}`}>{value}</span>
27
- </div>
28
- )
29
- }
30
-
31
- export default SimpleLabelValue
1
+ import React from 'react'
2
+ import './style.scss'
3
+
4
+ type SimpleLabelValueProps = {
5
+ label?: string | JSX.Element
6
+ value?: string | number | JSX.Element | JSX.Element[]
7
+ color?: string
8
+ className?: string
9
+ dataId?: string
10
+ }
11
+
12
+ const SimpleLabelValue: React.FC<SimpleLabelValueProps> = ({
13
+ label,
14
+ value,
15
+ color,
16
+ className = '',
17
+ dataId,
18
+ }: SimpleLabelValueProps) => {
19
+ const dataIdLabel =
20
+ typeof label === 'string' ? label?.toUpperCase()?.replaceAll(' ', '_') + '_LABEL_ID' : dataId
21
+ return (
22
+ <div className={`drawerItemContainer ${className}`}>
23
+ <span className="title" data-id={dataIdLabel}>
24
+ {label}
25
+ </span>
26
+ <span className={`text ${color ? `color-${color}` : ''}`}>{value}</span>
27
+ </div>
28
+ )
29
+ }
30
+
31
+ export default SimpleLabelValue
@@ -1 +1 @@
1
- export { default } from './SimpleLabelValue'
1
+ export { default } from './SimpleLabelValue'
@@ -1,30 +1,30 @@
1
- @import '../global';
2
-
3
- .drawerItemContainer {
4
- display: flex;
5
- flex-direction: column;
6
-
7
- .title {
8
- color: #000;
9
- font-weight: 600;
10
- font-size: 24px;
11
- line-height: 35px;
12
- margin-bottom: 3px;
13
- margin-top: 1.5rem;
14
- }
15
-
16
- .text {
17
- color: #000;
18
- font-weight: 400;
19
- font-size: 24px;
20
- line-height: 25px;
21
- }
22
-
23
- .color-green {
24
- color: $success-static;
25
- }
26
-
27
- .color-red {
28
- color: $error-static;
29
- }
30
- }
1
+ @import '../global';
2
+
3
+ .drawerItemContainer {
4
+ display: flex;
5
+ flex-direction: column;
6
+
7
+ .title {
8
+ color: #000;
9
+ font-weight: 600;
10
+ font-size: 24px;
11
+ line-height: 35px;
12
+ margin-bottom: 3px;
13
+ margin-top: 1.5rem;
14
+ }
15
+
16
+ .text {
17
+ color: #000;
18
+ font-weight: 400;
19
+ font-size: 24px;
20
+ line-height: 25px;
21
+ }
22
+
23
+ .color-green {
24
+ color: $success-static;
25
+ }
26
+
27
+ .color-red {
28
+ color: $error-static;
29
+ }
30
+ }