@supersoniks/concorde 3.2.0 → 3.2.2

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 (216) hide show
  1. package/build-infos.json +1 -1
  2. package/concorde-core.bundle.js +101 -101
  3. package/concorde-core.es.js +187 -182
  4. package/dist/concorde-core.bundle.js +101 -101
  5. package/dist/concorde-core.es.js +187 -182
  6. package/index.html +0 -0
  7. package/package.json +1 -1
  8. package/scripts/create-search.js +0 -0
  9. package/scripts/generate-routes.js +0 -0
  10. package/src/core/_types/types.ts +0 -0
  11. package/src/core/components/functional/date/date.ts +0 -0
  12. package/src/core/components/functional/functional.ts +0 -0
  13. package/src/core/components/functional/if/if.md +0 -0
  14. package/src/core/components/functional/if/if.test.ts +0 -0
  15. package/src/core/components/functional/list/list.spec.ts +0 -0
  16. package/src/core/components/functional/queue/queue.demo.ts +0 -0
  17. package/src/core/components/functional/router/router.demo.ts +0 -0
  18. package/src/core/components/functional/router/router.md +0 -0
  19. package/src/core/components/functional/router/router.spec.ts +0 -0
  20. package/src/core/components/functional/router/router.ts +0 -0
  21. package/src/core/components/functional/sonic-scope/sonic-scope.ts +0 -0
  22. package/src/core/components/functional/states/states.demo.ts +0 -0
  23. package/src/core/components/functional/states/states.md +0 -0
  24. package/src/core/components/functional/states/states.spec.ts +0 -0
  25. package/src/core/components/functional/states/states.ts +0 -0
  26. package/src/core/components/functional/submit/submit.ts +0 -0
  27. package/src/core/components/functional/translation/translation.ts +0 -0
  28. package/src/core/components/ui/_css/scroll.ts +0 -0
  29. package/src/core/components/ui/_css/shadow.ts +0 -0
  30. package/src/core/components/ui/_css/size.ts +0 -0
  31. package/src/core/components/ui/_css/type.ts +0 -0
  32. package/src/core/components/ui/alert/alert.md +0 -0
  33. package/src/core/components/ui/alert/alert.ts +0 -0
  34. package/src/core/components/ui/alert-messages/alert-messages.md +0 -0
  35. package/src/core/components/ui/badge/badge.md +0 -0
  36. package/src/core/components/ui/badge/badge.ts +0 -0
  37. package/src/core/components/ui/button/button.md +0 -0
  38. package/src/core/components/ui/button/button.ts +0 -0
  39. package/src/core/components/ui/captcha/captcha.md +0 -0
  40. package/src/core/components/ui/captcha/captcha.ts +0 -0
  41. package/src/core/components/ui/card/card-footer.ts +0 -0
  42. package/src/core/components/ui/card/card-header-descripton.ts +0 -0
  43. package/src/core/components/ui/card/card-header.ts +0 -0
  44. package/src/core/components/ui/card/card-main.ts +0 -0
  45. package/src/core/components/ui/card/card.md +0 -0
  46. package/src/core/components/ui/card/card.ts +0 -0
  47. package/src/core/components/ui/divider/divider.ts +0 -0
  48. package/src/core/components/ui/form/checkbox/checkbox.md +0 -0
  49. package/src/core/components/ui/form/checkbox/checkbox.ts +0 -0
  50. package/src/core/components/ui/form/css/form-control.ts +0 -0
  51. package/src/core/components/ui/form/fieldset/fieldset.ts +0 -0
  52. package/src/core/components/ui/form/fieldset/legend-description.ts +0 -0
  53. package/src/core/components/ui/form/fieldset/legend.ts +0 -0
  54. package/src/core/components/ui/form/form-layout/form-layout.md +0 -0
  55. package/src/core/components/ui/form/input/input.md +0 -0
  56. package/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -0
  57. package/src/core/components/ui/form/radio/radio.md +0 -0
  58. package/src/core/components/ui/form/radio/radio.ts +0 -0
  59. package/src/core/components/ui/form/select/select.md +0 -0
  60. package/src/core/components/ui/form/switch/switch.md +0 -0
  61. package/src/core/components/ui/form/switch/switch.ts +0 -0
  62. package/src/core/components/ui/form/textarea/textarea.ts +0 -0
  63. package/src/core/components/ui/icon/icons.ts +14 -3
  64. package/src/core/components/ui/image/image.md +0 -0
  65. package/src/core/components/ui/image/image.ts +0 -0
  66. package/src/core/components/ui/loader/loader.md +0 -0
  67. package/src/core/components/ui/loader/loader.ts +0 -0
  68. package/src/core/components/ui/loader/styles/fixed.ts +0 -0
  69. package/src/core/components/ui/loader/styles/inline.ts +0 -0
  70. package/src/core/components/ui/menu/menu.ts +0 -0
  71. package/src/core/components/ui/modal/modal-actions.ts +0 -0
  72. package/src/core/components/ui/modal/modal-close.ts +0 -0
  73. package/src/core/components/ui/modal/modal-subtitle.ts +0 -0
  74. package/src/core/components/ui/modal/modal-title.ts +0 -0
  75. package/src/core/components/ui/modal/modal.md +0 -0
  76. package/src/core/components/ui/pop/pop.md +0 -0
  77. package/src/core/components/ui/progress/progress.ts +0 -0
  78. package/src/core/components/ui/table/table-tbody.ts +0 -0
  79. package/src/core/components/ui/table/table-th.ts +0 -0
  80. package/src/core/components/ui/table/table.ts +0 -0
  81. package/src/core/components/ui/theme/theme-collection/core-variables.ts +0 -0
  82. package/src/core/components/ui/theme/theme-collection/dark.ts +0 -0
  83. package/src/core/components/ui/theme/theme-collection/light.ts +0 -0
  84. package/src/core/components/ui/theme/theme.ts +0 -0
  85. package/src/core/components/ui/toast/toast-item.ts +0 -0
  86. package/src/core/components/ui/tooltip/tooltip.ts +0 -0
  87. package/src/core/components/ui/ui.ts +0 -0
  88. package/src/core/directives/DataProvider.ts +0 -0
  89. package/src/core/directives/Wording.ts +0 -0
  90. package/src/core/mixins/Fetcher.ts +0 -0
  91. package/src/core/mixins/FormCheckable.ts +0 -0
  92. package/src/core/mixins/TemplatesContainer.ts +0 -0
  93. package/src/core/utils/HTML.ts +0 -0
  94. package/src/core/utils/LocationHandler.ts +0 -0
  95. package/src/core/utils/Objects.ts +0 -0
  96. package/src/core/utils/Utils.ts +0 -0
  97. package/src/core/utils/api.ts +0 -0
  98. package/src/core/utils/route.spec.ts +0 -0
  99. package/src/core/utils/route.ts +0 -0
  100. package/src/docs/code.ts +0 -0
  101. package/src/docs/docs.ts +0 -0
  102. package/src/docs/header/header.ts +0 -0
  103. package/src/docs/layout.ts +0 -0
  104. package/src/docs/navigation/navigation.ts +0 -0
  105. package/src/docs/search/docs-search.json +0 -0
  106. package/src/docs/search/markdown-renderer.ts +0 -0
  107. package/src/docs/search/page.ts +0 -0
  108. package/src/docs/search/search.ts +0 -0
  109. package/src/docs/tailwind/css/tailwind.css +0 -0
  110. package/src/docs/tailwind/css.d.ts +0 -0
  111. package/src/index.ts +0 -0
  112. package/src/test-utils/TestUtils.ts +0 -0
  113. package/src/tsconfig-model.json +0 -0
  114. package/src/tsconfig.json +294 -294
  115. package/tailwind.config.js +0 -0
  116. package/templates-test.html +0 -0
  117. package/vite/config.js +0 -0
  118. package/docs/assets/index-C0K6xugr.css +0 -1
  119. package/docs/assets/index-Dgl1lJQo.js +0 -4861
  120. package/docs/css/docs.css +0 -0
  121. package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
  122. package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
  123. package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
  124. package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
  125. package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
  126. package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
  127. package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
  128. package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
  129. package/docs/fonts/ClashGrotesk-Light.eot +0 -0
  130. package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
  131. package/docs/fonts/ClashGrotesk-Light.woff +0 -0
  132. package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
  133. package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
  134. package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
  135. package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
  136. package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
  137. package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
  138. package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
  139. package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
  140. package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
  141. package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
  142. package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
  143. package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
  144. package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
  145. package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
  146. package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
  147. package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
  148. package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
  149. package/docs/img/concorde-icon.svg +0 -5
  150. package/docs/img/concorde-logo.svg +0 -1
  151. package/docs/img/concorde.png +0 -0
  152. package/docs/img/concorde_def.png +0 -0
  153. package/docs/img/concorde_seuil.png.webp +0 -0
  154. package/docs/img/concorde_seuil_invert.png +0 -0
  155. package/docs/img/paul_metrand.jpg +0 -0
  156. package/docs/img/paul_metrand_xs.jpg +0 -0
  157. package/docs/index.html +0 -93
  158. package/docs/src/core/components/functional/date/date.md +0 -290
  159. package/docs/src/core/components/functional/fetch/fetch.md +0 -117
  160. package/docs/src/core/components/functional/if/if.md +0 -16
  161. package/docs/src/core/components/functional/list/list.md +0 -199
  162. package/docs/src/core/components/functional/mix/mix.md +0 -41
  163. package/docs/src/core/components/functional/queue/queue.md +0 -87
  164. package/docs/src/core/components/functional/router/router.md +0 -129
  165. package/docs/src/core/components/functional/sdui/default-library.json +0 -108
  166. package/docs/src/core/components/functional/sdui/example.json +0 -99
  167. package/docs/src/core/components/functional/sdui/sdui.md +0 -356
  168. package/docs/src/core/components/functional/states/states.md +0 -87
  169. package/docs/src/core/components/functional/submit/submit.md +0 -83
  170. package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
  171. package/docs/src/core/components/functional/value/value.md +0 -35
  172. package/docs/src/core/components/ui/alert/alert.md +0 -121
  173. package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
  174. package/docs/src/core/components/ui/badge/badge.md +0 -127
  175. package/docs/src/core/components/ui/button/button.md +0 -182
  176. package/docs/src/core/components/ui/captcha/captcha.md +0 -24
  177. package/docs/src/core/components/ui/card/card.md +0 -97
  178. package/docs/src/core/components/ui/divider/divider.md +0 -35
  179. package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -104
  180. package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
  181. package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
  182. package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
  183. package/docs/src/core/components/ui/form/input/input.md +0 -167
  184. package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -131
  185. package/docs/src/core/components/ui/form/radio/radio.md +0 -84
  186. package/docs/src/core/components/ui/form/select/select.md +0 -97
  187. package/docs/src/core/components/ui/form/switch/switch.md +0 -84
  188. package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
  189. package/docs/src/core/components/ui/group/group.md +0 -75
  190. package/docs/src/core/components/ui/icon/icon.md +0 -125
  191. package/docs/src/core/components/ui/icon/icons.json +0 -1
  192. package/docs/src/core/components/ui/image/image.md +0 -107
  193. package/docs/src/core/components/ui/link/link.md +0 -43
  194. package/docs/src/core/components/ui/loader/loader.md +0 -67
  195. package/docs/src/core/components/ui/menu/menu.md +0 -288
  196. package/docs/src/core/components/ui/modal/modal.md +0 -123
  197. package/docs/src/core/components/ui/pop/pop.md +0 -96
  198. package/docs/src/core/components/ui/progress/progress.md +0 -63
  199. package/docs/src/core/components/ui/table/table.md +0 -455
  200. package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
  201. package/docs/src/docs/_core-concept/overview.md +0 -57
  202. package/docs/src/docs/_core-concept/subscriber.md +0 -76
  203. package/docs/src/docs/_getting-started/concorde-outside.md +0 -143
  204. package/docs/src/docs/_getting-started/create-a-component.md +0 -137
  205. package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -174
  206. package/docs/src/docs/_getting-started/pubsub.md +0 -150
  207. package/docs/src/docs/_getting-started/start.md +0 -39
  208. package/docs/src/docs/_getting-started/theming.md +0 -91
  209. package/docs/src/docs/search/docs-search.json +0 -3917
  210. package/docs/src/tag-list.json +0 -1
  211. package/docs/src/tsconfig-model.json +0 -23
  212. package/docs/src/tsconfig.json +0 -918
  213. package/docs/svg/regular/plane.svg +0 -1
  214. package/docs/svg/solid/plane.svg +0 -1
  215. package/php/get-challenge.php +0 -34
  216. package/php/some-service.php +0 -42
@@ -1,356 +0,0 @@
1
- # SDUI
2
-
3
- ## What is SDUI?
4
-
5
- SDUI stands for `Server Driven User Interfaces`.
6
- Basically, it generates a user interface based on a JSON SDUI Descriptor.
7
-
8
- ### Subscriber extension:
9
-
10
- SDUI extends the mixin [Subscriber](#docs/_core-concept/subscriber.md/subscriber).
11
- This means that you must set a dataProvider with an id pointing to the publisher that will hold your SDUI Descriptor.
12
- This also means that it has a reactive property named `props` that you can set with the JSON SDUI Descriptor in order to configure it.
13
-
14
- ### Fetcher extension:
15
-
16
- SDUI extends the mixin Fetcher as [Fetch](#core/components/functional/fetch/fetch.md/fetch) and [List](#core/components/functional/list/list.md/list).
17
-
18
- In this case, it will parse the JSON coming from the request.
19
- The JSON must comply with the SDUI descriptor format.
20
-
21
- As a fetcher, invalidating the publisher or updating the endpoint will trigger a new fetch and update accordingly.
22
-
23
- ### Rendering:
24
-
25
- It has no shadowdom, and its display style is set to `contents`, so an empty SDUI has the fewest impact on the layout.
26
-
27
- ## SDUI descriptor
28
-
29
- ### TypeScript definition:
30
- <sonic-code language="typescript">
31
- <template>
32
- export type SDUIDescriptor = {
33
- js?: Array&lt;string&gt;;
34
- css?: Array&lt;string&gt;;
35
- library?: Record&lt;string, SDUINode&gt;;
36
- nodes?: Array&lt;SDUINode&gt;;
37
- };
38
- </template>
39
- </sonic-code>
40
-
41
- ### Meaning of the keys:
42
-
43
- * **js**: An array of URLs pointing to JavaScript files to load.
44
- * **css**: An array of URLs pointing to CSS files to load.
45
- * **library**: A record of SDUINode definitions intended to be used as a model for other nodes. The keys of the record can be used as the libraryKey of the node. This node will then specialize the model with its own descriptor.
46
- * **nodes**: An array of SDUINode descriptors. Each SDUINode will result in an HTMLElement added to the root of the component.
47
-
48
- ## SDUINode
49
-
50
- ### Descriptor
51
-
52
- An SDUINode represents an HTMLElement.
53
-
54
- TypeScript definition:
55
-
56
- <sonic-code language="typescript">
57
- <template>
58
- export type SDUINode = {
59
- markup?: string;
60
- tagName?: string;
61
- attributes?: Record&lt;string, string&gt;;
62
- nodes?: Array&lt;SDUINode&gt;;
63
- innerHTML?: string;
64
- prefix?: string;
65
- suffix?: string;
66
- libraryKey?: string;
67
- contentElementSelector?: string;
68
- parentElementSelector?: string;
69
- };
70
- </template>
71
- </sonic-code>
72
-
73
- Summary of properties:
74
- * **markup**: Use it if you prefer to define your node entirely using an HTML string.
75
- * **tagName**: The tag name of the HTML element.
76
- * **attributes**: A string key/value pair storing each attribute name/value of the HTML element created.
77
- * **nodes**: An array of SDUINode descriptors. The children of the HTMLElement are created this way.
78
- * **innerHTML**: The inner HTML of the current node is defined here if needed.
79
- * **prefix**: Use it if you want to wrap the component with some HTML string in conjunction with the suffix.
80
- * **suffix**: Use it if you want to wrap the component with some HTML string in conjunction with the prefix.
81
- * **libraryKey**: An identifier that points to an SDUINode to be used as a model for this node.
82
- * **contentElementSelector**: For SDUINodes defined in the library only. It is a CSS selector that defines where child nodes are added.
83
- * **parentElementSelector**: If the current node, as a future child, has a `parentElementSelector` attribute, it is added to the node corresponding to the associated CSS selector rather than directly to the element.
84
-
85
- ### Markup
86
- Use it if you prefer to define your node entirely using an HTML string.
87
-
88
- <sonic-code>
89
- <template>
90
- <sonic-sdui
91
- dataProvider="sdui-markup-example"
92
- props='{
93
- "nodes":[
94
- {
95
- "markup":"keep shouting <sonic-badge>foo</sonic-badge> <sonic-badge>bar</sonic-badge> !"
96
- }
97
- ]}'
98
- ></sonic-sdui>
99
- </template>
100
- </sonic-code>
101
-
102
- ### Tag name
103
- Here we use the field `tagName` of SDUINode to create an element with tag name `sonic-input`.
104
-
105
- <sonic-code>
106
- <template>
107
- <sonic-sdui
108
- dataProvider="sdui-tagName-example"
109
- props='{
110
- "nodes":[
111
- {
112
- "tagName":"sonic-input"
113
- }
114
- ]}'
115
- ></sonic-sdui>
116
- </template>
117
- </sonic-code>
118
-
119
- ### Attributes
120
- A string key/value pair storing each attribute name/value of the HTML element created.
121
- As no tag name is defined, a div element is created.
122
- Here we define the style attribute to create a tiny red square.
123
-
124
- <sonic-code>
125
- <template>
126
- <sonic-sdui
127
- dataProvider="sdui-attributes-example"
128
- props='{
129
- "nodes":[{
130
- "attributes":{
131
- "style":"width:50px;height:10px;background:red;"
132
- }
133
- }]
134
- }'
135
- ></sonic-sdui>
136
- </template>
137
- </sonic-code>
138
-
139
- ### Nodes
140
- Children of the current node can be added using the field `nodes` recursively.
141
-
142
- <sonic-code>
143
- <template>
144
- <sonic-sdui
145
- dataProvider="sdui-nodes-example"
146
- props='{
147
- "nodes":[{
148
- "nodes":[
149
- {"innerHTML":"A"},
150
- {
151
- "prefix":"B",
152
- "nodes":[
153
- {"innerHTML":"👉 B.1"},
154
- {"innerHTML":"👉 B.2"}
155
- ]
156
- }
157
- ]
158
- }]
159
- }'
160
- ></sonic-sdui>
161
- </template>
162
- </sonic-code>
163
-
164
- ### InnerHTML
165
- As no tag name is defined, a div element is created, and then we use `innerHTML` to add content to it.
166
-
167
- <sonic-code>
168
- <template>
169
- <sonic-sdui
170
- dataProvider="sdui-html-example"
171
- props='{
172
- "nodes":[{
173
- "innerHTML":"keep shouting <sonic-badge>foo</sonic-badge> <sonic-badge>bar</sonic-badge> !"
174
- }]
175
- }'
176
- ></sonic-sdui>
177
- </template>
178
- </sonic-code>
179
-
180
- ### Prefix and suffix
181
- Use them if you want to wrap the component with some HTML string.
182
-
183
- <sonic-code>
184
- <template>
185
- <sonic-sdui
186
- dataProvider="sdui-prefixSuffix-example"
187
- props='{
188
- "nodes":[{
189
- "prefix":"👇",
190
- "suffix":"☝️",
191
- "innerHTML":"The node content"
192
- }]
193
- }'
194
- ></sonic-sdui>
195
- </template>
196
- </sonic-code>
197
-
198
- ### Library key and contentElementSelector
199
- The libraryKey of SDUINode is an identifier that points to an SDUINode description in the library to be used as a model for this node.
200
-
201
- Note that the SDUI has a default library containing some basic component definitions useful for form declaration (see default-library.json).
202
-
203
- This example uses the library key `submit` which points to a `sonic-submit` containing a button also coming from the library.
204
-
205
- The element named `button` in the library is a `sonic-button` of type `success` containing a check icon as a prefix.
206
-
207
- Since the `submit` library element contains an attribute `contentElementSelector` with the value `sonic-button`, the "injected content" is put inside the button.
208
-
209
- We used `innerHTML` for the sake of simplicity, but you can use nodes to add any complex content.
210
-
211
- <sonic-code>
212
- <template>
213
- <sonic-sdui dataProvider="sdui-library-example" props='
214
- {
215
- "nodes":[
216
- {
217
- "libraryKey":"submit",
218
- "innerHTML":"Injected content"
219
- }
220
- ]
221
- }
222
- '></sonic-sdui>
223
- </template>
224
- </sonic-code>
225
-
226
- ### parentElementSelector
227
-
228
- This special field lets you inject the content at any place in the HTML flow already set inside the parent SDUI component by using a CSS selector.
229
-
230
- ⚠️ Note that it doesn't work with top-level nodes.
231
-
232
- <sonic-code>
233
- <template>
234
- <sonic-sdui dataProvider="sdui-parentElementSelector-example" props='
235
- {
236
- "nodes":[
237
- {
238
- "nodes":[
239
- {
240
- "prefix":"👇 Selected parent element",
241
- "suffix":"☝️ End of selected parent element",
242
- "tagName":"span"
243
- },
244
- {
245
- "parentElementSelector":"span",
246
- "innerHTML":"Content having a parentElementSelector attribute"
247
- }
248
- ]
249
- }
250
- ]
251
- }
252
- '></sonic-sdui>
253
- </template>
254
- </sonic-code>
255
-
256
- ### Fetch example:
257
-
258
- <sonic-code>
259
- <template>
260
- <sonic-sdui dataProvider="sdui-fetch-example" endPoint="/src/core/components/functional/sdui/example.json"></sonic-sdui>
261
- </template>
262
- </sonic-code>
263
-
264
- ## Transformers:
265
-
266
- The transformers let you transform the structure of the SDUI Descriptor into a new one before parsing and rendering it.
267
-
268
- To enable it, you must fill the `transformation` attribute of the component with a URL pointing to a Transform descriptor.
269
-
270
- <sonic-code language="typescript">
271
- <template>
272
- export type SDUITransformDescription = {
273
- library?: Record&lt;string, SDUINode&gt;;
274
- transforms: Array&lt;SDUITransformAction&gt;;
275
- };
276
- </template>
277
- </sonic-code>
278
-
279
- ### The library:
280
-
281
- Each key of the library will be merged with the current library in the SDUI Descriptor, by replacing or creating items library key by key.
282
-
283
- ### The transform actions:
284
-
285
- Each transform represents an action that will be done on the SDUI descriptor before the creation of the entire UI.
286
-
287
- <sonic-code language="typescript">
288
- <template>
289
- export type SDUITransformAction = {
290
- action: SDUITransformActionName;
291
- patterns?: Array&lt;SDUINode&gt;;
292
- after?: SDUINode;
293
- before?: SDUINode;
294
- in?: SDUINode;
295
- ui?: SDUINode;
296
- };
297
- </template>
298
- </sonic-code>
299
-
300
- The action that will be done is a verb:
301
-
302
- <sonic-code language="typescript">
303
- <template>
304
- export type SDUITransformActionName = "remap" | "unwrap" | "wrap" | "delete" | "insert" | "move";
305
- </template>
306
- </sonic-code>
307
-
308
- * **remap**: The properties (tagName, innerHTML, etc.) of the targeted SDUINode will be created/changed according to their presence in the `ui` (SDUINode) property of the transformAction.
309
- * **unwrap**: Replaces the targeted SDUINode in place with its children.
310
- * **wrap**: Groups all SDUINodes targeted by the patterns into the new SDUINode described in the `ui` prop of the transformAction.
311
- * **delete**: Deletes the targeted item.
312
- * **insert**: Inserts a new SDUINode described by the `ui` prop into the flow. The position of insertion depends on the presence of the attributes `before`, `after`, `in`, which is a pattern to target an existing SDUINode.
313
-
314
- ## Misc Tricks:
315
-
316
- ### sduiKey
317
-
318
- This is an HTML attribute to set on the component if needed. In this case, the component will not treat its props value directly as an SDUI descriptor. Internally, it will basically extract the SDUIDescriptor by doing something like this: `const sduiDescriptor = this.props[this.sduikey]`.
319
-
320
- ### messageKey
321
-
322
- This is an HTML attribute to set on the component if needed. In this case, the component will automatically create a `sonic-toast-message-subscriber` component. The data found in `props[messageKey]` will be treated as the data expected by the `sonic-toast-message-subscriber`. So, by respecting the format of data supported by this component, you will be able to show multiple toasts in the result of a request.
323
-
324
- Example of JSON with `messageKey`=`messages`:
325
- <sonic-code language="typescript">
326
- <template>
327
- {
328
- "messages": [{
329
- "content": "The product has been added to your cart",
330
- "status": "success",
331
- "type": "public"
332
- }]
333
- }
334
- </template>
335
- </sonic-code>
336
-
337
- ### library
338
-
339
- This is an HTML attribute to set on the component if needed. You can set a URL pointing to a JSON describing a library with the same structure as the library in the SDUIDescriptor. The component will simply override its library with the given one.
340
-
341
- ## Playground
342
-
343
- Here is a little playground to let you test some simple tricks.
344
-
345
- <sonic-code>
346
- <template>
347
- <sonic-textarea
348
- rows="10"
349
- onChange="SonicPublisherManager.get('sdui-playground').set(JSON.parse(this.value))"
350
- value='{"nodes":[{"tagName":"div", "innerHTML":"test"}]}'
351
- >
352
- </sonic-textarea>
353
- <sonic-sdui dataProvider="sdui-playground" props='{"nodes":[{"tagName":"div", "innerHTML":"test"}]}'>
354
- </sonic-sdui>
355
- </template>
356
- </sonic-code>
@@ -1,87 +0,0 @@
1
- # States
2
-
3
- ### sonic-states displays different states depending on the value of a sub-property of its dataProvider (data-path attribute in dot notation):
4
- * It loops over its child templates and tests if the regexp contained in the *data-value* attribute matches the value of the property
5
- * If so, the content of the corresponding template is displayed as a state.
6
- * If the attribute dataProviderExpression is provided the content is surrounded by a div:
7
- * The "dataProvider" attribute of this div is the result of calling the replace function on the property value with the regexp and dataproviderExpression as parameters.
8
- * The subscribers/fetch... of the template will refer to this dataProvider
9
- * You can also use url-pattern expressions for the route parameters, see the examples
10
- *
11
- **Examples**
12
- * With ma.property= 2 :
13
- * RegExp data-value = (\d+) and dataproviderExpression = /user/$1 the dataProvider attribute will be "/user/2"
14
- * url-pattern data-value = :id and dataproviderExpression = /user/:id the dataProvider attribute will be "/user/2
15
-
16
- ## Basic
17
-
18
- <sonic-code>
19
- <template>
20
- <div class="flex gap-2 items-center" formDataProvider="states-basic-example">
21
- <sonic-button radio name="selection" value="#home" checked size="xs">Home</sonic-button>
22
- <sonic-button radio name="selection" value="#about" size="xs">About</sonic-button>
23
- <sonic-button radio name="selection" value="#work" size="xs">Work</sonic-button>
24
- <sonic-button radio name="selection" value="#contact" size="xs">Contact</sonic-button>
25
- </div>
26
- <div class="text-center text-neutral-700 border rounded text-4xl my-6 p-3 ">
27
- <sonic-states dataProvider="states-basic-example" data-path="selection">
28
- <template data-value="#home">Home</template>
29
- <template data-value="#about">About</template>
30
- <template data-value="#work">Work</template>
31
- <template data-value="#contact">Contact</template>
32
- </sonic-states>
33
- </div>
34
- </template>
35
- </sonic-code>
36
-
37
- ## Regexp
38
-
39
- When using **capturing groups ()** the stored values are accessible via the **dataProviderExpression**
40
- **e.g.**, data-value="#couleur_<b class="text-danger">(\d+)</b>" => dataProviderExpression="api/unknown/<b class="text-danger">$1</b>"
41
-
42
- <sonic-code>
43
- <template>
44
- <div serviceURL="https://reqres.in">
45
- <sonic-list formDataProvider="states-regexp-example" fetch dataProvider="api/unknown" key="data" class="flex gap-2 items-center" >
46
- <template>
47
- <sonic-button radio size="xs" name="selection" data-bind ::value="#couleur_$id">
48
- <span data-bind ::inner-html="ucFirst|$name"></span>
49
- </sonic-button>
50
- </template>
51
- </sonic-list>
52
- <sonic-states dataProvider="states-regexp-example" data-path="selection">
53
- <template data-value="#couleur_(\d+)" dataProviderExpression="api/unknown/$1">
54
- <sonic-fetch>
55
- <input type="color" disabled data-bind ::value="$data.color" class=" w-full h-10 my-3" />
56
- </sonic-fetch>
57
- </template>
58
- </sonic-states>
59
- </div>
60
- </template>
61
- </sonic-code>
62
-
63
- ## Url-pattern
64
-
65
- Same as RegExp but using <a href="https://www.npmjs.com/package/url-pattern" target="_blank">url patterns</a>
66
- **e.g.**, data-value="#couleur_<b class="text-danger">:id</b>" => dataProviderExpression="api/unknown/<b class="text-danger">:id</b>"
67
-
68
- <sonic-code>
69
- <template>
70
- <div serviceURL="https://reqres.in">
71
- <sonic-list formDataProvider="states-regexp-example" fetch dataProvider="api/unknown" key="data" class="flex gap-2 items-center" >
72
- <template>
73
- <sonic-button radio size="xs" name="selection" data-bind ::value="#couleur_$id">
74
- <span data-bind ::inner-html="ucFirst|$name"></span>
75
- </sonic-button>
76
- </template>
77
- </sonic-list>
78
- <sonic-states dataProvider="states-regexp-example" data-path="selection">
79
- <template data-value="#couleur_:id" dataProviderExpression="api/unknown/:id">
80
- <sonic-fetch>
81
- <input type="color" disabled data-bind ::value="$data.color" class=" w-full h-10 my-3" />
82
- </sonic-fetch>
83
- </template>
84
- </sonic-states>
85
- </div>
86
- </template>
87
- </sonic-code>
@@ -1,83 +0,0 @@
1
- # Submit
2
-
3
- ## The submit element is used to send data to a rest service
4
- * The api is set up like a [fetcher](#core/components/functional/fetch/fetch.md/fetch).
5
- * The *formDataProvider* attribute points to the adress where the data is held by a publisher.
6
- * This attribute is also used by form elements such as *sonic-input*, or *sonic-select*, which fill this publisher with their *value* attribute according to their *name* attribute
7
- * The *method* attribute allows you to choose the sending method: *put/delete/post*, *post* being the default method.
8
- * If the *onClick* attribute is present, the data is sent when the content is clicked on
9
- * If the *onEnterKey* attribute is present, data is sent when the enter key of an element contained in the *sonic-submit* with focus is pressed
10
- * During sending, *sonic-submit* elements with the same *dataProvider* attribute have the *disabled="disabled "* property, which has the effect of disabling their content
11
- * The *clearedDataOnSuccess* attribute can be used to clear the data from the corresponding dataProvider when the call to the api has provided a result.
12
-
13
- ## Form example
14
- <sonic-code>
15
- <template>
16
- <sonic-scope
17
- serviceURL="https://reqres.in" dataProvider="api/register"
18
- formDataProvider="submit-example" submitResultDataProvider="submit-example-result"
19
- method="post"
20
- class="max-w-lg block"
21
- >
22
- <sonic-submit onEnterKey>
23
- <div class="grid grid-cols-2 gap-4 mb-4 ">
24
- <sonic-input required name="email" type="email" value="eve.holt@reqres.in"></sonic-input>
25
- <sonic-input required type="password" name="password" value="pistol"></sonic-input>
26
- </div>
27
- </sonic-submit>
28
- <sonic-submit onClick>
29
- <sonic-button type="success" class="w-full">Submit</sonic-button>
30
- </sonic-submit>
31
- </sonic-scope>
32
- </template>
33
- </sonic-code>
34
-
35
-
36
-
37
-
38
-
39
- ## Result handling example
40
-
41
- Result will show when something has been submit because the **dataprovider** used in this example is the same as the **submitResultDataProvider** used in the previous form.
42
- <sonic-code>
43
- <template>
44
- <div dataProvider="submit-example-result">
45
- <div>Id : <span data-bind ::inner-html="$id"></span></div>
46
- <div>Token : <span data-bind ::inner-html="$token"></span></div>
47
- <div data-bind ::inner-html="$error"></div>
48
- </div>
49
- </template>
50
- </sonic-code>
51
-
52
-
53
- ## dot notation
54
-
55
- You can write the folowing code where the name attribute is written in dot notation.
56
-
57
- <sonic-code>
58
- <template>
59
- <sonic-scope formDataProvider="submit-example-dot-notation">
60
- <div class="grid grid-cols-2 gap-4 mb-4 ">
61
- <sonic-input required name="email.value" type="email" value="eve.holt@reqres.in"></sonic-input>
62
- <sonic-input required type="password" name="details.password.value" value="pistol"></sonic-input>
63
- </div>
64
- </sonic-scope>
65
- </template>
66
- </sonic-code>
67
-
68
- The data will be stored in the following format:
69
-
70
- <sonic-code language="typescript">
71
- <template>
72
- {
73
- email: {
74
- value: "eve.holt@reqres.in",
75
- },
76
- details: {
77
- password: {
78
- value: "pistol",
79
- },
80
- },
81
- }
82
- </template>
83
- </sonic-code>
@@ -1,91 +0,0 @@
1
- # Subscriber
2
-
3
- La mixin Subscriber permet lier un composant à un publisher.
4
- La liaison à un publisher se fait via l'attribut *dataProvider* du composant qui représente ce que l'on obtient en appellant PublisherManager.get(dataProvider).
5
-
6
- Les propriétés du composant sont automatiquement remplies avec les propriétés du même nom dans les données du publisher.
7
-
8
- Le composant est automatiquement mis à jour lorsque les données du publisher sont mises à jour.
9
-
10
- ## DataProvider
11
-
12
- **Id** of the dataProvider that the component will **subscribe** to
13
-
14
- <sonic-code>
15
- <template>
16
- <sonic-subscriber dataProvider="id_that_the_subsriber_will_subscribe_to" debug>
17
- <sonic-button> custom dataProvider id</sonic-button>
18
- </sonic-subscriber>
19
- <sonic-subscriber debug>
20
- <sonic-button> default id : pageHTML</sonic-button>
21
- </sonic-subscriber>
22
- </template>
23
- </sonic-code>
24
-
25
- ## Props
26
-
27
- Data object (json) that will be passed to the dataProvider
28
-
29
- <sonic-code>
30
- <template>
31
- <sonic-subscriber props='{"data":"Hello world"}' debug>
32
- <sonic-button> Hover to see the data</sonic-button>
33
- </sonic-subscriber>
34
- </template>
35
- </sonic-code>
36
-
37
-
38
- ## Debug
39
-
40
- **Helper**, display the data held by the dataProvider in a floating div
41
-
42
- <sonic-code>
43
- <template>
44
- <sonic-subscriber debug>
45
- <sonic-button> see the dataProvider'data </sonic-button>
46
- </sonic-subscriber>
47
- </template>
48
- </sonic-code>
49
-
50
-
51
- ## NoAutofill
52
-
53
- <sonic-alert status="info">Docs coming soon</sonic-alert>
54
-
55
- ## PropertyMap
56
-
57
- <sonic-alert status="info">Docs coming soon</sonic-alert>
58
-
59
- Permet de mapper un nom de propriété de donnée source vers une propriété du subscriber à la volée
60
-
61
- ## BindPublisher
62
-
63
- <sonic-alert status="info">Docs coming soon</sonic-alert>
64
-
65
- On peut utiliser cette fonction pour lier un publisher spécifique au composant si besoin.
66
-
67
- ## instanceCounter
68
-
69
- <sonic-alert status="info">Docs coming soon</sonic-alert>
70
-
71
- ## Publisher
72
-
73
- <sonic-alert status="info">Docs coming soon</sonic-alert>
74
-
75
- ## Args
76
-
77
- <sonic-alert status="info">Docs coming soon</sonic-alert>
78
-
79
- ## NoShadowDom
80
-
81
- Par défaut on crée un shadow dom mais on peut demander à ne pas en avoir via cette propriété et un attribut associé.
82
- Cela se fait à l'initialisation uniquement et n'est pas modifiable lors de la vie du composant.
83
-
84
-
85
- ## Other attributes gathered from subscriber.stories.ts
86
-
87
- styles ??
88
- title ??
89
- _props ??
90
- onAssign ??
91
- defferedDebug ??
@@ -1,35 +0,0 @@
1
- # Value
2
-
3
- Simply shows a value from a data provider.
4
- You can target sub data value using dot syntax.
5
- The value reacts to changes.
6
-
7
- * Below is a form that helps you to set a value for the field "preference" in the data target with id "value-example"
8
- <sonic-code>
9
- <template>
10
- <div formDataProvider="value-example">
11
- which one do you prefer ?
12
- <sonic-radio name="preference" checked value="dogs"> Dogs</sonic-radio>
13
- <sonic-radio name="preference" value="cats"> Cats</sonic-radio>
14
- </div>
15
- </template>
16
- </sonic-code>
17
- * Then you can see live value of the preference using this code :
18
- <sonic-code>
19
- <template>
20
- I prefer <sonic-value dataProvider="value-example" key="preference"></sonic-value>
21
- </template>
22
- </sonic-code>
23
- * If you have more complex data like this
24
- <sonic-code>
25
- <template>
26
- <sonic-subscriber dataProvider="value-example-2" props='{"my":{"complex":[{"data":"👋 Hi There"}]}}'></sonic-subscriber>
27
- </template>
28
- </sonic-code>
29
- * You can target it with the dot syntax
30
- <sonic-code>
31
- <template>
32
- <sonic-value dataProvider="value-example-2" key="my.complex.0.data"></sonic-value>
33
- </template>
34
- </sonic-code>
35
-