@massimo-cassandro/minimo 1.7.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/design-tokens/tokens/size.minimo.tokens.jsonc +16 -16
  2. package/index.js +4 -2
  3. package/package.json +1 -1
  4. package/src/components/TODO form-multiselect/form-multiselect.css +40 -0
  5. package/src/components/TODO form-multiselect/form-multiselect.js +83 -0
  6. package/src/components/TODO vanilla-cookie-consent/cookie-consent.css +20 -0
  7. package/src/components/TODO vanilla-cookie-consent/cookie-consent.js +76 -0
  8. package/src/components/TODO vanilla-cookie-consent/render-cookie-list.js +32 -0
  9. package/src/components/TODO vanilla-cookie-consent/src/cookie-list.js +85 -0
  10. package/src/components/TODO vanilla-cookie-consent/src/it-translation.js +38 -0
  11. package/src/components/TODO vanilla-cookie-consent/src/run-analytics.js +54 -0
  12. package/src/components/TODO vanilla-cookie-consent/src/run-recaptcha.js +71 -0
  13. package/src/components/modal-alert/TODO modal-alert-demo/demo.css +63 -0
  14. package/src/components/modal-alert/TODO modal-alert-demo/demo.js +155 -0
  15. package/src/components/modal-popup/modal-popup.js +2 -1
  16. package/src/components/slide-up-down-toggle/slide-up-down-toggle.js +246 -0
  17. package/src/components/slide-up-down-toggle/slide-up-down-toggle.module.css +97 -0
  18. package/src/components/snackbar/snackbar.js +2 -1
  19. package/src/components/spinner/spinner.js +2 -1
  20. package/src/components/unsplash-page/TODO unsplash-page-demo/README.md +194 -0
  21. package/src/components/unsplash-page/TODO unsplash-page-demo/changelog.md +5 -0
  22. package/src/components/unsplash-page/TODO unsplash-page-demo/unsplash-page/demo.js +15 -0
  23. package/src/components/unsplash-page/TODO unsplash-page-demo/unsplash-page/rollup.config.mjs +26 -0
  24. package/src/components/unsplash-page/TODO unsplash-page-demo/unsplash-page/unsplash-page-demo.min.js +3 -0
  25. package/src/utilities/generate-pwd.js +22 -0
  26. package/src/web-components/TODO json-table/README.md +67 -0
  27. package/src/web-components/TODO json-table/TODO.md +12 -0
  28. package/src/web-components/TODO json-table/_work/OLD/docs/custom-props-list.md +69 -0
  29. package/src/web-components/TODO json-table/_work/OLD/script/create-css-custom-props-doc.mjs +113 -0
  30. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-end.md +4 -0
  31. package/src/web-components/TODO json-table/_work/OLD/script/src/custom-props-start.md +30 -0
  32. package/src/web-components/TODO json-table/_work/OLD/src/css/icons.module.css +22 -0
  33. package/src/web-components/TODO json-table/_work/OLD/src/css/info.module.css +42 -0
  34. package/src/web-components/TODO json-table/_work/OLD/src/css/main-wrapper.module.css +4 -0
  35. package/src/web-components/TODO json-table/_work/OLD/src/css/table.module.css +154 -0
  36. package/src/web-components/TODO json-table/_work/OLD/src/css/utility.module.css +9 -0
  37. package/src/web-components/TODO json-table/_work/OLD/src/icons/false.svg +1 -0
  38. package/src/web-components/TODO json-table/_work/OLD/src/icons/search-arrows.svg +1 -0
  39. package/src/web-components/TODO json-table/_work/OLD/src/icons/true.svg +1 -0
  40. package/src/web-components/TODO json-table/_work/OLD/src/index.js +56 -0
  41. package/src/web-components/TODO json-table/_work/OLD/src/js/default-columns-data-types.js +172 -0
  42. package/src/web-components/TODO json-table/_work/OLD/src/js/defaults.js +156 -0
  43. package/src/web-components/TODO json-table/_work/OLD/src/js/info-section.js +31 -0
  44. package/src/web-components/TODO json-table/_work/OLD/src/js/listeners.js +17 -0
  45. package/src/web-components/TODO json-table/_work/OLD/src/js/main-builder.js +26 -0
  46. package/src/web-components/TODO json-table/_work/OLD/src/js/parse-params.js +121 -0
  47. package/src/web-components/TODO json-table/_work/OLD/src/js/set-column-classname.js +22 -0
  48. package/src/web-components/TODO json-table/_work/OLD/src/js/table-builder.js +64 -0
  49. package/src/web-components/TODO json-table/_work/OLD/src/js/table-foot.js +8 -0
  50. package/src/web-components/TODO json-table/_work/OLD/src/js/table-head.js +47 -0
  51. package/src/web-components/TODO json-table/_work/OLD/src/js/table-row.js +83 -0
  52. package/src/web-components/TODO json-table/_work/OLD/src/js/utilities.js +5 -0
  53. package/src/web-components/TODO json-table/_work/__json-table-react/index.js +4 -0
  54. package/src/web-components/TODO json-table/_work/__json-table-react/src/build-page-array.js +73 -0
  55. package/src/web-components/TODO json-table/_work/__json-table-react/src/columns-data-types.js +73 -0
  56. package/src/web-components/TODO json-table/_work/__json-table-react/src/defaults.js +50 -0
  57. package/src/web-components/TODO json-table/_work/__json-table-react/src/download-excel.js +156 -0
  58. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-className.js +19 -0
  59. package/src/web-components/TODO json-table/_work/__json-table-react/src/set-download-filename.js +17 -0
  60. package/src/web-components/TODO json-table/_work/__json-table-react/src/table-to-csv.js +48 -0
  61. package/src/web-components/TODO json-table/_work/archived/table-to-csv.js +48 -0
  62. package/src/web-components/TODO json-table/_work/arrow.svg +3 -0
  63. package/src/web-components/TODO json-table/_work/da decidere/get-cell-data.js +18 -0
  64. package/src/web-components/TODO json-table/_work/download-button.js +29 -0
  65. package/src/web-components/TODO json-table/_work/download-excel.js +155 -0
  66. package/src/web-components/TODO json-table/_work/pagination-array-builder.js +73 -0
  67. package/src/web-components/TODO json-table/_work/pagination.js +37 -0
  68. package/src/web-components/TODO json-table/_work/set-download-filename.js +19 -0
  69. package/src/web-components/TODO json-table/_work/table-info.js +24 -0
  70. package/src/web-components/TODO json-table/demo/README.md +66 -0
  71. package/src/web-components/TODO json-table/demo/assets/link-simple.svg +1 -0
  72. package/src/web-components/TODO json-table/demo/demo-data/json-static-table-demo-data.js +512 -0
  73. package/src/web-components/TODO json-table/demo/demo.css +32 -0
  74. package/src/web-components/TODO json-table/demo/demo.js +24 -0
  75. package/src/web-components/TODO json-table/demo/js/demo-ajax-table.js +165 -0
  76. package/src/web-components/TODO json-table/demo/js/demo-static-table.js +180 -0
  77. package/src/web-components/TODO json-table/demo/webpack-modules/css-rules.mjs +122 -0
  78. package/src/web-components/TODO json-table/demo/webpack-modules/get-jsConfig-aliases.mjs +33 -0
  79. package/src/web-components/TODO json-table/demo/webpack-modules/svg-rules.mjs +108 -0
  80. package/src/web-components/TODO json-table/demo/webpack-modules/svgo.config.mjs +26 -0
  81. package/src/web-components/TODO json-table/demo/webpack.config.mjs +333 -0
  82. package/src/web-components/TODO json-table/docs/custom-props-list.md +74 -0
  83. package/src/web-components/TODO json-table/docs-builder/create-css-custom-props-doc.mjs +157 -0
  84. package/src/web-components/TODO json-table/docs-builder/src/custom-props-end.md +6 -0
  85. package/src/web-components/TODO json-table/docs-builder/src/custom-props-start.md +29 -0
  86. package/src/web-components/TODO json-table/src/TODO.md +1 -0
  87. package/src/web-components/TODO json-table/src/__json-table-react/build-page-array.js +73 -0
  88. package/src/web-components/TODO json-table/src/__json-table-react/columns-data-types.js +73 -0
  89. package/src/web-components/TODO json-table/src/__json-table-react/defaults.js +50 -0
  90. package/src/web-components/TODO json-table/src/__json-table-react/download-excel.js +156 -0
  91. package/src/web-components/TODO json-table/src/__json-table-react/set-className.js +19 -0
  92. package/src/web-components/TODO json-table/src/__json-table-react/set-download-filename.js +17 -0
  93. package/src/web-components/TODO json-table/src/__json-table-react/table-to-csv.js +48 -0
  94. package/src/web-components/TODO json-table/src/css/custom-media.css +16 -0
  95. package/src/web-components/TODO json-table/src/css/icons.module.css +22 -0
  96. package/src/web-components/TODO json-table/src/css/info-section.module.css +78 -0
  97. package/src/web-components/TODO json-table/src/css/main-builder.module.css +6 -0
  98. package/src/web-components/TODO json-table/src/css/table.module.css +172 -0
  99. package/src/web-components/TODO json-table/src/css/utility.module.css +9 -0
  100. package/src/web-components/TODO json-table/src/icons/arrow-down-bold.svg +1 -0
  101. package/src/web-components/TODO json-table/src/icons/false.svg +1 -0
  102. package/src/web-components/TODO json-table/src/icons/true.svg +1 -0
  103. package/src/web-components/TODO json-table/src/index.js +125 -0
  104. package/src/web-components/TODO json-table/src/js/default-columns-data-types.js +172 -0
  105. package/src/web-components/TODO json-table/src/js/defaults.js +510 -0
  106. package/src/web-components/TODO json-table/src/js/get-ajax-data.js +72 -0
  107. package/src/web-components/TODO json-table/src/js/info-section.js +39 -0
  108. package/src/web-components/TODO json-table/src/js/init-ajax-table.js +30 -0
  109. package/src/web-components/TODO json-table/src/js/init-static-table.js +18 -0
  110. package/src/web-components/TODO json-table/src/js/main-builder.js +87 -0
  111. package/src/web-components/TODO json-table/src/js/parse-data-row.js +123 -0
  112. package/src/web-components/TODO json-table/src/js/parse-params.js +118 -0
  113. package/src/web-components/TODO json-table/src/js/set-search-listener.js +62 -0
  114. package/src/web-components/TODO json-table/src/js/set-sort-listeners.js +115 -0
  115. package/src/web-components/TODO json-table/src/js/static-data-sorting.js +23 -0
  116. package/src/web-components/TODO json-table/src/js/table-builder.js +45 -0
  117. package/src/web-components/TODO json-table/src/js/table-row.js +43 -0
  118. package/src/web-components/TODO json-table/src/js/table-tfoot.js +9 -0
  119. package/src/web-components/TODO json-table/src/js/table-thead.js +91 -0
  120. package/src/web-components/TODO json-table/src/js/update-info.js +42 -0
  121. package/src/web-components/TODO json-table/src/js/utilities.js +5 -0
  122. package/src/web-components/s-datatable-component/s-datatable-component.js +2 -1
  123. package/src/web-components/s-datatable-component/src/parse-cols.js +2 -1
@@ -0,0 +1,194 @@
1
+ # Unsplash page
2
+
3
+ > This repository will soon be integrated with [minimo](https://github.com/massimo-cassandro/minimo)
4
+
5
+ **demo:** <https://massimo-cassandro.github.io/unsplash-page/demo>
6
+
7
+ Single page with random photo from [Unsplash](https://unsplash.com/) to display some messages (useful for error pages).
8
+
9
+ This component comes from some experiments I did with the Unsplash API. The initial purpose was to display more appealing error pages, but you can use it for any use.
10
+
11
+ For best results, it is advisable to display images from a photo collection prepared on Unsplash. The demos in this repository use my collection ["World"](https://unsplash.com/collections/3660951/world).
12
+
13
+ You need to create a server script to retrieve the JSON data of a random image from Unsplash (see [Get a Random Photo](https://unsplash.com/documentation#get-a-random-photo) on Unsplash API docs).
14
+
15
+ The script also implements [BlurHash](https://blurha.sh/), to show a placeholder of the image until it loads.
16
+
17
+ For more details and examples take a look at:
18
+
19
+ * <https://unsplash.com/developers>
20
+ * [A Random Image Slideshow With Unsplash and React](https://betterprogramming.pub/a-random-image-slideshow-with-unsplash-and-react-1b6aee698652)
21
+ * [Unsplash Random Photo 1](https://github.com/massimo-cassandro/area-test/tree/main/2023-03-unsplash-random-photo-1)
22
+ * [Random Unsplash Photos Slideshow](https://github.com/massimo-cassandro/area-test/tree/main/2023-05-unsplash-random-photo-2)
23
+ * [A Split Image Effect in React](https://medium.com/better-programming/a-split-image-effect-in-react-beb2baa3fe5f) and [split image](https://github.com/massimo-cassandro/area-test/tree/main/2023-07-split-image)
24
+
25
+
26
+ The SVG icons used in the script are from [Phosphor Icon](https://phosphoricons.com/). At the moment it is not possible to use different ones without modifying the source code.
27
+
28
+ ## Installation
29
+
30
+ Install from NPM:
31
+
32
+ ```bash
33
+ npm i -S @massimo-cassandro/unsplash-page blurhash
34
+ ```
35
+
36
+ Fro info about **blurhash**: <https://www.npmjs.com/package/blurhash>.
37
+
38
+ ## Running a local demo
39
+
40
+ Launch a php server (php needed for data proxy), then go to the `demo` dir:
41
+
42
+ ```bash
43
+ php -S localhost:8000
44
+ ```
45
+
46
+ and then open `http://localhost:8000/demo/`.
47
+
48
+ ## Use
49
+
50
+ Demo: <https://massimo-cassandro.github.io/unsplash-page/demo/vanilla-js/index.html>
51
+
52
+
53
+ Add to your script:
54
+
55
+ ```javascript
56
+ import { unsplashPageJS } from '@massimo-cassandro/unsplash-page';
57
+
58
+
59
+ unsplashPageJS({
60
+ targetElement : document.getElementById('root'),
61
+ className : 'class',
62
+ unsplashDataUrl : 'url',
63
+ utmSource : 'source',
64
+ title : 'Message title',
65
+ text : 'This is the message <strong>text</strong>',
66
+ backLink : '<a href="link/to/home">Back to home</a>',
67
+ hidePhotoLink : true,
68
+ cssModules : false,
69
+ cssModulesObj : null
70
+ });
71
+ ```
72
+
73
+ where:
74
+
75
+ * `className`, `unsplashDataUrl`, `utmSource` and `hidePhotoLink` correspond exactly to what is described in the React version
76
+ * `title`, `text` and `backLink` are like the previous ones, but in this case they are always strings
77
+ * `targetElement`: The DOM element in which to insert the necessary markup
78
+ * `cssModules`: Set to true if your bundler uses CSS Modules (default `false`)
79
+ * `cssModulesObj`: If you are using CSS Modules, assign to these parameter the imported styles object (see below).
80
+
81
+ ### CSS
82
+ The JS file does not include any CSS, to maintain maximum flexibility of use.
83
+
84
+ Then you can plug your CSS into the html (like I did in the demo) or manage it with Rollup, Webpack etc.
85
+
86
+ If you are using CSS modules, you need to share the parsed CSS object with the script so that the processed class names can be used:
87
+
88
+
89
+ ```javascript
90
+ import styles from '@massimo-cassandro/unsplash-page/src/unsplash-page.module.css';
91
+
92
+ unsplashPageJS({
93
+ /* ... */
94
+ cssModules : true,
95
+ cssModulesObj : styles
96
+ });
97
+ ```
98
+
99
+ ### SVG icons
100
+
101
+ SVG icons are imported into the script, both in the React and Vanilla JS versions.
102
+
103
+ In the latter, they need to be managed by your bundler to ensure they load correctly. In the demo, I used [@rollup/plugin-image](https://www.npmjs.com/package/@rollup/plugin-image) to import them as base64. Since they are very small, this seems to be the simplest solution.
104
+
105
+
106
+ ## CSS customization
107
+
108
+ You can customize the CSS (fonts, colors, etc.) using some CSS custom properties.
109
+
110
+ You need to provide them as a separate CSS file to change the default settings.
111
+
112
+ Below you can see the list of properties set with their default values: simply reset the ones you want to change and ignore the others.
113
+
114
+ You can do this by setting variables in the `:root` element, or you can narrow their scope to the component container by assigning it a class (thru the `className` parameter) and then using it in you CSS.
115
+
116
+ For a complete list of all custom properties see `src/unsplash-page.modules.css`;
117
+
118
+ ```css
119
+ /* needed if your script doesn't embed the css file */
120
+ @import '@massimo-cassandro/unsplash-page/src/unsplash-page.module.css';
121
+
122
+ .your-custom-class { /* or :root */
123
+
124
+ /* your css custom props */
125
+ }
126
+ ```
127
+
128
+ ## Using http error codes
129
+
130
+ Using HTTP Error Codes from your server can be a clever way to use this component.
131
+
132
+ First, get the error code from your server (404, 500, etc.), for example by setting it as a `data` attribute somewhere, then pass it to the script that implements UnsplashPage.
133
+ Matching the errorCode with an object of predefinited titles and text, can do the trick:
134
+
135
+
136
+ ```javascript
137
+ const myErrorCode = +document.body.dataset.errorCode || 500;
138
+
139
+ const errorTypes = {
140
+ 403: {
141
+ title: 'Oops… You can’t access this page',
142
+ // title: 'Ops… Non puoi accedere a questa pagina',
143
+ text: null
144
+ },
145
+ 404: {
146
+ title: 'Oops… This page does not exist',
147
+ // title: 'Ops… Questa pagina non esiste',
148
+ text: null
149
+ },
150
+ 500: {
151
+ title: 'Oops… An error has occurred',
152
+ // title: 'Ops… Si è verificato un errore',
153
+ text: null
154
+ },
155
+ 503: {
156
+ title: 'Sorry, this site is temporarily under maintenance',
157
+ // title: 'Siamo spiacenti, il sito è temporaneamente in manutenzione',
158
+ text: null
159
+ }
160
+ };
161
+
162
+ unsplashPageJS({
163
+ /* ... */
164
+ title: errorTypes[myErrorCode].title,
165
+ text: errorTypes[myErrorCode].text,
166
+ backLink: myErrorCode !== 503? <a href="link/to/home">Back to home</a> : null
167
+
168
+ });
169
+ ```
170
+
171
+ ## Use with React
172
+ The previous version of UP contained a React version of the script, but, to simplify maintenance and achieve maximum flexibility of use, I now prefer to use a React wrapper of the Vanilla JS script: you can find a template of the file in the `react` folder.
173
+
174
+ The sample uses [React Router](https://reactrouter.com) to display error messages based on server results.
175
+
176
+ In the same folder, you can find the previous, unmantained, React version,
177
+
178
+ ## Images breakpoints & sizes
179
+
180
+ Images are uploaded at different sizes using the [Unsplash API](https://unsplash.com/documentation#dynamically-resizable-images). Other than a few differences, CSS media query breakpoints are the same as those in [Bootstrap 5](https://getbootstrap.com/docs/5.3/layout/breakpoints/).
181
+
182
+ The following table reports the image size for each breakpoint:
183
+
184
+
185
+ | BS5 breakpoint | xs | sm | md | lg | xl | xxl |
186
+ |------------------------------|:-----:|:--------:|:---------:|:----------:|:-----------:|:------:|
187
+ | Page width | < 576 | 576 -767 | 768 - 991 | 992 - 1199 | 1200 - 1399 | >=1400 |
188
+ | img width | 576 | 768 | 992 | 1200 | 1400 | 1920 |
189
+ | img height (16/9) | 324 | 432 | 558 | 675 | 788 | 1080 |
190
+ | img height (4/3) | 432 | 576 | 744 | 900 | 1050 | 1440 |
191
+ | img height (9/21, portrait) | 1344 | | | | | |
192
+ | img height (21/9, landscape) | 247 | | | | | |
193
+
194
+ Sizes and breakpoints are defined in the `img-breakpoints.js` file.
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ * 1.0.0 (29 nov 2023) - First Release
4
+ * 2.0.0 (30 apr 2024) - Dropped react version and sass
5
+ * 2.1.0 (04 mar 2025) - Separazione regole css per reset body tag
@@ -0,0 +1,15 @@
1
+ import { unsplashPageJS } from '../src/unsplash-page.js';
2
+
3
+ unsplashPageJS({
4
+ targetElement : document.getElementById('root'),
5
+ unsplashDataUrl : window.location.origin.match('localhost')!== null ?
6
+ 'http://localhost:8000/demo/demo-data.php' // local test
7
+ : 'https://primominuto.altervista.org/proxy/getUnsplashPhotos.php'
8
+ ,
9
+ utmSource : 'vanilla-js-test',
10
+ title : 'Message title',
11
+ text : 'This is the message <strong>text</strong>',
12
+ backLink : '<a href="https://github.com/massimo-cassandro/unsplash-page">Back to repository home</a>',
13
+ hidePhotoLink : true,
14
+ cssModulesObj : null
15
+ });
@@ -0,0 +1,26 @@
1
+ import terser from '@rollup/plugin-terser';
2
+ import node_resolve from '@rollup/plugin-node-resolve';
3
+ import image from '@rollup/plugin-image';
4
+
5
+ import p from '../package.json' assert { type: 'json' };
6
+
7
+ export default [
8
+ {
9
+ input: './demo/demo.js',
10
+ plugins: [
11
+ node_resolve(),
12
+ // commonjs(),
13
+ image(),
14
+ terser({ compress: { passes: 2 } }),
15
+ ],
16
+ output: [
17
+ {
18
+ file: './demo/unsplash-page-demo.min.js',
19
+ format: 'iife',
20
+ sourcemap: true,
21
+ banner: `/*! Unsplash Page v.${p.version} - Massimo Cassandro ${new Date().toLocaleString('en-EN', {
22
+ year: 'numeric', month: 'long', day: 'numeric' })} */`
23
+ }
24
+ ]
25
+ }
26
+ ];
@@ -0,0 +1,3 @@
1
+ /*! Unsplash Page v.2.0.2 - Massimo Cassandro May 1, 2024 */
2
+ !function(){"use strict";const t=[{name:"xxl",mq:"(min-width: 1400px)",w:1920,h:1080,dpr2:!1},{name:"xl",mq:"(min-width: 1200px) and (max-width: 1399px)",w:1400,h:788,dpr2:!1},{name:"lg",mq:"(min-width: 992px) and (max-width: 1199px)",w:1200,h:675,dpr2:!1},{name:"md",ar:"16/9",mq:"(min-width: 768px) and (max-width: 991px)",w:992,h:558,dpr2:!0},{name:"sm",ar:"16/9",mq:"(min-width: 576px) and (max-width: 767px)",w:768,h:432,dpr2:!0},{name:"xs-portrait",ar:"16/9",mq:"(orientation: portrait) and (max-width: 575px)",w:324,h:576,dpr2:!0},{name:"xs-landscape",ar:"16/9",mq:"(orientation: landscape) and (max-width: 575px)",w:576,h:324,dpr2:!0}];var e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],a=t=>{let a=0;for(let c=0;c<t.length;c++){let r=t[c];a=83*a+e.indexOf(r)}return a},c=t=>{let e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},r=t=>{let e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.trunc(12.92*e*255+.5):Math.trunc(255*(1.055*Math.pow(e,.4166666666666667)-.055)+.5)},n=(t,e)=>(t=>t<0?-1:1)(t)*Math.pow(Math.abs(t),e),s=class extends Error{constructor(t){super(t),this.name="ValidationError",this.message=t}},l=t=>{let e=t>>8&255,a=255&t;return[c(t>>16),c(e),c(a)]},o=(t,e)=>{let a=Math.floor(t/361),c=Math.floor(t/19)%19,r=t%19;return[n((a-9)/9,2)*e,n((c-9)/9,2)*e,n((r-9)/9,2)*e]};!function(e){const c=["targetElement","unsplashDataUrl","utmSource","title"];e={targetElement:null,className:null,unsplashDataUrl:null,utmSource:null,title:null,text:null,backLink:null,hidePhotoLink:!0,cssModulesObj:null,...e};try{if(c.map((t=>e[t])).filter((t=>null!==t&&""!==t)).length!==c.length)throw new Error(`I parametri ${c.map((t=>`\`${t}\``)).join(",")} sono obbligatori`);const n=t=>e.cssModulesObj?e.cssModulesObj[t]:t;e.targetElement.innerHTML=`<div class="${n("upContainer")+(e.className?` ${e.className}`:"")}"></div>`;const i=e.targetElement.querySelector("."+n("upContainer"));i.innerHTML=`<div class="${n("upLoaderWrapper")}"><div class="${n("upLoader")}"></div></div>`,async function(t){t={unsplash_data_url:null,...t};try{if(!t.unsplash_data_url)throw new Error("Unsplash data url must be defined");return await(async()=>{const e=await fetch(t.unsplash_data_url);if(!e.ok)throw console.error("Ajax error on: "+t.unsplash_data_url),console.error(e),new Error(`Loading error: ${e.status}`);return await e.json()})().then((t=>({id:t.id,color:t.color,width:t.width,height:t.height,alt_description:t.alt_description,date:t.created_at,base_url:t.urls.raw,unsplash_url:t.links.html,author:t.user.name??t.user.username,author_profile:t.user.links.html,blur_hash:t.blur_hash,image_description:(()=>{let e=t.location.name,a=t.description??t.alt_description;return t.description&&e&&(e=new RegExp(e,"i").test(a)?null:e),[a,e].filter((t=>null!=t)).join(" / ")})()})))}catch(t){console.error(t)}}({unsplash_data_url:e.unsplashDataUrl}).then((c=>{const h=((t,e,c,n)=>{(t=>{if(!t||t.length<6)throw new s("The blurhash string must be at least 6 characters");let e=a(t[0]),c=Math.floor(e/9)+1,r=e%9+1;if(t.length!==4+2*r*c)throw new s(`blurhash length mismatch: length is ${t.length} but it should be ${4+2*r*c}`)})(t),n|=1;let i=a(t[0]),h=Math.floor(i/9)+1,u=i%9+1,p=(a(t[1])+1)/166,d=new Array(u*h);for(let e=0;e<d.length;e++)if(0===e){let c=a(t.substring(2,6));d[e]=l(c)}else{let c=a(t.substring(4+2*e,6+2*e));d[e]=o(c,p*n)}let m=4*e,g=new Uint8ClampedArray(m*c);for(let t=0;t<c;t++)for(let a=0;a<e;a++){let n=0,s=0,l=0;for(let r=0;r<h;r++)for(let o=0;o<u;o++){let i=Math.cos(Math.PI*a*o/e)*Math.cos(Math.PI*t*r/c),h=d[o+r*u];n+=h[0]*i,s+=h[1]*i,l+=h[2]*i}let o=r(n),i=r(s),p=r(l);g[4*a+0+t*m]=o,g[4*a+1+t*m]=i,g[4*a+2+t*m]=p,g[4*a+3+t*m]=255}return g})(c.blur_hash,i.offsetWidth,i.offsetHeight),u=document.createElement("canvas");u.className=n("upCanvas"),u.width=i.offsetWidth,u.height=i.offsetHeight;const p=u.getContext("2d"),d=p.createImageData(i.offsetWidth,i.offsetHeight);d.data.set(h),p.putImageData(d,0,0),i.insertAdjacentElement("afterbegin",u);const m=["avif","webp","pjpg"];i.insertAdjacentHTML("beforeend","<picture>"+t.map(((e,a)=>{const r=a===t.length-1;return m.map((t=>{const a=t===m.at(-1);let s=c.base_url+(/\?/.test(c.base_url)?"&":"?")+"fit=crop&crop=focalpoint&q=60"+`&w=${e.w}&h=${e.h}`+`&fm=${t}`;return r&&a?`<img class="${n("unsplashPhoto")}" src="${s}" srcset="${s}${e.dpr2?` 1x, ${s}&dpr=2 2x`:""}" alt="${c.alt_description??`${c.author} / Unsplash`}" width="${e.w}" height="${e.h}">`:`<source srcset="${s}${e.dpr2?` 1x, ${s}&dpr=2 2x`:""}" `+(a?"":`type="image/${t}" `)+`media="${e.mq}" `+`width="${e.w}" height="${e.h}">`})).join("")})).join("")+"</picture>"),i.querySelector("."+n("unsplashPhoto")).onload=()=>{i.querySelector("."+n("upLoaderWrapper")).remove(),i.classList.add(n("show")),i.insertAdjacentHTML("beforeend",`<div class="${n("upMessageBox")}">\n <div class="${n("upMessage")}">\n <h1>${e.title}</h1>\n ${e.text?`<p>${e.text}</p>`:""}\n ${e.backLink?`<p class="${n("upBackLink")}">${e.backLink}</p>`:""}\n\n <div class="${n("upArrowWrapper")}" role="button">\n <img src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='black' viewBox='0 0 256 256'%3e%3cpath d='M152%2c80v96H120v48L24%2c128l96-96V80Z' opacity='0.2'%3e%3c/path%3e%3cpath d='M152%2c72H128V32a8%2c8%2c0%2c0%2c0-13.66-5.66l-96%2c96a8%2c8%2c0%2c0%2c0%2c0%2c11.32l96%2c96A8%2c8%2c0%2c0%2c0%2c128%2c224V184h24a8%2c8%2c0%2c0%2c0%2c8-8V80A8%2c8%2c0%2c0%2c0%2c152%2c72Zm-8%2c96H120a8%2c8%2c0%2c0%2c0-8%2c8v28.69L35.31%2c128%2c112%2c51.31V80a8%2c8%2c0%2c0%2c0%2c8%2c8h24Zm80-88v96a8%2c8%2c0%2c0%2c1-16%2c0V80a8%2c8%2c0%2c0%2c1%2c16%2c0Zm-32%2c0v96a8%2c8%2c0%2c0%2c1-16%2c0V80a8%2c8%2c0%2c0%2c1%2c16%2c0Z'%3e%3c/path%3e%3c/svg%3e" alt="Icona freccia">\n </div>\n </div>\n\n <div class="${n("upCredits")}">\n <em>${c.image_description}</em>\n <span>Photo\n <a href="${c.author_profile}?utmSource=${e.utmSource}&utm_medium=referral">\n ${c.author} / Unsplash\n </a>\n </span>\n </div>\n </div>\n <div class="${n("unsplashPhotoLink")}${e.hidePhotoLink?` ${n("upShowOnHover")}`:""}">\n <a href="${c.unsplash_url}?utm_source=${e.utmSource}&utm_medium=referral" target="_blank" rel="noopener noreferrer">\n <img src="data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' fill='black' viewBox='0 0 256 256'%3e%3cpath d='M224%2c56V178.06l-39.72-39.72a8%2c8%2c0%2c0%2c0-11.31%2c0L147.31%2c164%2c97.66%2c114.34a8%2c8%2c0%2c0%2c0-11.32%2c0L32%2c168.69V56a8%2c8%2c0%2c0%2c1%2c8-8H216A8%2c8%2c0%2c0%2c1%2c224%2c56Z' opacity='0.2'%3e%3c/path%3e%3cpath d='M216%2c40H40A16%2c16%2c0%2c0%2c0%2c24%2c56V200a16%2c16%2c0%2c0%2c0%2c16%2c16H216a16%2c16%2c0%2c0%2c0%2c16-16V56A16%2c16%2c0%2c0%2c0%2c216%2c40Zm0%2c16V158.75l-26.07-26.06a16%2c16%2c0%2c0%2c0-22.63%2c0l-20%2c20-44-44a16%2c16%2c0%2c0%2c0-22.62%2c0L40%2c149.37V56ZM40%2c172l52-52%2c80%2c80H40Zm176%2c28H194.63l-36-36%2c20-20L216%2c181.38V200ZM144%2c100a12%2c12%2c0%2c1%2c1%2c12%2c12A12%2c12%2c0%2c0%2c1%2c144%2c100Z'%3e%3c/path%3e%3c/svg%3e" alt="Icona immagine" />\n </a>\n </div>`),i.querySelector("."+n("upArrowWrapper")).addEventListener("click",(t=>{t.target.closest(`.${n("upMessage")}`).classList.toggle(n("hidden"))}),!1)}}))}catch(t){console.error(t)}}({targetElement:document.getElementById("root"),unsplashDataUrl:null!==window.location.origin.match("localhost")?"http://localhost:8000/demo/demo-data.php":"https://primominuto.altervista.org/proxy/getUnsplashPhotos.php",utmSource:"vanilla-js-test",title:"Message title",text:"This is the message <strong>text</strong>",backLink:'<a href="https://github.com/massimo-cassandro/unsplash-page">Back to repository home</a>',hidePhotoLink:!0,cssModulesObj:null})}();
3
+ //# sourceMappingURL=unsplash-page-demo.min.js.map
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Generates a random password using uppercase letters and digits,
3
+ * excluding visually ambiguous characters (O, I, 0).
4
+ *
5
+ * @param {number} [min_length=8] - Minimum password length (matches `minlength` attribute).
6
+ * @returns {string} The generated password.
7
+ */
8
+ export function generatePwd(min_length = 8) {
9
+
10
+ let chars='ABCDEFGHJKLMNPQRSTUVWXYZ123456789',
11
+ charsNum = chars.length,
12
+ min_lenght = min_length || 8,
13
+ pwd = '', i, x;
14
+
15
+ for( x = 0; x < min_lenght; x++ ) {
16
+ i = Math.floor(Math.random() * charsNum);
17
+ pwd += chars.charAt(i);
18
+ }
19
+
20
+ return pwd;
21
+
22
+ }
@@ -0,0 +1,67 @@
1
+ # jsonTable
2
+
3
+ HTML table generator from Ajax or static JSON. It can also add advanced functionality to static tables.
4
+
5
+ > NB: **In this first version, the static json option is disabled**.
6
+
7
+ > NB: **This first release only provides the json-table source code, not the compiled version. To use ikson-tabble you'll need to process the code with your own bundler, which must be able to process SVG files and CSS modules (if you want to use the default css files).**.
8
+
9
+
10
+ It allows you to create a table from a JSON file or stream, adding some extra features: search, sorting, pagination, etc.
11
+
12
+ It's inspired by [jQuery Datatable](https://datatables.net/), but has far fewer features. However, it's much easier to use, highly customizable, and doesn't require jQuery.
13
+
14
+ In most cases, you simply need to modify the configuration parameters and CSS properties.
15
+
16
+ For more advanced customizations, you'll need to use the code in the `src` directory and customize the various CSS files.
17
+
18
+
19
+ [Changelog](changelog.txt).
20
+
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm i -D @massimo-cassandro/json-table
26
+ ```
27
+
28
+ ## Use
29
+
30
+ Create a *JsonTable*:
31
+
32
+ ```javascript
33
+ const jt = new JsonTable(table_params, optional_custom_data_types_obj);
34
+ ```
35
+
36
+ where: <!-- TODO --> TODO
37
+
38
+
39
+ ## Use with `data-*` attributes and automatic rendering
40
+
41
+ <!-- TODO --> TODO
42
+
43
+ ## Customizing CSS
44
+ You can customize the default CSS setting using custom properties; for more details, see [Custom CSS Properties List](docs/custom-props-list.md).
45
+
46
+ ## Generate elements params object
47
+ <!-- TODO --> TODO
48
+
49
+ ## Custom events
50
+
51
+ The library dispatches a custom event `jt:ready` on the table container when the instance is ready. The event `detail` property contains an object like `{ jsonTable: instance }`.
52
+
53
+ To make the event easier to catch, the library dispatches it asynchronously using `Promise.resolve().then(...)`. This schedules the dispatch in the microtask queue (that is, the callback runs after the current call stack finishes, but before the next macrotask). As a result, listeners registered immediately after calling `new JsonTable(...)` will still be able to intercept the event.
54
+
55
+ Example — register the listener before instantiation for maximum safety:
56
+
57
+ ```javascript
58
+ const container = document.getElementById('mytable');
59
+ container.addEventListener('jt:ready', e => { console.log(e.detail.jsonTable); });
60
+ new JsonTable({ container, ... });
61
+ ```
62
+
63
+
64
+ ## Limitations
65
+
66
+ * Only one `tr` element is allowed for `thead`
67
+
@@ -0,0 +1,12 @@
1
+ # json-table
2
+
3
+ ## core
4
+ * meccanismo acquisizione json per grandi quantità di records basato sulla paginazione
5
+ * opzione `condition` per renderizzare o meno una colonna (vedi opzione `hidden` di simple-datatable)
6
+ * in generale ogni elemento (cella) deve acceyyare contenuti in forma di stringa plain text, stringa html, elemento DOM, array domBuilder...
7
+ * possibilità di utilizzare un campo solo a fini di ricerca senza mostrarlo nella tabella
8
+ * possibilità di definire valori per ordinamento e ricerca diversi da quelli effettivamente presenti nel josn. Il default dovrebbe corrispondere a quanto mostrato
9
+
10
+ ## altro
11
+ * nei campi di tipo numerico prevedere classi di default text-end e text-numeric o classe ad hoc socrascrivibile
12
+ * footerRender: possibilità di funzioni predefinite per calcoli base (somma, media ecc) di una determinata colonna
@@ -0,0 +1,69 @@
1
+ # CSS Custom Properties List
2
+
3
+ List of all CSS custom properties used in css files.
4
+
5
+ If you don't want to use a new CSS, you can use the default one, just by customizing the values ​​of the custom properties.
6
+
7
+ You can set the custom values ​​in the `:root` element, or directly in the json-table wrapper by assigning it a specific class:
8
+
9
+ In the json-table config:
10
+
11
+ ```javascript
12
+ new jsonTable({
13
+ container: '...',
14
+ mainWrapperExtraClassName: 'my-custom-classname',
15
+
16
+ /* other config parameters */
17
+ });
18
+ ```
19
+
20
+ In your css:
21
+
22
+ ```css
23
+ .my-custom-classname {
24
+ --jt-search-input-bg-color: #efefef;
25
+ --jt-search-input-border-color: #666;
26
+
27
+ /* other custom properties */
28
+ }
29
+
30
+ ```
31
+
32
+
33
+ ## Properties
34
+ | Property | Default value | Description |
35
+ | :--- | :--- | :--- |
36
+ | `--jt-bool-false-color` | `#c00` | color for _false_ boolean values icon |
37
+ | `--jt-bool-icon-size` | `1.3em` | boolean icons size |
38
+ | `--jt-bool-true-color` | `#0a7202` | color for _true_ boolean values icon |
39
+ | `--jt-placeholder-color` | `#999` | color for placeholder text |
40
+ | `--jt-search-input-bg-color` | `transparent` | background color for search input element |
41
+ | `--jt-search-input-border-color` | `#999` | border color for search input element |
42
+ | `--jt-search-input-font-size` | `clamp(.85rem, 6vw, 1rem)` | font size for search input element |
43
+ | `--jt-search-input-padding-x` | `.75rem` | left and right padding for search input element |
44
+ | `--jt-search-input-padding-y` | `.375rem` | top and bottom padding for search input element |
45
+ | `--jt-search-input-text-color` | `currentColor` | text color for search input element |
46
+ | `--jt-table-border-color` | `#999` | table `border-color` |
47
+ | `--jt-table-border-style` | `solid` | table `border-style` |
48
+ | `--jt-table-border-width` | `1px` | table `border-width` |
49
+ | `--jt-table-caption-side` | `bottom` | table `caption-side` (`top` or `bottom`) |
50
+ | `--jt-table-cell-bg-color` | `#fff` | td `background-color` |
51
+ | `--jt-table-cell-border-color` | `#999` | td `border-color` |
52
+ | `--jt-table-cell-border-style` | `solid` | td `border-style` |
53
+ | `--jt-table-cell-border-width` | `1px` | td `border-width` |
54
+ | `--jt-table-cell-padding-x` | `.5rem` | left and right padding for td |
55
+ | `--jt-table-cell-padding-y` | `.5rem` | top and bottom padding for td |
56
+ | `--jt-table-cell-vertical-border-width` | `1px` | td `border-width` for vertical borders |
57
+ | `--jt-table-margin-block` | `1rem` | top and bottom margins for table |
58
+ | `--jt-table-tfoot-cell-bg-color` | `#f4f4f4` | background color for tfoot cells |
59
+ | `--jt-table-tfoot-cell-border-color` | `#666` | border color for tfoot cells (applied to the bottom border of the first tr of tfoot) |
60
+ | `--jt-table-tfoot-cell-border-width` | `3px` | border width for tfoot cells (applied to the bottom border of the first tr of tfoot) |
61
+ | `--jt-table-thead-cell-bg-color` | `#e4e4e4` | background color for thead cells |
62
+ | `--jt-table-thead-cell-border-color` | `#666` | border color for thead cells (applied to the bottom border of the last tr of thead) |
63
+ | `--jt-table-thead-cell-border-width` | `3px` | border width for thead cells (applied to the bottom border of the last tr of thead) |
64
+ | `--jt-wrapper-margin-block` | `1rem` | top and bottom margins for main wrapper element |
65
+
66
+ ## Notes
67
+ * `--jt-search-input-*`: you'll need that custom properties only if the `search`
68
+ parameter is set to `true` (default) and the `searchInputClassName`
69
+ (custom classname for search input, default `true`) parameter is not set.
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ /* eslint-disable no-console */
3
+
4
+ import * as fs from 'fs';
5
+ import * as path from 'path';
6
+ import { styleText } from 'node:util';
7
+
8
+ // parse all css files and extract all custom properties
9
+ // then create a markdown document adding a description for each property
10
+
11
+ // tke key is a camelCase version of the css property name (without leading --jt-)
12
+ const descriptions = {
13
+
14
+ boolFalseColor : 'color for _false_ boolean values icon',
15
+ boolIconSize : 'boolean icons size',
16
+ boolTrueColor : 'color for _true_ boolean values icon',
17
+ placeholderColor : 'color for placeholder text',
18
+ searchInputBgColor : 'background color for search input element',
19
+ searchInputBorderColor : 'border color for search input element',
20
+ searchInputFontSize : 'font size for search input element',
21
+ searchInputPaddingX : 'left and right padding for search input element',
22
+ searchInputPaddingY : 'top and bottom padding for search input element',
23
+ searchInputTextColor : 'text color for search input element',
24
+ tableBorderColor : 'table `border-color`',
25
+ tableBorderStyle : 'table `border-style`',
26
+ tableBorderWidth : 'table `border-width`',
27
+ tableCaptionSide : 'table `caption-side` (`top` or `bottom`)',
28
+ tableCellBgColor : 'td `background-color`',
29
+ tableCellBorderColor : 'td `border-color`',
30
+ tableCellBorderStyle : 'td `border-style`',
31
+ tableCellBorderWidth : 'td `border-width`',
32
+ tableCellPaddingX : 'left and right padding for td',
33
+ tableCellPaddingY : 'top and bottom padding for td',
34
+ tableCellVerticalBorderWidth : 'td `border-width` for vertical borders',
35
+ tableMarginBlock : 'top and bottom margins for table',
36
+ tableTfootCellBgColor : 'background color for tfoot cells',
37
+ tableTfootCellBorderColor : 'border color for tfoot cells (applied to the bottom border of the first tr of tfoot)',
38
+ tableTfootCellBorderWidth : 'border width for tfoot cells (applied to the bottom border of the first tr of tfoot)',
39
+ tableTheadCellBgColor : 'background color for thead cells',
40
+ tableTheadCellBorderColor : 'border color for thead cells (applied to the bottom border of the last tr of thead)',
41
+ tableTheadCellBorderWidth : 'border width for thead cells (applied to the bottom border of the last tr of thead)',
42
+ wrapperMarginBlock : 'top and bottom margins for main wrapper element',
43
+
44
+ };
45
+
46
+
47
+ const props = {},
48
+ css_folder = '../src/css',
49
+ target_file = path.resolve(new URL('.', import.meta.url).pathname, '../docs/custom-props-list.md'),
50
+ show_props_list = false // to create the descriptions
51
+ ;
52
+
53
+
54
+ try {
55
+
56
+ fs.readdirSync(css_folder).forEach(file => {
57
+ if(file.endsWith('.css')) {
58
+ const css_content = fs.readFileSync(path.join(css_folder, file), 'utf8'),
59
+ matches = css_content.matchAll(/var\(--jt-(?<name>(.*?))(?:, (?<def>(.*?))\)[ ;])/g);
60
+
61
+ for (const match of matches) {
62
+ if(match?.groups) {
63
+
64
+ if(props[match.groups.name]) {
65
+ if(props[match.groups.name].default !== match.groups.def) {
66
+ throw new Error( `Default values of the same property cannot be different (${match.groups.name})` );
67
+ }
68
+ props[match.groups.name].files.push(file);
69
+
70
+ } else {
71
+ props[match.groups.name] = {
72
+ files: [file],
73
+ default: match.groups.def
74
+ };
75
+ }
76
+
77
+ }
78
+ }
79
+ }
80
+ });
81
+
82
+ let descriptionsKeys = '';
83
+
84
+ const table = '## Properties\n' +
85
+ '| Property | Default value | Description |\n' +
86
+ '| :--- | :--- | :--- |\n' +
87
+ Object.keys(props).toSorted((a, b) => a.localeCompare(b)).map(key => {
88
+
89
+ const descrKey = key.replace(/-([a-z])/g, function (part) { return part[1].toUpperCase(); });
90
+
91
+ if(show_props_list) {
92
+ descriptionsKeys +=`${descrKey}: '${descriptions[descrKey]??''}',\n`;
93
+ }
94
+
95
+ return `| \`--jt-${key}\` | \`${props[key].default}\` | ${descriptions[descrKey] ?? ''} |`;
96
+ }).join('\n')
97
+ ;
98
+
99
+ const start_text = fs.readFileSync( './src/custom-props-start.md', 'utf8' ),
100
+ end_text = fs.readFileSync( './src/custom-props-end.md', 'utf8' );
101
+
102
+ fs.writeFileSync( target_file, start_text + '\n\n' + table + '\n\n' + end_text );
103
+
104
+ if(show_props_list) {
105
+ console.log('\n' +styleText(['yellow'], descriptionsKeys) + '\n'); // lista chiavi
106
+ }
107
+
108
+ console.log( '\n' + styleText(['bgGreen'], ' Done ' ) + '\n' );
109
+
110
+ } catch(e) {
111
+ let message = styleText('bgRed', ` ${e} `);
112
+ console.error( '\n' + message + '\n');
113
+ }
@@ -0,0 +1,4 @@
1
+ ## Notes
2
+ * `--jt-search-input-*`: you'll need that custom properties only if the `search`
3
+ parameter is set to `true` (default) and the `searchInputClassName`
4
+ (custom classname for search input, default `true`) parameter is not set.
@@ -0,0 +1,30 @@
1
+ # CSS Custom Properties List
2
+
3
+ List of all CSS custom properties used in css files.
4
+
5
+ If you don't want to use a new CSS, you can use the default one, just by customizing the values ​​of the custom properties.
6
+
7
+ You can set the custom values ​​in the `:root` element, or directly in the json-table wrapper by assigning it a specific class:
8
+
9
+ In the json-table config:
10
+
11
+ ```javascript
12
+ new jsonTable({
13
+ container: '...',
14
+ mainWrapperExtraClassName: 'my-custom-classname',
15
+
16
+ /* other config parameters */
17
+ });
18
+ ```
19
+
20
+ In your css:
21
+
22
+ ```css
23
+ .my-custom-classname {
24
+ --jt-search-input-bg-color: #efefef;
25
+ --jt-search-input-border-color: #666;
26
+
27
+ /* other custom properties */
28
+ }
29
+
30
+ ```
@@ -0,0 +1,22 @@
1
+ .icon { /* applied to the td */
2
+ text-align: center;
3
+
4
+ svg {
5
+ position: relative;
6
+ top: -3px;
7
+ width: var(--jt-bool-icon-size, 1.3em);
8
+ aspect-ratio: 1;
9
+ fill: none;
10
+ stroke: currentColor;
11
+ stroke-linecap: round;
12
+ stroke-linejoin: round;
13
+ stroke-width: 8px;
14
+ }
15
+
16
+ &.true {
17
+ color: var(--jt-bool-true-color, #0a7202);
18
+ }
19
+ &.false {
20
+ color: var(--jt-bool-false-color, #c00);
21
+ }
22
+ }
@@ -0,0 +1,42 @@
1
+ .info {
2
+ display: flex;
3
+ align-items: center;
4
+
5
+ }
6
+ .resultInfo {
7
+ flex: 1;
8
+ }
9
+ .search {
10
+ flex: 0 1 15rem;
11
+ }
12
+ .searchInput {
13
+ display: block;
14
+ width: 100%;
15
+ padding: var(--jt-search-input-padding-y, .375rem) var(--jt-search-input-padding-x, .75rem);
16
+ font-size: var(--jt-search-input-font-size, clamp(.85rem, 6vw, 1rem));
17
+ color: var(--jt-search-input-text-color, currentColor);
18
+ background-color: var(--jt-search-input-bg-color, transparent);
19
+ border: 1px solid var(--jt-search-input-border-color, #999);
20
+ border-radius: .4rem;
21
+
22
+ &:focus {
23
+ outline: 2px solid hsl(192deg 84% 63% / .7);
24
+ }
25
+ &::placeholder {
26
+ color: var(--jt-placeholder-color, #999);
27
+ opacity: 1;
28
+ }
29
+ &[disabled] {
30
+ opacity: .6;
31
+ &::placeholder {
32
+ font-style: italic;
33
+ }
34
+ }
35
+
36
+ /* @media (prefers-color-scheme: dark) {
37
+ border-color: var(--jt -search-input-border-color-dark, #ecede8);
38
+ &:focus {
39
+ outline-color: var(--green-2);
40
+ }
41
+ } */
42
+ }
@@ -0,0 +1,4 @@
1
+ .wrapper {
2
+ display: block;
3
+ margin-block: var(--jt-wrapper-margin-block, 1rem);
4
+ }