jmapcloud-ng 1.1.14 → 1.1.16

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 (116) hide show
  1. package/.env.example +14 -2
  2. package/.storybook/main.ts +39 -0
  3. package/.storybook/preview.tsx +53 -0
  4. package/index.html.example +58 -0
  5. package/package.json +15 -23
  6. package/public/index.js +190 -1
  7. package/public/ng-core/index.js +8 -7
  8. package/readme.md +1 -2
  9. package/stories/NumberInput.stories.tsx +76 -0
  10. package/stories/RadioGroup.stories.tsx +58 -0
  11. package/stories/Select.stories.tsx +80 -0
  12. package/stories/TextField.stories.tsx +58 -0
  13. package/vite.config.ts +184 -0
  14. package/vitest.config.ts +20 -0
  15. package/public/0459ffa6fb90a5f28cce.jpeg +0 -0
  16. package/public/119.1c53fc837017c47d1253.js +0 -1
  17. package/public/3028880919fb73dfe888.jpeg +0 -0
  18. package/public/354.f69990de55718d7295f8.js +0 -89
  19. package/public/454.8787532673b02274ab6e.js +0 -101
  20. package/public/52.f5e2b640458dea9838d1.js +0 -1
  21. package/public/540.43fb8eab59c982ac43fe.js +0 -1
  22. package/public/619.eeeadc32d69cb206b2f7.js +0 -1
  23. package/public/625.92fb52db33bd0c51555c.js +0 -1
  24. package/public/672.18c77287fb908be1bd6e.js +0 -1
  25. package/public/6778c27ffaded711edfd.png +0 -0
  26. package/public/719.3600580d111c9ccb84cf.js +0 -1
  27. package/public/8dd976ca45da314b75dd.jpeg +0 -0
  28. package/public/931.00ed503def9cbc08ad50.js +0 -1
  29. package/public/99afe0d2e54da682449e.jpeg +0 -0
  30. package/public/adfa69cf2717b89b6bb5.jpeg +0 -0
  31. package/public/ae0a5e6d1e3a9dde5441.jpeg +0 -0
  32. package/public/de5f4722562b2b315b48.png +0 -0
  33. package/public/ng-core/09981dd99649bb6ef1ac.svg +0 -105
  34. package/public/ng-core/52.14c434f61e513f1ef5da.js +0 -1
  35. package/public/ng-core/c193d6d1884e572c3b28.png +0 -0
  36. package/public/ng-core/d0566a872348b35a7296.png +0 -0
  37. package/public/ng-core/de5f4722562b2b315b48.png +0 -0
  38. /package/public/{0038a0301d10913ef1a5.png → ARROW.9V9mH5sV.png} +0 -0
  39. /package/public/{4057c163e11def908a90.svg → JMap-Cloud-Logo.Bqp3iL-5.svg} +0 -0
  40. /package/public/{6be4a9aff03c67e671d8.woff → barlow-v5-latin-ext_latin-300.BOtJevCE.woff} +0 -0
  41. /package/public/{62df9be6c862d273e849.ttf → barlow-v5-latin-ext_latin-300.CU1HK-bZ.ttf} +0 -0
  42. /package/public/{8b70e6d02996d24fbe26.woff2 → barlow-v5-latin-ext_latin-300.DLZg2Aqw.woff2} +0 -0
  43. /package/public/{e29c61ea7a5baabf5f4e.eot → barlow-v5-latin-ext_latin-300.f3X_qAHv.eot} +0 -0
  44. /package/public/{67e73a1cc6b8251e3ce1.eot → barlow-v5-latin-ext_latin-300italic.Cq3R63xm.eot} +0 -0
  45. /package/public/{c3d30fdfede822039221.woff → barlow-v5-latin-ext_latin-300italic.D7H-NYlV.woff} +0 -0
  46. /package/public/{9cd8b1aa87f79ba5fa0d.ttf → barlow-v5-latin-ext_latin-300italic.IFGWg-1n.ttf} +0 -0
  47. /package/public/{f8f61d01e9d0e645f832.woff2 → barlow-v5-latin-ext_latin-300italic.egA3zdlg.woff2} +0 -0
  48. /package/public/{78deb69247b11dfaef82.ttf → barlow-v5-latin-ext_latin-500.C4YXkooW.ttf} +0 -0
  49. /package/public/{ba7c7a40fbe1f44f9479.woff2 → barlow-v5-latin-ext_latin-500.CD6t94O0.woff2} +0 -0
  50. /package/public/{e8f262034b5631a64a0b.eot → barlow-v5-latin-ext_latin-500.CxOfqZC2.eot} +0 -0
  51. /package/public/{777e7e6fe2378aaae24f.woff → barlow-v5-latin-ext_latin-500.CzPrU5vz.woff} +0 -0
  52. /package/public/{25a7d7975ef0d3ef388a.woff → barlow-v5-latin-ext_latin-500italic.57LLgqjl.woff} +0 -0
  53. /package/public/{b5165670c231fb850519.ttf → barlow-v5-latin-ext_latin-500italic.B6ytA4Ll.ttf} +0 -0
  54. /package/public/{661f40a1301ccb4a3902.woff2 → barlow-v5-latin-ext_latin-500italic.BlgFPUrR.woff2} +0 -0
  55. /package/public/{e2a6ddee443d4e6cf1ed.eot → barlow-v5-latin-ext_latin-500italic.Ckyh_717.eot} +0 -0
  56. /package/public/{c7d002dea1093108b8de.eot → barlow-v5-latin-ext_latin-700.BRgY-mcC.eot} +0 -0
  57. /package/public/{fd850adaa0518f36b06d.ttf → barlow-v5-latin-ext_latin-700.Bit82amp.ttf} +0 -0
  58. /package/public/{ce8277efba6b7e0a2a5c.woff → barlow-v5-latin-ext_latin-700.BpBhuUVz.woff} +0 -0
  59. /package/public/{d0dd3909312ceba37118.woff2 → barlow-v5-latin-ext_latin-700.DC603mJ6.woff2} +0 -0
  60. /package/public/{4c795b2381e21dab3d48.woff → barlow-v5-latin-ext_latin-700italic.Ca79JvF0.woff} +0 -0
  61. /package/public/{285533c63e34641da323.woff2 → barlow-v5-latin-ext_latin-700italic.ClCyBg9U.woff2} +0 -0
  62. /package/public/{879e91ad82b5b535cf0c.eot → barlow-v5-latin-ext_latin-700italic.D8ZJZUNK.eot} +0 -0
  63. /package/public/{1ee5ef3f7b69d0e1a043.ttf → barlow-v5-latin-ext_latin-700italic.DqT2IX-q.ttf} +0 -0
  64. /package/public/{5202701c84b3fa4d7fab.woff2 → barlow-v5-latin-ext_latin-italic.1jYUkYRv.woff2} +0 -0
  65. /package/public/{20810ee7649dffced61b.ttf → barlow-v5-latin-ext_latin-italic.BEAJKPKF.ttf} +0 -0
  66. /package/public/{ec1879956d06705c8df1.woff → barlow-v5-latin-ext_latin-italic.BWD2mhUL.woff} +0 -0
  67. /package/public/{70c5533fa86bfec6a286.eot → barlow-v5-latin-ext_latin-italic.DjOUzQd-.eot} +0 -0
  68. /package/public/{6d63cfd120fdbf1c4eb9.ttf → barlow-v5-latin-ext_latin-regular.B3onXd7t.ttf} +0 -0
  69. /package/public/{99a52b75db400feaff73.woff2 → barlow-v5-latin-ext_latin-regular.Ca4dJCbb.woff2} +0 -0
  70. /package/public/{33701469cd0541b0e782.eot → barlow-v5-latin-ext_latin-regular.D-IiuhnY.eot} +0 -0
  71. /package/public/{2eda83a40af3d9412dce.woff → barlow-v5-latin-ext_latin-regular.DLT4q60S.woff} +0 -0
  72. /package/public/{6179310a76747e88c3fb.jpeg → default.Ce_Z_JPs.jpeg} +0 -0
  73. /package/public/{6230e7c7c8475e869f62.jpeg → jmap.C4V11UP7.jpeg} +0 -0
  74. /package/public/{ef53d84ef6d55e48e702.png → logo.hwi8NCH2.png} +0 -0
  75. /package/public/ng-core/{cff684e59ffb052d72cb.woff2 → MaterialIcons-Regular.BjVsc-s9.woff2} +0 -0
  76. /package/public/ng-core/{83bebaf37c09c7e1c3ee.woff → MaterialIcons-Regular.Bnsxcfr1.woff} +0 -0
  77. /package/public/ng-core/{5e7382c63da0098d634a.ttf → MaterialIcons-Regular.N21pKt8_.ttf} +0 -0
  78. /package/public/ng-core/{4674f8ded773cb03e824.eot → MaterialIcons-Regular.rDPjWPoz.eot} +0 -0
  79. /package/public/ng-core/{6be4a9aff03c67e671d8.woff → barlow-v5-latin-ext_latin-300.BOtJevCE.woff} +0 -0
  80. /package/public/ng-core/{62df9be6c862d273e849.ttf → barlow-v5-latin-ext_latin-300.CU1HK-bZ.ttf} +0 -0
  81. /package/public/ng-core/{8b70e6d02996d24fbe26.woff2 → barlow-v5-latin-ext_latin-300.DLZg2Aqw.woff2} +0 -0
  82. /package/public/ng-core/{e29c61ea7a5baabf5f4e.eot → barlow-v5-latin-ext_latin-300.f3X_qAHv.eot} +0 -0
  83. /package/public/ng-core/{67e73a1cc6b8251e3ce1.eot → barlow-v5-latin-ext_latin-300italic.Cq3R63xm.eot} +0 -0
  84. /package/public/ng-core/{c3d30fdfede822039221.woff → barlow-v5-latin-ext_latin-300italic.D7H-NYlV.woff} +0 -0
  85. /package/public/ng-core/{9cd8b1aa87f79ba5fa0d.ttf → barlow-v5-latin-ext_latin-300italic.IFGWg-1n.ttf} +0 -0
  86. /package/public/ng-core/{f8f61d01e9d0e645f832.woff2 → barlow-v5-latin-ext_latin-300italic.egA3zdlg.woff2} +0 -0
  87. /package/public/ng-core/{78deb69247b11dfaef82.ttf → barlow-v5-latin-ext_latin-500.C4YXkooW.ttf} +0 -0
  88. /package/public/ng-core/{ba7c7a40fbe1f44f9479.woff2 → barlow-v5-latin-ext_latin-500.CD6t94O0.woff2} +0 -0
  89. /package/public/ng-core/{e8f262034b5631a64a0b.eot → barlow-v5-latin-ext_latin-500.CxOfqZC2.eot} +0 -0
  90. /package/public/ng-core/{777e7e6fe2378aaae24f.woff → barlow-v5-latin-ext_latin-500.CzPrU5vz.woff} +0 -0
  91. /package/public/ng-core/{25a7d7975ef0d3ef388a.woff → barlow-v5-latin-ext_latin-500italic.57LLgqjl.woff} +0 -0
  92. /package/public/ng-core/{b5165670c231fb850519.ttf → barlow-v5-latin-ext_latin-500italic.B6ytA4Ll.ttf} +0 -0
  93. /package/public/ng-core/{661f40a1301ccb4a3902.woff2 → barlow-v5-latin-ext_latin-500italic.BlgFPUrR.woff2} +0 -0
  94. /package/public/ng-core/{e2a6ddee443d4e6cf1ed.eot → barlow-v5-latin-ext_latin-500italic.Ckyh_717.eot} +0 -0
  95. /package/public/ng-core/{c7d002dea1093108b8de.eot → barlow-v5-latin-ext_latin-700.BRgY-mcC.eot} +0 -0
  96. /package/public/ng-core/{fd850adaa0518f36b06d.ttf → barlow-v5-latin-ext_latin-700.Bit82amp.ttf} +0 -0
  97. /package/public/ng-core/{ce8277efba6b7e0a2a5c.woff → barlow-v5-latin-ext_latin-700.BpBhuUVz.woff} +0 -0
  98. /package/public/ng-core/{d0dd3909312ceba37118.woff2 → barlow-v5-latin-ext_latin-700.DC603mJ6.woff2} +0 -0
  99. /package/public/ng-core/{4c795b2381e21dab3d48.woff → barlow-v5-latin-ext_latin-700italic.Ca79JvF0.woff} +0 -0
  100. /package/public/ng-core/{285533c63e34641da323.woff2 → barlow-v5-latin-ext_latin-700italic.ClCyBg9U.woff2} +0 -0
  101. /package/public/ng-core/{879e91ad82b5b535cf0c.eot → barlow-v5-latin-ext_latin-700italic.D8ZJZUNK.eot} +0 -0
  102. /package/public/ng-core/{1ee5ef3f7b69d0e1a043.ttf → barlow-v5-latin-ext_latin-700italic.DqT2IX-q.ttf} +0 -0
  103. /package/public/ng-core/{5202701c84b3fa4d7fab.woff2 → barlow-v5-latin-ext_latin-italic.1jYUkYRv.woff2} +0 -0
  104. /package/public/ng-core/{20810ee7649dffced61b.ttf → barlow-v5-latin-ext_latin-italic.BEAJKPKF.ttf} +0 -0
  105. /package/public/ng-core/{ec1879956d06705c8df1.woff → barlow-v5-latin-ext_latin-italic.BWD2mhUL.woff} +0 -0
  106. /package/public/ng-core/{70c5533fa86bfec6a286.eot → barlow-v5-latin-ext_latin-italic.DjOUzQd-.eot} +0 -0
  107. /package/public/ng-core/{6d63cfd120fdbf1c4eb9.ttf → barlow-v5-latin-ext_latin-regular.B3onXd7t.ttf} +0 -0
  108. /package/public/ng-core/{99a52b75db400feaff73.woff2 → barlow-v5-latin-ext_latin-regular.Ca4dJCbb.woff2} +0 -0
  109. /package/public/ng-core/{33701469cd0541b0e782.eot → barlow-v5-latin-ext_latin-regular.D-IiuhnY.eot} +0 -0
  110. /package/public/ng-core/{2eda83a40af3d9412dce.woff → barlow-v5-latin-ext_latin-regular.DLT4q60S.woff} +0 -0
  111. /package/public/ng-core/{29807dae6b7e9d8d55ec.ico → favicon_dark.BF6q4K7_.ico} +0 -0
  112. /package/public/ng-core/{a36ae31b461350c13f48.ico → favicon_light.P7XKPcl8.ico} +0 -0
  113. /package/public/ng-core/{b520733890c5a5ebd989.gif → loading.BSbPtkHb.gif} +0 -0
  114. /package/public/ng-core/{ef53d84ef6d55e48e702.png → logo.hwi8NCH2.png} +0 -0
  115. /package/public/{66686eb78f3c2f6b96e8.png → project-home-page.DE87IrpB.png} +0 -0
  116. /package/public/{49ffd22e22cb71aab698.jpeg → transitionPageBackground.D8W87_U8.jpeg} +0 -0
package/readme.md CHANGED
@@ -1,6 +1,6 @@
1
1
  #### The first time, install dependencies :
2
2
 
3
- npm i
3
+ npm i
4
4
 
5
5
  #### To start the application :
6
6
 
@@ -15,7 +15,6 @@ When code is changed, it's automatically built and the web page refresh by its o
15
15
  - https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
16
16
  - "Prettier - Code formatter" extention (Author : Esben Petersen)
17
17
 
18
-
19
18
  #### VPS publishing
20
19
 
21
20
  When working in a VPS environment, your personal VPS expect to find the Portal compiled sources in a local diretory inside the web hosting VPS infrascructure.
@@ -0,0 +1,76 @@
1
+ import { InputAdornment, TextField, Typography } from "@mui/material"
2
+ import type { Meta, StoryObj } from "@storybook/react"
3
+ import { useArgs } from "storybook/internal/preview-api"
4
+ import { PrintField } from "@/print/components/PrintComponents"
5
+
6
+ const meta: Meta = {
7
+ title: "Form/NumberInput",
8
+ args: {
9
+ label: "Scale",
10
+ value: 25000,
11
+ min: 100,
12
+ max: 10000000000,
13
+ step: 5000
14
+ },
15
+ argTypes: {
16
+ label: { control: "text" },
17
+ value: { control: "number" },
18
+ min: { control: "number" },
19
+ max: { control: "number" },
20
+ step: { control: "number" }
21
+ }
22
+ }
23
+
24
+ export default meta
25
+ type Story = StoryObj
26
+
27
+ export const Scale: Story = {
28
+ render: () => {
29
+ const [{ label, value, min, max, step }, updateArgs] = useArgs<{ label: string; value: number; min: number; max: number; step: number }>()
30
+ return (
31
+ <PrintField label={label}>
32
+ <TextField
33
+ variant="filled"
34
+ type="number"
35
+ value={value}
36
+ onChange={e => updateArgs({ value: Number(e.target.value) })}
37
+ sx={{ "& input": { paddingLeft: 0 } }}
38
+ InputProps={{
39
+ startAdornment: (
40
+ <InputAdornment position="start">
41
+ <Typography sx={theme => ({ paddingLeft: ".9375rem", color: theme.palette.primary.main, fontSize: ".875rem" })}>
42
+ 1 :{" "}
43
+ </Typography>
44
+ </InputAdornment>
45
+ ),
46
+ inputProps: { min, max, step }
47
+ }}
48
+ />
49
+ </PrintField>
50
+ )
51
+ }
52
+ }
53
+
54
+ export const Plain: Story = {
55
+ args: {
56
+ label: "Count",
57
+ value: 10,
58
+ min: 0,
59
+ max: 100,
60
+ step: 1
61
+ },
62
+ render: () => {
63
+ const [{ label, value, min, max, step }, updateArgs] = useArgs<{ label: string; value: number; min: number; max: number; step: number }>()
64
+ return (
65
+ <PrintField label={label}>
66
+ <TextField
67
+ variant="filled"
68
+ type="number"
69
+ value={value}
70
+ onChange={e => updateArgs({ value: Number(e.target.value) })}
71
+ InputProps={{ inputProps: { min, max, step } }}
72
+ />
73
+ </PrintField>
74
+ )
75
+ }
76
+ }
@@ -0,0 +1,58 @@
1
+ import { Checkbox, FormControlLabel, FormGroup, FormLabel } from "@mui/material"
2
+ import type { Meta, StoryObj } from "@storybook/react"
3
+ import { useArgs } from "storybook/internal/preview-api"
4
+ import { RadioGroup } from "@/print/components/PrintComponents"
5
+
6
+ const meta: Meta<typeof RadioGroup> = {
7
+ title: "Form/RadioGroup",
8
+ component: RadioGroup
9
+ }
10
+
11
+ export default meta
12
+ type Story = StoryObj<typeof RadioGroup>
13
+
14
+ export const MultipleCheckboxes: Story = {
15
+ render: () => {
16
+ const [args, updateArgs] = useArgs<{ date: boolean; north: boolean; scale: boolean; legend: boolean }>()
17
+ return (
18
+ <RadioGroup>
19
+ <FormLabel component="legend">Display</FormLabel>
20
+ <FormGroup>
21
+ <FormControlLabel
22
+ control={<Checkbox size="small" color="primary" checked={args.date ?? true} onChange={() => updateArgs({ date: !args.date })} />}
23
+ label="Date"
24
+ />
25
+ <FormControlLabel
26
+ control={<Checkbox size="small" color="primary" checked={args.north ?? true} onChange={() => updateArgs({ north: !args.north })} />}
27
+ label="North Arrow"
28
+ />
29
+ <FormControlLabel
30
+ control={<Checkbox size="small" color="primary" checked={args.scale ?? true} onChange={() => updateArgs({ scale: !args.scale })} />}
31
+ label="Scale"
32
+ />
33
+ <FormControlLabel
34
+ control={<Checkbox size="small" color="primary" checked={args.legend ?? false} onChange={() => updateArgs({ legend: !args.legend })} />}
35
+ label="Legend"
36
+ />
37
+ </FormGroup>
38
+ </RadioGroup>
39
+ )
40
+ },
41
+ args: { date: true, north: true, scale: true, legend: false } as any
42
+ }
43
+
44
+ export const SingleCheckbox: Story = {
45
+ render: () => {
46
+ const [{ checked }, updateArgs] = useArgs<{ checked: boolean }>()
47
+ return (
48
+ <RadioGroup>
49
+ <FormLabel component="legend">Resolution</FormLabel>
50
+ <FormControlLabel
51
+ control={<Checkbox size="small" color="primary" checked={checked ?? false} onChange={() => updateArgs({ checked: !checked })} />}
52
+ label="High resolution"
53
+ />
54
+ </RadioGroup>
55
+ )
56
+ },
57
+ args: { checked: false } as any
58
+ }
@@ -0,0 +1,80 @@
1
+ import { Select } from "@mui/material"
2
+ import type { Meta, StoryObj } from "@storybook/react"
3
+ import { useArgs } from "storybook/internal/preview-api"
4
+ import { PrintField } from "@/print/components/PrintComponents"
5
+
6
+ const meta: Meta = {
7
+ title: "Form/Select",
8
+ args: {
9
+ label: "File Type",
10
+ value: "png"
11
+ },
12
+ argTypes: {
13
+ label: { control: "text" },
14
+ value: { control: "select", options: ["png", "jpeg", "pdf"] }
15
+ }
16
+ }
17
+
18
+ export default meta
19
+ type Story = StoryObj
20
+
21
+ export const FileType: Story = {
22
+ render: () => {
23
+ const [{ label, value }, updateArgs] = useArgs<{ label: string; value: string }>()
24
+ return (
25
+ <PrintField label={label}>
26
+ <Select native variant="filled" value={value} onChange={e => updateArgs({ value: e.target.value })}>
27
+ <option value="png">png</option>
28
+ <option value="jpeg">jpeg</option>
29
+ <option value="pdf">pdf</option>
30
+ </Select>
31
+ </PrintField>
32
+ )
33
+ }
34
+ }
35
+
36
+ export const PaperFormat: Story = {
37
+ args: {
38
+ label: "Paper Format",
39
+ value: "letter"
40
+ },
41
+ argTypes: {
42
+ value: { control: "select", options: ["letter", "a4", "a3", "a2", "a1", "a0"] }
43
+ },
44
+ render: () => {
45
+ const [{ label, value }, updateArgs] = useArgs<{ label: string; value: string }>()
46
+ return (
47
+ <PrintField label={label}>
48
+ <Select native variant="filled" value={value} onChange={e => updateArgs({ value: e.target.value })}>
49
+ <option value="letter">Letter</option>
50
+ <option value="a4">A4</option>
51
+ <option value="a3">A3</option>
52
+ <option value="a2">A2</option>
53
+ <option value="a1">A1</option>
54
+ <option value="a0">A0</option>
55
+ </Select>
56
+ </PrintField>
57
+ )
58
+ }
59
+ }
60
+
61
+ export const Orientation: Story = {
62
+ args: {
63
+ label: "Orientation",
64
+ value: "true"
65
+ },
66
+ argTypes: {
67
+ value: { control: "select", options: ["true", "false"] }
68
+ },
69
+ render: () => {
70
+ const [{ label, value }, updateArgs] = useArgs<{ label: string; value: string }>()
71
+ return (
72
+ <PrintField label={label}>
73
+ <Select native variant="filled" value={value} onChange={e => updateArgs({ value: e.target.value })}>
74
+ <option value="true">Portrait</option>
75
+ <option value="false">Landscape</option>
76
+ </Select>
77
+ </PrintField>
78
+ )
79
+ }
80
+ }
@@ -0,0 +1,58 @@
1
+ import { TextField } from "@mui/material"
2
+ import type { Meta, StoryObj } from "@storybook/react"
3
+ import { useArgs } from "storybook/internal/preview-api"
4
+ import { PrintField } from "@/print/components/PrintComponents"
5
+
6
+ const meta: Meta = {
7
+ title: "Form/TextField",
8
+ args: {
9
+ label: "Title",
10
+ value: "My Map Title",
11
+ placeholder: ""
12
+ },
13
+ argTypes: {
14
+ label: { control: "text" },
15
+ value: { control: "text" },
16
+ placeholder: { control: "text" }
17
+ }
18
+ }
19
+
20
+ export default meta
21
+ type Story = StoryObj
22
+
23
+ export const Default: Story = {
24
+ render: () => {
25
+ const [{ label, value, placeholder }, updateArgs] = useArgs<{ label: string; value: string; placeholder: string }>()
26
+ return (
27
+ <PrintField label={label}>
28
+ <TextField
29
+ variant="filled"
30
+ value={value}
31
+ placeholder={placeholder}
32
+ onChange={e => updateArgs({ value: e.target.value })}
33
+ />
34
+ </PrintField>
35
+ )
36
+ }
37
+ }
38
+
39
+ export const Empty: Story = {
40
+ args: {
41
+ label: "Subtitle",
42
+ value: "",
43
+ placeholder: "Enter subtitle..."
44
+ },
45
+ render: () => {
46
+ const [{ label, value, placeholder }, updateArgs] = useArgs<{ label: string; value: string; placeholder: string }>()
47
+ return (
48
+ <PrintField label={label}>
49
+ <TextField
50
+ variant="filled"
51
+ value={value}
52
+ placeholder={placeholder}
53
+ onChange={e => updateArgs({ value: e.target.value })}
54
+ />
55
+ </PrintField>
56
+ )
57
+ }
58
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,184 @@
1
+ import react from "@vitejs/plugin-react"
2
+ import dotenv from "dotenv"
3
+ import { readFileSync } from "fs"
4
+ import { resolve } from "path"
5
+ import { defineConfig, type Plugin } from "vite"
6
+ import mkcert from "vite-plugin-mkcert"
7
+
8
+ dotenv.config({ path: resolve(__dirname, ".env") })
9
+
10
+ const packageJSON = JSON.parse(readFileSync(resolve(__dirname, "package.json"), "utf8"))
11
+
12
+ const getBuildNumber = () => {
13
+ const d = new Date()
14
+ const pad = (n: number) => (n < 10 ? `0${n}` : `${n}`)
15
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}.${process.env.GITHUB_BUILD_NUMBER ?? "dev"}`
16
+ }
17
+
18
+ const getRestBaseUrl = () => {
19
+ const env = process.env.CLOUD_ENV
20
+ const prefix =
21
+ env === "production" ? "" : env === "staging" ? "staging." : env === "QA" ? "qa." : process.env.REST_BASE_API_DEV_SERVER_PREFIX ? `${process.env.REST_BASE_API_DEV_SERVER_PREFIX}.` : "dev."
22
+ return `https://api.${prefix}jmapcloud.io`
23
+ }
24
+
25
+ const getHtmlInputPath = () => resolve(__dirname, process.env.BUILD_TARGET === "cloud" ? "build/index.html" : "index.html")
26
+
27
+ const JMAP_OPTIONS_PLACEHOLDER = "/* __JMAP_OPTIONS_PLACEHOLDER__ */"
28
+
29
+ function jmapOptionsPlugin(): Plugin {
30
+ return {
31
+ name: "jmap-options",
32
+ transformIndexHtml(html: string) {
33
+ const replacement = `window.JMAP_OPTIONS = { restBaseUrl: "${getRestBaseUrl()}", map: {}, application: {}, hideMainLayout: true }`
34
+ return html.replace(JMAP_OPTIONS_PLACEHOLDER, replacement)
35
+ }
36
+ }
37
+ }
38
+
39
+ function inlineCssInLegacyBuildPlugin(isLegacyProductionBuild: boolean): Plugin {
40
+ return {
41
+ name: "inline-css-in-legacy-build",
42
+ apply: "build",
43
+ enforce: "post",
44
+ generateBundle(_outputOptions, bundle) {
45
+ if (!isLegacyProductionBuild) {
46
+ return
47
+ }
48
+
49
+ const cssAssets = Object.entries(bundle).flatMap(([fileName, output]) => {
50
+ if (output.type !== "asset" || !output.fileName.endsWith(".css")) {
51
+ return []
52
+ }
53
+
54
+ const source = output.source
55
+ const cssText = typeof source === "string" ? source : Buffer.from(source).toString("utf8")
56
+ return [{ fileName, cssText }]
57
+ })
58
+ const combinedCss = cssAssets.map(css => css.cssText).join("\n")
59
+
60
+ for (const output of Object.values(bundle)) {
61
+ if (output.type !== "chunk" || !output.isEntry) {
62
+ continue
63
+ }
64
+
65
+ if (!combinedCss) {
66
+ continue
67
+ }
68
+
69
+ const styleId = `vite-inline-css-${output.fileName.replace(/[^a-zA-Z0-9_-]/g, "-")}`
70
+ const injectionCode = `(function(){var id=${JSON.stringify(styleId)};if(document.getElementById(id)){return;}var s=document.createElement("style");s.id=id;s.appendChild(document.createTextNode(${JSON.stringify(combinedCss)}));document.head.appendChild(s);}());`
71
+ output.code = `${injectionCode}\n${output.code}`
72
+ }
73
+
74
+ for (const css of cssAssets) {
75
+ const cssFileName = css.fileName
76
+ delete bundle[cssFileName]
77
+ }
78
+
79
+ for (const output of Object.values(bundle)) {
80
+ if (output.type !== "asset" || !output.fileName.endsWith(".html")) {
81
+ continue
82
+ }
83
+
84
+ const source = output.source
85
+ const html = typeof source === "string" ? source : Buffer.from(source).toString("utf8")
86
+
87
+ output.source = html
88
+ .replace(/<link[^>]*rel=["']stylesheet["'][^>]*>\s*/g, "")
89
+ // Legacy mode uses classic scripts; strip module type first.
90
+ .replace(/<script([^>]*?)\stype=["']module["']([^>]*)>/g, (_match: string, before: string, after: string) => `<script${before}${after}>`)
91
+ // Enforce defer on every script tag in legacy HTML.
92
+ .replace(/<script(?![^>]*\bdefer\b)([^>]*)>/g, (_match: string, attrs: string) => `<script${attrs} defer>`)
93
+ }
94
+ }
95
+ }
96
+ }
97
+
98
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
+ export default defineConfig(async ({ command }): Promise<any> => {
100
+ const postcssParentSelector = (await import("postcss-parent-selector")).default
101
+ const keepGlobalRootSelectorsPlugin: any = {
102
+ postcssPlugin: "keep-global-root-selectors",
103
+ Rule(rule: { selectors?: string[] }) {
104
+ if (!rule.selectors) {
105
+ return
106
+ }
107
+ rule.selectors = rule.selectors.map(selector => selector.replace(/^\.jmap_wrapper\s+(html|body|:root)(?=[\s.:#[>+~]|$)/, "$1"))
108
+ }
109
+ }
110
+ const isLegacyProductionBuild = command === "build" && process.env.NODE_ENV === "production"
111
+ const coreIndexFileUrl =
112
+ process.env.CORE_INDEX_FILE_URL && process.env.CORE_INDEX_FILE_URL.trim().length > 0
113
+ ? process.env.CORE_INDEX_FILE_URL
114
+ : command === "serve"
115
+ ? `https://localhost:${process.env.CORE_DEV_PORT ?? "8085"}/src/core.ts`
116
+ : "./ng-core/index.js"
117
+ const plugins: any[] = [react(), jmapOptionsPlugin(), inlineCssInLegacyBuildPlugin(isLegacyProductionBuild)]
118
+
119
+ if (command === "serve") {
120
+ const { default: checker } = await import("vite-plugin-checker")
121
+ plugins.push(mkcert(), checker({ typescript: true }))
122
+ }
123
+
124
+ return {
125
+ root: __dirname,
126
+ resolve: {
127
+ alias: {
128
+ "@": resolve(__dirname, "src")
129
+ }
130
+ },
131
+ define: {
132
+ TYPESCRIPT_APP_VERSION: JSON.stringify(getBuildNumber()),
133
+ APP_VERSION: process.env.BUILD_TARGET === "cloud" ? JSON.stringify(getBuildNumber()) : JSON.stringify(packageJSON.version),
134
+ IS_DEV: command === "serve" ? "true" : "false",
135
+ CORE_INDEX_FILE_URL: JSON.stringify(coreIndexFileUrl),
136
+ MUI_X_PRO_LICENSE: JSON.stringify(process.env.MUI_X_PRO_LICENSE ?? "")
137
+ },
138
+ css: {
139
+ postcss: {
140
+ plugins: [
141
+ postcssParentSelector({
142
+ selector: ".jmap_wrapper"
143
+ }),
144
+ keepGlobalRootSelectorsPlugin
145
+ ]
146
+ }
147
+ },
148
+ plugins,
149
+ server: {
150
+ port: Number(process.env.DEV_PORT) || 8086,
151
+ cors: true
152
+ },
153
+ build: {
154
+ outDir: process.env.BUILD_DIR || resolve(__dirname, "public"),
155
+ emptyOutDir: true,
156
+ target: isLegacyProductionBuild ? "es2015" : "esnext",
157
+ sourcemap: command === "serve",
158
+ cssCodeSplit: !isLegacyProductionBuild,
159
+ // TODO: feature/JMAP8-3471 - replace terser by esbuild
160
+ minify: "terser",
161
+ terserOptions: {
162
+ compress: {},
163
+ ecma: 2015,
164
+ keep_classnames: true,
165
+ keep_fnames: true,
166
+ toplevel: false,
167
+ format: {
168
+ comments: false,
169
+ beautify: false
170
+ }
171
+ },
172
+ rollupOptions: {
173
+ input: getHtmlInputPath(),
174
+ output: {
175
+ ...(isLegacyProductionBuild ? { format: "iife" as const, name: "JMapNgBundle" } : {}),
176
+ inlineDynamicImports: isLegacyProductionBuild,
177
+ entryFileNames: process.env.BUILD_TARGET === "cloud" ? "[name].[hash].js" : "[name].js",
178
+ chunkFileNames: "[name].[hash].js",
179
+ assetFileNames: "[name].[hash][extname]"
180
+ }
181
+ }
182
+ }
183
+ }
184
+ })
@@ -0,0 +1,20 @@
1
+ /// <reference types="vitest/config" />
2
+ import { resolve } from "path"
3
+ import { defineConfig } from "vitest/config"
4
+
5
+ export default defineConfig({
6
+ resolve: {
7
+ alias: {
8
+ "@": resolve(__dirname, "src"),
9
+ "jmapcloud-common": resolve(__dirname, "../../../packages/jmapcloud-common/src/index.ts"),
10
+ "jmapcloud-ng-core-types": resolve(__dirname, "../ng-core-types/index.ts"),
11
+ "jmapcloud-ng-types": resolve(__dirname, "../ng-types/index.ts"),
12
+ "jmapcloud-ng-types/all-enums": resolve(__dirname, "../ng-types/all-enums.ts")
13
+ }
14
+ },
15
+ test: {
16
+ environment: "node",
17
+ globals: true,
18
+ passWithNoTests: true
19
+ }
20
+ })
Binary file
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkjmapcloud_ng=self.webpackChunkjmapcloud_ng||[]).push([[119],{90119:function(e,t,n){n.r(t),n.d(t,{startSelectionPage:function(){return startSelectionPage}});var i=n(49236),a=n(36870),l=n(86326),r=n(63776),o=n(61275),s=n(68737),d=n(82432),c=(n(80742),n(8380),n(1986),n(47531)),h=n(77608),u=n(15331),b=n(31665),p=n(5535),m=n(51682),g=n(92248),A=n(9940),f=n(12945),x=n(73726),C=n(12396),S=n(42432),j=n(63010),v=n(63641),y=n(76922),N=n(72387),T=n(69626),w=n(13326),_=n(65492);const D=(0,w.Ay)(_.A)({height:"1rem",borderRadius:"0.1rem",fontSize:"0.8rem","& > .MuiChip-label":{textAlign:"center",padding:"0.2rem",paddingLeft:"0.25rem",paddingRight:"0.25rem"}},{withTheme:!0});var E=n(67110),P=void 0;const k=function getCollator(){return(0,i.A)(this,P),new Intl.Collator(JMap.Language.getLocale(),{numeric:!0,sensitivity:"base"})}.bind(void 0),M=function compare(e,t,n,a){return(0,i.A)(this,P),null==e&&null!=t?a===E.C_.ASCENDANT?1:-1:null!=e&&null==t?a===E.C_.ASCENDANT?-1:1:a===E.C_.ASCENDANT?n.compare(e,t):n.compare(t,e)}.bind(void 0);var R=n(82324),L=n(64821);function EnhancedTableHead(e){var t=this;const{order:n,orderBy:l,onRequestSort:r}=e,o=function createSortHandler(e){var n=this;return(0,i.A)(this,t),function(t){(0,i.A)(this,n),r(t,e)}.bind(this)}.bind(this);return(0,a.jsx)(f.A,{children:(0,a.jsx)(C.A,{children:e.headCells.map(function(e){return(0,i.A)(this,t),(0,a.jsx)(g.A,{id:`selection-table-header-${e.id}`,align:"left",padding:e.disablePadding?"none":"normal",sortDirection:l===e.name&&n,children:(0,a.jsxs)(S.A,{id:`selection-table-header-${e.id}-label`,sx:{textTransform:"capitalize"},active:l===e.name,direction:l===e.name?n:E.C_.ASCENDANT,onClick:o(e.name),children:[e.label,l===e.name?(0,a.jsx)(u.A,{component:"span",sx:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1},children:n===E.C_.DESCENDANT?"sorted descending":"sorted ascending"}):null]})},e.id)}.bind(this))})})}const I=(0,d.Ng)(function(e){var t=this;(0,i.A)(this,undefined);const n=(0,N.B)(e).selection.displayedLayerId,a=e.layer.allById[n],l=a?a.attributes:[],r=a?a.name:"-";return{selection:e.map.selection,displayedLayerId:n,layerName:r,headCells:l.map(function(e){return(0,i.A)(this,t),{id:e.id,name:e.name,disablePadding:!0,label:e.label,type:e.type}}.bind(this)),containerHeight:e.map.containerHeight}}.bind(void 0))(function SelectionTableFn(e){var t=this;const[n,r]=l.useState(E.C_.ASCENDANT),[o,d]=l.useState(""),[f,S]=l.useState(0),N=function handleRequestSort(e,a){(0,i.A)(this,t);const l=o===a&&n===E.C_.ASCENDANT;r(l?E.C_.DESCENDANT:E.C_.ASCENDANT),d(a)}.bind(this),w=function handleClick(e,n){(0,i.A)(this,t),JMap.Map.fitFeatures([n.jmap_feature_buff],{paddingBottom:(0,L.N)(),maxZoom:R.nD})}.bind(this),_=function handlePageChange(e,n){return(0,i.A)(this,t),S(n)}.bind(this),P=(e.selection[e.displayedLayerId]||[]).map(function(e){return(0,i.A)(this,t),{jmap_feature_buff:e,...e.properties}}.bind(this));let I=f;f*T.l>P.length&&(I=0);const H=k();return(0,a.jsxs)(u.A,{sx:function sx(e){return(0,i.A)(this,t),{backgroundColor:e.palette.background.paper,width:"100%",height:"100%",paddingLeft:".5rem",paddingRight:".5rem",borderRadius:0}}.bind(this),children:[(0,a.jsx)(b.A,{id:"selection-table-close-button",title:(0,y.Tl)("selection.close.table"),children:(0,a.jsx)(u.A,{sx:{position:"absolute",top:".5rem",right:".5rem",zIndex:2,cursor:"pointer"},children:(0,a.jsx)(h.g,{icon:c.GR,onClick:function onClick(){(0,i.A)(this,t),JMap.Application.Selection.closeTableTab()}.bind(this)})})}),(0,a.jsxs)(j.A,{sx:{position:"relative",left:"0.5rem"},children:[(0,a.jsx)(v.A,{id:"selection-table-layer-title",variant:"h6",color:"textPrimary",children:e.layerName}),(0,a.jsxs)(v.A,{id:"selection-table-count-title",sx:{fontSize:".95rem"},color:"textSecondary",children:[" : ",(0,y.Tl)("selection.layer.count",P.length)]})]}),(0,a.jsx)(A.A,{sx:{position:"relative",left:"0.5rem",width:"calc(100% - 1rem)",overflowY:"auto",overflowX:"auto",height:"calc(100% - 4rem)"},children:(0,a.jsxs)(p.A,{"aria-labelledby":"selection-table-title",size:"small","aria-label":"Selection table",children:[(0,a.jsx)(EnhancedTableHead,{headCells:e.headCells,order:n,orderBy:o,onRequestSort:N}),(0,a.jsx)(m.A,{children:P.sort(function(e,a){return(0,i.A)(this,t),M(e[o],a[o],H,n)}.bind(this)).slice(I*T.l,I*T.l+T.l).map(function(n,l){var r=this;return(0,i.A)(this,t),(0,a.jsx)(C.A,{id:`selection-table-row-${l}`,hover:!0,onClick:function onClick(e){return(0,i.A)(this,r),w(e,n)}.bind(this),tabIndex:-1,children:e.headCells.map(function(e,t){return(0,i.A)(this,r),(0,a.jsx)(g.A,{id:`selection-table-row-${l}-cell-${e.id}`,align:"number"===e.type?"right":"left",children:(o=e.type,d=n[e.name],null==d||"null"===d?(0,a.jsx)(D,{variant:"filled",color:"secondary",label:(0,y.Tl)(`data.${String(d)}`)}):"date"===o||"datetime"===o?JMap.Util.Date.format(d,{displayTime:"datetime"===o}):"string"===o&&s._t.test(d)?(0,a.jsx)("a",{href:d,target:"_blank",children:d}):String(d))},t);var o,d}.bind(this))},l)}.bind(this))})]})}),P.length>T.l&&(0,a.jsx)(x.A,{id:"selection-table-pagination",component:"div",count:P.length,rowsPerPage:T.l,page:I,onPageChange:_,labelRowsPerPage:(0,y.Tl)("row.per.page")})]})});var H=void 0;const J=function SelectionPageFn(e){return(0,i.A)(this,H),(0,a.jsx)(o.A,{theme:e.theme,children:(0,a.jsx)(I,{})})}.bind(void 0),$=(0,d.Ng)(function(e){return(0,i.A)(this,H),{theme:e.external[s.sZ].ui.theme}}.bind(void 0))(J),z=function SelectionPage(){return(0,i.A)(this,H),(0,a.jsx)(d.Kq,{store:JMap.getDataStore(),children:(0,a.jsx)($,{})})}.bind(void 0);function startSelectionPage(){var e=this;window.addEventListener("beforeunload",function(){(0,i.A)(this,e),JMap.Application.Selection.closeTableTab()}.bind(this));r.H(document.body).render((0,a.jsx)(l.StrictMode,{children:(0,a.jsx)(z,{})}))}}}]);
Binary file