Compare commits

...

251 Commits

Author SHA1 Message Date
6c2f36f020 1.5.0
Some checks failed
Default (tags) / security (push) Failing after 14s
Default (tags) / test (push) Failing after 14s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-04-11 10:15:00 +00:00
71f4d44782 feat(badge): Add dees-badge component with demo file and update packageManager field in package.json 2025-04-11 10:15:00 +00:00
6df2eb5acc 1.4.1
Some checks failed
Default (tags) / security (push) Failing after 17s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-01-20 03:59:23 +01:00
469f8e0f21 fix(dependencies): Update dependency versions for smartpromise, webcontainer/api, tapbundle, and @types/node 2025-01-20 03:59:23 +01:00
3712f6ef90 1.4.0
Some checks failed
Default (tags) / security (push) Failing after 17s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-01-20 03:43:21 +01:00
d2646cd62c feat(dees-terminal): Enhanced the dees-terminal component to support environment variable settings and improved setup command execution. 2025-01-20 03:43:20 +01:00
f29ca0ba0b 1.3.4
Some checks failed
Default (tags) / security (push) Failing after 18s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2025-01-15 16:00:03 +01:00
0c273a818d fix(chart): Fix chart rendering and appearance issues in the DeesChartArea component. 2025-01-15 16:00:03 +01:00
6e8099c6f4 1.3.3
Some checks failed
Default (tags) / security (push) Failing after 18s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-12-17 19:44:47 +01:00
07c68b82a4 fix(dees-input-multitoggle): Add missing TypeScript declaration for dees-input-multitoggle 2024-12-17 19:44:47 +01:00
afd19dc912 1.3.2
Some checks failed
Default (tags) / security (push) Failing after 17s
Default (tags) / test (push) Failing after 12s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
2024-12-09 19:14:21 +01:00
f02572665f fix(metadata): Updated package metadata and readme for better project description and structure. 2024-12-09 19:14:21 +01:00
f93082e9b0 1.3.1 2024-11-07 01:16:54 +01:00
08f3bad5f9 fix(DeesSimpleAppDash): Fix: add border to controlbar in DeesSimpleAppDash 2024-11-07 01:16:54 +01:00
563958813e 1.3.0 2024-11-07 01:14:37 +01:00
1ae1703133 feat(dees-simple-appdash): Enhance responsive styling and terminal setup command 2024-11-07 01:14:36 +01:00
d2771dfc31 1.2.0 2024-10-07 13:43:15 +02:00
dd46d3e2f4 feat(index.ts): Add export for colors module in index.ts 2024-10-07 13:43:15 +02:00
ae641801e1 1.1.13 2024-10-06 01:18:13 +02:00
719e63c667 fix(dees-button): Fix styling issue in button component. 2024-10-06 01:18:13 +02:00
e26da1bb8f 1.1.12 2024-10-06 01:12:01 +02:00
f5fad07038 fix(dees-button): Fix reflect attribute for disabled property on dees-button component 2024-10-06 01:12:00 +02:00
68992301ff 1.1.11 2024-10-05 00:01:38 +02:00
d529c27a68 fix(DeesStepper): Adjusted CSS properties in DeesStepper component 2024-10-05 00:01:37 +02:00
56e8d868c9 1.1.10 2024-10-04 15:34:00 +02:00
14e1d4a9f5 fix(dependencies): Reverted @webcontainer/api version 2024-10-04 15:33:59 +02:00
efe49469aa 1.1.9 2024-10-04 15:30:14 +02:00
39500f802a fix(dependencies): Update various dependencies for compatibility and stability. 2024-10-04 15:30:13 +02:00
a64d38dbb1 1.1.8 2024-09-02 22:09:11 +02:00
e2d3ae8949 fix(dees-simple-appdash): Corrected viewTab active background color 2024-09-02 22:09:10 +02:00
1c4fd0a2da 1.1.7 2024-09-02 22:07:43 +02:00
d0e85da308 fix(dependencies): Update dependencies to their latest versions 2024-09-02 22:07:42 +02:00
6a0b0aa741 1.1.6 2024-07-01 11:59:31 +02:00
4c620f480c fix(dees-dataview-codebox): Corrected the font-family order for better font rendering. 2024-07-01 11:59:30 +02:00
b7ebcc4cef 1.1.5 2024-07-01 11:58:19 +02:00
e6275bfeb3 fix(dees-dataview-codebox): Adjusted line number font weight in codebox 2024-07-01 11:58:18 +02:00
d4585654b6 1.1.4 2024-07-01 11:57:52 +02:00
1a8562dc6f fix(UI): Fixed font-family order for code and value elements 2024-07-01 11:57:51 +02:00
2148959c35 1.1.3 2024-07-01 11:52:56 +02:00
28a84f7c1a fix(dees-dataview-codebox): Adjusted codebox font weight and font family. 2024-07-01 11:52:56 +02:00
e935dc3983 1.1.2 2024-06-30 21:33:23 +02:00
ab30b51c9e fix(elements): Fix various UI components and improve styles 2024-06-30 21:33:22 +02:00
8377d94f81 1.1.1 2024-06-30 10:37:53 +02:00
14ebeeaee8 fix(build): Fix build script by updating source folders. 2024-06-30 10:37:52 +02:00
fdc8cb44ab 1.1.0 2024-06-30 10:37:12 +02:00
f72936d1a7 feat(project dependencies): Updated various dependencies and internal fonts 2024-06-30 10:37:12 +02:00
04170d4834 update documentation 2024-04-20 23:16:19 +02:00
9006e023bd 1.0.289 2024-02-13 23:31:27 +01:00
8c8d5e9329 fix(core): update 2024-02-13 23:31:26 +01:00
f4fee46439 1.0.288 2024-02-05 13:56:50 +01:00
af2ee9a6a5 fix(core): update 2024-02-05 13:56:49 +01:00
a3012b5ec1 1.0.287 2024-02-05 13:17:45 +01:00
0f414ae24a fix(core): update 2024-02-05 13:17:44 +01:00
1fa9b410ed 1.0.286 2024-02-05 13:13:02 +01:00
90c7890cbf fix(core): update 2024-02-05 13:13:02 +01:00
55e601b806 1.0.285 2024-02-05 13:12:27 +01:00
45952914ba fix(core): update 2024-02-05 13:12:26 +01:00
5f83b01f0e 1.0.284 2024-02-05 13:11:06 +01:00
c03563f2fc fix(core): update 2024-02-05 13:11:05 +01:00
edf50d2f8d 1.0.283 2024-02-05 10:07:50 +01:00
d0789ab279 fix(core): update 2024-02-05 10:07:49 +01:00
55bac1bf7b 1.0.282 2024-02-03 14:49:26 +01:00
2957121473 fix(core): update 2024-02-03 14:49:25 +01:00
020a1bfb75 1.0.281 2024-02-03 14:42:47 +01:00
bb246c4f8e fix(core): update 2024-02-03 14:42:46 +01:00
cf258a8d59 1.0.280 2024-02-03 14:42:21 +01:00
38b4df1ce3 fix(core): update 2024-02-03 14:42:20 +01:00
2f7fdc16c7 1.0.279 2024-02-03 12:44:12 +01:00
f4b426bc7f fix(core): update 2024-02-03 12:44:12 +01:00
9577cc9ebf 1.0.278 2024-02-03 11:26:16 +01:00
be5124217a fix(core): update 2024-02-03 11:26:15 +01:00
d029a6c346 1.0.277 2024-01-24 12:18:38 +01:00
69bb03dcdf fix(core): update 2024-01-24 12:18:37 +01:00
5eb2f4cebc 1.0.276 2024-01-24 00:59:11 +01:00
c021a84788 fix(core): update 2024-01-24 00:59:11 +01:00
321ce99338 1.0.275 2024-01-22 22:30:45 +01:00
6cfe89645c fix(core): update 2024-01-22 22:30:44 +01:00
11f900beeb 1.0.274 2024-01-22 20:51:51 +01:00
39ca21e57c fix(core): update 2024-01-22 20:51:50 +01:00
87872191e2 1.0.273 2024-01-22 19:40:09 +01:00
2d3fd74333 fix(core): update 2024-01-22 19:40:08 +01:00
eebe898dcc 1.0.272 2024-01-22 19:27:54 +01:00
ca73d00f68 fix(core): update 2024-01-22 19:27:54 +01:00
14bdc46073 1.0.271 2024-01-22 19:27:31 +01:00
bf04ce6a8f fix(core): update 2024-01-22 19:27:30 +01:00
9dc6dab3a5 1.0.270 2024-01-22 19:23:23 +01:00
a21a3b6918 fix(core): update 2024-01-22 19:23:22 +01:00
6ae21d73aa 1.0.269 2024-01-22 18:39:31 +01:00
941871991f fix(core): update 2024-01-22 18:39:31 +01:00
497c38f426 1.0.268 2024-01-22 18:30:36 +01:00
bfaa1623d9 fix(core): update 2024-01-22 18:30:35 +01:00
5ffa5a2adc 1.0.267 2024-01-22 18:30:01 +01:00
16d1375e47 fix(core): update 2024-01-22 18:30:00 +01:00
30eda34f37 1.0.266 2024-01-22 17:32:58 +01:00
2cc7eb1ead fix(core): update 2024-01-22 17:32:58 +01:00
64f5bee801 1.0.265 2024-01-22 17:29:53 +01:00
9d57f983dd fix(core): update 2024-01-22 17:29:53 +01:00
8ccd21df36 1.0.264 2024-01-22 17:25:55 +01:00
c22c994d12 fix(core): update 2024-01-22 17:25:55 +01:00
01369444b7 1.0.263 2024-01-22 17:22:33 +01:00
4beb15f70c fix(core): update 2024-01-22 17:22:33 +01:00
30170bcd2e 1.0.262 2024-01-22 17:12:59 +01:00
f29a8de504 fix(core): update 2024-01-22 17:12:58 +01:00
965ab02315 1.0.261 2024-01-22 01:29:28 +01:00
991784eae6 fix(core): update 2024-01-22 01:29:27 +01:00
b474b7986c 1.0.260 2024-01-22 01:26:13 +01:00
98542252cb fix(core): update 2024-01-22 01:26:13 +01:00
0d78deadf2 1.0.259 2024-01-22 01:11:29 +01:00
5108f47e56 fix(core): update 2024-01-22 01:11:28 +01:00
7d4e5f2ca7 1.0.258 2024-01-22 00:59:26 +01:00
c0ad0f4570 fix(core): update 2024-01-22 00:59:25 +01:00
d56eb602a9 1.0.257 2024-01-21 22:37:39 +01:00
f1c791eb12 fix(core): update 2024-01-21 22:37:39 +01:00
e872188be7 1.0.256 2024-01-21 17:14:16 +01:00
2d712e78b0 fix(core): update 2024-01-21 17:14:15 +01:00
ebeecd0686 1.0.255 2024-01-21 14:25:03 +01:00
1d09f994c6 fix(core): update 2024-01-21 14:25:02 +01:00
686c3714fc 1.0.254 2024-01-21 14:14:57 +01:00
e29086036c fix(core): update 2024-01-21 14:14:57 +01:00
78e24aa720 1.0.253 2024-01-21 13:57:46 +01:00
7c8876c835 fix(core): update 2024-01-21 13:57:46 +01:00
2222fb1e01 1.0.252 2024-01-21 13:57:27 +01:00
46b30a1ef0 fix(core): update 2024-01-21 13:57:26 +01:00
d49d5f70ef 1.0.251 2024-01-21 13:36:48 +01:00
76a950e2ba fix(core): update 2024-01-21 13:36:47 +01:00
077aba5e58 1.0.250 2024-01-21 13:27:29 +01:00
857362423f fix(core): update 2024-01-21 13:27:29 +01:00
e7232b6a53 1.0.249 2024-01-21 01:45:36 +01:00
2eb26544b3 fix(core): update 2024-01-21 01:45:35 +01:00
a40834d1cf 1.0.248 2024-01-21 01:42:07 +01:00
0c1159d4c7 fix(core): update 2024-01-21 01:42:06 +01:00
4584765046 1.0.247 2024-01-21 01:12:57 +01:00
5817068cb5 fix(core): update 2024-01-21 01:12:57 +01:00
8fa01fbaad 1.0.246 2024-01-18 02:08:20 +01:00
9cdae8ccdb fix(core): update 2024-01-18 02:08:19 +01:00
7e1c5f3dbb 1.0.245 2024-01-15 19:42:34 +01:00
1f3f17247c fix(core): update 2024-01-15 19:42:33 +01:00
f07f2bb95e 1.0.244 2024-01-15 19:42:16 +01:00
0b2f6715e0 fix(core): update 2024-01-15 19:42:15 +01:00
e473364d40 1.0.243 2024-01-15 12:57:50 +01:00
554b72b075 fix(core): update 2024-01-15 12:57:49 +01:00
2c34ec8b39 1.0.242 2024-01-11 21:14:31 +01:00
e6b8e2de19 fix(core): update 2024-01-11 21:14:30 +01:00
a99d270ef1 1.0.241 2024-01-10 05:11:56 +01:00
93ee42135c fix(core): update 2024-01-10 05:11:55 +01:00
f3ca4a114a 1.0.240 2024-01-09 13:57:54 +01:00
7515b824eb fix(core): update 2024-01-09 13:57:53 +01:00
18b98b831a 1.0.239 2023-12-26 21:21:19 +01:00
d99fc8bde9 fix(core): update 2023-12-26 21:21:18 +01:00
f8d5f86814 1.0.238 2023-12-20 19:11:16 +01:00
9c1de08b4b fix(core): update 2023-12-20 19:11:16 +01:00
7f26337e1b 1.0.237 2023-12-20 19:09:55 +01:00
49f3fc8feb fix(core): update 2023-12-20 19:09:55 +01:00
5613ad7fa6 1.0.236 2023-12-08 19:16:23 +01:00
5af43900c4 fix(core): update 2023-12-08 19:16:22 +01:00
c5598f95ef 1.0.235 2023-12-08 18:26:40 +01:00
13d0cf729c fix(core): update 2023-12-08 18:26:40 +01:00
032e928dde 1.0.234 2023-12-08 18:22:19 +01:00
14ab3682f2 fix(core): update 2023-12-08 18:22:18 +01:00
c554e730a6 1.0.233 2023-12-08 18:15:40 +01:00
4d5a490e80 fix(core): update 2023-12-08 18:15:40 +01:00
7708c89fe1 1.0.232 2023-11-29 20:39:18 +01:00
0a0be3e357 fix(core): update 2023-11-29 20:39:17 +01:00
7b7c469fab 1.0.231 2023-11-29 17:20:33 +01:00
d852186888 fix(core): update 2023-11-29 17:20:32 +01:00
6cfda1ebf3 1.0.230 2023-10-31 13:44:19 +01:00
8e0062fdd5 fix(core): update 2023-10-31 13:44:18 +01:00
844cc30551 1.0.229 2023-10-24 14:18:04 +02:00
64074e37fc fix(core): update 2023-10-24 14:18:03 +02:00
cd9b028e9b 1.0.228 2023-10-23 21:23:19 +02:00
81da871e38 fix(core): update 2023-10-23 21:23:18 +02:00
90e78a2e31 1.0.227 2023-10-23 17:26:04 +02:00
5cec1fea73 fix(core): update 2023-10-23 17:26:03 +02:00
52130d67e2 1.0.226 2023-10-23 16:13:02 +02:00
a73ad40eb1 fix(core): update 2023-10-23 16:13:02 +02:00
6589818b0b 1.0.225 2023-10-20 11:17:43 +02:00
555fa32ac2 fix(core): update 2023-10-20 11:17:42 +02:00
50a84f2422 1.0.224 2023-10-20 10:47:54 +02:00
c724a3e85b fix(core): update 2023-10-20 10:47:53 +02:00
b47530e254 1.0.223 2023-10-18 15:18:50 +02:00
b80fdf113e fix(core): update 2023-10-18 15:18:49 +02:00
963edbffa3 1.0.222 2023-10-17 20:07:46 +02:00
f3687f724f fix(core): update 2023-10-17 20:07:45 +02:00
a736ee9800 1.0.221 2023-10-12 15:43:11 +02:00
bea2047092 fix(core): update 2023-10-12 15:43:10 +02:00
7d98ac8f38 1.0.220 2023-10-11 12:24:13 +02:00
32244bb450 fix(core): update 2023-10-11 12:24:12 +02:00
b154631c77 1.0.219 2023-10-07 20:01:50 +02:00
466a24ac10 fix(core): update 2023-10-07 20:01:49 +02:00
7db91a2fe6 1.0.218 2023-10-07 19:33:05 +02:00
46652dec6f fix(core): update 2023-10-07 19:33:04 +02:00
50e591b80c 1.0.217 2023-10-05 22:42:34 +02:00
6710a163a9 fix(core): update 2023-10-05 22:42:33 +02:00
a39f43f79a 1.0.216 2023-10-05 14:37:00 +02:00
964520a2f9 fix(core): update 2023-10-05 14:36:59 +02:00
6e680085a4 1.0.215 2023-09-22 20:02:49 +02:00
286a843b67 fix(core): update 2023-09-22 20:02:48 +02:00
df7c5ebafc 1.0.214 2023-09-22 19:42:23 +02:00
9927323a9d fix(core): update 2023-09-22 19:42:23 +02:00
66f3e66c8b 1.0.213 2023-09-22 19:04:03 +02:00
c68b0c5090 fix(core): update 2023-09-22 19:04:02 +02:00
53ac03507d 1.0.212 2023-09-22 13:15:34 +02:00
0031b51bcf fix(core): update 2023-09-22 13:15:34 +02:00
67a8c6e591 1.0.211 2023-09-20 18:57:54 +02:00
806390a068 fix(core): update 2023-09-20 18:57:54 +02:00
508b18bc3b 1.0.210 2023-09-18 15:12:58 +02:00
c2499ea507 fix(core): update 2023-09-18 15:12:57 +02:00
c0c91aec94 1.0.209 2023-09-17 21:38:02 +02:00
a27008a295 fix(core): update 2023-09-17 21:38:02 +02:00
7e11627618 1.0.208 2023-09-17 10:29:23 +02:00
968ce63a53 fix(core): update 2023-09-17 10:29:22 +02:00
7c0eb3290f 1.0.207 2023-09-16 14:31:03 +02:00
62403625ba fix(core): update 2023-09-16 14:31:03 +02:00
9a34b03540 1.0.206 2023-09-15 20:51:04 +02:00
8bb63df7e3 fix(core): update 2023-09-15 20:51:03 +02:00
65cd73845a 1.0.205 2023-09-15 20:11:52 +02:00
8534bc254b fix(core): update 2023-09-15 20:11:51 +02:00
2a2fd324a0 1.0.204 2023-09-15 19:07:35 +02:00
58e3de2559 fix(core): update 2023-09-15 19:07:34 +02:00
c30736870d 1.0.203 2023-09-15 19:03:19 +02:00
cfd48de885 fix(core): update 2023-09-15 19:03:18 +02:00
462df2b648 1.0.202 2023-09-15 17:27:36 +02:00
f64da93cf9 fix(core): update 2023-09-15 17:27:35 +02:00
a55db621ef 1.0.201 2023-09-14 19:46:10 +02:00
c033bdfc3b fix(core): update 2023-09-14 19:46:09 +02:00
2610e56ec1 1.0.200 2023-09-14 19:43:27 +02:00
08aa9e3fe4 fix(core): update 2023-09-14 19:43:26 +02:00
411ae7ee07 1.0.199 2023-09-13 21:14:06 +02:00
41700c1eb1 fix(core): update 2023-09-13 21:14:05 +02:00
8d7bac9793 1.0.198 2023-09-13 21:13:48 +02:00
0229eefa4d fix(core): update 2023-09-13 21:13:47 +02:00
61f646743a 1.0.197 2023-09-13 19:15:54 +02:00
e3babde7e8 fix(core): update 2023-09-13 19:15:53 +02:00
c389e43e93 1.0.196 2023-09-13 18:12:02 +02:00
1511db4eea fix(core): update 2023-09-13 18:12:01 +02:00
d713756034 1.0.195 2023-09-13 16:46:01 +02:00
17d224332d fix(core): update 2023-09-13 16:46:00 +02:00
32dd5e769b 1.0.194 2023-09-13 16:25:55 +02:00
12ace00a90 fix(core): update 2023-09-13 16:25:54 +02:00
bbc09330c9 1.0.193 2023-09-13 13:41:57 +02:00
82ead7bd1a fix(core): update 2023-09-13 13:41:56 +02:00
f8f9b150b8 1.0.192 2023-09-13 01:37:03 +02:00
494e8b7e26 fix(core): update 2023-09-13 01:37:02 +02:00
c76d364071 1.0.191 2023-09-12 13:44:07 +02:00
760e0085f7 fix(core): update 2023-09-12 13:44:07 +02:00
6890ca1f1f 1.0.190 2023-09-12 13:42:56 +02:00
9ca000cf06 fix(core): update 2023-09-12 13:42:55 +02:00
1c0f5129a9 1.0.189 2023-09-09 13:34:46 +02:00
69e17949f4 fix(core): update 2023-09-09 13:34:46 +02:00
bcfd3495dd 1.0.188 2023-09-08 11:44:04 +02:00
03a46a72c5 fix(core): update 2023-09-08 11:44:03 +02:00
87 changed files with 14619 additions and 5233 deletions

View File

@ -119,6 +119,6 @@ jobs:
run: | run: |
npmci node install stable npmci node install stable
npmci npm install npmci npm install
pnpm install -g @gitzone/tsdoc pnpm install -g @git.zone/tsdoc
npmci command tsdoc npmci command tsdoc
continue-on-error: true continue-on-error: true

429
changelog.md Normal file
View File

@ -0,0 +1,429 @@
# Changelog
## 2025-04-11 - 1.5.0 - feat(badge)
Add dees-badge component with demo file and update packageManager field in package.json
- Introduce a new badge component allowing different types (default, primary, success, warning, error) with an optional rounded style
- Provide a demo for the badge component
- Export the badge component in the main elements index
- Update package.json to include an explicit packageManager field
## 2025-01-20 - 1.4.1 - fix(dependencies)
Update dependency versions for smartpromise, webcontainer/api, tapbundle, and @types/node
- Update @push.rocks/smartpromise to version ^4.2.0
- Downgrade @webcontainer/api to version 1.2.0
- Update @push.rocks/tapbundle to version ^5.5.6
- Update @types/node to version ^22.10.7
## 2025-01-20 - 1.4.0 - feat(dees-terminal)
Enhanced the dees-terminal component to support environment variable settings and improved setup command execution.
- Added environment property to pass custom environment variables.
- Introduced webcontainerDeferred to handle the promise for web container creation.
- Enhanced demo to illustrate environment variable usage.
- Improved async interaction with the terminal for setting environment variables and executing setup commands.
## 2025-01-15 - 1.3.4 - fix(chart)
Fix chart rendering and appearance issues in the DeesChartArea component.
- Resolved issues with chart dimensions calculation based on padding.
- Adjusted grid and axis lines appearance for better visibility.
- Updated tooltip and grid line styling for better accessibility.
- Improved series data representation as time-series for more accurate display.
## 2024-12-17 - 1.3.3 - fix(dees-input-multitoggle)
Add missing TypeScript declaration for dees-input-multitoggle
- Added a missing declaration to the HTMLElementTagNameMap for 'dees-input-multitoggle' element.
## 2024-12-09 - 1.3.2 - fix(metadata)
Updated package metadata and readme for better project description and structure.
- Updated package.json and npmextra.json with a detailed project description and list of keywords.
- Enhanced readme.md with installation instructions, component usage examples, and detailed component descriptions for clarity.
## 2024-11-07 - 1.3.1 - fix(DeesSimpleAppDash)
Fix: add border to controlbar in DeesSimpleAppDash
- Fixed the missing border at the top of the controlbar in DeesSimpleAppDash.
## 2024-11-07 - 1.3.0 - feat(dees-simple-appdash)
Enhance responsive styling and terminal setup command
- Added a new property `terminalSetupCommand` for configuring terminal setup commands.
- Improved responsive styling and positioning for components to achieve a fluid layout.
- Fixed layout shifts by switching positions to `absolute` for `appbar` and `appcontent`.
## 2024-10-07 - 1.2.0 - feat(index.ts)
Add export for colors module in index.ts
- The index.ts file now exports the colors module, making color utilities available for external use.
## 2024-10-06 - 1.1.13 - fix(dees-button)
Fix styling issue in button component.
- Moved the .button.disabled styling block to its correct position after the .button.highlighted block.
## 2024-10-06 - 1.1.12 - fix(dees-button)
Fix reflect attribute for disabled property on dees-button component
- Added reflect: true to the 'disabled' property ensuring changes reflect in the DOM attribute.
## 2024-10-05 - 1.1.11 - fix(DeesStepper)
Adjusted CSS properties in DeesStepper component
- Increased border-radius from 8px to 16px for step container elements
- Adjusted font-size and font-weight for the title in the step container to improve readability
## 2024-10-04 - 1.1.10 - fix(dependencies)
Reverted @webcontainer/api version
- Changed @webcontainer/api version from ^1.3.0 to 1.2.0 in package.json
## 2024-10-04 - 1.1.9 - fix(dependencies)
Update various dependencies for compatibility and stability.
- Update @design.estate/dees-domtools to version ^2.0.61
- Update @design.estate/dees-element to version ^2.0.39
- Update @webcontainer/api to version ^1.3.0
- Update apexcharts to version ^3.54.0
- Update monaco-editor to version ^0.52.0
- Update pdfjs-dist to version ^4.6.82
- Update @push.rocks/tapbundle to version ^5.3.0
- Update @types/node to version ^22.7.4
## 2024-09-02 - 1.1.8 - fix(dees-simple-appdash)
Corrected viewTab active background color
- Corrected the background color of the viewTab in active state for better visual consistency.
## 2024-09-02 - 1.1.7 - fix(dependencies)
Update dependencies to their latest versions
- Update dependency versions in package.json:
- - @design.estate/dees-element from ^2.0.34 to ^2.0.36
- - @fortawesome/fontawesome-svg-core from ^6.5.2 to ^6.6.0
- - @fortawesome/free-brands-svg-icons from ^6.5.2 to ^6.6.0
- - @fortawesome/free-regular-svg-icons from ^6.5.2 to ^6.6.0
- - @fortawesome/free-solid-svg-icons from ^6.5.2 to ^6.6.0
- - @tsclass/tsclass from ^4.0.63 to ^4.1.2
- - apexcharts from ^3.49.2 to ^3.53.0
- - highlight.js from 11.9.0 to 11.10.0
- - monaco-editor from ^0.50.0 to ^0.51.0
- - pdfjs-dist from ^4.3.136 to ^4.5.136
- - @git.zone/tsbuild from ^2.1.82 to ^2.1.84
- - @push.rocks/tapbundle from ^5.0.23 to ^5.0.24
- - @types/node from ^20.14.9 to ^22.5.2
## 2024-07-01 - 1.1.6 - fix(dees-dataview-codebox)
Corrected the font-family order for better font rendering.
- Corrected the font-family order in dees-dataview-codebox.ts to ensure 'Intel One Mono' is prioritized over 'Geist Mono'.
## 2024-07-01 - 1.1.5 - fix(dees-dataview-codebox)
Adjusted line number font weight in codebox
- Changed the line number font weight from 400 to 200 in the codebox for better visual alignment.
## 2024-07-01 - 1.1.4 - fix(UI)
Fixed font-family order for code and value elements
- Updated font-family order in dees-dataview-codebox.ts
- Updated font-family order in dees-dataview-statusobject.ts
## 2024-07-01 - 1.1.3 - fix(dees-dataview-codebox)
Adjusted codebox font weight and font family.
- Changed font weight from 200 to 400 for better readability.
- Updated font-family to include 'Geist Mono' for uniform appearance.
## 2024-06-30 - 1.1.2 - fix(elements)
Fix various UI components and improve styles
- Updated styles for multiple components for better appearance in dark mode.
- Added missing event handling in `dees-input-fileupload` component.
- Implemented tooltip support in `dees-label` component.
- Fixed alignment issues in `dees-appui-*` components.
- Resolved various accessibility issues in form elements.
## 2024-06-30 - 1.1.1 - fix(build)
Fix build script by updating source folders.
- Updated build script to correctly reference 'tsfolders' folder.
## 2024-06-30 - 1.1.0 - feat(project dependencies)
Updated various dependencies and internal fonts
- Updated dependencies in package.json with the latest versions.
- Updated font-family references from 'Roboto' and 'Inter' to 'Geist Sans' across multiple components.
## 2024-04-20 - 1.0.289 - Documentation Update
Updated the project documentation.
## 2024-02-05 to 2024-02-13 - 1.0.277 to 1.0.288 - Core Fixes
Series of core updates and patches.
## 2024-01-22 to 2024-02-05 - 1.0.257 to 1.0.276 - Core Fixes
More core updates and patches.
## 2024-01-21 - 1.0.256 to 1.0.257 - Core Fixes
Minor bugfixes for core functionalities.
## 2024-01-18 - 1.0.246 - Core Fixes
Bugfixes for core functionalities.
## 2024-01-15 - 1.0.242 to 1.0.245 - Core Fixes
Various core bugfixes.
## 2024-01-11 - 1.0.241 to 1.0.242 - Core Fixes
Bugfixes for core functionalities.
## 2024-01-10 - 1.0.240 to 1.0.241 - Core Fixes
Minor core fixes and improvements.
## 2024-01-09 - 1.0.239 to 1.0.240 - Core Fixes
Core updates and patches.
## 2023-12-26 - 1.0.238 to 1.0.239 - Core Fixes
Updates to core functionalities.
## 2023-12-20 - 1.0.236 to 1.0.238 - Core Fixes
Bugfixes and updates for core functionalities.
## 2023-12-08 - 1.0.233 to 1.0.236 - Core Fixes
Multiple updates to core functionalities.
## 2023-11-29 - 1.0.231 to 1.0.232 - Core Fixes
Minor core patches.
## 2023-10-31 - 1.0.229 to 1.0.230 - Core Fixes
Various updates and fixes for core.
## 2023-10-24 - 1.0.228 to 1.0.229 - Core Fixes
More core updates and patches.
## 2023-10-23 - 1.0.226 to 1.0.228 - Core Fixes
Series of updates and fixes for core functionalities.
## 2023-10-20 - 1.0.223 to 1.0.225 - Core Fixes
Minor updates and fixes for core.
## 2023-10-18 - 1.0.222 to 1.0.223 - Core Fixes
Core patches and bugfixes.
## 2023-10-17 - 1.0.221 to 1.0.222 - Core Fixes
Further updates to core functionalities.
## 2023-10-12 - 1.0.220 to 1.0.221 - Core Fixes
Minor core updates.
## 2023-10-11 - 1.0.219 to 1.0.220 - Core Fixes
Bugfixes and updates for core.
## 2023-10-07 - 1.0.217 to 1.0.219 - Core Fixes
Series of core updates and patches.
## 2023-10-05 - 1.0.216 to 1.0.217 - Core Fixes
Minor updates for core functionalities.
## 2023-09-22 - 1.0.212 to 1.0.215 - Core Fixes
Various updates and fixes for core.
## 2023-09-20 - 1.0.210 to 1.0.211 - Core Fixes
Series of core patches.
## 2023-09-18 - 1.0.209 to 1.0.210 - Core Fixes
Bugfixes and improvements to core.
## 2023-09-17 - 1.0.207 to 1.0.209 - Core Fixes
Minor updates and fixes.
## 2023-09-15 - 1.0.203 to 1.0.206 - Core Fixes
Series of core improvements and fixes.
## 2023-09-14 - 1.0.199 to 1.0.202 - Core Fixes
Patches for core functionalities.
## 2023-09-13 - 1.0.194 to 1.0.198 - Core Fixes
Various bugfixes and updates for core.
## 2023-09-12 - 1.0.190 to 1.0.193 - Core Fixes
Minor core patches.
## 2023-09-09 - 1.0.188 to 1.0.189 - Core Fixes
Updates and bugfixes for core.
## 2023-09-07 - 1.0.186 to 1.0.187 - Core Fixes
Core patches and improvements.
## 2023-09-04 - 1.0.184 to 1.0.185 - Core Fixes
Series of updates and bugfixes for core.
## 2023-09-01 - 1.0.180 to 1.0.183 - Core Fixes
Various core updates and fixes.
## 2023-08-28 - 1.0.177 to 1.0.179 - Core Fixes
Minor bugfixes and updates.
## 2023-08-26 - 1.0.176 to 1.0.177 - Core Fixes
Bugfixes for core functionalities.
## 2023-08-20 - 1.0.173 to 1.0.175 - Core Fixes
Series of updates and fixes for core.
## 2023-08-08 - 1.0.172 to 1.0.173 - Core Fixes
Minor core updates.
## 2023-08-07 - 1.0.171 to 1.0.172 - Core Fixes
Various updates to core.
## 2023-04-12 - 1.0.169 to 1.0.170 - Core Fixes
Bugfixes for core functionalities.
## 2023-04-10 - 1.0.163 to 1.0.168 - Core Fixes
Series of core updates and patches.
## 2023-04-07 - 1.0.160 to 1.0.162 - Core Fixes
Various updates for core functionalities.
## 2023-04-06 - 1.0.155 to 1.0.159 - Core Fixes
Bugfixes and improvements to core.
## 2023-03-27 - 1.0.150 to 1.0.154 - Core Fixes
Minor updates and patches for core functionalities.
## 2023-03-09 - 1.0.149 to 1.0.150 - Core Fixes
Bugfixes for core functionalities.
## 2023-01-17 - 1.0.146 to 1.0.148 - Core Fixes
Updates and fixes for core.
## 2023-01-16 - 1.0.144 to 1.0.145 - Core Fixes
Series of updates and bugfixes for core.
## 2023-01-13 - 1.0.134 to 1.0.143 - Core Fixes
Various core patches and improvements.
## 2023-01-12 - 1.0.132 to 1.0.133 - Core Fixes
Minor fixes for core functionalities.
## 2023-01-11 - 1.0.126 to 1.0.131 - Core Fixes
Series of updates and fixes for core.
## 2023-01-09 - 1.0.122 to 1.0.123 - Core Fixes
Minor core patches and updates.
## 2023-01-07 - 1.0.113 to 1.0.121 - Core Fixes
Updates and bugfixes for core functionalities.
## 2023-01-03 - 1.0.107 to 1.0.110 - Core Fixes
Series of core updates and fixes.
## 2022-12-12 - 1.0.105 to 1.0.106 - Core Fixes
Various core patches.
## 2022-12-07 - 1.0.104 to 1.0.105 - Core Fixes
Bugfixes and improvements to core functionalities.
## 2022-12-06 - 1.0.103 to 1.0.104 - Core Fixes
Series of updates and patches for core.
## 2022-08-18 - 1.0.98 to 1.0.102 - Core Fixes
Updates and bugfixes for core functionalities.
## 2022-07-14 - 1.0.93 to 1.0.94 - Core Fixes
Minor core updates.
## 2022-06-26 - 1.0.92 to 1.0.93 - Core Fixes
Bugfixes for core functionalities.
## 2022-06-10 - 1.0.91 to 1.0.92 - Core Fixes
Updates and patches for core.
## 2022-05-30 - 1.0.90 to 1.0.91 - Core Fixes
Minor updates and bugfixes.
## 2022-05-26 - 1.0.87 to 1.0.89 - Core Fixes
Series of core updates and patches.
## 2022-05-24 to 2022-05-20 - 1.0.83 to 1.0.86 - Core Fixes
Various updates and bugfixes for core functionalities.
## 2022-05-03 - 1.0.79 to 1.0.80 - Core Fixes
Updates and patches for core functionalities.
## 2022-03-18 - 1.0.74 to 1.0.77 - Core Fixes
Bugfixes and updates for core functionalities.
## 2022-01-24 - 1.0.73 to 1.0.74 - Core Fixes
Minor core patches.
## 2021-12-10 - 1.0.71 to 1.0.72 - Core Fixes
Series of updates and fixes for core functionalities.
## 2021-11-27 - 1.0.70 to 1.0.71 - Core Fixes
Bugfixes and improvements to core.
## 2021-10-08 - 1.0.68 to 1.0.69 - Core Fixes
Various core updates and patches.
## 2021-10-07 - 1.0.67 to 1.0.68 - Core Fixes
Minor updates and improvements for core.
## 2021-09-15 - 1.0.64 to 1.0.66 - Core Fixes
Bugfixes and improvements to core functionalities.
## 2021-09-14 - 1.0.61 to 1.0.62 - Core Fixes
Minor patches and updates for core.
## 2021-09-10 - 1.0.57 to 1.0.60 - Core Fixes
Series of updates and fixes for core functionalities.
## 2021-09-09 - 1.0.54 to 1.0.56 - Core Fixes
Various core updates and patches.
## 2021-09-01 - 1.0.51 to 1.0.53 - Core Fixes
Minor updates for core functionalities.
## 2021-08-29 - 1.0.49 to 1.0.50 - Core Fixes
Bugfixes and patches for core.
## 2021-08-27 - 1.0.44 to 1.0.48 - Core Fixes
Series of updates and improvements for core functionalities.
## 2021-08-26 - 1.0.42 to 1.0.43 - Core Fixes
Minor updates and bugfixes for core.
## 2021-08-25 - 1.0.38 to 1.0.41 - Core Fixes
Extracted series of core updates and patches.
## 2021-08-24 - 1.0.37 - Core Fix
Bugfixes for core functionalities.
## 2021-08-20 - 1.0.34 to 1.0.36 - Core Fixes
Core functionalities updates and patches.
## 2021-05-05 - 1.0.32 to 1.0.33 - Core Fixes
Series of core bugfixes.
## 2021-03-06 - 1.0.29 to 1.0.31 - Core Fixes
Updates and improvements for core functionalities.
## 2021-02-13 - 1.0.27 to 1.0.28 - Core Fixes
Bugfixes and patches for core functionalities.
## 2020-12-10 - 1.0.25 to 1.0.26 - Core Fixes
Various core updates and improvements.
## 2020-12-02 - 1.0.23 to 1.0.24 - Core Fixes
Minor updates for core functionalities.
## 2020-12-01 - 1.0.21 to 1.0.22 - Core Fixes
Bugfixes and patches for core.
## 2020-09-13 - 1.0.19 to 1.0.20 - Core Fixes
Updates and bugfixes for core functionalities.
## 2020-05-11 - 1.0.17 to 1.0.18 - Core Fixes
Core functionalities updates.

View File

@ -2,17 +2,46 @@
"gitzone": { "gitzone": {
"projectType": "wcc", "projectType": "wcc",
"module": { "module": {
"githost": "gitlab.com", "githost": "code.foss.global",
"gitscope": "design.estate", "gitscope": "design.estate",
"gitrepo": "dees-catalog", "gitrepo": "dees-catalog",
"description": "a webcomponents catalog for handling daily stuff on the web", "description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
"npmPackagename": "@design.estate/dees-catalog", "npmPackagename": "@design.estate/dees-catalog",
"license": "MIT", "license": "MIT",
"projectDomain": "design.estate" "projectDomain": "design.estate",
"keywords": [
"Web Components",
"User Interface",
"UI Library",
"Component Library",
"JavaScript",
"TypeScript",
"Dynamic Components",
"Modular Architecture",
"Reusable Components",
"Web Development",
"Application UI",
"Custom Elements",
"Shadow DOM",
"UI Elements",
"Dashboard Interfaces",
"Form Handling",
"Data Display",
"Visualization",
"Charting",
"Interactive Components",
"Responsive Design",
"Web Applications",
"Modern Web",
"Frontend Development"
]
} }
}, },
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

View File

@ -1,41 +1,48 @@
{ {
"name": "@design.estate/dees-catalog", "name": "@design.estate/dees-catalog",
"version": "1.0.187", "version": "1.5.0",
"private": false, "private": false,
"description": "website for lossless.com", "description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
"main": "dist_ts_web/index.js", "main": "dist_ts_web/index.js",
"typings": "dist_ts_web/index.d.ts", "typings": "dist_ts_web/index.d.ts",
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "tstest test/ --web", "test": "tstest test/ --web",
"build": "tsbuild element --allowimplicitany && tsbundle element --production", "build": "tsbuild tsfolders --allowimplicitany && tsbundle element --production",
"watch": "tswatch element", "watch": "tswatch element",
"buildDocs": "tsdoc" "buildDocs": "tsdoc"
}, },
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@design.estate/dees-domtools": "^2.0.39", "@design.estate/dees-domtools": "^2.1.1",
"@design.estate/dees-element": "^2.0.27", "@design.estate/dees-element": "^2.0.39",
"@design.estate/dees-wcctools": "^1.0.78", "@design.estate/dees-wcctools": "^1.0.90",
"@fortawesome/fontawesome-svg-core": "^6.4.2", "@fortawesome/fontawesome-svg-core": "^6.7.2",
"@fortawesome/free-brands-svg-icons": "^6.4.2", "@fortawesome/free-brands-svg-icons": "^6.7.2",
"@fortawesome/free-regular-svg-icons": "^6.4.2", "@fortawesome/free-regular-svg-icons": "^6.7.2",
"@fortawesome/free-solid-svg-icons": "^6.4.2", "@fortawesome/free-solid-svg-icons": "^6.7.2",
"@push.rocks/smartpromise": "^4.0.3", "@push.rocks/smarti18n": "^1.0.4",
"@push.rocks/smartstring": "^4.0.9", "@push.rocks/smartpromise": "^4.2.0",
"@tsclass/tsclass": "^4.0.42", "@push.rocks/smartstring": "^4.0.15",
"highlight.js": "11.8.0", "@tsclass/tsclass": "^4.4.0",
"pdfjs-dist": "^3.10.111" "@webcontainer/api": "1.2.0",
"apexcharts": "^4.3.0",
"highlight.js": "11.11.1",
"ibantools": "^4.5.1",
"monaco-editor": "^0.52.2",
"pdfjs-dist": "^4.10.38",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.66", "@git.zone/tsbuild": "^2.1.84",
"@gitzone/tsbundle": "^2.0.8", "@git.zone/tsbundle": "^2.0.15",
"@gitzone/tstest": "^1.0.77", "@git.zone/tstest": "^1.0.90",
"@gitzone/tswatch": "^2.0.7", "@git.zone/tswatch": "^2.0.37",
"@push.rocks/projectinfo": "^5.0.2", "@push.rocks/projectinfo": "^5.0.2",
"@push.rocks/tapbundle": "^5.0.15", "@push.rocks/tapbundle": "^5.5.6",
"@types/node": "^20.5.9" "@types/node": "^22.10.7"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",
@ -51,5 +58,32 @@
], ],
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
] ],
"keywords": [
"Web Components",
"User Interface",
"UI Library",
"Component Library",
"JavaScript",
"TypeScript",
"Dynamic Components",
"Modular Architecture",
"Reusable Components",
"Web Development",
"Application UI",
"Custom Elements",
"Shadow DOM",
"UI Elements",
"Dashboard Interfaces",
"Form Handling",
"Data Display",
"Visualization",
"Charting",
"Interactive Components",
"Responsive Design",
"Web Applications",
"Modern Web",
"Frontend Development"
],
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
} }

13005
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

4
readme.hints.md Normal file
View File

@ -0,0 +1,4 @@
!!! Please pay attention to the following points when writing the readme: !!!
* Give a short rundown of components and a few points abputspecific features on each.
* Try to list all components in a summary.
* Then list all components with a short description.

232
readme.md
View File

@ -1,39 +1,215 @@
# @design.estate/dees-catalog # @design.estate/dees-catalog
a webcomponents catalog for handling daily stuff on the web An extensive library for building modern web applications with dynamic components using Web Components, JavaScript, and TypeScript.
## Availabililty and Links ## Install
* [npmjs.org (npm package)](https://www.npmjs.com/package/@design.estate/dees-catalog) To install the `@design.estate/dees-catalog` library, you can use npm or any other compatible JavaScript package manager. Using npm is recommended:
* [gitlab.com (source)](https://gitlab.com/design.estate/dees-catalog)
* [github.com (source mirror)](https://github.com/design.estate/dees-catalog)
* [docs (typedoc)](https://design.estate.gitlab.io/dees-catalog/)
## Status for master ```bash
npm install @design.estate/dees-catalog
Status Category | Status Badge ```
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/design.estate/dees-catalog/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/design.estate/dees-catalog/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@design.estate/dees-catalog)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/design.estate/dees-catalog)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@design.estate/dees-catalog)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@design.estate/dees-catalog)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@design.estate/dees-catalog)](https://lossless.cloud)
## Usage ## Usage
## Contribution ### Overview
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) The `@design.estate/dees-catalog` is a powerful library that offers a suite of dynamic components designed for building sophisticated web applications. This library leverages modern web standards such as Web Components, and programming languages like JavaScript and TypeScript to provide developers with modular and reusable components. These components enhance the development workflow by offering ready-to-use solutions for UI design and interactivity, enabling developers to create intricate and functional applications efficiently.
## Contribution Below, we will explore the diverse range of components available, demonstrating their integration and usage thoroughly within real-world scenarios. Each example will be crafted in TypeScript to ensure type safety and maintainable code. Let's navigate through the components by examining their setups, features, and potential applications in a comprehensive manner.
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :) ### Getting Started with Components
For further information read the linked docs at the top of this readme. To use these components, you first need to import them into your project. Depending on your development environment, you might be using a module bundler that supports ES modules. In such cases, importing components is straightforward as demonstrated below:
## Legal ```typescript
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc) import {
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) DeesButton,
DeesModal,
DeesTable,
DeesAppuiBase,
DeesForm,
DeesInputText,
DeesAppuiMainmenu,
DeesAppuiMainselector
} from '@design.estate/dees-catalog';
```
### Button Component: `DeesButton`
`DeesButton` is a versatile button component that can be configured for various UI needs such as form submissions, navigation actions, or interactive interfaces. It supports multiple styles including normal, highlighted, discreet, and status-based variations (e.g., pending, success, error).
#### Example Usage
```typescript
import { DeesButton } from '@design.estate/dees-catalog';
// Create a simple button
const submitButton = document.createElement('dees-button');
submitButton.text = 'Submit';
submitButton.type = 'highlighted';
// Add functionality
submitButton.addEventListener('clicked', () => {
console.log('Submit button clicked!');
});
document.body.appendChild(submitButton);
// Handling status change
async function handleFormSubmission() {
submitButton.status = 'pending';
try {
await simulateNetworkRequest();
submitButton.status = 'success';
} catch {
submitButton.status = 'error';
}
}
function simulateNetworkRequest() {
return new Promise(resolve => setTimeout(resolve, 2000));
}
submitButton.addEventListener('clicked', handleFormSubmission);
```
### Modal Component: `DeesModal`
The `DeesModal` component is used to display content in an overlay. It is suitable for scenarios like alerts, dialog boxes, or interactive user forms. The modal can be highly customized with different header, content, and footer components.
#### Example Usage
```typescript
import { DeesModal } from '@design.estate/dees-catalog';
import { html } from '@design.estate/dees-element';
// Creating a modal
const modalContent = html`<p>Welcome to our platform</p>`;
const modal = DeesModal.createAndShow({
heading: 'Welcome',
content: modalContent,
menuOptions: [
{ name: 'Close', action: () => modal.destroy() },
{ name: 'Proceed', action: () => console.log('Proceeding') }
]
});
```
### Form Handling With `DeesForm`
The `DeesForm` and its related input elements simplify form creation and handling. The form component integrates validation, submission, and data collection functions.
#### Creating a Form
```typescript
import {
DeesForm,
DeesInputText,
DeesFormSubmit,
DeesInputDropdown
} from '@design.estate/dees-catalog';
const registrationForm = document.createElement('dees-form');
const nameInput = document.createElement('dees-input-text');
nameInput.label = 'Name';
nameInput.required = true;
const roleSelect = document.createElement('dees-input-dropdown');
roleSelect.label = 'Role';
roleSelect.options = [
{ option: 'Admin', key: 'admin' },
{ option: 'Editor', key: 'editor' }
];
const submitButton = document.createElement('dees-form-submit');
submitButton.text = 'Register';
registrationForm.appendChild(nameInput);
registrationForm.appendChild(roleSelect);
registrationForm.appendChild(submitButton);
registrationForm.addEventListener('formData', event => {
console.log('Form Data:', event.detail.data);
});
document.body.appendChild(registrationForm);
```
### Data Presentation with `DeesTable`
The `DeesTable` component allows for effective data management and presentation through dynamic tables. It supports features such as sorting, selecting, and action-triggering from table items.
#### Displaying a Data Table
```typescript
import { DeesTable } from '@design.estate/dees-catalog';
const data = [
{ name: 'Alice', status: 'Active' },
{ name: 'Bob', status: 'Inactive' }
];
const table = new DeesTable();
table.heading1 = 'User Table';
table.data = data;
document.body.appendChild(table);
// Custom Actions and Row Selection
table.addEventListener('rowSelected', (event) => console.log(event.detail));
```
### Structural Components
`DeesAppuiBase`, along with components such as `DeesAppuiMainmenu` and `DeesAppuiMainselector`, provide the scaffolding needed for application UIs, particularly dashboards.
#### Setting Up an Application Layout
```typescript
import { DeesAppuiBase } from '@design.estate/dees-catalog';
const appBase = document.createElement('dees-appui-base');
document.body.appendChild(appBase);
```
### Data Visualization with ApexCharts
`DeesChartArea` provides easy integration with ApexCharts for creating detailed visualizations.
#### Implementing a Chart
```typescript
import { DeesChartArea } from '@design.estate/dees-catalog';
// Create and configure a chart
const chart = new DeesChartArea();
document.body.appendChild(chart);
chart.chart.updateSeries([
{ name: 'Sales', data: [20, 40, 30, 50] }
]);
```
### Customization and Extensibility
The `@design.estate/dees-catalog` is built for extensibility and customization. You can extend components, integrate custom events, and style them as per your requirements. This ensures that your application remains unique and tailored to your audience.
The library not only saves development time by providing ready-made components but also enhances maintainability through its clean interfaces and TypeScript support, making your code robust and type-safe. With the library's expansive set of features, building modern web applications has never been easier. Enjoy the blend of simplicity and power that `@design.estate/dees-catalog` brings to the table.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @push.rocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-catalog', name: '@design.estate/dees-catalog',
version: '1.0.187', version: '1.5.0',
description: 'website for lossless.com' description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
} }

View File

@ -0,0 +1,13 @@
export const dark = {
blue: '#0050b9',
blueActive: '#0069f2',
blueMuted: '#012452',
text: '#ffffff',
}
export const bright = {
blue: '#0050b9',
blueActive: '#0069f2',
blueMuted: '#0069f2',
text: '#333333',
}

View File

@ -0,0 +1,239 @@
import * as plugins from './00plugins.js';
import {
DeesElement,
type TemplateResult,
property,
customElement,
html,
css,
cssManager,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { DeesContextmenu } from './dees-contextmenu.js';
@customElement('dees-appui-activitylog')
export class DeesAppuiActivitylog extends DeesElement {
// STATIC
public static demo = () => html`<dees-appui-activitylog></dees-appui-activitylog>`;
// INSTANCE
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: #fff;
position: relative;
display: block;
width: 100%;
max-width: 300px;
height: 100%;
background: #111c28;
font-family: 'Intel One Mono', sans-serif;
border-left: 1px solid #202020;
cursor: default;
}
.maincontainer {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
}
.topbar {
position: absolute;
top: 0px;
height: 32px;
width: 100%;
padding: 0px 12px 0px 12px;
background: #0e151f;
}
.topbar .heading {
text-align: left;
line-height: 24px;
padding-top: 8px;
font-weight: 500;
font-size: 14px;
font-family: 'Geist Sans', sans-serif;
}
.activityContainer {
position: absolute;
top: 32px;
bottom: 40px;
width: 100%;
padding: 8px 0px;
overflow-y: scroll;
}
.streamingIndicator {
font-size: 12px;
text-align: center;
padding-top: 16px;
color: #888
}
.streamingIndicator.bottom {
padding-top: 0px;
padding-bottom: 16px;
}
.activityentry {
min-height: 30px;
font-size: 12px;
padding: 8px 16px;
border-bottom: 1px dotted #ffffff20;
}
.activityentry:last-of-type {
border-bottom: 1px solid #ffffff00;
}
.activityentry:hover {
background: #00000080;
}
.timestamp {
color: #ff8787;
}
.searchbox {
position: absolute;
bottom: 0px;
width: 100%;
height: 40px;
background: #0e151f;
}
.searchbox input {
color: #fff;
background: none;
width: 100%;
height: 40px;
line-height: 32px;
border: none;
padding: 4px 12px;
font-family: 'Intel One Mono', sans-serif;
}
.searchbox input:focus {
outline: none;
}
.bottomShadow {
position: absolute;
width: 100%;
height: 32px;
bottom: 40px;
background: linear-gradient(180deg, #111c2800 0%, #0e151f 100%);
pointer-events: none;
}
.topShadow {
position: absolute;
width: 100%;
height: 32px;
top: 32px;
background: linear-gradient(0deg, #111c2800 0%, #0e151f 100%);
pointer-events: none;
}
`,
];
public render(): TemplateResult {
return html`
${domtools.elementBasic.styles}
<style></style>
<div class="maincontainer">
<div class="topbar">
<div class="heading">Activity Log</div>
</div>
<div class="activityContainer">
<div class="streamingIndicator">streaming...</div>
<div class="activityentry" @contextmenu=${async eventArg => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [
{
name: 'app settings',
action: async () => {},
},
{
name: 'account settings',
action: async () => {},
},
{
name: 'logout',
action: async () => {},
},
]);
}}>
<span class="timestamp">22:01:</span> Max Mustermann logged in
</div>
<div class="activityentry">
<span class="timestamp">22:02:</span> Max Mustermann viewed an invoice
</div>
<div class="activityentry">
<span class="timestamp">22:03:</span> Max Mustermann added a new contact
</div>
<div class="activityentry">
<span class="timestamp">22:04:</span> Max Mustermann updated account settings
</div>
<div class="activityentry">
<span class="timestamp">22:05:</span> Max Mustermann logged out
</div>
<div class="activityentry">
<span class="timestamp">22:06:</span> Max Mustermann logged in
</div>
<div class="activityentry">
<span class="timestamp">22:07:</span> Max Mustermann created a new invoice
</div>
<div class="activityentry">
<span class="timestamp">22:08:</span> Max Mustermann sent an invoice
</div>
<div class="activityentry">
<span class="timestamp">22:09:</span> Max Mustermann viewed reports
</div>
<div class="activityentry">
<span class="timestamp">22:10:</span> Max Mustermann logged out
</div>
<div class="activityentry">
<span class="timestamp">22:11:</span> Max Mustermann logged in
</div>
<div class="activityentry">
<span class="timestamp">22:12:</span> Max Mustermann deleted an invoice
</div>
<div class="activityentry">
<span class="timestamp">22:13:</span> Max Mustermann contacted support
</div>
<div class="activityentry">
<span class="timestamp">22:14:</span> Max Mustermann added a new user
</div>
<div class="activityentry">
<span class="timestamp">22:15:</span> Max Mustermann changed password
</div>
<div class="activityentry">
<span class="timestamp">22:16:</span> Max Mustermann logged out
</div>
<div class="activityentry">
<span class="timestamp">22:17:</span> Max Mustermann logged in
</div>
<div class="activityentry">
<span class="timestamp">22:18:</span> Max Mustermann archived an invoice
</div>
<div class="activityentry">
<span class="timestamp">22:19:</span> Max Mustermann approved a payment
</div>
<div class="activityentry">
<span class="timestamp">22:20:</span> Max Mustermann logged out
</div>
<div class="streamingIndicator bottom">loading more...</div>
</div>
<div class="searchbox">
<input type="text" placeholder="Search" />
</div>
<div class="topShadow"></div>
<div class="bottomShadow"></div>
</div>
`;
}
}

View File

@ -0,0 +1,77 @@
import {
DeesElement,
type TemplateResult,
property,
customElement,
html,
css,
cssManager,
} from '@design.estate/dees-element';
@customElement('dees-appui-appbar')
export class DeesAppuiBar extends DeesElement {
public static demo = () => html`<dees-appui-appbar></dees-appui-appbar>`;
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: block;
position: relative;
height: 100%;
width: 100%;
height: 40px;
border-bottom: 1px solid #202020;
background: #000000;
color: #ffffff80;
font-size: 12px;
display: grid;
grid-template-columns: ${cssManager.cssGridColumns(3, 20)};
-webkit-app-region: drag;
}
.menus {
display: flex;
padding-left: 8px;
cursor: default;
}
.menuItem {
line-height: 24px;
padding: 0px 8px;
margin: 8px 0px;
border-radius: 4px;
-webkit-app-region: no-drag;
}
.menuItem:hover {
background: #ffffff20;
}
.breadcrumbs {
height: 24px;
line-height: 24px;
margin: 8px;
border-radius: 8px;
text-align: center;
}
`,
];
// INSTANCE
public render(): TemplateResult {
return html`
<div class="menus">
<dees-windowcontrols></dees-windowcontrols>
<div class="menuItem">File</div>
<div class="menuItem">View</div>
<div class="menuItem">Help</div>
<div class="menuItem">Terminal</div>
</div>
<div class="breadcrumbs">
tool:social.io > org:design.estate > prop:lossless.com
</div>
<div class="account"></div>
`;
}
}

View File

@ -0,0 +1,47 @@
import {
DeesElement,
type TemplateResult,
property,
customElement,
html,
css,
cssManager,
} from '@design.estate/dees-element';
@customElement('dees-appui-base')
export class DeesAppuiBase extends DeesElement {
public static demo = () => html`<dees-appui-base></dees-appui-base>`;
public static styles = [
cssManager.defaultStyles,
css`
:host {
position: absolute;
height: 100%;
width: 100%;
}
.maingrid {
position: absolute;
top: 40px;
height: calc(100% - 40px);
width: 100%;
display: grid;
grid-template-columns: 60px 240px auto 240px;
}
`,
];
// INSTANCE
public render(): TemplateResult {
return html`
<style></style>
<dees-appui-appbar></dees-appui-appbar>
<div class="maingrid">
<dees-appui-mainmenu></dees-appui-mainmenu>
<dees-appui-mainselector></dees-appui-mainselector>
<dees-appui-maincontent></dees-appui-maincontent>
<dees-appui-activitylog></dees-appui-activitylog>
</div>
`;
}
}

View File

@ -0,0 +1,161 @@
import * as interfaces from './interfaces/index.js';
import {
DeesElement,
type TemplateResult,
property,
customElement,
html,
css,
cssManager,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
@customElement('dees-appui-maincontent')
export class DeesAppuiMaincontent extends DeesElement {
public static demo = () => html`<dees-appui-maincontent></dees-appui-maincontent>`;
// INSTANCE
@property({
type: Array,
})
public tabs: interfaces.ITab[] = [
{ key: 'option 1', action: () => {} },
{ key: 'a very long option', action: () => {} },
{ key: 'reminder: set your tabs', action: () => {} },
{ key: 'option 4', action: () => {} },
];
@property()
public selectedTab = null;
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: #fff;
display: block;
width: 100%;
height: 100%;
position: relative;
background: #161616;
}
.maincontainer {
position: absolute;
height: 100%;
right: 0px;
top: 0px;
width: 100%;
}
.topbar {
position: absolute;
width: 100%;
background: #000000;
user-select: none;
}
.topbar .tabsContainer {
padding-top: 20px;
padding-bottom: 0px;
position: relative;
z-index: 1;
display: grid;
margin-left: 24px;
font-size: 14px;
}
.topbar .tabsContainer .tab {
color: #a0a0a0;
white-space: nowrap;
margin-right: 30px;
padding-top: 4px;
padding-bottom: 12px;
transition: color 0.1s;
}
.topbar .tabsContainer .tab:hover {
color: #ffffff;
}
.topbar .tabsContainer .tab.selectedTab {
color: #e0e0e0;
}
.topbar .tabIndicator {
position: absolute;
z-index: 0;
left: 40px;
bottom: 0px;
height: 40px;
width: 40px;
background: #161616;
transition: all 0.1s;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
border-top: 1px solid #444444;
}
.mainicon {
}
`,
];
public render(): TemplateResult {
return html`
<style>
.topbar .tabsContainer {
grid-template-columns: repeat(${this.tabs.length}, min-content);
}
</style>
<div class="maincontainer">
<div class="topbar">
<div class="tabsContainer">
${this.tabs.map((tabArg) => {
return html`
<div
class="tab ${tabArg === this.selectedTab ? 'selectedTab' : null}"
@click="${() => {
this.selectedTab = tabArg;
this.updateTabIndicator();
tabArg.action();
}}"
>
${tabArg.key}
</div>
`;
})}
</div>
<div class="tabIndicator"></div>
</div>
</div>
`;
}
/**
* updates the indicator
*/
private updateTabIndicator() {
let selectedTab = this.selectedTab;
const tabIndex = this.tabs.indexOf(selectedTab);
const selectedTabElement: HTMLElement = this.shadowRoot.querySelector(
`.tabsContainer .tab:nth-child(${tabIndex + 1})`
);
const tabsContainer: HTMLElement = this.shadowRoot.querySelector('.tabsContainer');
const marginLeft = parseInt(window.getComputedStyle(tabsContainer).getPropertyValue("margin-left"));
const tabIndicator: HTMLElement = this.shadowRoot.querySelector('.tabIndicator');
tabIndicator.style.width = selectedTabElement.clientWidth + 24 + 'px';
tabIndicator.style.left = selectedTabElement.offsetLeft + marginLeft - 12 + 'px';
}
private updateTab(tabArg: interfaces.ITab) {
this.selectedTab = tabArg;
this.updateTabIndicator();
this.selectedTab.action();
}
firstUpdated() {
this.updateTab(this.tabs[0]);
}
}

View File

@ -0,0 +1,142 @@
import * as plugins from './00plugins.js';
import * as interfaces from './interfaces/index.js';
import {
DeesElement,
type TemplateResult,
property,
customElement,
html,
css,
cssManager,
} from '@design.estate/dees-element';
import { DeesContextmenu } from './dees-contextmenu.js';
/**
* the most left menu
* usually used as organization selector
*/
@customElement('dees-appui-mainmenu')
export class DeesAppuiMainmenu extends DeesElement {
public static demo = () => html`<dees-appui-mainmenu></dees-appui-mainmenu>`;
// INSTANCE
// INSTANCE
@property()
public tabs: interfaces.ITab[] = [
{ key: 'option 1', iconName: 'building', action: () => {} },
{ key: 'option 2', iconName: 'building', action: () => {} },
{ key: 'option 3', iconName: 'building', action: () => {} },
{ key: 'option 4', iconName: 'building', action: () => {} },
];
@property()
public selectedTab: interfaces.ITab;
public static styles = [
cssManager.defaultStyles,
css`
.mainContainer {
--menuSize: 60px;
color: #ccc;
z-index: 10;
display: block;
position: relative;
width: var(--menuSize);
height: 100%;
background: #000000;
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
user-select: none;
border-right: 1px solid #202020;
}
.tabsContainer {
}
.tab {
padding-top: 18px;
font-size: 24px;
width: var(--menuSize);
height: var(--menuSize);
text-align: center;
transition: color 0.1s, background 0.2s;
}
.tab:hover {
background: rgba(255, 255, 255, 0.15);
}
.tab.selectedTab {
color: #fff;
background: rgba(255, 255, 255, 0.1);
}
.tabIndicator {
opacity: 0;
background: #4e729a;
position: absolute;
width: 5px;
height: calc((var(--menuSize) / 3) * 2);
left: 0px;
top: calc(var(--menuSize) - (((var(--menuSize) / 3) * 2) / 2));
border-top-right-radius: 7px;
border-bottom-right-radius: 7px;
transition: all 0.1s;
}
`,
];
public render(): TemplateResult {
return html`
<div class="mainContainer" @contextmenu=${(eventArg) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [{
name: 'app settings',
action: async () => {},
iconName: 'gear',
}])
}}>
<div class="tabsContainer">
${this.tabs.map((tabArg) => {
return html`
<div
class="tab ${tabArg === this.selectedTab ? 'selectedTab' : null}"
@click="${() => {
this.updateTab(tabArg);
}}"
>
<dees-icon iconFA="${tabArg.iconName as any}"></dees-icon>
</div>
`;
})}
</div>
<div class="tabIndicator"></div>
</div>
`;
}
private async updateTabIndicator() {
let selectedTab = this.selectedTab;
if (!selectedTab) {
selectedTab = this.tabs[0];
}
const tabIndex = this.tabs.indexOf(selectedTab);
const selectedTabElement: HTMLElement = this.shadowRoot.querySelector(
`.tabsContainer .tab:nth-child(${tabIndex + 1})`
);
const tabIndicator: HTMLElement = this.shadowRoot.querySelector('.tabIndicator');
const offsetTop = selectedTabElement.offsetTop;
tabIndicator.style.opacity = `1`;
tabIndicator.style.top = `calc(${offsetTop}px + (var(--menuSize) / 6))`;
}
updateTab(tabArg: interfaces.ITab) {
this.selectedTab = tabArg;
this.updateTabIndicator();
this.selectedTab.action();
}
firstUpdated() {
this.updateTab(this.tabs[0]);
}
}

View File

@ -0,0 +1,160 @@
import * as plugins from './00plugins.js';
import * as interfaces from './interfaces/index.js';
import { DeesContextmenu } from './dees-contextmenu.js';
import {
DeesElement,
type TemplateResult,
property,
customElement,
html,
css,
cssManager,
} from '@design.estate/dees-element';
/**
* the property selector menu
* mainly used to select assets within in an organization
*/
@customElement('dees-appui-mainselector')
export class DeesAppuiMainselector extends DeesElement {
public static demo = () => html`<dees-appui-mainselector></dees-appui-mainselector>`;
// INSTANCE
@property()
public selectionOptions: interfaces.ISelectionOption[] = [
{
key: 'Overview',
action: () => {},
},
{
key: 'option 1',
action: () => {},
},
{ key: 'option 2', action: () => {} },
{ key: 'option 3', action: () => {} },
{ key: 'option 4', action: () => {} },
];
@property()
public selectedOption: interfaces.ISelectionOption = null;
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: #fff;
position: relative;
display: block;
width: 100%;
max-width: 300px;
height: 100%;
background: #000000;
border-right: 1px solid #222222;
}
.maincontainer {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
}
.topbar {
position: absolute;
height: 32px;
width: 100%;
}
.topbar .heading {
padding-left: 16px;
padding-top: 8px;
line-height: 24px;
font-family: 'Geist Sans', sans-serif;
font-weight: 600;
font-size: 14px;
}
.selectionOptions {
position: absolute;
top: 32px;
padding-top: 8px;
left: 0px;
width: 100%;
font-family: 'Geist Sans', sans-serif;
font-size: 14px;
}
.selectionOptions .selectionOption {
cursor: default;
margin-left: 16px;
margin-right: 16px;
padding-top: 8px;
padding-bottom: 8px;
border-top: 1px dotted #303030;
border-left: 0px solid rgba(0, 0, 0, 0);
transition: all 0.1s;
}
.selectionOptions .selectionOption:hover {
border-left: 2px solid #26a69a50;
padding-left: 8px;
}
.selectionOptions .selectionOption:first-child {
border-top: 1px solid rgba(0, 0, 0, 0);
}
.selectionOptions .selectionOption.selectedOption {
border-left: 4px solid #26a69a;
padding-left: 10px;
}
`,
];
public render(): TemplateResult {
return html`
<style></style>
<div class="maincontainer">
<div class="topbar">
<div class="heading">Properties</div>
</div>
<div class="selectionOptions">
${this.selectionOptions.map((selectionOptionArg) => {
return html`
<div
class="selectionOption ${this.selectedOption === selectionOptionArg
? 'selectedOption'
: null}"
@click="${() => {
this.selectOption(selectionOptionArg);
}}"
@contextmenu="${(eventArg: MouseEvent) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [
{
name: 'property settings',
action: async () => {},
iconName: 'gear',
},
]);
}}"
>
${selectionOptionArg.key}
</div>
`;
})}
</div>
</div>
`;
}
private selectOption(optionArg: interfaces.ISelectionOption) {
this.selectedOption = optionArg;
this.selectedOption.action();
}
firstUpdated() {
this.selectOption(this.selectionOptions[0]);
}
}

View File

@ -0,0 +1,12 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<div style="display: flex; gap: 8px; align-items: center;">
<dees-badge .text=${'Default'}></dees-badge>
<dees-badge .type=${'primary'} .text=${'Primary'}></dees-badge>
<dees-badge .type=${'success'} .text=${'Success'}></dees-badge>
<dees-badge .type=${'warning'} .text=${'Warning'}></dees-badge>
<dees-badge .type=${'error'} .text=${'Error'}></dees-badge>
<dees-badge .type=${'primary'} .rounded=${true} .text=${'Rounded'}></dees-badge>
</div>
`;

View File

@ -0,0 +1,96 @@
import {
DeesElement,
css,
cssManager,
customElement,
html,
property,
type CSSResult,
type TemplateResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-badge.demo.js';
declare global {
interface HTMLElementTagNameMap {
'dees-badge': DeesBadge;
}
}
@customElement('dees-badge')
export class DeesBadge extends DeesElement {
public static demo = demoFunc;
@property({ type: String })
public type: 'default' | 'primary' | 'success' | 'warning' | 'error' = 'default';
@property({ type: String })
public text: string = '';
@property({ type: Boolean })
public rounded: boolean = false;
constructor() {
super();
domtools.elementBasic.setup();
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: inline-block;
}
.badge {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 2px 8px;
font-size: 12px;
font-weight: 500;
line-height: 1.5;
border-radius: 4px;
white-space: nowrap;
}
.badge.rounded {
border-radius: 12px;
}
.badge.default {
background: ${cssManager.bdTheme('#f5f5f5', '#333')};
color: ${cssManager.bdTheme('#666', '#ccc')};
}
.badge.primary {
background: #0050b9;
color: #ffffff;
}
.badge.success {
background: #2e7d32;
color: #ffffff;
}
.badge.warning {
background: #ed6c02;
color: #ffffff;
}
.badge.error {
background: #e4002b;
color: #ffffff;
}
`,
];
public render(): TemplateResult {
return html`
<div class="badge ${this.type} ${this.rounded ? 'rounded' : ''}">
${this.text}
</div>
`;
}
}

View File

@ -0,0 +1,15 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-button>This is a slotted Text</dees-button>
<p>
<dees-button text="Highlighted: This text shows" type="highlighted">Highlighted</dees-button>
</p>
<p><dees-button type="discreet">This is discreete button</dees-button></p>
<p><dees-button disabled>This is a disabled button</dees-button></p>
<p><dees-button type="big">This is a slotted Text</dees-button></p>
<p><dees-button status="normal">Normal Status</dees-button></p>
<p><dees-button disabled status="pending">Pending Status</dees-button></p>
<p><dees-button disabled status="success">Success Status</dees-button></p>
<p><dees-button disabled status="error">Error Status</dees-button></p>
`;

View File

@ -1,3 +1,4 @@
import { demoFunc } from './dees-button.demo.js';
import { import {
customElement, customElement,
html, html,
@ -20,17 +21,7 @@ declare global {
@customElement('dees-button') @customElement('dees-button')
export class DeesButton extends DeesElement { export class DeesButton extends DeesElement {
public static demo = () => html` public static demo = demoFunc;
<dees-button>This is a slotted Text</dees-button>
<p><dees-button text="Highlighted: This text shows" type="highlighted">Highlighted</dees-button></p>
<p><dees-button type="discreet">This is discreete button</dees-button></p>
<p><dees-button disabled>This is a disabled button</dees-button></p>
<p><dees-button type="big">This is a slotted Text</dees-button></p>
<p><dees-button status="normal">Normal Status</dees-button></p>
<p><dees-button disabled status="pending">Pending Status</dees-button></p>
<p><dees-button disabled status="success">Success Status</dees-button></p>
<p><dees-button disabled status="error">Error Status</dees-button></p>
`;
@property({ @property({
reflect: true, reflect: true,
@ -44,7 +35,8 @@ export class DeesButton extends DeesElement {
public eventDetailData: string; public eventDetailData: string;
@property({ @property({
type: Boolean type: Boolean,
reflect: true,
}) })
public disabled = false; public disabled = false;
@ -70,10 +62,10 @@ export class DeesButton extends DeesElement {
public static styles = [ public static styles = [
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`
:host { :host {
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
font-family: 'Geist Sans', 'monospace';
} }
:host([hidden]) { :host([hidden]) {
display: none; display: none;
@ -92,7 +84,7 @@ export class DeesButton extends DeesElement {
border: 1px solid ${cssManager.bdTheme('#eee', '#333')}; border: 1px solid ${cssManager.bdTheme('#eee', '#333')};
border-top: ${cssManager.bdTheme('1px solid #eee', '1px solid #444')}; border-top: ${cssManager.bdTheme('1px solid #eee', '1px solid #444')};
border-radius: 4px; border-radius: 4px;
line-height: 40px; height: 40px;
padding: 0px 8px; padding: 0px 8px;
min-width: 100px; min-width: 100px;
user-select: none; user-select: none;
@ -101,23 +93,15 @@ export class DeesButton extends DeesElement {
} }
.button:hover { .button:hover {
cursor: pointer; background: #0050b9;
background: #039be5;
color: #ffffff; color: #ffffff;
border: 1px solid #039be5; border: 1px solid #0050b9;
border-top: 1px solid #039be5; border-top: 1px solid #0050b9;
} }
.button:active { .button:active {
background: #0277bd; background: #0069f2;
border-top: 1px solid #0277bd; border-top: 1px solid #0069f2;
}
.button.disabled {
background: ${cssManager.bdTheme('#ffffff00', '#11111100')};
border: 1px dashed ${cssManager.bdTheme('#666666', '#666666')};
color: #9b9b9e;
cursor: default;
} }
.button.highlighted { .button.highlighted {
@ -141,6 +125,14 @@ export class DeesButton extends DeesElement {
.button.discreet:hover { .button.discreet:hover {
background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.1)', 'rgba(255, 255, 255, 0.1)')}; background: ${cssManager.bdTheme('rgba(0, 0, 0, 0.1)', 'rgba(255, 255, 255, 0.1)')};
} }
.button.disabled {
background: ${cssManager.bdTheme('#ffffff00', '#11111100')};
border: 1px dashed ${cssManager.bdTheme('#666666', '#666666')};
color: #9b9b9e;
cursor: default;
}
.button.hidden { .button.hidden {
display: none; display: none;
} }
@ -154,8 +146,8 @@ export class DeesButton extends DeesElement {
} }
.button.pending { .button.pending {
border: 1px dashed ${cssManager.bdTheme('#0277bd', '#0277bd70')}; border: 1px dashed ${cssManager.bdTheme('#0069f2', '#0069f270')};
background: ${cssManager.bdTheme('#0277bd', '#0277bd70')}; background: ${cssManager.bdTheme('#0069f2', '#0069f270')};
color: #fff; color: #fff;
} }

View File

@ -0,0 +1,21 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => {
return html`
<style>
.demoBox {
position: relative;
background: #000000;
height: 100%;
width: 100%;
padding: 40px;
box-sizing: border-box;
}
</style>
<div class="demoBox">
<dees-chart-area
.label=${'System Usage'}
></dees-chart-area>
</div>
`;
};

View File

@ -0,0 +1,266 @@
import {
DeesElement,
css,
cssManager,
customElement,
html,
property,
state,
type CSSResult,
type TemplateResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-chart-area.demo.js';
import ApexCharts from 'apexcharts';
declare global {
interface HTMLElementTagNameMap {
'dees-chart-area': DeesChartArea;
}
}
@customElement('dees-chart-area')
export class DeesChartArea extends DeesElement {
public static demo = demoFunc;
// instance
@state()
public chart: ApexCharts;
@property()
public label: string = 'Untitled Chart';
private resizeObserver: ResizeObserver;
constructor() {
super();
domtools.elementBasic.setup();
this.resizeObserver = new ResizeObserver((entries) => {
for (let entry of entries) {
if (entry.target.classList.contains('mainbox')) {
this.resizeChart(); // Call resizeChart when the .mainbox size changes
}
}
});
this.registerStartupFunction(async () => {
this.updateComplete.then(() => {
const mainbox = this.shadowRoot.querySelector('.mainbox');
if (mainbox) {
this.resizeObserver.observe(mainbox); // Start observing the .mainbox element
}
});
});
this.registerGarbageFunction(async () => {
this.resizeObserver.disconnect();
});
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
font-family: 'Geist Sans', sans-serif;
color: #ccc;
font-weight: 600;
font-size: 12px;
}
.mainbox {
position: relative;
width: 100%;
height: 400px;
background: #111;
border-radius: 8px;
}
.chartTitle {
position: absolute;
top: 0;
left: 0;
width: 100%;
text-align: center;
padding-top: 16px;
}
.chartContainer {
position: absolute;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
padding: 32px 16px 16px 0px;
}
`,
];
public render(): TemplateResult {
return html`
<div class="mainbox">
<div class="chartTitle">${this.label}</div>
<div class="chartContainer"></div>
</div>
`;
}
public async firstUpdated() {
const domtoolsInstance = await this.domtoolsPromise;
var options: ApexCharts.ApexOptions = {
series: [
{
name: 'cpu',
data: [
{ x: '2025-01-15T03:00:00', y: 25 },
{ x: '2025-01-15T07:00:00', y: 30 },
{ x: '2025-01-15T11:00:00', y: 20 },
{ x: '2025-01-15T15:00:00', y: 35 },
{ x: '2025-01-15T19:00:00', y: 25 },
],
},
{
name: 'memory',
data: [
{ x: '2025-01-15T03:00:00', y: 10 },
{ x: '2025-01-15T07:00:00', y: 12 },
{ x: '2025-01-15T11:00:00', y: 10 },
{ x: '2025-01-15T15:00:00', y: 30 },
{ x: '2025-01-15T19:00:00', y: 40 },
],
},
],
chart: {
width: 0, // Adjusted for responsive width
height: 0, // Adjusted for responsive height
type: 'area',
toolbar: {
show: false, // This line disables the toolbar
},
},
dataLabels: {
enabled: false,
},
stroke: {
width: 1,
curve: 'smooth',
},
xaxis: {
type: 'datetime', // Time-series data
labels: {
format: 'hh:mm A', // Time formatting
style: {
colors: '#9e9e9e', // Label color
fontSize: '12px',
},
},
axisBorder: {
show: false, // Hide x-axis border
},
axisTicks: {
show: false, // Hide x-axis ticks
},
},
yaxis: {
min: 0,
labels: {
formatter: function (val: number) {
return `${val} Mbps`; // Format Y-axis labels
},
style: {
colors: '#9e9e9e', // Label color
fontSize: '12px',
},
},
axisBorder: {
show: false, // Hide y-axis border
},
axisTicks: {
show: false, // Hide y-axis ticks
},
},
tooltip: {
shared: true, // Enables the tooltip to display across series
intersect: false, // Allows hovering anywhere on the chart
followCursor: true, // Makes tooltip follow mouse even between points
x: {
format: 'dd/MM/yy HH:mm',
},
custom: function ({ series, seriesIndex, dataPointIndex, w }) {
// Get the x value
const xValue = w.globals.labels[dataPointIndex];
// Iterate through each series and get its value
let tooltipContent = `<div style="padding: 10px; background: #1e1e2f; color: white; border-radius: 5px;">`;
tooltipContent += ``; // `<strong>Time:</strong> ${xValue}<br/>`;
series.forEach((s, index) => {
const label = w.globals.seriesNames[index]; // Get series label
const value = s[dataPointIndex]; // Get value at data point
tooltipContent += `<strong>${label}:</strong> ${value} Mbps<br/>`;
});
tooltipContent += `</div>`;
return tooltipContent;
},
},
grid: {
xaxis: {
lines: {
show: true, // This enables the grid lines along the x-axis
},
},
yaxis: {
lines: {
show: true,
},
},
borderColor: '#333', // Set the color of the grid lines
strokeDashArray: 0, // Solid line
row: {
colors: [], // This can be used to alternate the shading of the horizontal rows
opacity: 0.1,
},
column: {
colors: [], // For vertical column bands, not needed here but available for customization
opacity: 0.1,
},
},
fill: {
type: 'gradient', // Gradient fill for the area
gradient: {
shade: 'dark',
type: 'vertical',
gradientToColors: ['#9c27b0'], // Gradient color ending
stops: [0, 100],
},
},
};
this.chart = new ApexCharts(this.shadowRoot.querySelector('.chartContainer'), options);
await this.chart.render();
await this.resizeChart();
}
public async resizeChart() {
const mainbox: HTMLDivElement = this.shadowRoot.querySelector('.mainbox');
const chartContainer: HTMLDivElement = this.shadowRoot.querySelector('.chartContainer');
// Get computed style of the element
const styleMainbox = window.getComputedStyle(mainbox);
const styleChartContainer = window.getComputedStyle(chartContainer);
// Extract padding values
const paddingTop = parseInt(styleChartContainer.paddingTop, 10);
const paddingBottom = parseInt(styleChartContainer.paddingBottom, 10);
const paddingLeft = parseInt(styleChartContainer.paddingLeft, 10);
const paddingRight = parseInt(styleChartContainer.paddingRight, 10);
// Calculate the actual width and height to use, subtracting padding
const actualWidth = mainbox.clientWidth - paddingLeft - paddingRight;
const actualHeight = mainbox.offsetHeight - paddingTop - paddingBottom;
await this.chart.updateOptions({
chart: {
width: actualWidth,
height: actualHeight,
},
});
}
}

View File

@ -0,0 +1,20 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => {
return html`
<style>
.demoBox {
position: relative;
background: #000000;
height: 100%;
width: 100%;
padding: 40px;
}
</style>
<div class="demoBox">
<dees-chart-log
.label=${'Event Log'}
></dees-chart-log>
</div>
`;
};

View File

@ -0,0 +1,89 @@
import {
DeesElement,
css,
cssManager,
customElement,
html,
property,
state,
type CSSResult,
type TemplateResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-chart-log.demo.js';
import ApexCharts from 'apexcharts';
declare global {
interface HTMLElementTagNameMap {
'dees-chart-log': DeesChartLog;
}
}
@customElement('dees-chart-log')
export class DeesChartLog extends DeesElement {
public static demo = demoFunc;
// instance
@state()
public chart: ApexCharts;
@property()
public label: string = 'Untitled Chart';
constructor() {
super();
domtools.elementBasic.setup();
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
font-family: 'Geist Sans', sans-serif;
color: #ccc;
font-weight: 600;
font-size: 12px;
}
.mainbox {
position: relative;
width: 100%;
height: 400px;
background: #222;
border-radius: 8px;
padding: 32px 16px 16px 0px;
}
.chartTitle {
position: absolute;
top: 0;
left: 0;
width: 100%;
text-align: center;
padding-top: 16px;
}
.chartContainer {
position: relative;
width: 100%;
height: 100%;
}
`,
];
public render(): TemplateResult {
return html` <div class="mainbox">
<div class="chartTitle">${this.label}</div>
<div class="chartContainer"></div>
</div> `;
}
public async firstUpdated() {
const domtoolsInstance = await this.domtoolsPromise;
}
public async updateLog() {
}
}

View File

@ -0,0 +1,41 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<style>
.demoContainer {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
background: #222;
}
</style>
<div class="demoContainer">
<dees-chips
selectionMode="none"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' },
]}
></dees-chips>
<dees-chips
selectionMode="single"
chipsAreRemovable
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' },
]}
></dees-chips>
<dees-chips
selectionMode="multiple"
.selectableChips=${[
{ key: 'account1', value: 'Payment Account 1' },
{ key: 'account2', value: 'PaymentAccount2' },
{ key: 'account3', value: 'Payment Account 3' },
]}
></dees-chips>
</div>
`;

View File

@ -11,6 +11,7 @@ import {
} from '@design.estate/dees-element'; } from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-chips.demo.js';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -18,30 +19,32 @@ declare global {
} }
} }
type Tag = { key: string; value: string };
@customElement('dees-chips') @customElement('dees-chips')
export class DeesChips extends DeesElement { export class DeesChips extends DeesElement {
public static demo = () => html` public static demo = demoFunc;
<dees-chips .selectableChips=${['Payment Account 1', 'PaymentAccount2', 'Payment Account 3']}></dees-chips>
<dees-chips selectionMode="multiple" .selectableChips=${['Payment Account 1', 'PaymentAccount2', 'Payment Account 3']}></dees-chips>
`;
@property() @property()
public selectionMode: 'single' | 'multiple' = 'single'; public selectionMode: 'none' | 'single' | 'multiple' = 'single';
@property({ @property({
type: Array type: Boolean,
}) })
public selectableChips: string[] = []; public chipsAreRemovable: boolean = false;
@property({
type: Array,
})
public selectableChips: Tag[] = [];
@property() @property()
public selectedChip: string = null; public selectedChip: Tag = null;
@property({ @property({
type: Array type: Array,
}) })
public selectedChips: string[] = []; public selectedChips: Tag[] = [];
constructor() { constructor() {
super(); super();
@ -50,47 +53,87 @@ export class DeesChips extends DeesElement {
public static styles = [ public static styles = [
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`
:host { :host {
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
} }
.mainbox { .mainbox {
user-select: none;
} }
.chip { .chip {
background: #494949; border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #444')};
display: inline-block; background: #333333;
padding: 8px 12px; display: inline-flex;
font-size: 14px; height: 20px;
line-height: 20px;
padding: 0px 8px;
font-size: 12px;
color: #fff; color: #fff;
border-radius: 40px; border-radius: 40px;
margin-right: 4px; margin-right: 4px;
margin-bottom: 8px; margin-bottom: 4px;
position: relative;
overflow: hidden;
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
} }
.chip:hover { .chip:hover {
background: #666666; background: #666666;
cursor: pointer;
} }
.chip.selected { .chip.selected {
background: #00A3FF; background: #00a3ff;
} }
.chipKey {
background: rgba(0, 0, 0, 0.3);
height: 100%;
display: inline-block;
margin-left: -8px;
padding-left: 8px;
padding-right: 8px;
margin-right: 8px;
}
dees-icon {
padding: 0px 6px 0px 4px;
margin-left: 4px;
margin-right: -8px;
background: rgba(0, 0, 0, 0.3);
}
dees-icon:hover {
background: #e4002b;
}
`, `,
]; ];
public render(): TemplateResult { public render(): TemplateResult {
return html` return html`
<div class="mainbox"> <div class="mainbox">
${this.selectableChips.map(chipArg => html` ${this.selectableChips.map(
<div @click=${() => this.selectChip(chipArg)} class="chip ${this.selectedChip === chipArg || this.selectedChips.includes(chipArg) ? 'selected' : ''}"> (chip) => html`
${chipArg} <div
@click=${() => this.selectChip(chip)}
class="chip ${this.isSelected(chip) ? 'selected' : ''}"
>
${chip.key ? html`<div class="chipKey">${chip.key}</div>` : html``} ${chip.value}
${this.chipsAreRemovable
? html`
<dees-icon
@click=${(event: Event) => {
event.stopPropagation(); // prevent the selectChip event from being triggered
this.removeChip(chip);
}}
.iconFA=${'xmark'}
></dees-icon>
`
: html``}
</div> </div>
`)} `
)}
</div> </div>
`; `;
} }
@ -102,23 +145,51 @@ export class DeesChips extends DeesElement {
} }
} }
public async selectChip(chipArg: string) { private isSelected(chip: Tag): boolean {
if (this.selectionMode === 'single') { if (this.selectionMode === 'single') {
if (this.selectedChip === chipArg) { return this.selectedChip?.key === chip.key;
} else {
return this.selectedChips.some((selected) => selected.key === chip.key);
}
}
public async selectChip(chip: Tag) {
if (this.selectionMode === 'none') {
return;
}
if (this.selectionMode === 'single') {
if (this.isSelected(chip)) {
this.selectedChip = null; this.selectedChip = null;
this.selectedChips = []; this.selectedChips = [];
} else { } else {
this.selectedChip = chipArg; this.selectedChip = chip;
this.selectedChips = [chipArg]; this.selectedChips = [chip];
} }
} else if(this.selectionMode === 'multiple') { } else if (this.selectionMode === 'multiple') {
if (this.selectedChips.includes(chipArg)) { if (this.isSelected(chip)) {
this.selectedChips = this.selectedChips.filter(chipArg2 => chipArg !== chipArg2) this.selectedChips = this.selectedChips.filter((selected) => selected.key !== chip.key);
} else { } else {
this.selectedChips.push(chipArg); this.selectedChips = [...this.selectedChips, chip];
} }
this.requestUpdate(); this.requestUpdate();
} }
console.log(this.selectedChips); console.log(this.selectedChips);
} }
public removeChip(chipToRemove: Tag): void {
// Remove the chip from selectableChips
this.selectableChips = this.selectableChips.filter((chip) => chip.key !== chipToRemove.key);
// Remove the chip from selectedChips if present
this.selectedChips = this.selectedChips.filter((chip) => chip.key !== chipToRemove.key);
// If the removed chip was the selectedChip, set selectedChip to null
if (this.selectedChip && this.selectedChip.key === chipToRemove.key) {
this.selectedChip = null;
}
// Trigger an update to re-render the component
this.requestUpdate();
}
} }

View File

@ -0,0 +1,57 @@
import { html } from '@design.estate/dees-element';
import * as plugins from './00plugins.js';
import { DeesContextmenu } from './dees-contextmenu.js';
export const demoFunc = () => html`
<style>
.withMargin {
display: block;
margin: 20px;
}
</style>
<dees-button @contextmenu=${(eventArg) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [
{
name: 'copy',
iconName: 'copySolid',
action: async () => {
return null;
},
},
{
name: 'edit',
iconName: 'penToSquare',
action: async () => {
return null;
},
},{
name: 'paste',
iconName: 'pasteSolid',
action: async () => {
return null;
},
},
]);
}}>Right-Click for contextmenu</dees-button>
<dees-contextmenu class="withMargin"></dees-contextmenu>
<dees-contextmenu
class="withMargin"
.menuItems=${[
{
name: 'copy',
iconName: 'copySolid',
action: async () => {},
},
{
name: 'edit',
iconName: 'penToSquare',
action: async () => {},
},{
name: 'paste',
iconName: 'pasteSolid',
action: async () => {},
},
] as plugins.tsclass.website.IMenuItem[]}
></dees-contextmenu>
`;

View File

@ -1,4 +1,6 @@
import * as plugins from './plugins.js'; import * as colors from './00colors.js';
import * as plugins from './00plugins.js';
import { demoFunc } from './dees-contextmenu.demo.js';
import { import {
customElement, customElement,
html, html,
@ -23,64 +25,49 @@ declare global {
@customElement('dees-contextmenu') @customElement('dees-contextmenu')
export class DeesContextmenu extends DeesElement { export class DeesContextmenu extends DeesElement {
// DEMO // DEMO
public static demo = () => html` public static demo = demoFunc
<style>
.withMargin {
display: block;
margin: 20px;
}
</style>
<dees-button @contextmenu=${(eventArg) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [
{
name: 'copy',
iconName: 'copySolid',
action: async () => {
return null;
},
},
{
name: 'edit',
iconName: 'penToSquare',
action: async () => {
return null;
},
},{
name: 'paste',
iconName: 'pasteSolid',
action: async () => {
return null;
},
},
]);
}}>Hello</dees-button>
<dees-contextmenu class="withMargin"></dees-contextmenu>
<dees-contextmenu
class="withMargin"
.menuItems=${[
{
name: 'copy',
iconName: 'copySolid',
action: async () => {},
},
{
name: 'edit',
iconName: 'penToSquare',
action: async () => {},
},{
name: 'paste',
iconName: 'pasteSolid',
action: async () => {},
},
] as plugins.tsclass.website.IMenuItem[]}
></dees-contextmenu>
`;
// STATIC // STATIC
// This will store all the accumulated menu items
public static contextMenuDeactivated = false;
public static accumulatedMenuItems: plugins.tsclass.website.IMenuItem[] = [];
// Add a global event listener for the right-click context menu
public static initializeGlobalListener() {
document.addEventListener('contextmenu', (event: MouseEvent) => {
if (this.contextMenuDeactivated) {
return;
}
event.preventDefault();
// Get the target element of the right-click
let target: EventTarget | null = event.target;
// Clear previously accumulated items
DeesContextmenu.accumulatedMenuItems = [];
// Traverse up the DOM tree to accumulate menu items
while (target) {
if ((target as any).getContextMenuItems) {
DeesContextmenu.accumulatedMenuItems.push(...(target as any).getContextMenuItems());
}
target = (target as Node).parentNode;
}
// Open the context menu with the accumulated items
DeesContextmenu.openContextMenuWithOptions(event, DeesContextmenu.accumulatedMenuItems);
});
}
// allows opening of a contextmenu with options
public static async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) { public static async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
if (this.contextMenuDeactivated) {
return;
}
eventArg.preventDefault(); eventArg.preventDefault();
eventArg.stopPropagation();
const contextMenu = new DeesContextmenu(); const contextMenu = new DeesContextmenu();
contextMenu.style.position = 'absolute'; contextMenu.style.position = 'fixed';
contextMenu.style.zIndex = '2000'; contextMenu.style.zIndex = '2000';
contextMenu.style.top = `${eventArg.clientY.toString()}px`; contextMenu.style.top = `${eventArg.clientY.toString()}px`;
contextMenu.style.left = `${eventArg.clientX.toString()}px`; contextMenu.style.left = `${eventArg.clientX.toString()}px`;
@ -98,6 +85,7 @@ export class DeesContextmenu extends DeesElement {
contextMenu.style.transform = 'scale(1,1)'; contextMenu.style.transform = 'scale(1,1)';
} }
// INSTANCE
@property({ @property({
type: Array, type: Array,
}) })
@ -108,6 +96,9 @@ export class DeesContextmenu extends DeesElement {
super(); super();
} }
/**
* STATIC STYLES
*/
public static styles = [ public static styles = [
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`
@ -120,16 +111,18 @@ export class DeesContextmenu extends DeesElement {
color: ${cssManager.bdTheme('#222', '#ccc')}; color: ${cssManager.bdTheme('#222', '#ccc')};
font-size: 14px; font-size: 14px;
width: 200px; width: 200px;
border: 1px solid #444; border: 1px solid ${cssManager.bdTheme('#fff', '#ffffff10')};
min-height: 40px; min-height: 34px;
border-radius: 3px; border-radius: 3px;
background: #222; background: ${cssManager.bdTheme('#fff', '#222')};
box-shadow: 0px 1px 4px #000; box-shadow: 0px 1px 4px ${cssManager.bdTheme('#00000020', '#000000')};
user-select: none; user-select: none;
padding: 4px;
} }
.mainbox .menuitem { .mainbox .menuitem {
padding: 8px; padding: 4px 8px;
border-radius: 3px;
} }
.mainbox .menuitem dees-icon { .mainbox .menuitem dees-icon {
@ -140,12 +133,10 @@ export class DeesContextmenu extends DeesElement {
} }
.mainbox .menuitem:hover { .mainbox .menuitem:hover {
cursor: pointer; background: ${cssManager.bdTheme(colors.bright.blue, colors.dark.blue)};
background: #ffffff10;
} }
.mainbox .menuitem:active { .mainbox .menuitem:active {
cursor: pointer;
background: #ffffff05; background: #ffffff05;
} }
`, `,
@ -162,15 +153,21 @@ export class DeesContextmenu extends DeesElement {
</div> </div>
`; `;
})} })}
${this.menuItems.length === 0 ? html`
<div class="menuitem" @click=${() => {
DeesContextmenu.contextMenuDeactivated = true;
this.destroy();
}}>
<dees-icon .iconFA=${'xmark'}></dees-icon
>allow native context
</div>
` : html``}
</div> </div>
`; `;
} }
public async firstUpdated() { public async firstUpdated() {
if (!this.menuItems || this.menuItems.length === 0) {
const mainbox = this.shadowRoot.querySelector('.mainbox');
mainbox.textContent = 'no menu items present';
}
} }
public async handleClick(menuItem: plugins.tsclass.website.IMenuItem) { public async handleClick(menuItem: plugins.tsclass.website.IMenuItem) {
@ -188,3 +185,5 @@ export class DeesContextmenu extends DeesElement {
this.parentElement.removeChild(this); this.parentElement.removeChild(this);
} }
} }
DeesContextmenu.initializeGlobalListener();

View File

@ -6,6 +6,7 @@ import {
type TemplateResult, type TemplateResult,
property, property,
state, state,
cssManager,
} from '@design.estate/dees-element'; } from '@design.estate/dees-element';
import hlight from 'highlight.js'; import hlight from 'highlight.js';
@ -13,6 +14,7 @@ import hlight from 'highlight.js';
import * as smartstring from '@push.rocks/smartstring'; import * as smartstring from '@push.rocks/smartstring';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { DeesContextmenu } from './dees-contextmenu.js';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -46,6 +48,7 @@ export class DeesDataviewCodebox extends DeesElement {
display: block; display: block;
text-align: left; text-align: left;
font-size: 16px; font-size: 16px;
font-family: 'Geist Sans', sans-serif;
} }
.mainbox { .mainbox {
position: relative; position: relative;
@ -58,31 +61,38 @@ export class DeesDataviewCodebox extends DeesElement {
} }
.appbar { .appbar {
position: relative;
color: ${cssManager.bdTheme('#333', '#ccc')};
background: ${cssManager.bdTheme('#ffffff', '#161616')};
border-bottom: 1px solid ${cssManager.bdTheme('#eeeeeb', '#222222')};
height: 24px; height: 24px;
background: #161616; display: flex;
border-bottom: 1px solid #222222;
font-size: 12px; font-size: 12px;
color: #CCC;
font-family: 'Hubot Sans', 'monospace';
line-height: 24px; line-height: 24px;
justify-content: center;
align-items: center;
} }
.appbar .fileName { .appbar .fileName {
line-height: inherit;
position: relative;
flex: 1;
text-align: center; text-align: center;
} }
.bottomBar { .bottomBar {
color: ${cssManager.bdTheme('#333', '#ccc')};
background: ${cssManager.bdTheme('#ffffff', '#161616')};
border-top: 1px solid ${cssManager.bdTheme('#eeeeeb', '#222222')};
height: 24px; height: 24px;
background: #161616;
border-top: 1px solid #222222;
font-size: 12px; font-size: 12px;
color: #CCC;
font-family: 'Hubot Sans', 'monospace';
line-height: 24px; line-height: 24px;
text-align: right;
padding-right: 100px;
} }
.languageLabel { .languageLabel {
color: #fff; color: ${cssManager.bdTheme('#333', '#ccc')};
font-size: 12px; font-size: 12px;
line-height: 24px; line-height: 24px;
z-index: 10; z-index: 10;
@ -105,7 +115,6 @@ export class DeesDataviewCodebox extends DeesElement {
} }
.lineNumbers { .lineNumbers {
color: ${this.goBright ? '#acacac' : '#666666'}; color: ${this.goBright ? '#acacac' : '#666666'};
padding: 30px 16px 0px 0px; padding: 30px 16px 0px 0px;
text-align: right; text-align: right;
@ -133,7 +142,7 @@ export class DeesDataviewCodebox extends DeesElement {
.lineNumbers { .lineNumbers {
line-height: 1.4em; line-height: 1.4em;
font-weight: 200; font-weight: 200;
font-family: 'Intel One Mono', 'monospace'; font-family: 'Intel One Mono', 'Geist Mono', 'monospace';
} }
.hljs-string { .hljs-string {
@ -156,9 +165,24 @@ export class DeesDataviewCodebox extends DeesElement {
color: ${this.goBright ? '#EF9300' : '#ffd765'}; color: ${this.goBright ? '#EF9300' : '#ffd765'};
} }
</style> </style>
<div class="mainbox"> <div
class="mainbox"
@contextmenu="${(eventArg) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [
{
name: 'About',
iconName: 'circleInfo',
action: async () => {
return null;
},
},
]);
}}"
>
<div class="appbar"> <div class="appbar">
<dees-windowcontrols type="mac" position="left"></dees-windowcontrols>
<div class="fileName">index.ts</div> <div class="fileName">index.ts</div>
<dees-windowcontrols type="mac" position="right"></dees-windowcontrols>
</div> </div>
<div class="codegrid"> <div class="codegrid">
<div class="lineNumbers"> <div class="lineNumbers">

View File

@ -1,7 +1,16 @@
import { html } from '@design.estate/dees-element'; import { html, cssManager } from '@design.estate/dees-element';
import * as tsclass from '@tsclass/tsclass'; import * as tsclass from '@tsclass/tsclass';
export const demoFunc = () => html`<dees-dataview-statusobject export const demoFunc = () => html` <style>
.demo {
background: ${cssManager.bdTheme('#eeeeeb', '#000000')};
display: block;
content: '';
padding: 40px;
}
</style>
<div class="demo">
<dees-dataview-statusobject
.statusObject=${{ .statusObject=${{
id: '1', id: '1',
name: 'Demo Item', name: 'Demo Item',
@ -35,5 +44,6 @@ export const demoFunc = () => html`<dees-dataview-statusobject
}, },
], ],
} as tsclass.code.IStatusObject} } as tsclass.code.IStatusObject}
> >
</dees-dataview-statusobject>`; </dees-dataview-statusobject>
</div>`;

View File

@ -1,3 +1,6 @@
import * as colors from './00colors.js';
import * as plugins from './00plugins.js';
import { demoFunc } from './dees-dataview-statusobject.demo.js'; import { demoFunc } from './dees-dataview-statusobject.demo.js';
import { import {
DeesElement, DeesElement,
@ -29,11 +32,13 @@ export class DeesDataviewStatusobject extends DeesElement {
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`
.mainbox { .mainbox {
border-radius: 3px; border-radius: 8px;
background: ${cssManager.bdTheme('#fff', '#1b1b1b')}; background: ${cssManager.bdTheme('#fff', '#1b1b1b')};
box-shadow: 0px 1px 3px #00000030; box-shadow: 0px 1px 3px #00000030;
min-height: 48px; min-height: 48px;
color: ${cssManager.bdTheme('#000', '#fff')}; color: ${cssManager.bdTheme('#000', '#fff')};
border-top: ${cssManager.bdTheme('none', '1px solid #ffffff10')};
cursor: default;
} }
.heading { .heading {
@ -61,16 +66,28 @@ export class DeesDataviewStatusobject extends DeesElement {
} }
.copyMain { .copyMain {
cursor: pointer;
font-size: 10px; font-size: 10px;
font-weight: 600; font-weight: 600;
text-transform: uppercase; text-transform: uppercase;
border: 1px solid ${cssManager.bdTheme('#999', '#444')}; border: 1px solid ${cssManager.bdTheme('#e0e0e0', '#444')};
text-align: center; text-align: center;
padding: 4px; padding: 4px;
border-radius: 3px; border-radius: 3px;
margin-right: 16px; margin-right: 16px;
color: #ffffff80 color: ${cssManager.bdTheme('#333', '#ffffff80')};
user-select: none;
}
.copyMain:hover {
background: ${cssManager.bdTheme(colors.bright.blue, colors.dark.blue)};
border: 1px solid ${cssManager.bdTheme(colors.bright.blue, colors.dark.blue)};
color: #fff;
}
.copyMain:active {
background: ${cssManager.bdTheme(colors.bright.blueActive, colors.dark.blueActive)};
border: 1px solid ${cssManager.bdTheme(colors.bright.blueActive, colors.dark.blueActive)};
color: #fff;
} }
.statusdot.ok { .statusdot.ok {
@ -86,11 +103,20 @@ export class DeesDataviewStatusobject extends DeesElement {
} }
.detail { .detail {
minheight: 60px; min-height: 60px;
align-items: center; align-items: center;
display: grid; display: grid;
grid-template-columns: 40px auto; grid-template-columns: 40px auto;
border-top: 1px dotted ${cssManager.bdTheme('#999', '#282828')}; border-top: 1px dotted ${cssManager.bdTheme('#e0e0e0', '#282828')};
transition: all 0.2s;
}
.detail:hover {
background: #ffffff05;
}
.detail:active {
background: #ffffff10;
} }
.detail .detailsText { .detail .detailsText {
@ -107,7 +133,7 @@ export class DeesDataviewStatusobject extends DeesElement {
.detail .detailsText .value { .detail .detailsText .value {
font-size: 14px; font-size: 14px;
font-family: 'Intel One Mono'; font-family: 'Intel One Mono', 'Geist Mono';
} }
`, `,
]; ];

View File

@ -0,0 +1,98 @@
import {
DeesElement,
property,
html,
customElement,
type TemplateResult,
css,
cssManager,
domtools
} from '@design.estate/dees-element';
const deferred = domtools.plugins.smartpromise.defer();
declare global {
interface HTMLElementTagNameMap {
'dees-editormarkdown': DeesEditorMarkdown;
}
}
@customElement('dees-editormarkdown')
export class DeesEditorMarkdown extends DeesElement {
public static demo = () => html`<dees-editormarkdown></dees-editormarkdown>`;
public static styles = [
cssManager.defaultStyles,
css`
.gridcontainer {
position: absolute;
height: 100%;
width: 100%;
display: grid;
grid-template-columns: 60% 40%;
}
.editorContainer {
position: relative;
}
.outletContainer {
background: #111;
color: #fff;
font-family: 'Roboto Slab';
padding: 20px;
overflow-y: scroll;
}
`,
];
public render() {
return html`
<div class="gridcontainer">
<div class="editorContainer">
<dees-editor
.language=${'markdown'}
.content=${`# a test content
This is test content that is of longer form an hopefully starts to wrap when I need it. And yes, it does perfectly. nice.
Test | Hello
--- | ---
Yeah | So good
This is real asset I think. Why would we want to leave that on the table? Can you tell my that?
Why are we here?
Do you know?
> note:
There is something going on.
\`\`\`typescript
const hello = 'yes'
\`\`\`
`}
wordWrap="bounded"
></dees-editor>
</div>
<div class="outletContainer">
<dees-editormarkdownoutlet></dees-editormarkdownoutlet>
</div>
</div>
`;
}
public async firstUpdated(_changedPropertiesArg) {
await super.firstUpdated(_changedPropertiesArg);
const editor = this.shadowRoot.querySelector('dees-editor');
// lets care about wiring the markdown stuff.
const markdownOutlet = this.shadowRoot.querySelector('dees-editormarkdownoutlet');
const smartmarkdownInstance = new domtools.plugins.smartmarkdown.SmartMarkdown();
const mdParsedResult = await smartmarkdownInstance.getMdParsedResultFromMarkdown('loading...')
editor.contentSubject.subscribe(async contentArg => {
await mdParsedResult.updateFromMarkdownString(contentArg)
const html = mdParsedResult.html;
markdownOutlet.updateHtmlText(html);
})
}
}

View File

@ -0,0 +1,42 @@
import { customElement, DeesElement, html, type TemplateResult } from '@design.estate/dees-element';
declare global {
interface HTMLElementTagNameMap {
'dees-editormarkdownoutlet': DeesEditorMarkdownOutlet;
}
}
@customElement('dees-editormarkdownoutlet')
export class DeesEditorMarkdownOutlet extends DeesElement {
// DEMO
public static demo = () => html`<dees-editormarkdownoutlet></dees-editormarkdownoutlet>`;
// INSTANCE
private outlet: HTMLElement;
public render(): TemplateResult {
return html`
<div class="outlet markdown-body">
<h1>Hi there</h1>
</div>
`;
}
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
await super.firstUpdated(_changedProperties);
const styleElement = document.createElement('style');
const cssText = await (
await fetch('https://unpkg.com/github-markdown-css@5.1.0/github-markdown-dark.css')
).text();
styleElement.textContent = cssText;
this.shadowRoot.append(styleElement);
}
public async updateHtmlText(htmlTextArg: string) {
await this.updateComplete;
if (!this.outlet) {
this.outlet = this.shadowRoot.querySelector('.outlet');
}
this.outlet.innerHTML = htmlTextArg;
}
}

View File

@ -0,0 +1,126 @@
import {
DeesElement,
property,
html,
customElement,
type TemplateResult,
css,
cssManager,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import type * as monaco from 'monaco-editor';
declare global {
interface HTMLElementTagNameMap {
'dees-editor': DeesEditor;
}
}
@customElement('dees-editor')
export class DeesEditor extends DeesElement {
// DEMO
public static demo = () => html` <dees-editor></dees-editor> `;
// STATIC
public static monacoDeferred: ReturnType<typeof domtools.plugins.smartpromise.defer>;
// INSTANCE
public editorDeferred = domtools.plugins.smartpromise.defer<monaco.editor.IStandaloneCodeEditor>();
public language = 'typescript';
@property({
type: String
})
public content = "function hello() {\n\talert('Hello world!');\n}";
@property({
type: Object
})
public contentSubject = new domtools.plugins.smartrx.rxjs.Subject<string>();
@property({
type: Boolean
})
public wordWrap: monaco.editor.IStandaloneEditorConstructionOptions['wordWrap'] = 'off';
constructor() {
super();
domtools.DomTools.setupDomTools();
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
}
* {
box-sizing: border-box;
}
#container {
position: absolute;
height: 100%;
width: 100%;
}
`,
];
public render(): TemplateResult {
return html`
<div class="mainbox">
<div id="container"></div>
</div>
`;
}
public async firstUpdated(
_changedProperties: Map<string | number | symbol, unknown>
): Promise<void> {
super.firstUpdated(_changedProperties);
const container = this.shadowRoot.getElementById('container');
if (!DeesEditor.monacoDeferred) {
DeesEditor.monacoDeferred = domtools.plugins.smartpromise.defer();
const scriptUrl = `https://cdn.jsdelivr.net/npm/monaco-editor/min/vs/loader.js`;
const script = document.createElement('script');
script.src = scriptUrl;
script.onload = () => {
DeesEditor.monacoDeferred.resolve();
};
document.head.appendChild(script);
}
await DeesEditor.monacoDeferred.promise;
(window as any).require.config({
paths: { vs: 'https://cdn.jsdelivr.net/npm/monaco-editor/min/vs' },
});
(window as any).require(['vs/editor/editor.main'], async () => {
const editor = ((window as any).monaco.editor as typeof monaco.editor).create(container, {
value: this.content,
language: this.language,
theme: 'vs-dark',
useShadowDOM: true,
fontSize: 16,
automaticLayout: true,
wordWrap: this.wordWrap
});
this.editorDeferred.resolve(editor);
});
const css = await (
await fetch('https://cdn.jsdelivr.net/npm/monaco-editor/min/vs/editor/editor.main.css')
).text();
const styleElement = document.createElement('style');
styleElement.textContent = css;
this.shadowRoot.append(styleElement);
// editor is setup let do the rest
const editor = await this.editorDeferred.promise;
editor.onDidChangeModelContent(async eventArg => {
this.contentSubject.next(editor.getValue());
});
this.contentSubject.next(editor.getValue());
}
}

View File

@ -0,0 +1,69 @@
import { html, domtools, cssManager } from '@design.estate/dees-element';
import type { DeesForm } from './dees-form.js';
export const demoFunc = () => html`
<style>
.demoContainer {
max-width: 400px;
margin: 24px auto;
padding: 16px;
background: ${cssManager.bdTheme('#eeeeeb', '#111')};
box-shadow: 0px 1px 3px #00000030;
}
</style>
<div class="demoContainer">
<dees-form
style="display: block; margin:auto; max-width: 500px; padding: 20px"
@formData=${async (eventArg) => {
const form: DeesForm = eventArg.currentTarget;
form.setStatus('pending', 'authenticating...');
await domtools.plugins.smartdelay.delayFor(1000);
form.setStatus('success', 'authenticated!');
}}
>
<dees-input-dropdown
.label=${'title'}
.options=${[
{ option: 'option 1', key: 'option1' },
{ option: 'option 2', key: 'option2' },
{ option: 'option 3', key: 'option3' },
]}
></dees-input-dropdown>
<dees-input-multiselect
.label=${'title'}
.options=${[
{ option: 'option 1', key: 'option1' },
{ option: 'option 2', key: 'option2' },
{ option: 'option 3', key: 'option3' },
]}></dees-input-multiselect>
<dees-input-typelist
.label=${'a type list'}
></dees-input-typelist>
<dees-input-text .required="${true}" key="hello1" label="a text" .description=${`
This is an awesome description.
`}></dees-input-text>
<dees-input-text .required="${true}" key="hello2" label="also a text"></dees-input-text>
<dees-input-text
.required="${true}"
key="hello3"
label="a password"
isPasswordBool
></dees-input-text>
<dees-input-checkbox
.required="${true}"
key="hello3"
label="another text"
></dees-input-checkbox>
<dees-input-iban></dees-input-iban>
<dees-input-multitoggle
.label=${'multi select'}
.options=${['option 1', 'option 2', 'option 3']}
.selectedOption=${'option 1'}
></dees-input-multitoggle>
<dees-input-fileupload
.label=${'attachments'}
></dees-input-fileupload>
<dees-form-submit>Submit</dees-form-submit>
</dees-form>
</div>
`;

View File

@ -1,4 +1,10 @@
import { customElement, html, type TemplateResult, DeesElement, type CSSResult, } from '@design.estate/dees-element'; import {
customElement,
html,
type TemplateResult,
DeesElement,
type CSSResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { DeesInputCheckbox } from './dees-input-checkbox.js'; import { DeesInputCheckbox } from './dees-input-checkbox.js';
@ -6,16 +12,27 @@ import { DeesInputText } from './dees-input-text.js';
import { DeesInputQuantitySelector } from './dees-input-quantityselector.js'; import { DeesInputQuantitySelector } from './dees-input-quantityselector.js';
import { DeesInputRadio } from './dees-input-radio.js'; import { DeesInputRadio } from './dees-input-radio.js';
import { DeesFormSubmit } from './dees-form-submit.js'; import { DeesFormSubmit } from './dees-form-submit.js';
import { DeesTable } from './dees-table.js';
import { demoFunc } from './dees-form.demo.js';
import { DeesInputIban } from './dees-input-iban.js';
// Unified set for form input types // Unified set for form input types
const FORM_INPUT_TYPES = [ const FORM_INPUT_TYPES = [
DeesInputCheckbox, DeesInputCheckbox,
DeesInputIban,
DeesInputText, DeesInputText,
DeesInputQuantitySelector, DeesInputQuantitySelector,
DeesInputRadio DeesInputRadio,
DeesTable,
]; ];
export type TFormInputElement = DeesInputCheckbox | DeesInputText | DeesInputQuantitySelector | DeesInputRadio; export type TFormInputElement =
| DeesInputCheckbox
| DeesInputIban
| DeesInputText
| DeesInputQuantitySelector
| DeesInputRadio
| DeesTable<any>;
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -25,26 +42,10 @@ declare global {
@customElement('dees-form') @customElement('dees-form')
export class DeesForm extends DeesElement { export class DeesForm extends DeesElement {
public static demo = demoFunc;
public static demo = () => html`
<dees-form
style="display: block; margin:auto; max-width: 500px; padding: 20px"
@formData=${async (eventArg) => {
const form: DeesForm = eventArg.currentTarget;
form.setStatus('pending', 'authenticating...');
await domtools.plugins.smartdelay.delayFor(1000);
form.setStatus('success', 'authenticated!');
}}
>
<dees-input-text .required="${true}" key="hello1" label="a text"></dees-input-text>
<dees-input-text .required="${true}" key="hello2" label="also a text"></dees-input-text>
<dees-input-checkbox .required="${true}" key="hello3" label="another text"></dees-input-checkbox>
<dees-form-submit>Submit</dees-form-submit>
</dees-form>
`;
public name: string = 'myform'; public name: string = 'myform';
public changeSubject = new domtools.rxjs.Subject(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
public readyDeferred = domtools.plugins.smartpromise.defer(); public readyDeferred = domtools.plugins.smartpromise.defer();
public render(): TemplateResult { public render(): TemplateResult {
@ -75,14 +76,14 @@ export class DeesForm extends DeesElement {
} }
public getFormElements(): Array<TFormInputElement> { public getFormElements(): Array<TFormInputElement> {
return (Array.from(this.children)).filter(child => return Array.from(this.children).filter((child) =>
FORM_INPUT_TYPES.includes(child.constructor as any) FORM_INPUT_TYPES.includes(child.constructor as any)
) as unknown as TFormInputElement[]; ) as unknown as TFormInputElement[];
} }
public getSubmitButton(): DeesFormSubmit | undefined { public getSubmitButton(): DeesFormSubmit | undefined {
return Array.from(this.children).find(child => return Array.from(this.children).find(
child instanceof DeesFormSubmit (child) => child instanceof DeesFormSubmit
) as DeesFormSubmit; ) as DeesFormSubmit;
} }
@ -100,9 +101,13 @@ export class DeesForm extends DeesElement {
} }
} }
/**
* collects the form data
* @returns
*/
public async collectFormData() { public async collectFormData() {
const children = this.getFormElements(); const children = this.getFormElements();
const valueObject: { [key: string]: string | number | boolean } = {}; const valueObject: { [key: string]: string | number | boolean | any[] } = {};
for (const child of children) { for (const child of children) {
if (!child.key) { if (!child.key) {
console.log(`form element with label "${child.label}" has no key. skipping.`); console.log(`form element with label "${child.label}" has no key. skipping.`);

View File

@ -0,0 +1,5 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-hint></dees-hint>
`;

View File

@ -0,0 +1,38 @@
import {
DeesElement,
css,
cssManager,
customElement,
html,
property,
type CSSResult,
type TemplateResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-hint.demo.js';
declare global {
interface HTMLElementTagNameMap {
'dees-hint': DeesHint;
}
}
@customElement('dees-hint')
export class DeesHint extends DeesElement {
public static demo = demoFunc;
@property({ type: String })
public type: 'info' | 'warn' | 'error' | 'critical' = 'info';
constructor() {
super();
domtools.elementBasic.setup();
}
public static styles = [cssManager.defaultStyles, css``];
public render(): TemplateResult {
return html` <div class="mainbox"></div> `;
}
}

View File

@ -0,0 +1,55 @@
import { html } from '@design.estate/dees-element';
import { faIcons } from './dees-icon.js';
export const demoFunc = () => html`
<style>
.demoContainer {
width: 100%;
display: flex;
flex-wrap: wrap;
background: #111111;
padding: 10px; font-size: 30px;
}
dees-icon {
transition: color 0.02s;
color: #ffffff;
}
dees-icon:hover {
color: #e4002b;
}
.iconContainer {
display: block;
padding: 16px 16px 0px 16px;
border: 1px solid #333333;
margin-right: 8px;
margin-bottom: 8px;
}
.iconName {
font-size: 12px;
text-align: center;
color: #ccc;
background: #333333;
padding: 4px 8px;
padding-bottom: 4px;
margin-left: -16px;
margin-right: -16px;
margin-top: 16px;
}
</style>
<div class="demoContainer">
${Object.keys(faIcons).map(
(iconName) => html`
<div class="iconContainer">
<dees-icon .iconFA=${iconName as any}></dees-icon>
<div class="iconName">${iconName}</div>
</div>
`
)}
</div>
`;

View File

@ -29,6 +29,7 @@ import {
faMessage as faMessageRegular, faMessage as faMessageRegular,
faPaste as faPasteRegular, faPaste as faPasteRegular,
faSun as faSunRegular, faSun as faSunRegular,
faTrashCan as faTrashCanRegular,
} from '@fortawesome/free-regular-svg-icons'; } from '@fortawesome/free-regular-svg-icons';
import { import {
faArrowRight as faArrowRightSolid, faArrowRight as faArrowRightSolid,
@ -42,74 +43,88 @@ import {
faCircleInfo as faCircleInfoSolid, faCircleInfo as faCircleInfoSolid,
faCircleCheck as faCircleCheckSolid, faCircleCheck as faCircleCheckSolid,
faCircleXmark as faCircleXmarkSolid, faCircleXmark as faCircleXmarkSolid,
faClockRotateLeft as faClockRotateLeftSolid,
faCopy as faCopySolid, faCopy as faCopySolid,
faDesktop as faDesktopSolid, faDesktop as faDesktopSolid,
faEye as faEyeSolid, faEye as faEyeSolid,
faEyeSlash as faEyeSlashSolid, faEyeSlash as faEyeSlashSolid,
faFileInvoice as faFileInvoiceSolid,
faFileInvoiceDollar as faFileInvoiceDollarSolid,
faGear as faGearSolid,
faGrip as faGripSolid, faGrip as faGripSolid,
faMagnifyingGlass as faMagnifyingGlassSolid,
faMessage as faMessageSolid, faMessage as faMessageSolid,
faMoneyCheckDollar as faMoneyCheckDollarSolid,
faMugHot as faMugHotSolid, faMugHot as faMugHotSolid,
faMinus as faMinusSolid, faMinus as faMinusSolid,
faNetworkWired as faNetworkWiredSolid,
faPaperclip as faPaperclipSolid,
faPaste as faPasteSolid, faPaste as faPasteSolid,
faPenToSquare as faPenToSquareSolid, faPenToSquare as faPenToSquareSolid,
faPlus as faPlusSolid,
faReceipt as faReceiptSolid,
faRss as faRssSolid, faRss as faRssSolid,
faUsers as faUsersSolid, faUsers as faUsersSolid,
faShare as faShareSolid, faShare as faShareSolid,
faSun as faSunSolid, faSun as faSunSolid,
faTerminal as faTerminalSolid,
faTrash as faTrashSolid,
faTrashCan as faTrashCanSolid,
faWallet as faWalletSolid,
faXmark as faXmarkSolid, faXmark as faXmarkSolid,
} from '@fortawesome/free-solid-svg-icons'; } from '@fortawesome/free-solid-svg-icons';
import { demoFunc } from './dees-icon.demo.js';
export const faIcons = { export const faIcons = {
// normal // normal
arrowRight: faArrowRightSolid, arrowRight: faArrowRightSolid,
arrowUpRightFromSquare: faArrowUpRightFromSquareSolid, arrowUpRightFromSquare: faArrowUpRightFromSquareSolid,
arrowUpRightFromSquareSolid: faArrowUpRightFromSquareSolid,
bell: faBellSolid, bell: faBellSolid,
bellSolid: faBellSolid,
bug: faBugSolid, bug: faBugSolid,
bugSolid: faBugSolid,
building: faBuildingSolid, building: faBuildingSolid,
buildingSolid: faBuildingSolid,
caretLeft: faCaretLeftSolid, caretLeft: faCaretLeftSolid,
caretLeftSolid: faCaretLeftSolid,
caretRight: faCaretRightSolid, caretRight: faCaretRightSolid,
caretRightSolid: faCaretRightSolid,
check: faCheckSolid, check: faCheckSolid,
checkSolid: faCheckSolid,
circleInfo: faCircleInfoSolid, circleInfo: faCircleInfoSolid,
circleInfoSolid: faCircleInfoSolid,
circleCheck: faCircleCheckRegular, circleCheck: faCircleCheckRegular,
circleCheckSolid: faCircleCheckSolid, circleCheckSolid: faCircleCheckSolid,
circleXmark: faCircleXmarkRegular, circleXmark: faCircleXmarkRegular,
circleXmarkSolid: faCircleXmarkSolid, circleXmarkSolid: faCircleXmarkSolid,
clockRotateLeft: faClockRotateLeftSolid,
copy: faCopyRegular, copy: faCopyRegular,
copySolid: faCopySolid, copySolid: faCopySolid,
desktop: faDesktopSolid, desktop: faDesktopSolid,
desktopSolid: faDesktopSolid,
eye: faEyeSolid, eye: faEyeSolid,
eyeSolid: faEyeSolid,
eyeSlash: faEyeSlashSolid, eyeSlash: faEyeSlashSolid,
eyeSlashSolid: faEyeSlashSolid, fileInvoice: faFileInvoiceSolid,
fileInvoiceDoller: faFileInvoiceDollarSolid,
gear: faGearSolid,
grip: faGripSolid, grip: faGripSolid,
gripSolid: faGripSolid, magnifyingGlass: faMagnifyingGlassSolid,
message: faMessageRegular, message: faMessageRegular,
messageSolid: faMessageSolid, messageSolid: faMessageSolid,
moneyCheckDollar: faMoneyCheckDollarSolid,
mugHot: faMugHotSolid, mugHot: faMugHotSolid,
faMugHotSolid: faMugHotSolid,
minus: faMinusSolid, minus: faMinusSolid,
minusSolid: faMinusSolid, networkWired: faNetworkWiredSolid,
paperclip: faPaperclipSolid,
paste: faPasteRegular, paste: faPasteRegular,
pasteSolid: faPasteSolid, pasteSolid: faPasteSolid,
penToSquare: faPenToSquareSolid, penToSquare: faPenToSquareSolid,
penToSquareSolid: faPenToSquareSolid, plus: faPlusSolid,
receipt: faReceiptSolid,
rss: faRssSolid, rss: faRssSolid,
rssSolid: faRssSolid,
share: faShareSolid, share: faShareSolid,
shareSolid: faShareSolid,
sun: faSunRegular, sun: faSunRegular,
sunSolid: faSunSolid, sunSolid: faSunSolid,
terminal: faTerminalSolid,
trash: faTrashSolid,
trashSolid: faTrashSolid,
trashCan: faTrashCanRegular,
trashCanSolid: faTrashCanSolid,
users: faUsersSolid,
wallet: faWalletSolid,
xmark: faXmarkSolid, xmark: faXmarkSolid,
xmarkSolid: faXmarkSolid,
// brands // brands
facebook: faFacebook, facebook: faFacebook,
google: faGoogle, google: faGoogle,
@ -119,7 +134,6 @@ export const faIcons = {
slack: faSlackHash, slack: faSlackHash,
tiktok: faTiktok, tiktok: faTiktok,
twitter: faTwitter, twitter: faTwitter,
users: faUsersSolid,
}; };
export type TIconKey = keyof typeof faIcons; export type TIconKey = keyof typeof faIcons;
@ -132,24 +146,7 @@ declare global {
@customElement('dees-icon') @customElement('dees-icon')
export class DeesIcon extends DeesElement { export class DeesIcon extends DeesElement {
public static demo = () => html` public static demo = demoFunc;
<dees-icon iconName="visibility"></dees-icon>
<div style="background: #fff; padding: 10px; font-size: 30px">
<style>
dees-icon {
transition: color 0.05s;
}
dees-icon:hover {
color: #e4002b;
}
</style>
<dees-icon .iconFA=${'messageSolid'}></dees-icon>
<dees-icon .iconFA=${'sun'}></dees-icon>
<dees-icon .iconFA=${'sunSolid'}></dees-icon>
<dees-icon .iconFA=${'facebook'}></dees-icon>
<dees-icon .iconFA=${'arrowUpRightFromSquare'}></dees-icon>
</div>
`;
@property({ @property({
type: String type: String

View File

@ -22,7 +22,7 @@ export class DeesInputCheckbox extends DeesElement {
public static demo = () => html`<dees-input-checkbox></dees-input-checkbox>`; public static demo = () => html`<dees-input-checkbox></dees-input-checkbox>`;
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
@property({ @property({
type: String, type: String,
@ -62,7 +62,10 @@ export class DeesInputCheckbox extends DeesElement {
display: block; display: block;
position: relative; position: relative;
margin: 20px 0px; margin: 20px 0px;
cursor: pointer; cursor: default;
}
:host(:hover) {
filter: ${cssManager.bdTheme('brightness(0.95)', 'brightness(1.1)')};
} }
.maincontainer { .maincontainer {
@ -100,8 +103,8 @@ export class DeesInputCheckbox extends DeesElement {
} }
.checkbox.selected { .checkbox.selected {
background: #039BE5; background: #0050b9;
border: 1px solid #039BE5; border: 1px solid #0050b9;
} }
.checkbox.disabled { .checkbox.disabled {

View File

@ -0,0 +1,27 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-input-dropdown
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
<dees-input-dropdown
.enableSearch=${false}
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
<div style="height: 300px"></div>
<dees-input-dropdown
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
`

View File

@ -1,5 +1,17 @@
import { customElement, DeesElement, type TemplateResult, property, html, css, cssManager, type CSSResult, } from '@design.estate/dees-element'; import {
customElement,
DeesElement,
type TemplateResult,
property,
state,
html,
css,
cssManager,
type CSSResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-input-dropdown.demo.js';
import { DeesWindowLayer } from './dees-windowlayer.js';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -9,18 +21,10 @@ declare global {
@customElement('dees-input-dropdown') @customElement('dees-input-dropdown')
export class DeesInputDropdown extends DeesElement { export class DeesInputDropdown extends DeesElement {
public static demo = () => html` public static demo = demoFunc;
<dees-input-dropdown
.options=${[
{option: 'option 1', key: 'option1'},
{option: 'option 2', key: 'option2'},
{option: 'option 3', key: 'option3'}
]}
></dees-input-dropdown>
`
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
@property({ @property({
type: String, type: String,
@ -32,25 +36,38 @@ export class DeesInputDropdown extends DeesElement {
public key: string; public key: string;
@property() @property()
public options: {option: string, key: string, payload?: any}[] = []; public options: { option: string; key: string; payload?: any }[] = [];
@property() @property()
public selectedOption: {option: string, key: string, payload?: any} = { public selectedOption: { option: string; key: string; payload?: any } = null;
key: null,
option: null,
payload: null
};
@property({ @property({
type: Boolean type: Boolean,
}) })
public required: boolean = false; public required: boolean = false;
@property({ @property({
type: Boolean type: Boolean,
})
public enableSearch: boolean = true;
@property({
type: Boolean,
}) })
public disabled: boolean = false; public disabled: boolean = false;
@state()
public opensToTop: boolean = false;
@state()
private filteredOptions: { option: string; key: string; payload?: any }[] = [];
@state()
private highlightedIndex: number = 0;
@state()
public isOpened = false;
public static styles = [ public static styles = [
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`
@ -59,10 +76,11 @@ export class DeesInputDropdown extends DeesElement {
} }
:host { :host {
font-family: Roboto;
position: relative; position: relative;
display: block; display: block;
height: 40px;
color: ${cssManager.bdTheme('#222', '#fff')}; color: ${cssManager.bdTheme('#222', '#fff')};
margin-bottom: 24px;
} }
.maincontainer { .maincontainer {
@ -71,106 +89,287 @@ export class DeesInputDropdown extends DeesElement {
.label { .label {
font-size: 14px; font-size: 14px;
margin-bottom: 15px; margin-bottom: 8px;
} }
.selectedBox { .selectedBox {
cursor: pointer; user-select: none;
position: relative; position: relative;
max-width: 420px; max-width: 420px;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
padding: 0px 8px; padding: 0px 8px;
z-index: 0px; background: ${cssManager.bdTheme('#fafafa', '#222222')};
background: ${cssManager.bdTheme('#ffffff', '#333333')};
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')}; box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
border-radius: 3px; border-radius: 3px;
border-top: 1px solid #CCCCCC00; border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #ffffff10')};
border-bottom: 1px solid #66666600; border-bottom: ${cssManager.bdTheme('1px solid #CCC', '1px solid #222')};
transition: all 0.2s ease;
font-size: 16px;
color: ${cssManager.bdTheme('#222', '#ccc')};
} }
.selectedBox.show { .selectedBox:hover {
border-top: 1px solid ${cssManager.bdTheme('#ffffff', '#666666')}; filter: ${cssManager.bdTheme('brightness(0.95)', 'brightness(1.1)')};
border-bottom: 1px solid ${cssManager.bdTheme('#fafafa', '#222222')}; }
.accentBottom {
filter: none !important;
}
.accentTop {
filter: none !important;
} }
.selectionBox { .selectionBox {
will-change:transform; will-change: transform;
pointer-events: none; pointer-events: none;
cursor: pointer;
transition: all 0.2s ease; transition: all 0.2s ease;
opacity: 0; opacity: 0;
position: relative;
background: ${cssManager.bdTheme('#ffffff', '#222222')}; background: ${cssManager.bdTheme('#ffffff', '#222222')};
max-width: 420px; max-width: 420px;
box-shadow: 0px 0px 5px rgba(0,0,0,0.2); box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
min-height: 40px; min-height: 40px;
margin-top: -40px; border-radius: 8px;
z-index: 100; padding: 4px 8px;
border-radius: 3px; position: absolute;
padding: 4px; user-select: none;
transform: scale(0.99,0.99); margin: 3px 0px 0px 0px;
border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #ffffff10')};
}
.selectionBox.top {
transform: translate(0px, 4px);
}
.selectionBox.bottom {
transform: translate(0px, -4px);
} }
.selectionBox.show { .selectionBox.show {
pointer-events: all; pointer-events: all;
transform: scale(1, 1) translate(0px, 0px);
opacity: 1; opacity: 1;
transform: scale(1,1); box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.8);
} }
.option { .option {
transition: all 0.1s; transition: all 0.1s;
line-height: 40px; line-height: 32px;
padding: 0px 4px; padding: 0px 4px;
border-radius: 3px; border-radius: 3px;
margin: 4px 0px;
}
.option.highlighted {
border-left: 2px solid #0069f2;
padding-left: 6px;
background: #ffffff20;
} }
.option:hover { .option:hover {
color: #fff; color: #fff;
padding-left: 8px; padding-left: 8px;
background: #0277bd; background: #0069f2;
} }
`
] .search.top {
padding-top: 4px;
}
.search.bottom {
padding-bottom: 4px;
}
.search input {
display: block;
background: none;
border: none;
height: 24px;
color: inherit;
text-align: left;
font-size: 12px;
font-weight: 600;
width: 100%;
margin: auto;
}
.search.top input {
border-bottom: 1px dotted #333;
}
.search.bottom input {
border-top: 1px dotted #333;
}
.search input:focus {
outline: none;
}
`,
];
public render(): TemplateResult { public render(): TemplateResult {
return html` return html`
${domtools.elementBasic.styles} <div class="maincontainer" @keydown="${this.isOpened ? this.handleKeyDown : undefined}">
<style> ${this.label ? html`<div class="label">${this.label}</div>` : html``}
</style>
<div class="maincontainer">
<div class="selectedBox show" @click="${event => {this.toggleSelectionBox();}}">
${this.selectedOption?.option}
</div>
<div class="selectionBox"> <div class="selectionBox">
${this.options.map(option => { ${this.enableSearch && !this.opensToTop
return html` ? html`
<div class="option" @click=${() => {this.updateSelection(option);}}>${option.option}</div> <div class="search top">
<input type="text" placeholder="Search" @input="${this.handleSearch}" />
</div>
` `
: null}
${this.filteredOptions.map((option, index) => {
const isHighlighted = this.highlightedIndex === index;
return html`
<div
class="option ${isHighlighted ? 'highlighted' : ''}"
@click=${() => {
this.updateSelection(option);
}}
>
${option.option}
</div>
`;
})} })}
${this.enableSearch && this.opensToTop
? html`
<div class="search bottom">
<input type="text" placeholder="Search" @input="${this.handleSearch}" />
</div>
`
: null}
</div>
<div
class="selectedBox"
@click="${(event) => {
if (!this.isElevated) {
this.toggleSelectionBox();
} else {
this.updateSelection(this.selectedOption);
}
}}"
>
${this.selectedOption?.option || 'Select...'}
</div> </div>
</div> </div>
`; `;
} }
firstUpdated() { firstUpdated() {
this.selectedOption = this.options[0] || null; this.selectedOption = this.selectedOption || null;
this.filteredOptions = this.options; // Initialize filteredOptions
} }
public async updateSelection(selectedOption) { public async updateSelection(selectedOption) {
this.selectedOption = selectedOption; this.selectedOption = selectedOption;
this.dispatchEvent(new CustomEvent('selectedOption', { this.dispatchEvent(
new CustomEvent('selectedOption', {
detail: selectedOption, detail: selectedOption,
bubbles: true bubbles: true,
})); })
);
if (this.isElevated) {
this.toggleSelectionBox(); this.toggleSelectionBox();
}
this.changeSubject.next(this); this.changeSubject.next(this);
} }
public toggleSelectionBox() { private isElevated: boolean = false;
this.shadowRoot.querySelector('.selectedBox').classList.toggle('show'); private windowOverlay: DeesWindowLayer;
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show'); public async toggleSelectionBox() {
this.isOpened = !this.isOpened;
const domtoolsInstance = await this.domtoolsPromise;
const selectedBox: HTMLElement = this.shadowRoot.querySelector('.selectedBox');
const selectionBox: HTMLElement = this.shadowRoot.querySelector('.selectionBox');
if (!this.isElevated) {
this.windowOverlay = await DeesWindowLayer.createAndShow({
blur: false,
});
const elevatedDropdown = new DeesInputDropdown();
elevatedDropdown.isElevated = true;
elevatedDropdown.label = this.label;
elevatedDropdown.enableSearch = this.enableSearch;
elevatedDropdown.required = this.required;
elevatedDropdown.disabled = this.disabled;
elevatedDropdown.style.position = 'fixed';
elevatedDropdown.style.top = this.getBoundingClientRect().top + 'px';
elevatedDropdown.style.left = this.getBoundingClientRect().left + 'px';
elevatedDropdown.style.width = this.clientWidth + 'px';
elevatedDropdown.options = this.options;
elevatedDropdown.selectedOption = this.selectedOption;
elevatedDropdown.highlightedIndex = elevatedDropdown.selectedOption ? elevatedDropdown.options.indexOf(
elevatedDropdown.options.find((option) => option.key === this.selectedOption.key)
) : -1;
console.log(elevatedDropdown.options);
console.log(elevatedDropdown.selectedOption);
console.log(elevatedDropdown.highlightedIndex);
this.windowOverlay.appendChild(elevatedDropdown);
await domtoolsInstance.convenience.smartdelay.delayFor(0);
elevatedDropdown.toggleSelectionBox();
const destroyOverlay = async () => {
(elevatedDropdown.shadowRoot.querySelector('.selectionBox') as HTMLElement).style.opacity =
'0';
elevatedDropdown.removeEventListener('selectedOption', handleSelection);
this.windowOverlay.removeEventListener('clicked', destroyOverlay);
this.windowOverlay.destroy();
};
const handleSelection = async (event) => {
await this.updateSelection(elevatedDropdown.selectedOption);
destroyOverlay();
};
elevatedDropdown.addEventListener('selectedOption', handleSelection);
this.windowOverlay.addEventListener('clicked', destroyOverlay);
} else {
if (!selectionBox.classList.contains('show')) {
selectionBox.style.width = selectedBox.clientWidth + 'px';
const spaceData = selectedBox.getBoundingClientRect();
if (300 > window.innerHeight - spaceData.bottom) {
this.opensToTop = true;
selectedBox.classList.add('accentTop');
selectionBox.classList.add('top');
selectionBox.style.bottom = selectedBox.clientHeight + 2 + 'px';
} else {
selectedBox.classList.add('accentBottom');
selectionBox.classList.add('bottom');
this.opensToTop = false;
const labelOffset = this.label ? 24 : 0;
selectionBox.style.top = selectedBox.clientHeight + labelOffset + 'px';
}
await domtoolsInstance.convenience.smartdelay.delayFor(0);
const searchInput = selectionBox.querySelector('input');
searchInput?.focus();
selectionBox.classList.add('show');
} else {
selectedBox.style.pointerEvents = 'none';
selectionBox.classList.remove('show');
// selectedBox.style.opacity = '0';
}
}
}
private handleSearch(event: Event): void {
const searchTerm = (event.target as HTMLInputElement).value.toLowerCase();
this.filteredOptions = this.options.filter((option) =>
option.option.toLowerCase().includes(searchTerm)
);
this.highlightedIndex = 0; // Reset highlighted index
}
private handleKeyDown(event: KeyboardEvent): void {
if (!this.isOpened) {
console.log('discarded key event. Check why this function is called.');
return;
}
const key = event.key;
const maxIndex = this.filteredOptions.length - 1;
if (key === 'ArrowDown') {
this.highlightedIndex = this.highlightedIndex + 1 > maxIndex ? 0 : this.highlightedIndex + 1;
event.preventDefault();
} else if (key === 'ArrowUp') {
this.highlightedIndex = this.highlightedIndex - 1 < 0 ? maxIndex : this.highlightedIndex - 1;
event.preventDefault();
} else if (key === 'Enter') {
this.updateSelection(this.filteredOptions[this.highlightedIndex]);
event.preventDefault();
}
} }
} }

View File

@ -1,3 +1,8 @@
import * as colors from './00colors.js';
import * as plugins from './00plugins.js';
import { DeesContextmenu } from './dees-contextmenu.js';
import { import {
customElement, customElement,
DeesElement, DeesElement,
@ -8,10 +13,9 @@ import {
unsafeCSS, unsafeCSS,
cssManager, cssManager,
type CSSResult, type CSSResult,
domtools,
} from '@design.estate/dees-element'; } from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
'dees-input-fileupload': DeesInputFileupload; 'dees-input-fileupload': DeesInputFileupload;
@ -20,10 +24,11 @@ declare global {
@customElement('dees-input-fileupload') @customElement('dees-input-fileupload')
export class DeesInputFileupload extends DeesElement { export class DeesInputFileupload extends DeesElement {
public static demo = () => html`<dees-input-fileupload .label=${'Attachments'}></dees-input-fileupload>`; public static demo = () =>
html`<dees-input-fileupload .label=${'Attachments'}></dees-input-fileupload>`;
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
@property({ @property({
type: String, type: String,
@ -71,6 +76,7 @@ export class DeesInputFileupload extends DeesElement {
display: grid; display: grid;
margin: 10px 0px; margin: 10px 0px;
margin-bottom: 24px; margin-bottom: 24px;
color: ${cssManager.bdTheme('#333', '#ccc')};
} }
.hidden { .hidden {
@ -78,31 +84,15 @@ export class DeesInputFileupload extends DeesElement {
} }
.maincontainer { .maincontainer {
color: ${cssManager.bdTheme('#333', '#ccc')};
}
.label {
font-size: 14px;
margin-bottom: 5px;
}
.uploadButton {
position: relative; position: relative;
cursor: pointer;
padding: 8px;
max-width: 600px;
background: ${cssManager.bdTheme('#fafafa', '#333333')};
border-radius: 3px; border-radius: 3px;
text-align: center; padding: 8px;
background: ${cssManager.bdTheme('#fafafa', '#222222')};
color: ${cssManager.bdTheme('#333', '#ccc')};
border-top: 1px solid #ffffff10;
} }
.uploadButton:hover { .maincontainer::after {
color: #fff;
background: rgb(3, 155, 229);
}
.uploadButton::after {
top: 2px; top: 2px;
right: 2px; right: 2px;
left: 2px; left: 2px;
@ -113,28 +103,71 @@ export class DeesInputFileupload extends DeesElement {
display: block; display: block;
border: 2px dashed rgba(255, 255, 255, 0); border: 2px dashed rgba(255, 255, 255, 0);
transition: all 0.2s; transition: all 0.2s;
pointer-events: none;
background: #00000000;
} }
.uploadButton.dragOver::after { .maincontainer.dragOver::after {
transform: scale3d(1, 1, 1); transform: scale3d(1, 1, 1);
border: 2px dashed rgba(255, 255, 255, 0.3); border: 2px dashed rgba(255, 255, 255, 0.3);
background: #00000080;
}
.label {
font-size: 14px;
margin-bottom: 8px;
}
.uploadButton {
position: relative;
padding: 8px;
max-width: 600px;
background: ${cssManager.bdTheme('#fafafa', '#333333')};
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: default;
}
.uploadButton:hover {
color: #fff;
background: ${unsafeCSS(colors.dark.blue)};
} }
.uploadCandidate { .uploadCandidate {
display: grid;
grid-template-columns: 48px auto;
background: #333;
padding: 8px 8px 8px 0px;
margin-bottom: 8px;
text-align: left; text-align: left;
border-bottom: 1px dashed #444; border-radius: 3px;
color: ${cssManager.bdTheme('#666', '#ccc')}; color: ${cssManager.bdTheme('#666', '#ccc')};
padding: 8px; font-family: 'Geist Sans', sans-serif;
font-family: 'Mona Sans', 'Inter', sans-serif; cursor: default;
} transition: all 0.2s;
border-top: 1px solid #ffffff10;
.uploadButton:hover .uploadCandidate {
color: ${cssManager.bdTheme('#fff', '#fff')};
border-bottom: 1px dashed #fff;
} }
.uploadCandidate:last-child { .uploadCandidate:last-child {
margin-bottom: 8px; margin-bottom: 8px;
} }
.uploadCandidate .icon {
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
}
.uploadCandidate:hover {
background: #393939;
}
.uploadCandidate .description {
font-size: 14px;
border-left: 1px solid #ffffff10;
padding-left: 8px;
}
`, `,
]; ];
@ -143,10 +176,32 @@ export class DeesInputFileupload extends DeesElement {
<div class="hidden"> <div class="hidden">
<input type="file"></div> <input type="file"></div>
</div> </div>
<div class="maincontainer">
${this.label ? html`<div class="label">${this.label}</div>` : null} ${this.label ? html`<div class="label">${this.label}</div>` : null}
${this.value.map((fileArg) => html` <div class="uploadCandidate">${fileArg.name} | ${fileArg.size}</div> `)} <div class="maincontainer ${this.state === 'dragOver' ? 'dragOver' : ''}">
<div class="uploadButton ${this.state === 'dragOver' ? 'dragOver' : ''}" @click=${this.openFileSelector}> ${this.value.map(
(fileArg) => html`
<div class="uploadCandidate" @contextmenu=${eventArg => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [{
iconName: 'trash',
name: 'Remove',
action: async () => {
this.value.splice(this.value.indexOf(fileArg), 1);
this.requestUpdate();
}
}]);
}}>
<div class="icon">
<dees-icon .iconFA=${'paperclip'}></dees-icon>
</div>
<div class="description">
<span style="font-weight: 600">${fileArg.name}</span><br />
<span style="font-weight: 400">${fileArg.size}</span>
</div>
</div> `
)}
<div class="uploadButton" @click=${
this.openFileSelector
}>
${this.buttonText} ${this.buttonText}
</div> </div>
</div> </div>
@ -160,7 +215,6 @@ export class DeesInputFileupload extends DeesElement {
this.buttonText = 'Upload more files...'; this.buttonText = 'Upload more files...';
} }
public async updateValue(eventArg: Event) { public async updateValue(eventArg: Event) {
const target: any = eventArg.target; const target: any = eventArg.target;
this.value = target.value; this.value = target.value;
@ -180,9 +234,8 @@ export class DeesInputFileupload extends DeesElement {
target.value = ''; target.value = '';
}); });
// lets handle drag and drop // lets handle drag and drop
const dropArea = this.shadowRoot.querySelector('.uploadButton'); const dropArea = this.shadowRoot.querySelector('.maincontainer');
const handlerFunction = (eventArg: DragEvent) => { const handlerFunction = (eventArg: DragEvent) => {
eventArg.preventDefault(); eventArg.preventDefault();
switch (eventArg.type) { switch (eventArg.type) {

View File

@ -0,0 +1,3 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`<dees-input-iban .label=${'IBAN'}></dees-input-iban>`;

View File

@ -0,0 +1,98 @@
import {
customElement,
DeesElement,
type TemplateResult,
state,
html,
domtools,
property,
} from '@design.estate/dees-element';
import * as ibantools from 'ibantools';
import { demoFunc } from './dees-input-iban.demo.js';
@customElement('dees-input-iban')
export class DeesInputIban extends DeesElement {
// STATIC
public static demo = demoFunc;
// INSTANCE
@state()
enteredString: string = '';
@state()
enteredIbanIsValid: boolean = false;
@property({
type: Boolean,
})
public disabled = false;
@property({
type: Boolean,
})
public required = false;
@property({
type: String,
})
public label = '';
@property({
type: String,
})
public key = '';
@property({
type: String,
})
public value = '';
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject<DeesInputIban>();
public render(): TemplateResult {
return html`
<style>
input[type='text'] {
line-height: 20px;
padding: 5px;
width: 250px;
}
</style>
<dees-input-text
.label=${'IBAN'}
.value=${this.value}
@input=${(eventArg: InputEvent) => {
this.validateIban(eventArg);
}}
></dees-input-text>
`;
}
public async firstUpdated() {
const deesInputText = this.shadowRoot.querySelector('dees-input-text');
deesInputText.disabled = this.disabled;
deesInputText.required = this.required;
deesInputText.changeSubject.subscribe(valueArg => {
this.value = valueArg.value;
this.changeSubject.next(this);
})
}
public async validateIban(eventArg: InputEvent): Promise<void> {
const inputElement: HTMLInputElement = eventArg.target as HTMLInputElement;
let enteredString = inputElement?.value;
enteredString = enteredString || '';
if (this.enteredString !== enteredString) {
this.enteredString = ibantools.friendlyFormatIBAN(enteredString) || '';
if (inputElement) {
inputElement.value = this.enteredString;
this.value = this.enteredString;
this.changeSubject.next(this);
}
}
this.enteredIbanIsValid = ibantools.isValidIBAN(this.enteredString.replace(/ /g, ''));
const deesInputText = this.shadowRoot.querySelector('dees-input-text');
deesInputText.validationText = `IBAN is valid: ${this.enteredIbanIsValid}`;
}
}

View File

@ -0,0 +1,14 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-input-multitoggle
.options=${['option 1', 'option 2', 'a longer option with multiple words']}
.selectedOption=${'option 2'}
></dees-input-multitoggle>
<dees-input-multitoggle
.type=${'boolean'}
.booleanTrueName=${'enabled'}
.booleanFalseName=${'disabled'}
.selectedOption=${'true'}
></dees-input-multitoggle>
`;

View File

@ -0,0 +1,159 @@
import {
customElement,
DeesElement,
type TemplateResult,
state,
html,
domtools,
property,
css,
cssManager,
} from '@design.estate/dees-element';
const { demoFunc } = await import('./dees-input-multitoggle.demo.js');
declare global {
interface HTMLElementTagNameMap {
'dees-input-multitoggle': DeesInputMultitoggle;
}
}
@customElement('dees-input-multitoggle')
export class DeesInputMultitoggle extends DeesElement {
public static demo = demoFunc;
@property({
type: String,
})
public label: string;
@property({
type: String,
})
public description: string;
@property()
type: 'boolean' | 'multi' | 'single' = 'multi';
@property()
booleanTrueName: string = 'true';
@property()
booleanFalseName: string = 'false';
@property({
type: Array,
})
options: string[] = [];
@property()
selectedOption: string = '';
@property()
boolValue: boolean = false;
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: block;
color: ${cssManager.bdTheme('#333', '#ccc')};
user-select: none;
margin: 8px 0px 24px 0px;
}
.label {
font-size: 14px;
margin-bottom: 8px;
}
.selections {
position: relative;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
background: ${cssManager.bdTheme('#fff', '#222')};
width: min-content;
border-radius: 20px;
height: 32px;
border-top: 1px solid #ffffff10;
}
.option {
color: #ccc;
position: relative;
padding: 0px 16px;
line-height: 32px;
cursor: default;
width: min-content; /* Make the width as per the content */
white-space: nowrap; /* Prevent text wrapping */
transition: all 0.1s;
font-size: 14px;
transform: translateY(-1px);
}
.option:hover {
color: #fff;
}
.option.selected {
color: #fff;
}
.indicator {
opacity: 0;
position: absolute;
height: 24px;
left: 4px;
top: 3px;
border-radius: 16px;
background: #0050b9;
min-width: 36px;
}
`,
];
public render(): TemplateResult {
return html`
<dees-label .label=${this.label} .description=${this.description}></dees-label>
<div class="mainbox">
<div class="selections">
<div class="indicator"></div>
${this.options.map(
(option) =>
html`<div class="option ${option === this.selectedOption ? 'selected': ''}" @click=${() => this.handleSelection(option)}>
${option}
</div> `
)}
</div>
</div>
`;
}
public async firstUpdated() {
if (this.type === 'boolean') {
this.options = [this.booleanTrueName || 'true', this.booleanFalseName || 'false'];
}
this.setIndicator();
}
public async handleSelection(optionArg: string) {
this.selectedOption = optionArg;
this.setIndicator();
}
public async setIndicator() {
const indicator: HTMLDivElement = this.shadowRoot.querySelector('.indicator');
const option: HTMLDivElement = this.shadowRoot.querySelector(
`.option:nth-child(${this.options.indexOf(this.selectedOption) + 2})`
);
if (indicator && option) {
indicator.style.width = `${option.clientWidth - 8}px`;
indicator.style.left = `${option.offsetLeft + 4}px`;
indicator.style.opacity = '1';
}
setTimeout(() => {
indicator.style.transition = 'all 0.1s';
}, 100);
}
}

View File

@ -0,0 +1,3 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`<dees-input-phone .label=${'Phone Number'}></dees-input-phone>`;

View File

@ -0,0 +1,29 @@
import {
customElement,
DeesElement,
type TemplateResult,
property,
html,
css,
unsafeCSS,
cssManager,
type CSSResult,
} from '@design.estate/dees-element';
import { demoFunc } from './dees-input-phone.demo.js';
declare global {
interface HTMLElementTagNameMap {
'dees-input-phone': DeesInputPhone;
}
}
@customElement('dees-input-phone')
export class DeesInputPhone extends DeesElement {
// STATIC
public static demo = demoFunc;
// INSTANCE
public render() {
return html`<div>Phone Input</div>`;
}
}

View File

@ -12,7 +12,7 @@ export class DeesInputQuantitySelector extends DeesElement {
public static demo = () => html`<dees-input-quantityselector></dees-input-quantityselector>`; public static demo = () => html`<dees-input-quantityselector></dees-input-quantityselector>`;
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
@property() @property()
public label: string = 'Label'; public label: string = 'Label';
@ -85,7 +85,6 @@ export class DeesInputQuantitySelector extends DeesElement {
} }
.selector:hover { .selector:hover {
cursor: pointer;
} }
.quantity { .quantity {

View File

@ -12,7 +12,7 @@ export class DeesInputRadio extends DeesElement {
public static demo = () => html`<dees-input-radio></dees-input-radio>`; public static demo = () => html`<dees-input-radio></dees-input-radio>`;
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject();
@property({ @property({
type: String, type: String,
@ -51,7 +51,6 @@ export class DeesInputRadio extends DeesElement {
display: block; display: block;
position: relative; position: relative;
margin: 20px 0px; margin: 20px 0px;
cursor: pointer;
} }
.maincontainer { .maincontainer {
@ -91,8 +90,8 @@ export class DeesInputRadio extends DeesElement {
} }
.checkbox.selected { .checkbox.selected {
background: #039BE5; background: #0050b9;
border: 1px solid #039BE5; border: 1px solid #0050b9;
} }
.maincontainer:hover .checkbox.selected { .maincontainer:hover .checkbox.selected {

View File

View File

@ -1,4 +1,15 @@
import {customElement, DeesElement, type TemplateResult, property, html, cssManager, type CSSResult,} from '@design.estate/dees-element'; import * as colors from './00colors.js';
import {
customElement,
DeesElement,
type TemplateResult,
property,
html,
cssManager,
css,
type CSSResult,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
declare global { declare global {
@ -15,14 +26,18 @@ export class DeesInputText extends DeesElement {
`; `;
// INSTANCE // INSTANCE
public changeSubject = new domtools.rxjs.Subject<DeesInputText>(); public changeSubject = new domtools.plugins.smartrx.rxjs.Subject<DeesInputText>();
public valueChangeSubject = new domtools.rxjs.Subject<string>();
@property({ @property({
type: String type: String,
}) })
public label: string; public label: string;
@property({
type: String,
})
public description: string;
@property({ @property({
type: String, type: String,
reflect: true, reflect: true,
@ -36,12 +51,12 @@ export class DeesInputText extends DeesElement {
public value: string = ''; public value: string = '';
@property({ @property({
type: Boolean type: Boolean,
}) })
public required: boolean = false; public required: boolean = false;
@property({ @property({
type: Boolean type: Boolean,
}) })
public disabled: boolean = false; public disabled: boolean = false;
@ -57,9 +72,23 @@ export class DeesInputText extends DeesElement {
}) })
public showPasswordBool = false; public showPasswordBool = false;
public render(): TemplateResult { @property({
return html ` type: Boolean,
<style> reflect: true,
})
public validationState: 'valid' | 'warn' | 'invalid';
@property({
reflect: true,
})
public validationText: string = '';
@property({})
validationFunction: (value: string) => boolean;
public static styles = [
cssManager.defaultStyles,
css`
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@ -67,37 +96,33 @@ export class DeesInputText extends DeesElement {
:host { :host {
position: relative; position: relative;
display: grid; display: grid;
margin: 10px 0px; margin: 8px 0px;
margin-bottom: 24px; margin-bottom: 24px;
z-index: auto;
} }
.maincontainer { .maincontainer {
color: ${this.goBright ? '#333' : '#ccc'}; color: ${cssManager.bdTheme('#333', '#ccc')};
}
.label {
font-size: 14px;
margin-bottom: 5px;
} }
input { input {
margin-top: 5px; margin-top: 0px;
background: ${this.goBright ? '#fafafa' : '#222'}; background: ${cssManager.bdTheme('#fafafa', '#222')};
border-top: ${this.goBright ? '1px solid #CCC' : '1px solid #444'}; border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #ffffff10')};
border-bottom: ${this.goBright ? '1px solid #CCC' : '1px solid #333'}; border-bottom: ${cssManager.bdTheme('1px solid #CCC', '1px solid #222')};
border-right: ${this.goBright ? '1px solid #CCC' : 'none'}; border-right: ${cssManager.bdTheme('1px solid #CCC', 'none')};
border-left: ${this.goBright ? '1px solid #CCC' : 'none'}; border-left: ${cssManager.bdTheme('1px solid #CCC', 'none')};
padding-left:10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
border-radius: 2px; border-radius: 2px;
width: 100%; width: 100%;
line-height: 48px; line-height: 36px;
transition: all 0.2s; transition: all 0.2s;
outline: none; outline: none;
font-size: 16px; font-size: 16px;
font-family: ${this.isPasswordBool ? 'monospace': 'Inter'}; position: relative;
letter-spacing: ${this.isPasswordBool ? '1px': 'normal'}; z-index: 2;
color: ${this.goBright ? '#333' : '#ccc'}; cursor: default;
} }
input:disabled { input:disabled {
@ -109,41 +134,98 @@ export class DeesInputText extends DeesElement {
input:focus { input:focus {
outline: none; outline: none;
border-bottom: 1px solid #e4002b; border-bottom: 1px solid ${cssManager.bdTheme( colors.bright.blueActive, colors.dark.blueActive)};
cursor: text;
}
input:hover {
filter: ${cssManager.bdTheme('brightness(0.95)', 'brightness(1.1)')};
} }
.showPassword { .showPassword {
position: absolute; position: absolute;
bottom: 8px; bottom: 7px;
right: 10px; right: 10px;
border: 1px dashed #444; border: 1px dashed #444;
border-radius: 7px; border-radius: 7px;
padding: 8px 0px; padding: 4px 0px;
width: 40px; width: 40px;
z-index: 3;
} }
.showPassword:hover { .showPassword:hover {
cursor: pointer; background: ${cssManager.bdTheme('#00000010', '#ffffff10')};
background: #333;
} }
.validationContainer {
text-align: center;
padding: 6px 2px 2px 2px;
margin-top: -4px;
font-size: 12px;
color: #fff;
background: #e4002b;
position: relative;
z-index: 1;
border-radius: 3px;
transition: all 0.2s;
}
`,
];
public render(): TemplateResult {
return html`
<style>
input {
font-family: ${this.isPasswordBool ? 'monospace' : 'Geist Sans'};
letter-spacing: ${this.isPasswordBool ? '1px' : 'normal'};
color: ${this.goBright ? '#333' : '#ccc'};
}
${this.validationText ? css`
.validationContainer {
height: 22px;
opacity: 1;
}
` : css`
.validationContainer {
height: 4px;
padding: 2px !important;
opacity: 0;
}
`}
</style> </style>
<div class="maincontainer"> <div class="maincontainer">
${this.label ? html`<div class="label">${this.label}</div>` : html``} <dees-label .label=${this.label} .description=${this.description}></dees-label>
<input type="${this.isPasswordBool && !this.showPasswordBool ? 'password' : 'text'}" .value=${this.value} @input="${this.updateValue}" .disabled=${this.disabled} /> <input
${this.isPasswordBool ? html` type="${this.isPasswordBool && !this.showPasswordBool ? 'password' : 'text'}"
.value=${this.value}
@input="${this.updateValue}"
.disabled=${this.disabled}
/>
<div class="validationContainer">
${this.validationText}
</div>
${this.isPasswordBool
? html`
<div class="showPassword" @click=${this.togglePasswordView}> <div class="showPassword" @click=${this.togglePasswordView}>
<dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon> <dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon>
</div> </div>
` : html``} `
: html``}
</div> </div>
`; `;
} }
firstUpdated() {
const input = this.shadowRoot.querySelector('input');
input.addEventListener('input', (eventArg: InputEvent) => {
});
}
public async updateValue(eventArg: Event) { public async updateValue(eventArg: Event) {
const target: any = eventArg.target; const target: any = eventArg.target;
this.value = target.value; this.value = target.value;
this.changeSubject.next(this); this.changeSubject.next(this);
this.valueChangeSubject.next(this.value);
} }
public async freeze() { public async freeze() {
@ -154,10 +236,10 @@ export class DeesInputText extends DeesElement {
this.disabled = false; this.disabled = false;
} }
public async togglePasswordView () { public async togglePasswordView() {
const domtools = await this.domtoolsPromise; const domtools = await this.domtoolsPromise;
this.showPasswordBool = !this.showPasswordBool; this.showPasswordBool = !this.showPasswordBool;
console.log(`this.showPasswordBool is: ${this.showPasswordBool}`) console.log(`this.showPasswordBool is: ${this.showPasswordBool}`);
} }
public async focus() { public async focus() {

View File

@ -0,0 +1,15 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<style>
.demoContainer {
max-width: 600px;
margin: auto;
padding: 40px;
background: #000;
}
</style>
<div class="demoContainer">
<dees-input-typelist></dees-input-typelist>
</div>
`;

View File

@ -0,0 +1,98 @@
import {
customElement,
DeesElement,
type TemplateResult,
state,
html,
domtools,
property,
css,
cssManager,
} from '@design.estate/dees-element';
const { demoFunc } = await import('./dees-input-typelist.demo.js');
@customElement('dees-input-typelist')
export class DeesInputTypelist extends DeesElement {
public static demo = demoFunc;
// INSTANCE
@property({
type: String,
})
public label: string;
constructor() {
super();
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: block;
color: ${cssManager.bdTheme('#333', '#fff')};
margin: 8px 0px 24px 0px;
}
.label {
font-size: 14px;
margin-bottom: 8px;
}
.mainbox {
border-radius: 3px;
background: #222;
overflow: hidden;
border-top: ${cssManager.bdTheme('1px solid #CCC', '1px solid #444')};
border-bottom: ${cssManager.bdTheme('1px solid #CCC', '1px solid #333')};
border-right: ${cssManager.bdTheme('1px solid #CCC', 'none')};
border-left: ${cssManager.bdTheme('1px solid #CCC', 'none')};
}
.tags {
padding: 16px;
cursor: default;
}
.notags {
text-align: center;
opacity: 0.5;
font-size: 12px;
}
input {
display: block;
box-sizing: border-box;
background: #181818;
width: 100%;
outline: none;
border: none;
color: inherit;
padding: 0px 16px;
overflow: hidden;
line-height: 32px;
height: 0px;
transition: height 0.2s;
}
input:focus {
height: 32px;
}
`,
];
public render(): TemplateResult {
return html`
<div class="label">${this.label}</div>
<div class="mainbox">
<div class="tags" @click=${() => {
this.shadowRoot.querySelector('input').focus();
}}>
<div class="notags">No tags yet</div>
</div>
<input type="text" placeholder="Type, press Enter to add it..." />
</div>
`;
}
}

View File

@ -0,0 +1,7 @@
import { html, cssManager } from '@design.estate/dees-element';
export const demoFunc = () => {
return html`
<dees-label .label=${'a label'}></dees-label>
`;
}

View File

@ -0,0 +1,70 @@
import * as plugins from './00plugins.js';
import * as colors from './00colors.js';
import {
customElement,
html,
css,
cssManager,
DeesElement,
property,
unsafeCSS,
query,
} from '@design.estate/dees-element';
import { demoFunc } from './dees-label.demo.js';
@customElement('dees-label')
export class DeesLabel extends DeesElement {
public static demo = demoFunc;
// INSTANCE
@property({
type: String,
reflect: true,
})
public label = '';
@property({
type: String,
reflect: true,
})
public description: string;
public static styles = [
cssManager.defaultStyles,
css`
.label {
color: ${cssManager.bdTheme('#333', '#ccc')};
font-size: 14px;
margin-bottom: 8px;
cursor: default;
user-select: none;
}
dees-icon {
display: inline-block;
font-size: 14px;
transform: translateY(1.5px);
}
`,
];
public render() {
return html`
${this.label
? html`
<div class="label">
${this.label}
${this.description
? html`
<dees-icon .iconFA=${'circleInfo'}></dees-icon>
<dees-speechbubble .text=${this.description}></dees-speechbubble>
`
: html``}
</div>
`
: html``}
`;
}
}

View File

@ -1,4 +1,4 @@
import * as plugins from './plugins.js'; import * as plugins from './00plugins.js';
import { import {
cssManager, cssManager,
css, css,
@ -16,11 +16,12 @@ export class DeesMobilenavigation extends DeesElement {
// STATIC // STATIC
public static demo = () => html` public static demo = () => html`
<dees-button @click=${() => { <dees-button @click=${() => {
DeesMobilenavigation.createAndInit([ DeesMobilenavigation.createAndShow([
{ {
name: 'Test', name: 'Test',
action: () => { action: async (deesMobileNav) => {
alert('test'); alert('test');
return null;
}, },
}, },
]); ]);
@ -28,7 +29,7 @@ export class DeesMobilenavigation extends DeesElement {
`; `;
private static singletonRef: DeesMobilenavigation; private static singletonRef: DeesMobilenavigation;
public static async createAndInit(menuItemsArg: plugins.tsclass.website.IMenuItem[]) { public static async createAndShow(menuItemsArg: plugins.tsclass.website.IMenuItem<DeesMobilenavigation>[]) {
if (!this.singletonRef) { if (!this.singletonRef) {
this.singletonRef = new DeesMobilenavigation(); this.singletonRef = new DeesMobilenavigation();
document.body.append(this.singletonRef); document.body.append(this.singletonRef);
@ -88,8 +89,8 @@ export class DeesMobilenavigation extends DeesElement {
right: 0px; right: 0px;
top: 0px; top: 0px;
bottom: 0px; bottom: 0px;
background: ${cssManager.bdTheme('#eeeeeb', '#000')};; background: ${cssManager.bdTheme('#eeeeeb', '#000')};
border-left: 1px dashed #444; border-left: 1px solid ${cssManager.bdTheme('#eeeeeb', '#222')};
pointer-events: none; pointer-events: none;
} }
@ -104,7 +105,6 @@ export class DeesMobilenavigation extends DeesElement {
padding: 8px; padding: 8px;
margin-left: -8px; margin-left: -8px;
margin-right: -8px; margin-right: -8px;
cursor: pointer;
border-radius: 3px; border-radius: 3px;
} }
.menuItem:hover { .menuItem:hover {
@ -115,7 +115,7 @@ export class DeesMobilenavigation extends DeesElement {
text-align: left; text-align: left;
font-size: 24px; font-size: 24px;
padding: 8px 0px; padding: 8px 0px;
font-family: 'Mona Sans', 'Inter', sans-serif; font-family: 'Geist Sans', sans-serif;
font-weight: 300; font-weight: 300;
border-bottom: 1px dashed #444; border-bottom: 1px dashed #444;
margin-top: 16px; margin-top: 16px;
@ -134,7 +134,7 @@ export class DeesMobilenavigation extends DeesElement {
class="menuItem" class="menuItem"
@click="${() => { @click="${() => {
this.hide(); this.hide();
menuItem.action(); menuItem.action(this);
}}" }}"
> >
${menuItem.name} ${menuItem.name}
@ -155,6 +155,7 @@ export class DeesMobilenavigation extends DeesElement {
const main = this.shadowRoot.querySelector('.main'); const main = this.shadowRoot.querySelector('.main');
if (!this.windowLayer) { if (!this.windowLayer) {
this.windowLayer = new DeesWindowLayer(); this.windowLayer = new DeesWindowLayer();
this.windowLayer.options.blur = true;
this.windowLayer.addEventListener('click', () => { this.windowLayer.addEventListener('click', () => {
this.hide(); this.hide();
}); });

View File

@ -0,0 +1,37 @@
import { html } from '@design.estate/dees-element';
import { DeesModal } from './dees-modal.js';
export const demoFunc = () => html`
<dees-button @click=${() => {
DeesModal.createAndShow({
heading: 'This is a heading',
content: html`
<dees-form>
<dees-input-text
.label=${'Username'}
>
</dees-input-text>
<dees-input-text
.label=${'Password'}
>
</dees-input-text>
</dees-form>
`,
menuOptions: [{
name: 'Cancel',
iconName: null,
action: async (deesModalArg) => {
deesModalArg.destroy();
return null;
}
}, {
name: 'Ok',
iconName: null,
action: async (deesModalArg) => {
deesModalArg.destroy();
return null;
}
}],
});
}}>open modal</dees-button>
`

View File

@ -0,0 +1,214 @@
import * as colors from './00colors.js';
import * as plugins from './00plugins.js';
import { demoFunc } from './dees-modal.demo.js';
import {
customElement,
html,
DeesElement,
property,
type TemplateResult,
cssManager,
css,
type CSSResult,
unsafeCSS,
unsafeHTML,
state,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import { DeesWindowLayer } from './dees-windowlayer.js';
declare global {
interface HTMLElementTagNameMap {
'dees-modal': DeesModal;
}
}
@customElement('dees-modal')
export class DeesModal extends DeesElement {
// STATIC
public static demo = demoFunc;
public static async createAndShow(optionsArg: {
heading: string;
content: TemplateResult;
menuOptions: plugins.tsclass.website.IMenuItem<DeesModal>[];
}) {
const body = document.body;
const modal = new DeesModal();
modal.heading = optionsArg.heading;
modal.content = optionsArg.content;
modal.menuOptions = optionsArg.menuOptions;
modal.windowLayer = await DeesWindowLayer.createAndShow({
blur: true,
});
modal.windowLayer.addEventListener('click', async () => {
await modal.destroy();
});
body.append(modal.windowLayer);
body.append(modal);
}
// INSTANCE
@property({
type: String,
})
public heading = '';
@state({})
public content: TemplateResult;
@state({})
public menuOptions: plugins.tsclass.website.IMenuItem<DeesModal>[] = [];
constructor() {
super();
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
font-family: 'Geist Sans', sans-serif;
color: ${cssManager.bdTheme('#333', '#fff')};
will-change: transform;
}
.modalContainer {
display: flex;
position: fixed;
top: 0px;
left: 0px;
width: 100vw;
height: 100vh;
box-sizing: border-box;
align-items: center;
justify-content: center;
z-index: 2000;
}
.modal {
will-change: transform;
transform: translateY(0px) scale(0.95);
opacity: 0;
width: 480px;
min-height: 120px;
background: #111;
border-radius: 8px;
border: 1px solid #222;
transition: all 0.2s;
overflow: hidden;
box-shadow: 0px 2px 5px #00000080;
}
.modal.show {
opacity: 1;
transform: translateY(0px) scale(1);
}
.modal.show.predestroy {
opacity: 0;
transform: translateY(10px) scale(1);
}
.modal .heading {
height: 32px;
font-family: 'Geist Sans', sans-serif;
line-height: 32px;
text-align: center;
font-weight: 600;
font-size: 12px;
border-bottom: 1px solid #222;
}
.modal .content {
padding: 16px;
}
.modal .bottomButtons {
display: flex;
flex-direction: row;
border-top: 1px solid #222;
justify-content: flex-end;
}
.modal .bottomButtons .bottomButton {
margin: 8px 0px;
padding: 8px 12px;
border-radius: 4px;
line-height: 16px;
text-align: center;
font-size: 14px;
cursor: default;
user-select: none;
}
.modal .bottomButtons .bottomButton:first-child {
margin-left: 8px;
}
.modal .bottomButtons .bottomButton:last-child {
margin-right: 8px;
}
.modal .bottomButtons .bottomButton:hover {
background: ${cssManager.bdTheme(colors.bright.blue, colors.dark.blue)};
}
.modal .bottomButtons .bottomButton:active {
background: ${cssManager.bdTheme(colors.bright.blueActive, colors.dark.blueActive)};
}
.modal .bottomButtons .bottomButton:last-child {
border-right: none;
}
`,
];
public render(): TemplateResult {
return html`
<style>
.modal .bottomButtons {
grid-template-columns: ${cssManager.cssGridColumns(this.menuOptions.length, 0)};
}
</style>
<div class="modalContainer" @click=${this.handleOutsideClick}>
<div class="modal">
<div class="heading">${this.heading}</div>
<div class="content">${this.content}</div>
<div class="bottomButtons">
${this.menuOptions.map(
(actionArg) => html`
<div class="bottomButton" @click=${() => {
actionArg.action(this);
}}>${actionArg.name}</div>
`
)}
</div>
</div>
</div>
`;
}
private windowLayer: DeesWindowLayer;
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
super.firstUpdated(_changedProperties);
const domtools = await this.domtoolsPromise;
await domtools.convenience.smartdelay.delayFor(30);
const modal = this.shadowRoot.querySelector('.modal');
modal.classList.add('show');
}
public async handleOutsideClick(eventArg: MouseEvent) {
eventArg.stopPropagation();
const modalContainer = this.shadowRoot.querySelector('.modalContainer');
if (eventArg.target === modalContainer) {
await this.destroy();
}
}
public async destroy() {
const domtools = await this.domtoolsPromise;
const modal = this.shadowRoot.querySelector('.modal');
modal.classList.add('predestroy');
await domtools.convenience.smartdelay.delayFor(200);
document.body.removeChild(this);
await this.windowLayer.destroy();
}
}

View File

@ -32,7 +32,7 @@ export class DeesPdf extends DeesElement {
return html` return html`
<style> <style>
:host { :host {
font-family: 'Mona Sans', 'Inter', sans-serif; font-family: 'Geist Sans', sans-serif;
display: block; display: block;
box-sizing: border-box; box-sizing: border-box;
max-width: 800px; max-width: 800px;
@ -57,18 +57,9 @@ export class DeesPdf extends DeesElement {
if (!DeesPdf.pdfJsReady) { if (!DeesPdf.pdfJsReady) {
const pdfJsReadyDeferred = domtools.plugins.smartpromise.defer(); const pdfJsReadyDeferred = domtools.plugins.smartpromise.defer();
DeesPdf.pdfJsReady = pdfJsReadyDeferred.promise; DeesPdf.pdfJsReady = pdfJsReadyDeferred.promise;
const loadDeferred = domtools.plugins.smartpromise.defer(); // @ts-ignore
const script = document.createElement('script'); DeesPdf.pdfjsLib = await import('https://cdn.jsdelivr.net/npm/pdfjs-dist@4.0.379/+esm');
script.addEventListener('load', () => { DeesPdf.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdn.jsdelivr.net/npm/pdfjs-dist@4.0.379/build/pdf.worker.mjs';
console.log('pdf.js loaded!');
loadDeferred.resolve();
});
script.src = 'https:////mozilla.github.io/pdf.js/build/pdf.js';
document.getElementsByTagName('head')[0].appendChild(script);
// The workerSrc property shall be specified.
await loadDeferred.promise;
DeesPdf.pdfjsLib = window['pdfjs-dist/build/pdf'];
DeesPdf.pdfjsLib.GlobalWorkerOptions.workerSrc = '//mozilla.github.io/pdf.js/build/pdf.worker.js';
pdfJsReadyDeferred.resolve(); pdfJsReadyDeferred.resolve();
} }
await DeesPdf.pdfJsReady; await DeesPdf.pdfJsReady;

View File

@ -0,0 +1,11 @@
import { html } from '@design.estate/dees-element';
import { DeesProgressbar } from './dees-progressbar.js';
export const demoFunc = () => {
return html`
<dees-progressbar
.percentage=${50}
></dees-progressbar>
`;
}

View File

@ -0,0 +1,95 @@
import * as plugins from './00plugins.js';
import * as colors from './00colors.js';
import { demoFunc } from './dees-progressbar.demo.js';
import {
customElement,
html,
DeesElement,
property,
type TemplateResult,
cssManager,
css,
type CSSResult,
unsafeCSS,
unsafeHTML,
state,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
@customElement('dees-progressbar')
export class DeesProgressbar extends DeesElement {
// STATIC
public static demo = demoFunc;
// INSTANCE
@property({
type: Number,
})
public percentage = 0;
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: ${cssManager.bdTheme(colors.bright.text, colors.dark.text)};
}
.progressBarContainer {
padding: 8px;
min-width: 200px;
}
.progressBar {
background: ${cssManager.bdTheme('#eeeeeb', '#444')};
height: 8px;
width: 100%;
border-radius: 4px;
border-top: 0.5px solid ${cssManager.bdTheme('none', '#555')};
}
.progressBarFill {
background: ${cssManager.bdTheme(colors.dark.blueActive, colors.bright.blueActive)};
height: 8px;
margin-top: -0.5px;
transition: 0.2s width;
border-radius: 4px;
width: 0px;
border-top: 0.5 solid ${cssManager.bdTheme('none', '#398fff')};
}
.progressText {
padding: 8px;
text-align: center;
}
`
];
public render() {
return html`
<div class="progressBarContainer">
<div class="progressBar">
<div class="progressBarFill"></div>
<div class="progressText">
${this.percentage}%
<div>
</div>
</div>
`
}
firstUpdated (_changedProperties: Map<string | number | symbol, unknown>): void {
super.firstUpdated(_changedProperties);
this.updateComplete.then(() => {
this.updatePercentage();
});
}
public async updatePercentage() {
const progressBarFill = this.shadowRoot.querySelector('.progressBarFill') as HTMLElement;
progressBarFill.style.width = `${this.percentage}%`;
}
updated(){
this.updatePercentage();
}
}

View File

@ -0,0 +1,21 @@
import { html } from '@design.estate/dees-element';
import type { IView } from './dees-simple-appdash.js';
export const demoFunc = () => html`
<dees-simple-appdash
.viewTabs=${[
{
name: 'View 1',
element: null,
},
{
name: 'View 2',
element: null,
},
{
name: 'View 3',
element: null,
}
] as IView[]}
>Hello there</dees-simple-appdash>
`;

View File

@ -0,0 +1,234 @@
import { demoFunc } from './dees-simple-appdash.demo.js';
import * as colors from './00colors.js';
import {
customElement,
html,
DeesElement,
property,
type TemplateResult,
cssManager,
css,
unsafeCSS,
type CSSResult,
state,
domtools,
} from '@design.estate/dees-element';
import { DeesTerminal } from './dees-terminal.js';
declare global {
interface HTMLElementTagNameMap {
'dees-simple-appdash': DeesSimpleAppDash;
}
}
export interface IView {
name: string;
element: DeesElement['constructor']['prototype'];
}
@customElement('dees-simple-appdash')
export class DeesSimpleAppDash extends DeesElement {
// STATIC
public static demo = demoFunc;
// INSTANCE
@property()
public name = 'Dees Simple Login';
@property()
public viewTabs: IView[] = [];
@property()
public terminalSetupCommand: string = `pnpm install @serve.zone/cli && clear && servezone info`;
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: ${cssManager.bdTheme('#333', '#ccc')};
user-select: none;
display: block;
overflow: hidden;
position: relative;
height: 100%;
width: 100%;
}
.maincontainer {
position: absolute;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
overflow: hidden;
}
.appbar {
position: absolute;
top: 0px;
left: 0px;
height: calc(100% - 24px);
width: 200px;
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
border-right: 1px solid ${cssManager.bdTheme('#ccc', '#ffffff20')};
font-size: 14px;
line-height: 32px;
font-family: 'Geist Sans', sans-serif;
padding: 0px 16px;
z-index: 2;
box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.8);
display: grid;
grid-template-rows: min-content auto min-content;
}
.appbar .viewTabs {
margin-left: -8px;
margin-right: -8px;
display: flex;
flex-direction: column;
align-items: top;
}
.viewTab {
padding: 0px 8px;
}
.viewTab:hover {
background: ${cssManager.bdTheme('#ccc', '#ffffff10')};
color: ${cssManager.bdTheme('#000', '#fff')};
}
.viewTab:active {
background: ${cssManager.bdTheme('#aaa', '#ffffff20')};
color: ${cssManager.bdTheme('#000', '#fff')};
}
.appName {
white-space: nowrap;
color: ${cssManager.bdTheme('#666', '#999')};
}
.appActions {
display: flex;
}
.appActions .action {
}
.appActions .action:hover {
color: ${cssManager.bdTheme('#000', '#fff')};
}
.appcontent {
z-index: 1;
position: absolute;
top: 0px;
right: 0px;
height: calc(100vh - 24px);
bottom: 24px;
width: calc(100vw - 200px);
overflow: auto;
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
overscroll-behavior: contain;
}
.controlbar {
color: #fff;
position: absolute;
bottom: 0px;
left: 0px;
width: 100%;
border-top: 1px solid #44444480;
height: 24px;
background: ${cssManager.bdTheme(colors.bright.blueMuted, colors.dark.blueMuted)};
z-index: 2;
display: flex;
justify-content: flex-end;
align-items: center;
flex-direction: row;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.8);
}
.control {
width: min-content;
margin-right: 16px;
font-size: 12px;
white-space: nowrap;
}
`,
];
public render(): TemplateResult {
return html`
<div class="maincontainer">
<div class="appbar">
<div class="appName">${this.name}</div>
<div class="viewTabs">
${this.viewTabs.map(
(view) => html`
<div class="viewTab" @click=${() => {
this.loadView(view);
}}>${view.name}</div>
`
)}
</div>
<div class="appActions">
<div class="action" @click=${() => {
this.dispatchEvent(new CustomEvent('logout'));
}}>Logout</div>
</div>
</div>
<div class="appcontent">
</div>
<div class="controlbar">
<div class="control">
<dees-icon .iconFA=${'networkWired'}></dees-icon>
</div>
<div class="control" @click=${this.launchTerminal}>
<dees-icon .iconFA=${'terminal'}></dees-icon>
</div>
</div>
</div>
`;
}
public async firstUpdated(_changedProperties): Promise<void> {
const domtools = await this.domtoolsPromise;
super.firstUpdated(_changedProperties);
await this.loadView(this.viewTabs[0]);
}
public currentTerminal: DeesTerminal;
public async launchTerminal() {
const maincontainer = this.shadowRoot.querySelector('.maincontainer');
const terminal = new DeesTerminal();
terminal.setupCommand = this.terminalSetupCommand;
this.currentTerminal = terminal;
maincontainer.appendChild(terminal);
terminal.style.position = 'absolute';
terminal.style.zIndex = '1';
terminal.style.top = '0px';
terminal.style.left = '200px';
terminal.style.right = '0px';
terminal.style.bottom = '24px';
terminal.style.opacity = '0';
terminal.style.transform = 'translateY(20px)';
terminal.style.transition = 'all 0.2s';
await domtools.plugins.smartdelay.delayFor(0);
terminal.style.opacity = '1';
terminal.style.transform = 'translateY(0px)';
return terminal;
}
private currentView: DeesElement;
public async loadView(viewArg: IView) {
const appcontent = this.shadowRoot.querySelector('.appcontent');
const view = new viewArg.element();
if (this.currentView) {
this.currentView.remove();
}
appcontent.appendChild(view);
this.currentView = view;
}
}

View File

@ -0,0 +1,3 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html` <dees-simple-login name="someapp"> Hello there </dees-simple-login> `;

View File

@ -1,3 +1,5 @@
import { demoFunc } from './dees-simple-login.demo.js';
import { import {
customElement, customElement,
html, html,
@ -20,15 +22,11 @@ declare global {
@customElement('dees-simple-login') @customElement('dees-simple-login')
export class DeesSimpleLogin extends DeesElement { export class DeesSimpleLogin extends DeesElement {
// STATIC // STATIC
public static demo = () => html` public static demo = demoFunc
<dees-simple-login>
Hello there
</dees-simple-login>
`;
// INSTANCE // INSTANCE
@property() @property()
public title = 'Dees Simple Login'; public name = 'Dees Simple Login';
public static styles = [ public static styles = [
cssManager.defaultStyles, cssManager.defaultStyles,
@ -44,13 +42,24 @@ export class DeesSimpleLogin extends DeesElement {
align-items: center; /* aligns vertically */ align-items: center; /* aligns vertically */
width: 100%; width: 100%;
height: 100%; height: 100%;
top: 0px;
left: 0px;
} }
.slotContainer {
position: absolute;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}
.login { .login {
min-width: 320px; min-width: 320px;
min-height: 100px; min-height: 100px;
background: ${cssManager.bdTheme('#eeeeeb', '#111')}; background: ${cssManager.bdTheme('#eeeeeb', '#111')};
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')}; box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
border-radius: 3px; border-radius: 8px;
padding: 24px; padding: 24px;
transition: opacity 0.3s, transform 0.3s; transition: opacity 0.3s, transform 0.3s;
} }
@ -71,7 +80,7 @@ export class DeesSimpleLogin extends DeesElement {
<div class="loginContainer"> <div class="loginContainer">
<div class="login"> <div class="login">
<dees-form> <dees-form>
<div class="header">Login to ${this.title}</div> <div class="header">Login to ${this.name}</div>
<dees-input-text key="username" label="username" required></dees-input-text> <dees-input-text key="username" label="username" required></dees-input-text>
<dees-input-text key="password" label="password" isPasswordBool required></dees-input-text> <dees-input-text key="password" label="password" isPasswordBool required></dees-input-text>
<dees-form-submit disabled>login</dees-form-submit> <dees-form-submit disabled>login</dees-form-submit>
@ -94,7 +103,6 @@ export class DeesSimpleLogin extends DeesElement {
const submit = this.shadowRoot.querySelector('dees-form-submit'); const submit = this.shadowRoot.querySelector('dees-form-submit');
form.addEventListener('formData', (event: CustomEvent) => { form.addEventListener('formData', (event: CustomEvent) => {
this.dispatchEvent(new CustomEvent('login', { detail: event.detail })); this.dispatchEvent(new CustomEvent('login', { detail: event.detail }));
// this.switchToSlottedContent();
}); });
} }

View File

@ -0,0 +1,23 @@
import { html, cssManager } from '@design.estate/dees-element';
export const demoFunc = () => {
return html`
<style>
.ref1 {
margin: 20px;
width: 10px;
height: 10px;
background-color: red;
}
</style>
<div class="ref1"></div>
<dees-speechbubble .text=${`
**This is a longer markdown text that can be used the write**
a longer description about whats going on the app
**This is a subheader**
and another text
`}></dees-speechbubble>
`;
};

View File

@ -1,3 +1,7 @@
import * as colors from './00colors.js';
import * as plugins from './00plugins.js';
import { demoFunc } from './dees-speechbubble.demo.js';
import { import {
customElement, customElement,
html, html,
@ -8,9 +12,11 @@ import {
css, css,
type CSSResult, type CSSResult,
unsafeCSS, unsafeCSS,
domtools,
directives,
unsafeHTML,
} from '@design.estate/dees-element'; } from '@design.estate/dees-element';
import { DeesWindowLayer } from './dees-windowlayer.js';
import * as domtools from '@design.estate/dees-domtools';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -20,26 +26,53 @@ declare global {
@customElement('dees-speechbubble') @customElement('dees-speechbubble')
export class DeesSpeechbubble extends DeesElement { export class DeesSpeechbubble extends DeesElement {
public static demo = () => html` <dees-speechbubble></dees-speechbubble> `; public static demo = demoFunc;
@property() // STATIC
public static async createAndShow(refElement: HTMLElement, textArg: string) {
const windowLayer = await DeesWindowLayer.createAndShow({
blur: false,
});
const speechbubble = document.createElement('dees-speechbubble');
speechbubble.windowLayer = windowLayer;
speechbubble.reffedElement = refElement;
speechbubble.text = textArg;
speechbubble.manifested = true;
windowLayer.appendChild(speechbubble);
windowLayer.style.pointerEvents = 'none';
(windowLayer.shadowRoot.querySelector('.windowOverlay') as HTMLElement).style.pointerEvents = 'none';
return speechbubble;
}
// INSTANCE
@property({
type: Object,
})
reffedElement: HTMLElement;
@property({
type: String,
reflect: true,
})
public text: string; public text: string;
@property({ @property({
type: Boolean, type: Boolean,
}) })
public disabled = false; public wave: boolean = false;
@property({ @property({
type: Boolean, type: Boolean,
}) })
public isHidden = false; public manifested = false;
@property({ @property({
type: String, type: String,
}) })
public status: 'normal' | 'pending' | 'success' | 'error' = 'normal'; public status: 'normal' | 'pending' | 'success' | 'error' = 'normal';
public windowLayer: DeesWindowLayer;
constructor() { constructor() {
super(); super();
} }
@ -48,28 +81,22 @@ export class DeesSpeechbubble extends DeesElement {
cssManager.defaultStyles, cssManager.defaultStyles,
css` css`
:host { :host {
position: relative;
display: block;
box-sizing: border-box; box-sizing: border-box;
color: ${cssManager.bdTheme('#333', '#fff')}; color: ${cssManager.bdTheme('#333', '#fff')};
cursor: pointer;
user-select: none; user-select: none;
} }
:host([hidden]) {
display: none;
}
.maincontainer { .maincontainer {
position: relative;
will-change: transform; will-change: transform;
transition: transform 0.2s; transition: transform 0.2s;
transform: translateX(0px); transform: translateX(0px);
position: relative;
transition: all 0.2s; transition: all 0.2s;
margin-left: 0px; margin-left: 0px;
} filter: drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.2));
pointer-events: none;
.maincontainer:hover { opacity: 0;
transform: translateX(3px); transition: all 0.2s;
} }
.arrow { .arrow {
@ -78,17 +105,17 @@ export class DeesSpeechbubble extends DeesElement {
background: ${cssManager.bdTheme('#fff', '#333')}; background: ${cssManager.bdTheme('#fff', '#333')};
height: 15px; height: 15px;
width: 15px; width: 15px;
left: 4px; left: 2px;
top: 5px; top: 12px;
border-radius: 2px; border-radius: 3px;
} }
.speechbubble { .speechbubble {
background: ${cssManager.bdTheme('#fff', '#333')}; background: ${cssManager.bdTheme('#fff', '#333')};
padding: 0px 10px; padding: 0px 16px;
border-radius: 3px; border-radius: 3px;
position: absolute; position: absolute;
line-height: 25px; min-width: 240px;
font-size: 12px; font-size: 12px;
top: 0px; top: 0px;
left: 8px; left: 8px;
@ -133,25 +160,70 @@ export class DeesSpeechbubble extends DeesElement {
public render(): TemplateResult { public render(): TemplateResult {
return html` return html`
${this.manifested
? html`
<div class="maincontainer" @click=${this.handleClick}> <div class="maincontainer" @click=${this.handleClick}>
<div class="arrow"></div> <div class="arrow"></div>
<div class="speechbubble"><span class="wave">👋</span> We build with launch.sh, and you can too.</div> <div class="speechbubble">
${this.wave ? html`<span class="wave">👋</span>` : html``}
${directives.resolve(this.getHtml())}
</div> </div>
</div>
`
: html``}
`; `;
} }
public async handleClick() { public async handleClick() {
if (this.disabled) { console.log('speechbubble got clicked.');
return;
}
globalThis.location.href = "https://launch.sh"
} }
public async firstUpdated() { public async firstUpdated() {
if (!this.textContent) { // lets make sure we have a ref
this.textContent = 'Button'; if (!this.reffedElement) {
this.performUpdate(); this.reffedElement = this.previousElementSibling as HTMLElement;
} }
if (this.manifested) {
await this.updatePosition();
(this.shadowRoot.querySelector('.maincontainer') as HTMLElement).style.opacity = '1';
} else {
// lets make sure we instrument it
let speechbubble: DeesSpeechbubble;
this.reffedElement.addEventListener('mouseenter', async () => {
speechbubble = await DeesSpeechbubble.createAndShow(this.reffedElement, this.text);
});
this.reffedElement.addEventListener('mouseleave', () => {
speechbubble.destroy();
});
}
}
public async updatePosition() {
const refElement = this.reffedElement;
const boundingClientRect = refElement.getBoundingClientRect();
this.style.position = 'fixed';
this.style.top = `${boundingClientRect.top - 13}px`;
this.style.left = `${boundingClientRect.left + refElement.clientWidth + 4}px`;
if (boundingClientRect.right > 250) {
this.style.width = `250px`;
}
}
public async getHtml(): Promise<any> {
if (!this.text) {
return '';
}
const normalized = domtools.plugins.smartstring.normalize.standard(this.text);
const result = await domtools.plugins.smartmarkdown.SmartMarkdown.easyMarkdownToHtml(
normalized
);
return unsafeHTML(result);
}
public async show() {}
public async destroy() {
(this.shadowRoot.querySelector('.maincontainer') as HTMLElement).style.opacity = '0';
this.windowLayer.destroy();
} }
} }

View File

@ -1,3 +1,6 @@
import * as plugins from './00plugins.js';
import * as colors from './00colors.js';
import { import {
DeesElement, DeesElement,
customElement, customElement,
@ -99,7 +102,7 @@ export class DeesStepper extends DeesElement {
transition: all 0.7s ease-in-out; transition: all 0.7s ease-in-out;
max-width: 500px; max-width: 500px;
min-height: 300px; min-height: 300px;
border-radius: 3px; border-radius: 16px;
background: ${cssManager.bdTheme('#ffffff', '#181818')}; background: ${cssManager.bdTheme('#ffffff', '#181818')};
border-top: 1px solid ${cssManager.bdTheme('#ffffff', '#181818')}; border-top: 1px solid ${cssManager.bdTheme('#ffffff', '#181818')};
color: ${cssManager.bdTheme('#333', '#fff')}; color: ${cssManager.bdTheme('#333', '#fff')};
@ -127,6 +130,7 @@ export class DeesStepper extends DeesElement {
} }
.step .stepCounter { .step .stepCounter {
color: #999;
position: absolute; position: absolute;
top: 0px; top: 0px;
right: 0px; right: 0px;
@ -137,6 +141,8 @@ export class DeesStepper extends DeesElement {
} }
.step .goBack { .step .goBack {
color: #999;
cursor: default;
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
@ -144,19 +150,34 @@ export class DeesStepper extends DeesElement {
font-size: 12px; font-size: 12px;
border-bottom-right-radius: 3px; border-bottom-right-radius: 3px;
background: ${cssManager.bdTheme('#00000008', '#ffffff08')}; background: ${cssManager.bdTheme('#00000008', '#ffffff08')};
cursor: pointer;
} }
.step .goBack:hover { .step .goBack:hover {
background: ${cssManager.bdTheme('#00000012', '#ffffff12')}; color: ${cssManager.bdTheme('#333', '#fff')};
background: ${cssManager.bdTheme('#00000012', colors.dark.blue)};
}
.step .goBack:active {
color: ${cssManager.bdTheme('#333', '#fff')};
background: ${cssManager.bdTheme('#00000012', colors.dark.blueActive)};
}
.step .goBack span {
transition: all 0.2s;
display: inline-block;
}
.step .goBack:hover span {
transform: translateX(-2px);
} }
.step .title { .step .title {
text-align: center; text-align: center;
padding-top: 50px; padding-top: 50px;
font-family: 'Mona Sans', 'Inter', sans-serif; font-family: 'Geist Sans', sans-serif;
font-size: 25px; font-size: 22px;
font-weight: 300;
font-weight: 500;
} }
.step .content { .step .content {
@ -178,7 +199,7 @@ export class DeesStepper extends DeesElement {
: ''}" : ''}"
> >
${this.getIndexOfStep(stepArg) > 0 ${this.getIndexOfStep(stepArg) > 0
? html`<div class="goBack" @click=${this.goBack}><- go to previous step</div>` ? html`<div class="goBack" @click=${this.goBack}><span style="font-family: Inter"><-</span> go to previous step</div>`
: ``} : ``}
<div class="stepCounter"> <div class="stepCounter">
Step ${this.steps.findIndex((elementArg) => elementArg === stepArg) + 1} of Step ${this.steps.findIndex((elementArg) => elementArg === stepArg) + 1} of

View File

@ -0,0 +1,129 @@
import { type ITableAction } from './dees-table.js';
import * as plugins from './00plugins.js';
import { html } from '@design.estate/dees-element';
interface ITableDemoData {
date: string;
amount: string;
description: string;
}
export const demoFunc = () => html`
<style>
.demoWrapper {
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
padding: 20px;
background: #000000;
}
</style>
<div class="demoWrapper">
<dees-table
heading1="Current Account Statement"
heading2="Bunq - Payment Account 2 - April 2021"
.editableFields="${['description']}"
.data=${[
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Printing Paper (Office Supplies) - STAPLES BREMEN',
},
{
date: '2021-04-02',
amount: '165.65 €',
description: 'Logitech Mouse (Hardware) - logi.com OnlineShop',
},
{
date: '2021-04-03',
amount: '2999,00 €',
description: 'Macbook Pro 16inch (Hardware) - Apple.de OnlineShop',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
]}
dataName="transactions"
.dataActions="${[
{
name: 'upload',
iconName: 'bell',
useTableBehaviour: 'upload',
type: ['inRow'],
actionFunc: async (optionsArg) => {
alert(optionsArg.item.amount);
},
},
{
name: 'visibility',
iconName: 'copy',
type: ['inRow'],
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'create new',
iconName: 'instagram',
type: ['header'],
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'to gallery',
iconName: 'message',
type: ['footer'],
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'copy',
iconName: 'copySolid',
type: ['contextmenu', 'inRow'],
action: async () => {
return null;
},
},
{
name: 'edit (from demo)',
iconName: 'penToSquare',
type: ['contextmenu'],
action: async () => {
return null;
},
},
{
name: 'paste',
iconName: 'pasteSolid',
type: ['contextmenu'],
action: async () => {
return null;
},
},
{
name: 'preview',
type: ['doubleClick', 'contextmenu'],
iconName: 'eye',
actionFunc: async (itemArg) => {
alert(itemArg.item.amount);
return null;
},
}
] as (ITableAction<ITableDemoData>)[] as any}"
.displayFunction=${(itemArg) => {
return {
...itemArg,
onlyDisplayProp: 'onlyDisplay',
};
}}
>This is a slotted Text</dees-table
>
</div>
`;

View File

@ -1,3 +1,6 @@
import * as colors from './00colors.js';
import * as plugins from './00plugins.js';
import { demoFunc } from './dees-table.demo.js';
import { import {
customElement, customElement,
html, html,
@ -12,7 +15,7 @@ import {
resolveExec, resolveExec,
} from '@design.estate/dees-element'; } from '@design.estate/dees-element';
import { DeesContextmenu } from './dees-contextmenu.js' import { DeesContextmenu } from './dees-contextmenu.js';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { type TIconKey } from './dees-icon.js'; import { type TIconKey } from './dees-icon.js';
@ -24,7 +27,7 @@ declare global {
} }
// interfaces // interfaces
export interface IDataAction<T = any> { export interface ITableAction<T = any> {
name: string; name: string;
iconName: TIconKey; iconName: TIconKey;
/** /**
@ -35,7 +38,15 @@ export interface IDataAction<T = any> {
/** /**
* the type of the action * the type of the action
*/ */
type: 'inRow' | 'rightClick' | 'footer' | 'header' | 'preview' | 'keyCombination'; type: (
| 'inRow'
| 'contextmenu'
| 'doubleClick'
| 'footer'
| 'header'
| 'preview'
| 'keyCombination'
)[];
/** /**
* allows to check if the action is relevant for the given item * allows to check if the action is relevant for the given item
* @param itemArg * @param itemArg
@ -47,7 +58,12 @@ export interface IDataAction<T = any> {
* @param itemArg * @param itemArg
* @returns * @returns
*/ */
actionFunc: (itemArg: T) => Promise<any>; actionFunc: (actionDataArg: ITableActionDataArg<T>) => Promise<any>;
}
export interface ITableActionDataArg<T> {
item: T;
table: DeesTable<T>;
} }
export type TDisplayFunction<T = any> = (itemArg: T) => object; export type TDisplayFunction<T = any> = (itemArg: T) => object;
@ -55,91 +71,7 @@ export type TDisplayFunction<T = any> = (itemArg: T) => object;
// the table implementation // the table implementation
@customElement('dees-table') @customElement('dees-table')
export class DeesTable<T> extends DeesElement { export class DeesTable<T> extends DeesElement {
public static demo = () => html` public static demo = demoFunc;
<style>
.demoWrapper {
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
padding: 20px;
background: #000000;
}
</style>
<div class="demoWrapper">
<dees-table
heading1="Current Account Statement"
heading2="Bunq - Payment Account 2 - April 2021"
.data=${[
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Printing Paper (Office Supplies) - STAPLES BREMEN',
},
{
date: '2021-04-02',
amount: '165.65 €',
description: 'Logitech Mouse (Hardware) - logi.com OnlineShop',
},
{
date: '2021-04-03',
amount: '2999,00 €',
description: 'Macbook Pro 16inch (Hardware) - Apple.de OnlineShop',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
]}
dataName="transactions"
.dataActions="${[
{
name: 'upload',
iconName: 'bell',
useTableBehaviour: 'upload',
type: 'inRow',
actionFunc: async (itemArg: any) => {
alert(itemArg.amount);
},
},
{
name: 'visibility',
iconName: 'copy',
type: 'inRow',
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'create new',
iconName: 'instagram',
type: 'header',
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'to gallery',
iconName: 'message',
type: 'footer',
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
] as IDataAction[]}"
.displayFunction=${(itemArg) => {
return {
...itemArg,
onlyDisplayProp: 'onlyDisplay',
};
}}
>This is a slotted Text</dees-table
>
</div>
`;
// INSTANCE // INSTANCE
@property({ @property({
@ -157,30 +89,79 @@ export class DeesTable<T> extends DeesElement {
}) })
public data: T[] = []; public data: T[] = [];
// dees-form compatibility -----------------------------------------
@property({
type: String,
})
public key: string;
@property({
type: String,
})
public label: string;
@property({
type: Boolean,
})
public disabled: boolean = false;
@property({
type: Boolean,
})
public required: boolean = false;
get value() {
return this.data;
}
set value(valueArg) {}
public changeSubject = new domtools.plugins.smartrx.rxjs.Subject<DeesTable<T>>();
// end dees-form compatibility -----------------------------------------
/**
* What does a row of data represent?
*/
@property({ @property({
type: String, type: String,
reflect: true, reflect: true,
}) })
public dataName: string; public dataName: string;
@property({
type: Boolean,
})
searchable: boolean = true;
@property({ @property({
type: Array, type: Array,
}) })
public dataActions: IDataAction[] = []; public dataActions: ITableAction<T>[] = [];
@property({ @property({
attribute: false, attribute: false,
}) })
public displayFunction: TDisplayFunction = (itemArg: T) => itemArg as any; public displayFunction: TDisplayFunction = (itemArg: T) => itemArg as any;
@property({
attribute: false,
})
public reverseDisplayFunction: (itemArg: any) => T = (itemArg: any) => itemArg as T;
@property({ @property({
type: Object, type: Object,
}) })
public selectedDataRow: T; public selectedDataRow: T;
@property({
type: Array,
})
public editableFields: string[] = [];
public files: File[] = []; public files: File[] = [];
public fileWeakMap = new WeakMap(); public fileWeakMap = new WeakMap();
public dataChangeSubject = new domtools.plugins.smartrx.rxjs.Subject();
constructor() { constructor() {
super(); super();
} }
@ -190,31 +171,32 @@ export class DeesTable<T> extends DeesElement {
css` css`
.mainbox { .mainbox {
color: ${cssManager.bdTheme('#333', '#fff')}; color: ${cssManager.bdTheme('#333', '#fff')};
font-family: 'Mona Sans', 'Inter', sans-serif; font-family: 'Geist Sans', sans-serif;
font-weight: 400; font-weight: 400;
font-size: 14px; font-size: 14px;
padding: 16px; padding: 16px;
display: block; display: block;
width: 100%; width: 100%;
min-height: 50px; min-height: 50px;
background: ${cssManager.bdTheme('#ffffff', '#333333')}; background: ${cssManager.bdTheme('#ffffff', '#222222')};
border-radius: 3px; border-radius: 3px;
border-top: 1px solid ${cssManager.bdTheme('#fff', '#444')}; border-top: 1px solid ${cssManager.bdTheme('#fff', '#ffffff10')};
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3); box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3);
overflow-x: auto; overflow-x: auto;
cursor: default;
} }
.header { .header {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
font-family: 'Geist Sans', sans-serif;
} }
.headingContainer { .headingContainer {
} }
.heading { .heading {
font-family: 'Hubot Sans', 'Inter', sans-serif;
} }
.heading1 { .heading1 {
@ -226,16 +208,20 @@ export class DeesTable<T> extends DeesElement {
.headingSeparation { .headingSeparation {
margin-top: 7px; margin-top: 7px;
border-bottom: 1px solid ${cssManager.bdTheme('#bcbcbc', '#bcbcbc')}; border-bottom: 1px solid ${cssManager.bdTheme('#bcbcbc', '#444444')};
} }
.headerActions { .headerActions {
user-select: none;
display: flex;
flex-direction: row;
margin-left: auto; margin-left: auto;
cursor: pointer;
} }
.headerAction { .headerAction {
display: flex; display: flex;
flex-direction: row;
color: ${cssManager.bdTheme('#333', '#ccc')}; color: ${cssManager.bdTheme('#333', '#ccc')};
margin-left: 16px;
} }
.headerAction:hover { .headerAction:hover {
@ -246,6 +232,24 @@ export class DeesTable<T> extends DeesElement {
margin-right: 8px; margin-right: 8px;
} }
.searchGrid {
background: ${cssManager.bdTheme('#fff', '#111111')};
display: grid;
grid-gap: 16px;
grid-template-columns: 1fr 200px;
margin-top: 16px;
padding: 0px 16px;
border-top: 1px solid ${cssManager.bdTheme('#fff', '#ffffff20')};
border-radius: 8px;
}
.searchGrid.hidden {
height: 0px;
opacity: 0;
overflow: hidden;
margin-top: 0px;
}
table, table,
.noDataSet { .noDataSet {
margin-top: 16px; margin-top: 16px;
@ -265,10 +269,9 @@ export class DeesTable<T> extends DeesElement {
text-align: left; text-align: left;
} }
tr:hover { tr:hover {
cursor: pointer;
} }
tr:hover .innerCellContainer { tr:hover td {
background: ${cssManager.bdTheme('#22222210', '#ffffff20')}; background: ${cssManager.bdTheme('#22222210', '#ffffff10')};
} }
tr:first-child:hover { tr:first-child:hover {
cursor: auto; cursor: auto;
@ -276,19 +279,34 @@ export class DeesTable<T> extends DeesElement {
tr:first-child:hover .innerCellContainer { tr:first-child:hover .innerCellContainer {
background: none; background: none;
} }
tr.selected .innerCellContainer { tr.selected td {
background: ${cssManager.bdTheme('#22222220', '#ffffff40')}; background: ${cssManager.bdTheme('#22222220', '#ffffff20')};
} }
tr.hasAttachment td {
background: ${cssManager.bdTheme('#0098847c', '#0098847c')};
}
th { th {
text-transform: uppercase; text-transform: none;
font-family: 'Geist Sans', sans-serif;
font-weight: 500;
} }
th, th,
td { td {
padding: 3px 0px; position: relative;
vertical-align: top;
padding: 0px;
border-right: 1px dashed ${cssManager.bdTheme('#999', '#808080')}; border-right: 1px dashed ${cssManager.bdTheme('#999', '#808080')};
} }
.innerCellContainer { .innerCellContainer {
min-height: 36px;
position: relative;
height: 100%;
width: 100%;
padding: 6px 8px; padding: 6px 8px;
line-height: 24px;
} }
th:first-child .innerCellContainer, th:first-child .innerCellContainer,
td:first-child .innerCellContainer { td:first-child .innerCellContainer {
@ -302,24 +320,53 @@ export class DeesTable<T> extends DeesElement {
td:last-child { td:last-child {
border-right: none; border-right: none;
} }
td input {
.action { width: 100%;
margin: -8px 0px; height: 100%;
padding: 8px; outline: none;
line-height: 16px; border: 2px solid #fa6101;
display: inline-block; top: 0px;
bottom: 0px;
right: 0px;
left: 0px;
position: absolute;
background: #fa610140;
color: ${cssManager.bdTheme('#333', '#fff')};
font-family: inherit;
font-size: inherit;
font-weight: inherit;
padding: 0px 6px;
} }
.actionsContainer {
.action:first-child { display: flex;
margin-left: -8px; flex-direction: row;
width: min-content; height: 24px;
transform: translateY(-4px);
margin-left: -6px;
}
.action {
position: relative;
padding: 8px 10px;
line-height: 24px;
height: 32px;
size: 16px;
border-radius: 8px;
} }
.action:hover { .action:hover {
background: ${cssManager.bdTheme('#CCC', '#111')}; background: ${cssManager.bdTheme(colors.bright.blue, colors.dark.blue)};
}
.action:active {
background: ${cssManager.bdTheme(colors.bright.blue, colors.dark.blueActive)};
}
.action:hover dees-icon {
filter: ${cssManager.bdTheme('invert(1) brightness(3)', '')};
} }
.footer { .footer {
font-family: 'Geist Sans', sans-serif;
font-size: 14px; font-size: 14px;
color: ${cssManager.bdTheme('#111', '#ffffff90')}; color: ${cssManager.bdTheme('#111', '#ffffff90')};
background: ${cssManager.bdTheme('#eeeeeb', '#00000050')}; background: ${cssManager.bdTheme('#eeeeeb', '#00000050')};
@ -338,19 +385,23 @@ export class DeesTable<T> extends DeesElement {
} }
.footerActions .footerAction { .footerActions .footerAction {
cursor: pointer;
padding: 8px 16px; padding: 8px 16px;
display: flex; display: flex;
user-select: none;
} }
.footerActions .footerAction:hover { .footerActions .footerAction:hover {
background: ${cssManager.bdTheme('#CCC', '#111')}; background: ${cssManager.bdTheme(colors.bright.blue, colors.dark.blue)};
color: #fff;
} }
.footerActions dees-icon { .footerActions .footerAction dees-icon {
display: flex; display: flex;
margin-right: 8px; margin-right: 8px;
} }
.footerActions .footerAction:hover dees-icon {
}
`, `,
]; ];
@ -360,19 +411,22 @@ export class DeesTable<T> extends DeesElement {
<!-- the heading part --> <!-- the heading part -->
<div class="header"> <div class="header">
<div class="headingContainer"> <div class="headingContainer">
<div class="heading heading1">${this.heading1}</div> <div class="heading heading1">${this.label || this.heading1}</div>
<div class="heading heading2">${this.heading2}</div> <div class="heading heading2">${this.heading2}</div>
</div> </div>
<div class="headerActions"> <div class="headerActions">
${resolveExec(async () => { ${resolveExec(async () => {
const resultArray: TemplateResult[] = []; const resultArray: TemplateResult[] = [];
for (const action of this.dataActions) { for (const action of this.dataActions) {
if (action.type !== 'header') continue; if (!action.type.includes('header')) continue;
resultArray.push( resultArray.push(
html`<div html`<div
class="headerAction" class="headerAction"
@click=${() => { @click=${() => {
action.actionFunc(this.selectedDataRow); action.actionFunc({
item: this.selectedDataRow,
table: this,
});
}} }}
> >
${action.iconName ${action.iconName
@ -387,6 +441,32 @@ export class DeesTable<T> extends DeesElement {
</div> </div>
</div> </div>
<div class="headingSeparation"></div> <div class="headingSeparation"></div>
<div class="searchGrid hidden">
<dees-input-text
.label=${'lucene syntax search'}
.description=${`
You can use the lucene syntax to search for data, e.g.:
\`\`\`
name: "john" AND age: 18
\`\`\`
`}
></dees-input-text>
<dees-input-multitoggle
.label=${'search mode'}
.options=${['table', 'data', 'server']}
.selectedOption=${'table'}
.description=${`
There are three basic modes:
* table: only searches data already in the table
* data: searches original data, ignoring table transforms
* server: searches data on the server
`}
></dees-input-multitoggle>
</div>
<!-- the actual table --> <!-- the actual table -->
<style></style> <style></style>
@ -437,14 +517,14 @@ export class DeesTable<T> extends DeesElement {
console.log('dragenter'); console.log('dragenter');
console.log(realTarget); console.log(realTarget);
setTimeout(() => { setTimeout(() => {
realTarget.style.background = 'green'; realTarget.classList.add('hasAttachment');
}, 0); }, 0);
}} }}
@dragleave=${async (eventArg: DragEvent) => { @dragleave=${async (eventArg: DragEvent) => {
eventArg.preventDefault(); eventArg.preventDefault();
eventArg.stopPropagation(); eventArg.stopPropagation();
const realTarget = getTr(eventArg.target as HTMLElement); const realTarget = getTr(eventArg.target as HTMLElement);
realTarget.style.background = 'none'; realTarget.classList.remove('hasAttachment');
}} }}
@dragover=${async (eventArg: DragEvent) => { @dragover=${async (eventArg: DragEvent) => {
eventArg.preventDefault(); eventArg.preventDefault();
@ -465,34 +545,45 @@ export class DeesTable<T> extends DeesElement {
} }
}} }}
@contextmenu=${async (eventArg: MouseEvent) => { @contextmenu=${async (eventArg: MouseEvent) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [ DeesContextmenu.openContextMenuWithOptions(
{ eventArg,
name: 'copy', this.getActionsForType('contextmenu').map((action) => {
iconName: 'copySolid', const menuItem: plugins.tsclass.website.IMenuItem = {
name: action.name,
iconName: action.iconName as any,
action: async () => { action: async () => {
await action.actionFunc({
item: itemArg,
table: this,
});
return null; return null;
}, },
}, };
{ return menuItem;
name: 'edit', })
iconName: 'penToSquare', );
action: async () => {
return null;
},
},{
name: 'paste',
iconName: 'pasteSolid',
action: async () => {
return null;
},
},
])
}} }}
class="${itemArg === this.selectedDataRow ? 'selected' : ''}" class="${itemArg === this.selectedDataRow ? 'selected' : ''}"
> >
${headings.map( ${headings.map(
(headingArg) => html` (headingArg) => html`
<td> <td
@dblclick=${(e: Event) => {
if (this.editableFields.includes(headingArg)) {
this.handleCellEditing(e, itemArg, headingArg);
} else {
const wantedAction = this.dataActions.find((actionArg) =>
actionArg.type.includes('doubleClick')
);
if (wantedAction) {
wantedAction.actionFunc({
item: itemArg,
table: this,
});
}
}
}}
>
<div class="innerCellContainer">${transformedItem[headingArg]}</div> <div class="innerCellContainer">${transformedItem[headingArg]}</div>
</td> </td>
` `
@ -502,25 +593,28 @@ export class DeesTable<T> extends DeesElement {
return html` return html`
<td> <td>
<div class="innerCellContainer"> <div class="innerCellContainer">
${(() => { <div class="actionsContainer">
const actions: TemplateResult[] = []; ${this.getActionsForType('inRow').map(
for (const action of this.dataActions) { (actionArg) => html`
if (action.type !== 'inRow') continue; <div
actions.push(
html`<div
class="action" class="action"
@click=${() => action.actionFunc(itemArg)} @click=${() =>
actionArg.actionFunc({
item: itemArg,
table: this,
})}
> >
${action.iconName ${actionArg.iconName
? html` ? html`
<dees-icon .iconFA=${action.iconName}></dees-icon> <dees-icon
.iconFA=${actionArg.iconName}
></dees-icon>
` `
: action.name} : actionArg.name}
</div>` </div>
); `
} )}
return actions; </div>
})()}
</div> </div>
</td> </td>
`; `;
@ -543,12 +637,15 @@ export class DeesTable<T> extends DeesElement {
${resolveExec(async () => { ${resolveExec(async () => {
const resultArray: TemplateResult[] = []; const resultArray: TemplateResult[] = [];
for (const action of this.dataActions) { for (const action of this.dataActions) {
if (action.type !== 'footer') continue; if (!action.type.includes('footer')) continue;
resultArray.push( resultArray.push(
html`<div html`<div
class="footerAction" class="footerAction"
@click=${() => { @click=${() => {
action.actionFunc(this.selectedDataRow); action.actionFunc({
item: this.selectedDataRow,
table: this,
});
}} }}
> >
${action.iconName ${action.iconName
@ -566,5 +663,122 @@ export class DeesTable<T> extends DeesElement {
`; `;
} }
public async firstUpdated() {} public async firstUpdated() {
}
public async updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void> {
super.updated(changedProperties);
this.determineColumnWidths();
if (this.searchable) {
const existing = this.dataActions.find((actionArg) => actionArg.type.includes('header') && actionArg.name === 'Search');
if (!existing) {
this.dataActions.unshift({
name: 'Search',
iconName: 'magnifyingGlass',
type: ['header'],
actionFunc: async () => {
console.log('open search');
const searchGrid = this.shadowRoot.querySelector('.searchGrid');
searchGrid.classList.toggle('hidden');
}
});
console.log(this.dataActions);
this.requestUpdate();
};
}
}
public async determineColumnWidths() {
const domtools = await this.domtoolsPromise;
await domtools.convenience.smartdelay.delayFor(0);
// Get the table element
const table = this.shadowRoot.querySelector('table');
if (!table) return;
// Get the first row's cells to measure the widths
const cells = table.rows[0].cells;
const handleColumnByIndex = async (i: number, waitForRenderArg: boolean = false) => {
const done = plugins.smartpromise.defer();
const cell = cells[i];
// Get computed width
const width = window.getComputedStyle(cell).width;
if (cell.textContent.includes('Actions')) {
const neededWidth =
this.dataActions.filter((actionArg) => actionArg.type.includes('inRow')).length * 36;
cell.style.width = `${Math.max(neededWidth, 68)}px`;
} else {
cell.style.width = width;
}
if (waitForRenderArg) {
requestAnimationFrame(() => {
done.resolve();
});
await done.promise;
}
};
if (cells[cells.length - 1].textContent.includes('Actions')) {
await handleColumnByIndex(cells.length - 1, true);
}
for (let i = 0; i < cells.length; i++) {
if (cells[i].textContent.includes('Actions')) {
continue;
}
await handleColumnByIndex(i);
}
table.style.tableLayout = 'fixed';
}
getActionsForType(typeArg: ITableAction['type'][0]) {
const actions: ITableAction[] = [];
for (const action of this.dataActions) {
if (!action.type.includes(typeArg)) continue;
actions.push(action);
}
return actions;
}
async handleCellEditing(event: Event, itemArg: T, key: string) {
const domtools = await this.domtoolsPromise;
const target = event.target as HTMLElement;
const originalColor = target.style.color;
target.style.color = 'transparent';
const transformedItem = this.displayFunction(itemArg);
const initialValue = (transformedItem[key] as unknown as string) || '';
// Create an input element
const input = document.createElement('input');
input.type = 'text';
input.value = initialValue;
const blurInput = async (blurArg = true, saveArg = false) => {
if (blurArg) {
input.blur();
}
if (saveArg) {
itemArg[key] = input.value as any; // Convert string to T (you might need better type casting depending on your data structure)
this.changeSubject.next(this);
}
input.remove();
target.style.color = originalColor;
this.requestUpdate();
};
// When the input loses focus or the Enter key is pressed, update the data
input.addEventListener('blur', () => {
blurInput(false, false);
});
input.addEventListener('keydown', (e: KeyboardEvent) => {
if (e.key === 'Enter') {
blurInput(true, true); // This will trigger the blur event handler above
}
});
// Replace the cell's content with the input
target.appendChild(input);
input.focus();
}
} }

View File

@ -0,0 +1,355 @@
import {
DeesElement,
property,
html,
customElement,
type TemplateResult,
css,
cssManager,
} from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
import * as webcontainer from '@webcontainer/api';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
declare global {
interface HTMLElementTagNameMap {
'dees-terminal': DeesTerminal;
}
}
@customElement('dees-terminal')
export class DeesTerminal extends DeesElement {
public static demo = () => html` <dees-terminal
.environment=${{
NODE_ENV: 'development',
PORT: '3000',
}}
></dees-terminal> `;
// INSTANCE
private resizeObserver: ResizeObserver;
@property()
public setupCommand = `pnpm install @serve.zone/cli && servezone cli\n`;
@property()
environment: {[key: string]: string} = {};
// exposing webcontainer
private webcontainerDeferred = new domtools.plugins.smartpromise.Deferred<webcontainer.WebContainer>();
public webcontainerPromise = this.webcontainerDeferred.promise;
constructor() {
super();
this.resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
// Handle the resize event
console.log(`Terminal Resized`);
this.handleResize();
}
});
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
padding: 20px;
background: #000;
position: absolute;
height: 100%;
width: 100%;
}
* {
box-sizing: border-box;
}
#container {
position: absolute;
height: calc(100% - 40px);
width: calc(100% - 40px);
}
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/term.js
* @license MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Originally forked from (with the author's permission):
* Fabrice Bellard's javascript vt100 for jslinux:
* http://bellard.org/jslinux/
* Copyright (c) 2011 Fabrice Bellard
* The original design remains. The terminal itself
* has been extended to include xterm CSI codes, among
* other features.
*/
/**
* Default styles for xterm.js
*/
.xterm {
font-feature-settings: 'liga' 0;
position: relative;
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
}
.xterm.focus,
.xterm:focus {
outline: none;
}
.xterm .xterm-helpers {
position: absolute;
top: 0;
/**
* The z-index of the helpers must be higher than the canvases in order for
* IMEs to appear on top.
*/
z-index: 5;
}
.xterm .xterm-helper-textarea {
padding: 0;
border: 0;
margin: 0;
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
position: absolute;
opacity: 0;
left: -9999em;
top: 0;
width: 0;
height: 0;
z-index: -5;
/** Prevent wrapping so the IME appears against the textarea at the correct position */
white-space: nowrap;
overflow: hidden;
resize: none;
}
.xterm .composition-view {
/* TODO: Composition position got messed up somewhere */
background: #000;
color: #fff;
display: none;
position: absolute;
white-space: nowrap;
z-index: 1;
}
.xterm .composition-view.active {
display: block;
}
.xterm .xterm-viewport {
/* On OS X this is required in order for the scroll bar to appear fully opaque */
background-color: #000;
overflow-y: scroll;
cursor: default;
position: absolute;
right: 0;
left: 0;
top: 0;
bottom: 0;
}
.xterm .xterm-screen {
position: relative;
}
.xterm .xterm-screen canvas {
position: absolute;
left: 0;
top: 0;
}
.xterm .xterm-scroll-area {
visibility: hidden;
}
.xterm-char-measure-element {
display: inline-block;
visibility: hidden;
position: absolute;
top: 0;
left: -9999em;
line-height: normal;
}
.xterm {
cursor: text;
}
.xterm.enable-mouse-events {
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
cursor: default;
}
.xterm.xterm-cursor-pointer {
cursor: pointer;
}
.xterm.column-select.focus {
/* Column selection mode */
cursor: crosshair;
}
.xterm .xterm-accessibility,
.xterm .xterm-message {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 10;
color: transparent;
}
.xterm .live-region {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
overflow: hidden;
}
.xterm-dim {
opacity: 0.5;
}
.xterm-underline {
text-decoration: underline;
}
`,
];
public render(): TemplateResult {
return html`
<div class="mainbox">
<div id="container"></div>
</div>
`;
}
private fitAddon: FitAddon;
public async firstUpdated(
_changedProperties: Map<string | number | symbol, unknown>
): Promise<void> {
const domtools = await this.domtoolsPromise;
super.firstUpdated(_changedProperties);
const container = this.shadowRoot.getElementById('container');
const term = new Terminal({
convertEol: true,
cursorBlink: true,
});
this.fitAddon = new FitAddon();
term.loadAddon(this.fitAddon);
// Open the terminal in #terminal-container
term.open(container);
// Make the terminal's size and geometry fit the size of #terminal-container
this.fitAddon.fit();
term.write(`dees-terminal custom terminal. \r\n$ `);
// lets start the webcontainer
// Call only once
const webcontainerInstance = await webcontainer.WebContainer.boot();
const shellProcess = await webcontainerInstance.spawn('jsh');
shellProcess.output.pipeTo(
new WritableStream({
write(data) {
term.write(data);
},
})
);
const input = shellProcess.input.getWriter();
term.onData((data) => {
input.write(data);
});
await this.waitForPrompt(term, '~/');
// lets set the environment variables
await this.setEnvironmentVariables(this.environment, webcontainerInstance);
input.write(`source source.env\n`);
await this.waitForPrompt(term, '~/');
// lets run the setup command
input.write(this.setupCommand);
await this.waitForPrompt(term, '~/');
input.write(`clear && echo 'welcome'\n`);
this.webcontainerDeferred.resolve(webcontainerInstance);
}
async connectedCallback(): Promise<void> {
await super.connectedCallback();
this.resizeObserver.observe(this);
}
async disconnectedCallback(): Promise<void> {
this.resizeObserver.unobserve(this);
await super.disconnectedCallback();
}
handleResize() {
this.fitAddon.fit();
}
public async waitForPrompt(term: Terminal, prompt: string): Promise<void> {
return new Promise<void>((resolve) => {
const checkPrompt = () => {
const lines = term.buffer.active;
for (let i = 0; i < lines.length; i++) {
const line = lines.getLine(i);
if (line && line.translateToString().includes(prompt)) {
setTimeout(() => {
resolve();
}, 100);
return;
}
}
setTimeout(checkPrompt, 100); // check every 100 ms
};
checkPrompt();
});
}
public async setEnvironmentVariables(envArg: {[key: string]: string}, webcontainerInstanceArg?: webcontainer.WebContainer) {
const webcontainerInstance = webcontainerInstanceArg ||await this.webcontainerPromise;
let envFile = ``
for (const key in envArg) {
envFile += `export ${key}="${envArg[key]}"\n`;
}
await webcontainerInstance.mount({'source.env': {
file: {
contents: envFile,
}
}});
}
}

View File

@ -0,0 +1,5 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = async () => {
return html`<dees-toast></dees-toast>`;
}

View File

@ -1,6 +1,7 @@
import { customElement, DeesElement, type TemplateResult, html, type CSSResult, } from '@design.estate/dees-element'; import { customElement, DeesElement, type TemplateResult, html, type CSSResult, } from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { demoFunc } from './dees-toast.demo.js';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -10,6 +11,7 @@ declare global {
@customElement('dees-toast') @customElement('dees-toast')
export class DeesToast extends DeesElement { export class DeesToast extends DeesElement {
public static demo = demoFunc;
constructor() { constructor() {
super(); super();

View File

@ -0,0 +1,10 @@
import { html } from '@design.estate/dees-element';
import { DeesUpdater } from './dees-updater.js';
export const demoFunc = async () => {
const updater = await DeesUpdater.createAndShow();
setTimeout(async () => {
await updater.destroy();
}, 10000);
}

View File

@ -1,7 +1,13 @@
import { customElement, DeesElement, type TemplateResult, html, property, type CSSResult, } from '@design.estate/dees-element'; import {
customElement,
import * as domtools from '@design.estate/dees-domtools'; DeesElement,
type TemplateResult,
html,
property,
type CSSResult,
domtools,
} from '@design.estate/dees-element';
import { demoFunc } from './dees-updater.demo.js';
import './dees-windowlayer'; import './dees-windowlayer';
import { css, cssManager } from '@design.estate/dees-element'; import { css, cssManager } from '@design.estate/dees-element';
@ -14,7 +20,13 @@ declare global {
@customElement('dees-updater') @customElement('dees-updater')
export class DeesUpdater extends DeesElement { export class DeesUpdater extends DeesElement {
public static demo = () => html`<dees-updater></dees-updater>`; public static demo = demoFunc;
public static async createAndShow() {
const updater = new DeesUpdater();
document.body.appendChild(updater);
return updater;
}
@property({ @property({
type: String, type: String,
@ -38,9 +50,8 @@ export class DeesUpdater extends DeesElement {
will-change: transform; will-change: transform;
position: relative; position: relative;
background: ${cssManager.bdTheme('#eeeeeb', '#222')}; background: ${cssManager.bdTheme('#eeeeeb', '#222')};
margin: auto;
max-width: 800px; max-width: 800px;
border-radius: 3px; border-radius: 8px;
border-top: 1px solid ${cssManager.bdTheme('#eeeeeb', '#333')}; border-top: 1px solid ${cssManager.bdTheme('#eeeeeb', '#333')};
} }
@ -63,28 +74,37 @@ export class DeesUpdater extends DeesElement {
display: grid; display: grid;
grid-template-columns: 50% 50%; grid-template-columns: 50% 50%;
} }
` `,
] ];
public render(): TemplateResult { public render(): TemplateResult {
return html` return html`
<dees-windowlayer @clicked="${this.windowLayerClicked}"> <dees-windowlayer
@clicked="${this.windowLayerClicked}"
.options=${{
blur: true,
}}
>
<div class="modalContainer"> <div class="modalContainer">
<div class="headingContainer"> <div class="headingContainer">
<dees-spinner .size=${60}></dees-spinner> <dees-spinner .size=${60}></dees-spinner>
<h1>Updating the application...</h1> <h1>Updating the application...</h1>
</div> </div>
<div class="progress">
<dees-progressbar .progress=${0.5}></dees-progressbar>
</div>
<div class="buttonContainer"> <div class="buttonContainer">
<dees-button>More info</dees-button> <dees-button>More info</dees-button>
<dees-button>Changelog</dees-button> <dees-button>Changelog</dees-button>
</div> </div>
</div> </div> </dees-windowlayer
</dees-windowlayer>> >>
`; `;
} }
private windowLayerClicked() { public async destroy() {
const windowLayer = this.shadowRoot.querySelector('dees-windowlayer'); this.parentElement.removeChild(this);
windowLayer.toggleVisibility();
} }
private windowLayerClicked() {}
} }

View File

@ -0,0 +1,99 @@
import {
customElement,
DeesElement,
domtools,
type TemplateResult,
html,
property,
type CSSResult,
state,
css,
cssManager,
} from '@design.estate/dees-element';
declare global {
interface HTMLElementTagNameMap {
'dees-windowcontrols': DeesWindowControls;
}
}
@customElement('dees-windowcontrols')
export class DeesWindowControls extends DeesElement {
// STATIC
public static demo = () => html`<dees-windowcontrols></dees-windowcontrols>`;
// Instance
@property({
reflect: true,
})
public type: 'mac' | 'linux' | 'windows' = 'mac';
@property({
reflect: true,
})
public position: 'left' | 'right' = 'left';
public static styles = [
cssManager.defaultStyles,
css`
:host {
position: relative;
display: block;
box-sizing: border-box;
padding-left: 16px;
padding-right: 16px;
}
.windowControls {
height: 100%;
position: relative;
display: flex;
justify-content: center;
align-items: center;
}
.windowControls div {
width: 12px;
height: 12px;
display: inline-block;
border-radius: 50%;
margin: 0px;
padding: 0px;
background: #222222;
}
.windowControls div.close {
background: #ff5f57;
margin-right: 12px;
}
.windowControls div.toDock {
background: #ffbd2e;
margin-right: 12px;
}
.windowControls div.minMax {
background: #27c93f;
}
.windowControls div:hover {
background: #333333;
}
`,
];
public render(): TemplateResult {
return html`
${(this.type === 'mac' && this.position === 'left') ||
((this.type === 'linux' || this.type === 'windows') && this.position === 'right')
? html`
<div class="windowControls">
<div class="close"></div>
<div class="toDock"></div>
<div class="minMax"></div>
</div>
`
: html``}
`;
}
}

View File

@ -1,6 +1,4 @@
import { customElement, DeesElement, type TemplateResult, html, property, type CSSResult, } from '@design.estate/dees-element'; import { customElement, DeesElement, domtools, type TemplateResult, html, property, type CSSResult, state, } from '@design.estate/dees-element';
import * as domtools from '@design.estate/dees-domtools';
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {
@ -8,20 +6,33 @@ declare global {
} }
} }
export interface IOptions_DeesWindowLayer {
blur: boolean;
}
@customElement('dees-windowlayer') @customElement('dees-windowlayer')
export class DeesWindowLayer extends DeesElement { export class DeesWindowLayer extends DeesElement {
// STATIC // STATIC
public static demo = () => html`<dees-windowlayer></dees-windowlayer>`; public static demo = () => html`<dees-windowlayer></dees-windowlayer>`;
public static async createAndShow() { public static async createAndShow(optionsArg?: IOptions_DeesWindowLayer) {
const domtoolsInstance = domtools.DomTools.getGlobalDomToolsSync(); const domtoolsInstance = domtools.DomTools.getGlobalDomToolsSync();
const windowLayer = new DeesWindowLayer(); const windowLayer = new DeesWindowLayer();
windowLayer.options = {
...windowLayer.options,
...optionsArg,
}
document.body.append(windowLayer); document.body.append(windowLayer);
await domtoolsInstance.convenience.smartdelay.delayFor(0); await domtoolsInstance.convenience.smartdelay.delayFor(0);
windowLayer.show(); windowLayer.show();
return windowLayer; return windowLayer;
} }
@state()
public options: IOptions_DeesWindowLayer = {
blur: false
};
// INSTANCE // INSTANCE
@property({ @property({
type: Boolean type: Boolean
@ -49,18 +60,29 @@ export class DeesWindowLayer extends DeesElement {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: rgba(0, 0, 0, 0.0); background: rgba(0, 0, 0, 0.0);
backdrop-filter: brightness(1); backdrop-filter: brightness(1) ${this.options.blur ? 'blur(0px)' : ''};
pointer-events: none; pointer-events: none;
z-index: 200; z-index: 200;
} }
.slotContent {
position: fixed;
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
z-index: 201;
}
.visible { .visible {
background: rgba(0, 0, 0, 0.2); background: rgba(0, 0, 0, 0.2);
backdrop-filter: brightness(0.3); backdrop-filter: brightness(0.9) ${this.options.blur ? 'blur(2px)' : ''};
pointer-events: all; pointer-events: all;
} }
</style> </style>
<div @click=${this.dispatchClicked} class="windowOverlay ${this.visible ? 'visible' : null}"> <div class="windowOverlay ${this.visible ? 'visible' : null}">
</div>
<div @click=${this.dispatchClicked} class="slotContent">
<slot></slot> <slot></slot>
</div> </div>
`; `;

View File

@ -1,25 +1,48 @@
export * from './dees-appui-activitylog.js';
export * from './dees-appui-appbar.js';
export * from './dees-appui-base.js';
export * from './dees-appui-maincontent.js';
export * from './dees-appui-mainmenu.js';
export * from './dees-appui-mainselector.js';
export * from './dees-badge.js';
export * from './dees-button-exit.js'; export * from './dees-button-exit.js';
export * from './dees-button.js'; export * from './dees-button.js';
export * from './dees-chart-area.js';
export * from './dees-chart-log.js';
export * from './dees-chips.js'; export * from './dees-chips.js';
export * from './dees-contextmenu.js'; export * from './dees-contextmenu.js';
export * from './dees-dataview-codebox.js'; export * from './dees-dataview-codebox.js';
export * from './dees-dataview-statusobject.js'; export * from './dees-dataview-statusobject.js';
export * from './dees-editor.js';
export * from './dees-editor-markdown.js';
export * from './dees-editor-markdownoutlet.js';
export * from './dees-form-submit.js'; export * from './dees-form-submit.js';
export * from './dees-form.js'; export * from './dees-form.js';
export * from './dees-hint.js';
export * from './dees-icon.js'; export * from './dees-icon.js';
export * from './dees-input-checkbox.js'; export * from './dees-input-checkbox.js';
export * from './dees-input-dropdown.js'; export * from './dees-input-dropdown.js';
export * from './dees-input-fileupload.js'; export * from './dees-input-fileupload.js';
export * from './dees-input-iban.js';
export * from './dees-input-typelist.js';
export * from './dees-input-phone.js';
export * from './dees-progressbar.js';
export * from './dees-input-quantityselector.js'; export * from './dees-input-quantityselector.js';
export * from './dees-input-radio.js'; export * from './dees-input-radio.js';
export * from './dees-input-text.js'; export * from './dees-input-text.js';
export * from './dees-label.js';
export * from './dees-mobilenavigation.js'; export * from './dees-mobilenavigation.js';
export * from './dees-modal.js';
export * from './dees-input-multitoggle.js';
export * from './dees-pdf.js'; export * from './dees-pdf.js';
export * from './dees-simple-appdash.js';
export * from './dees-simple-login.js'; export * from './dees-simple-login.js';
export * from './dees-speechbubble.js'; export * from './dees-speechbubble.js';
export * from './dees-spinner.js'; export * from './dees-spinner.js';
export * from './dees-stepper.js'; export * from './dees-stepper.js';
export * from './dees-table.js'; export * from './dees-table.js';
export * from './dees-terminal.js';
export * from './dees-toast.js'; export * from './dees-toast.js';
export * from './dees-updater.js'; export * from './dees-updater.js';
export * from './dees-windowcontrols.js';
export * from './dees-windowlayer.js'; export * from './dees-windowlayer.js';

View File

@ -0,0 +1,2 @@
export * from './tab.js';
export * from './selectionoption.js';

View File

@ -0,0 +1,4 @@
export interface ISelectionOption {
key: string;
action: () => void;
}

View File

@ -0,0 +1,5 @@
export interface ITab {
key: string;
iconName?: string;
action: () => void;
}

View File

@ -1,2 +1,4 @@
export * from './elements/index.js'; export * from './elements/index.js';
import * as colors from './elements/00colors.js';
export { colors };
export { commitinfo } from './00_commitinfo_data.js'; export { commitinfo } from './00_commitinfo_data.js';

View File

@ -3,9 +3,10 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"useDefineForClassFields": false, "useDefineForClassFields": false,
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "NodeNext",
"moduleResolution": "nodenext", "moduleResolution": "NodeNext",
"esModuleInterop": true "esModuleInterop": true,
"verbatimModuleSyntax": true
}, },
"exclude": [ "exclude": [
"dist_*/**/*.d.ts" "dist_*/**/*.d.ts"