@supersoniks/concorde 4.7.3 → 4.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.
- package/README.md +1 -1
- package/ai/AGENTS.md +4 -0
- package/ai/cursor/rules/concorde.mdc +11 -1
- package/ai/jetbrains/rules/concorde.md +8 -0
- package/ai/skills/concorde/SKILL.md +29 -2
- package/ai/skills/concorde-scope/SKILL.md +2 -2
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +289 -289
- package/concorde-core.es.js +4839 -4546
- package/dist/concorde-core.bundle.js +289 -289
- package/dist/concorde-core.es.js +4839 -4546
- package/dist/docs-mock-api-sw.js +19 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/dist/robots.txt +2 -0
- package/docs/assets/index-wyNMyWT9.js +11196 -0
- package/docs/docs-mock-api-sw.js +19 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +1 -1
- package/docs/robots.txt +2 -0
- package/package.json +9 -1
- package/public/docs-mock-api-sw.js +19 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/public/robots.txt +2 -0
- package/src/core/components/functional/example/example.ts +3 -3
- package/src/core/components/ui/captcha/captcha.md +0 -12
- package/src/core/components/ui/icon/icon.ts +17 -2
- package/src/core/components/ui/menu/menu.ts +12 -3
- package/src/core/decorators/api.post.spec.ts +293 -0
- package/src/core/decorators/api.spec.ts +7 -14
- package/src/core/decorators/api.ts +648 -15
- package/src/core/decorators/subscriber/bind.ts +13 -5
- package/src/core/decorators/subscriber/dynamicPath.spec.ts +53 -0
- package/src/core/decorators/subscriber/dynamicPath.ts +23 -1
- package/src/core/decorators/subscriber/handle.ts +3 -1
- package/src/core/decorators/subscriber/onAssign.ts +10 -2
- package/src/core/decorators/subscriber/publish.ts +12 -2
- package/src/core/utils/PublisherProxy.ts +95 -11
- package/src/core/utils/api.ts +72 -3
- package/src/core/utils/dpOptions.spec.ts +56 -0
- package/src/core/utils/endpoint.ts +3 -3
- package/src/decorators.ts +17 -1
- package/src/docs/_core-concept/dataFlow.md +9 -3
- package/src/docs/_decorators/bind.md +2 -2
- package/src/docs/_decorators/get.md +13 -4
- package/src/docs/_decorators/handle.md +5 -1
- package/src/docs/_decorators/on-assign.md +2 -0
- package/src/docs/_decorators/patch.md +45 -0
- package/src/docs/_decorators/post.md +93 -0
- package/src/docs/_decorators/publish.md +1 -1
- package/src/docs/_decorators/put.md +43 -0
- package/src/docs/_decorators/subscribe.md +4 -1
- package/src/docs/_directives/sub.md +1 -1
- package/src/docs/_getting-started/my-first-component.md +1 -1
- package/src/docs/_misc/api-configuration.md +3 -1
- package/src/docs/_misc/dataProviderKey.md +2 -2
- package/src/docs/_misc/dynamic-path.md +71 -0
- package/src/docs/_misc/endpoint.md +5 -3
- package/src/docs/components/docs-demo-sources.ts +102 -3
- package/src/docs/components/docs-lit-demo-raw.ts +2 -26
- package/src/docs/components/docs-lit-demo.ts +9 -42
- package/src/docs/components/docs-source-excerpt.ts +53 -0
- package/src/docs/components/docs-source-link.ts +24 -8
- package/src/docs/components/docs-source-raw.ts +34 -0
- package/src/docs/example/decorators-demo-geo.ts +2 -2
- package/src/docs/example/decorators-demo-post.ts +249 -0
- package/src/docs/example/decorators-demo-subscribe-publish-get-demos.ts +5 -5
- package/src/docs/example/decorators-demo.ts +1 -0
- package/src/docs/example/docs-api-config-demos.ts +5 -5
- package/src/docs/mock-api/router.ts +20 -0
- package/src/docs/navigation/navigation.ts +16 -0
- package/src/docs/search/docs-search.json +540 -15
- package/src/tsconfig.json +24 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/vite.config.mts +1 -1
- package/docs/assets/index-D9pxaQYK.js +0 -7508
- package/docs/src/core/components/functional/date/date.md +0 -290
- package/docs/src/core/components/functional/fetch/fetch.md +0 -125
- package/docs/src/core/components/functional/if/if.md +0 -9
- package/docs/src/core/components/functional/list/list.md +0 -65
- package/docs/src/core/components/functional/mix/mix.md +0 -41
- package/docs/src/core/components/functional/queue/queue.md +0 -72
- package/docs/src/core/components/functional/router/router.md +0 -94
- package/docs/src/core/components/functional/sdui/default-library.json +0 -108
- package/docs/src/core/components/functional/sdui/example.json +0 -99
- package/docs/src/core/components/functional/sdui/sdui.md +0 -356
- package/docs/src/core/components/functional/states/states.md +0 -87
- package/docs/src/core/components/functional/submit/submit.md +0 -114
- package/docs/src/core/components/functional/subscriber/subscriber.md +0 -91
- package/docs/src/core/components/functional/value/value.md +0 -35
- package/docs/src/core/components/ui/alert/alert.md +0 -121
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/docs/src/core/components/ui/badge/badge.md +0 -127
- package/docs/src/core/components/ui/button/button.md +0 -182
- package/docs/src/core/components/ui/captcha/captcha.md +0 -24
- package/docs/src/core/components/ui/card/card.md +0 -97
- package/docs/src/core/components/ui/divider/divider.md +0 -35
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -77
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +0 -129
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +0 -77
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +0 -44
- package/docs/src/core/components/ui/form/input/input.md +0 -142
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -133
- package/docs/src/core/components/ui/form/radio/radio.md +0 -57
- package/docs/src/core/components/ui/form/select/select.md +0 -71
- package/docs/src/core/components/ui/form/switch/switch.md +0 -57
- package/docs/src/core/components/ui/form/textarea/textarea.md +0 -65
- package/docs/src/core/components/ui/group/group.md +0 -75
- package/docs/src/core/components/ui/icon/icon.md +0 -125
- package/docs/src/core/components/ui/icon/icons.json +0 -1
- package/docs/src/core/components/ui/image/image.md +0 -107
- package/docs/src/core/components/ui/link/link.md +0 -43
- package/docs/src/core/components/ui/loader/loader.md +0 -55
- package/docs/src/core/components/ui/menu/menu.md +0 -329
- package/docs/src/core/components/ui/modal/modal.md +0 -119
- package/docs/src/core/components/ui/pop/pop.md +0 -96
- package/docs/src/core/components/ui/progress/progress.md +0 -63
- package/docs/src/core/components/ui/table/table.md +0 -455
- package/docs/src/core/components/ui/toast/toast.md +0 -166
- package/docs/src/core/components/ui/tooltip/tooltip.md +0 -82
- package/docs/src/docs/_core-concept/dataFlow.md +0 -73
- package/docs/src/docs/_core-concept/overview.md +0 -57
- package/docs/src/docs/_core-concept/subscriber.md +0 -75
- package/docs/src/docs/_decorators/ancestor-attribute.md +0 -79
- package/docs/src/docs/_decorators/auto-subscribe.md +0 -202
- package/docs/src/docs/_decorators/bind.md +0 -167
- package/docs/src/docs/_decorators/get.md +0 -68
- package/docs/src/docs/_decorators/handle.md +0 -171
- package/docs/src/docs/_decorators/on-assign.md +0 -388
- package/docs/src/docs/_decorators/publish.md +0 -55
- package/docs/src/docs/_decorators/subscribe.md +0 -97
- package/docs/src/docs/_decorators/wait-for-ancestors.md +0 -163
- package/docs/src/docs/_directives/sub.md +0 -91
- package/docs/src/docs/_getting-started/ai-agents.md +0 -56
- package/docs/src/docs/_getting-started/concorde-manual-install.md +0 -133
- package/docs/src/docs/_getting-started/concorde-outside.md +0 -33
- package/docs/src/docs/_getting-started/create-a-component.md +0 -139
- package/docs/src/docs/_getting-started/my-first-component.md +0 -236
- package/docs/src/docs/_getting-started/my-first-subscriber.md +0 -120
- package/docs/src/docs/_getting-started/pubsub.md +0 -37
- package/docs/src/docs/_getting-started/start.md +0 -47
- package/docs/src/docs/_getting-started/theming.md +0 -91
- package/docs/src/docs/_misc/api-configuration.md +0 -79
- package/docs/src/docs/_misc/dataProviderKey.md +0 -168
- package/docs/src/docs/_misc/docs-mock-api.md +0 -60
- package/docs/src/docs/_misc/endpoint.md +0 -43
- package/docs/src/docs/_misc/html-integration.md +0 -13
- package/docs/src/docs/search/docs-search.json +0 -8532
- package/docs/src/tag-list.json +0 -1
- package/docs/src/tsconfig-model.json +0 -23
- package/docs/src/tsconfig.json +0 -1050
- package/php/get-challenge.php +0 -34
- package/php/some-service.php +0 -42
|
@@ -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="/docs-mock-api">
|
|
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="/docs-mock-api">
|
|
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,114 +0,0 @@
|
|
|
1
|
-
# Submit
|
|
2
|
-
|
|
3
|
-
> **Live demos:** `<docs-lit-demo>` + `src/docs/example/docs-submit-demos.ts`. Use [Local API demos](#docs/_misc/docs-mock-api.md/docs-mock-api) (`serviceURL="/docs-mock-api"`).
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
**sonic-submit** sends the **formDataProvider** publisher to a REST endpoint (same configuration model as [fetch](#core/components/functional/fetch/fetch.md/fetch): `serviceURL` on an ancestor, path via `dataProvider` or `endPoint`).
|
|
8
|
-
|
|
9
|
-
| Trigger | Attribute |
|
|
10
|
-
|---------|-----------|
|
|
11
|
-
| Click inside the slot | `onClick` |
|
|
12
|
-
| Enter in a focused field inside the slot | `onEnterKey` |
|
|
13
|
-
|
|
14
|
-
| Data / API | Attribute / property | Notes |
|
|
15
|
-
|------------|----------------------|--------|
|
|
16
|
-
| Form fields | `formDataProvider` on ancestor | Filled by `sonic-input`, `sonic-select`, etc. via `name` |
|
|
17
|
-
| Result after call | `submitResultDataProvider` on ancestor | Whole result object (after optional `submit-result-key`) |
|
|
18
|
-
| Slice of JSON result | `submit-result-key` on **sonic-submit** | Dot path, e.g. `data` when the API returns `{ data: { … } }` |
|
|
19
|
-
| HTTP verb | `method` on **sonic-submit** | `post` (default), `put`, `patch`, `delete`, `get` — not inherited from `sonic-scope` |
|
|
20
|
-
| Path override | `endPoint` on **sonic-submit** | Wins over ancestor `dataProvider` |
|
|
21
|
-
| JSON vs multipart | `sendAsFormData` on **sonic-submit** | `FormData` body, still expects JSON response |
|
|
22
|
-
| Reset publishers | `clearedDataOnSuccess` on ancestor | Space-separated `DataProviderKey.path` values; runs when a **result object** is returned (including error payloads with `messages`) |
|
|
23
|
-
| Browser form POST | `native` on **sonic-submit** | See [Native HTML form](#native-html-form) |
|
|
24
|
-
| Result event | — | Bubbles `submit` `CustomEvent` with `detail` = result |
|
|
25
|
-
| Credential Management API | `usernameKey`, `passwordKey` on **sonic-submit** | After a **successful** HTTP response, stores login if those keys exist in the payload (defaults: `username`, `password`) |
|
|
26
|
-
| ALTCHA / captcha | `needsCaptchaValidation` on form/header publisher | Defers send until token is set — see [Captcha](#core/components/ui/captcha/captcha.md/captcha) |
|
|
27
|
-
|
|
28
|
-
While a REST submit runs, the slot is wrapped with `data-disabled` (faded, no pointer events). With **`native`**, validation and loader still run, then the browser performs a normal form submission.
|
|
29
|
-
|
|
30
|
-
## Form and result handling
|
|
31
|
-
|
|
32
|
-
POST to mock `api/register`; result publisher `submit-example-result`.
|
|
33
|
-
|
|
34
|
-
<docs-lit-demo for="docs-submit-demo"></docs-lit-demo>
|
|
35
|
-
|
|
36
|
-
## Native HTML form
|
|
37
|
-
|
|
38
|
-
With **`native`**, Concorde does **not** call `fetch`. After form validation it:
|
|
39
|
-
|
|
40
|
-
1. Copies **formDataProvider** values into matching `<input>` / `<select>` / `<textarea>` inside the closest **`<form>`** (creates hidden inputs if needed).
|
|
41
|
-
2. Programmatically clicks a hidden native `type="submit"` control (`name` / `value` on **sonic-submit** if you need them).
|
|
42
|
-
|
|
43
|
-
Use a real `<form action="…" method="post">` ancestor. For SPAs, a named **`target`** (e.g. iframe) avoids leaving the doc page.
|
|
44
|
-
|
|
45
|
-
<docs-lit-demo for="docs-submit-native-demo"></docs-lit-demo>
|
|
46
|
-
|
|
47
|
-
## sendAsFormData
|
|
48
|
-
|
|
49
|
-
Sends fields as **`multipart/form-data`** instead of `application/json` (response is still parsed as JSON).
|
|
50
|
-
|
|
51
|
-
<docs-lit-demo for="docs-submit-formdata-demo"></docs-lit-demo>
|
|
52
|
-
|
|
53
|
-
## submit-result-key
|
|
54
|
-
|
|
55
|
-
When the API wraps the payload (e.g. `{ data: { id, token } }`), set **`submit-result-key="data"`** on **sonic-submit** so **submitResultDataProvider** receives only the inner object.
|
|
56
|
-
|
|
57
|
-
<docs-lit-demo for="docs-submit-result-key-demo"></docs-lit-demo>
|
|
58
|
-
|
|
59
|
-
Mock endpoint: `POST /docs-mock-api/api/register/nested`.
|
|
60
|
-
|
|
61
|
-
## clearedDataOnSuccess
|
|
62
|
-
|
|
63
|
-
Lists one or more publisher ids (space-separated). After the API returns a result object, each is set to `{}` — useful to reset the form publisher.
|
|
64
|
-
|
|
65
|
-
<docs-lit-demo for="docs-submit-clear-demo"></docs-lit-demo>
|
|
66
|
-
|
|
67
|
-
## Custom `submit` event
|
|
68
|
-
|
|
69
|
-
Listen for the bubbling **`submit`** event; **`event.detail`** is the same result written to **submitResultDataProvider** (if configured).
|
|
70
|
-
|
|
71
|
-
<docs-lit-demo for="docs-submit-event-demo"></docs-lit-demo>
|
|
72
|
-
|
|
73
|
-
## endPoint vs dataProvider
|
|
74
|
-
|
|
75
|
-
Ancestor **`dataProvider`** is the default path; **`endPoint`** on **sonic-submit** overrides it for that button only.
|
|
76
|
-
|
|
77
|
-
<docs-lit-demo for="docs-submit-endpoint-demo"></docs-lit-demo>
|
|
78
|
-
|
|
79
|
-
## method="get"
|
|
80
|
-
|
|
81
|
-
Appends publisher fields as a query string on the endpoint, then performs a GET. The mock route `api/register/echo` returns the query for inspection.
|
|
82
|
-
|
|
83
|
-
<docs-lit-demo for="docs-submit-get-demo"></docs-lit-demo>
|
|
84
|
-
|
|
85
|
-
## dot notation (formDataProvider shape)
|
|
86
|
-
|
|
87
|
-
You can use dot notation in **`name`** on form controls; the publisher stores nested objects:
|
|
88
|
-
|
|
89
|
-
<sonic-code>
|
|
90
|
-
<template>
|
|
91
|
-
<sonic-scope formDataProvider="submit-example-dot-notation">
|
|
92
|
-
<div class="grid grid-cols-2 gap-4 mb-4 ">
|
|
93
|
-
<sonic-input required name="email.value" type="email" value="eve.holt@reqres.in"></sonic-input>
|
|
94
|
-
<sonic-input required type="password" name="details.password.value" value="pistol"></sonic-input>
|
|
95
|
-
</div>
|
|
96
|
-
</sonic-scope>
|
|
97
|
-
</template>
|
|
98
|
-
</sonic-code>
|
|
99
|
-
|
|
100
|
-
Stored shape:
|
|
101
|
-
|
|
102
|
-
<sonic-code language="typescript">
|
|
103
|
-
<template>
|
|
104
|
-
{
|
|
105
|
-
email: { value: "eve.holt@reqres.in" },
|
|
106
|
-
details: { password: { value: "pistol" } }
|
|
107
|
-
}
|
|
108
|
-
</template>
|
|
109
|
-
</sonic-code>
|
|
110
|
-
|
|
111
|
-
## Related
|
|
112
|
-
|
|
113
|
-
- [Captcha](#core/components/ui/captcha/captcha.md/captcha) — submit waits for `captchaToken` when validation is required.
|
|
114
|
-
- [HTML integration](#docs/_misc/html-integration.md/html-integration) — legacy `data-bind` result blocks; prefer **submitResultDataProvider** + `@subscribe` in Lit demos.
|
|
@@ -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
|
-
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# Alert
|
|
2
|
-
|
|
3
|
-
<sonic-code>
|
|
4
|
-
<template>
|
|
5
|
-
<sonic-alert status="error" label="Email error" text="This address is already in use" background></sonic-alert>
|
|
6
|
-
</template>
|
|
7
|
-
</sonic-code>
|
|
8
|
-
|
|
9
|
-
## Status
|
|
10
|
-
|
|
11
|
-
<sonic-code>
|
|
12
|
-
<template>
|
|
13
|
-
<div class="grid gap-4">
|
|
14
|
-
<sonic-alert label="Default"> This address is already in use. </sonic-alert>
|
|
15
|
-
<sonic-alert status="success" label="Success"> This address is already in use. </sonic-alert>
|
|
16
|
-
<sonic-alert status="error" label="Error"> This address is already in use. </sonic-alert>
|
|
17
|
-
<sonic-alert status="warning" label="Warning"> This address is already in use. </sonic-alert>
|
|
18
|
-
<sonic-alert status="info" label="Info"> This address is already in use. </sonic-alert>
|
|
19
|
-
</div>
|
|
20
|
-
</template>
|
|
21
|
-
</sonic-code>
|
|
22
|
-
|
|
23
|
-
## Sizes
|
|
24
|
-
|
|
25
|
-
<sonic-code>
|
|
26
|
-
<template>
|
|
27
|
-
<div class="grid gap-4">
|
|
28
|
-
<sonic-alert status="error" label="Email error" size="2xs">
|
|
29
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
30
|
-
</sonic-alert>
|
|
31
|
-
<sonic-alert status="error" label="Email error" size="xs">
|
|
32
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
33
|
-
</sonic-alert>
|
|
34
|
-
<sonic-alert status="error" label="Email error" size="sm">
|
|
35
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
36
|
-
</sonic-alert>
|
|
37
|
-
<sonic-alert status="error" label="Email error">
|
|
38
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
39
|
-
</sonic-alert>
|
|
40
|
-
<sonic-alert status="error" label="Email error" size="lg">
|
|
41
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
42
|
-
</sonic-alert>
|
|
43
|
-
<sonic-alert status="error" label="Email error" size="xl">
|
|
44
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
45
|
-
</sonic-alert>
|
|
46
|
-
<sonic-alert status="error" label="Email error" size="2xl">
|
|
47
|
-
This address is already in use. Lorem ipsum dolor sit amet.
|
|
48
|
-
</sonic-alert>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
51
|
-
</sonic-code>
|
|
52
|
-
|
|
53
|
-
## Alert with link
|
|
54
|
-
|
|
55
|
-
<sonic-code>
|
|
56
|
-
<template>
|
|
57
|
-
<sonic-alert status="info" label="New messages !">
|
|
58
|
-
You have 2 unread messages<br />
|
|
59
|
-
<div class="flex gap-2 mt-1">
|
|
60
|
-
<sonic-button variant="outline" type="info" size="xs">See messages</sonic-button>
|
|
61
|
-
<sonic-button variant="ghost" type="info" size="xs">dismiss</sonic-button>
|
|
62
|
-
</div>
|
|
63
|
-
</sonic-alert>
|
|
64
|
-
</template>
|
|
65
|
-
</sonic-code>
|
|
66
|
-
|
|
67
|
-
## Background
|
|
68
|
-
|
|
69
|
-
<sonic-code>
|
|
70
|
-
<template>
|
|
71
|
-
<div class="grid gap-4">
|
|
72
|
-
<sonic-alert background label="Lorem ipsum dolor">
|
|
73
|
-
This address is already in use.
|
|
74
|
-
</sonic-alert>
|
|
75
|
-
<sonic-alert status="success" background label="Lorem ipsum dolor">
|
|
76
|
-
This address is already in use.
|
|
77
|
-
</sonic-alert>
|
|
78
|
-
<sonic-alert status="error" background label="Lorem ipsum dolor">
|
|
79
|
-
This address is already in use.
|
|
80
|
-
</sonic-alert>
|
|
81
|
-
<sonic-alert status="warning" background label="Lorem ipsum dolor">
|
|
82
|
-
This address is already in use.
|
|
83
|
-
</sonic-alert>
|
|
84
|
-
<sonic-alert status="info" background label="Lorem ipsum dolor">
|
|
85
|
-
This address is already in use.
|
|
86
|
-
</sonic-alert>
|
|
87
|
-
</div>
|
|
88
|
-
</template>
|
|
89
|
-
</sonic-code>
|
|
90
|
-
|
|
91
|
-
## Dismissible
|
|
92
|
-
|
|
93
|
-
<sonic-code>
|
|
94
|
-
<template>
|
|
95
|
-
<sonic-alert class="mb-3" dismissible label="Lorem ipsum dolor">
|
|
96
|
-
This address is already in use.
|
|
97
|
-
</sonic-alert>
|
|
98
|
-
<sonic-alert status="success" class="mb-3" dismissible label="Lorem ipsum dolor">
|
|
99
|
-
This address is already in use.
|
|
100
|
-
</sonic-alert>
|
|
101
|
-
<sonic-alert status="error" class="mb-3" dismissible label="Lorem ipsum dolor">
|
|
102
|
-
This address is already in use.
|
|
103
|
-
</sonic-alert>
|
|
104
|
-
<sonic-alert status="warning" class="mb-3" dismissible label="Lorem ipsum dolor">
|
|
105
|
-
This address is already in use.
|
|
106
|
-
</sonic-alert>
|
|
107
|
-
<sonic-alert status="info" class="mb-3" dismissible label="Lorem ipsum dolor">
|
|
108
|
-
This address is already in use.
|
|
109
|
-
</sonic-alert>
|
|
110
|
-
</template>
|
|
111
|
-
</sonic-code>
|
|
112
|
-
|
|
113
|
-
## Dismiss forever
|
|
114
|
-
|
|
115
|
-
<sonic-code>
|
|
116
|
-
<template>
|
|
117
|
-
<sonic-alert class="mb-3" dismissible dismissForever label="Lorem ipsum dolor" id="addressUniqueId">
|
|
118
|
-
This address is already in use.
|
|
119
|
-
</sonic-alert>
|
|
120
|
-
</template>
|
|
121
|
-
</sonic-code>
|
|
File without changes
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
# Badge
|
|
2
|
-
|
|
3
|
-
## Type
|
|
4
|
-
<sonic-code>
|
|
5
|
-
<template>
|
|
6
|
-
<sonic-badge>Default</sonic-badge>
|
|
7
|
-
<sonic-badge type="primary">Primary</sonic-badge>
|
|
8
|
-
<sonic-badge type="neutral">Neutral</sonic-badge>
|
|
9
|
-
<sonic-badge type="warning">Warning</sonic-badge>
|
|
10
|
-
<sonic-badge type="info">Info</sonic-badge>
|
|
11
|
-
<sonic-badge type="success">Success</sonic-badge>
|
|
12
|
-
<sonic-badge type="danger">Danger</sonic-badge>
|
|
13
|
-
<sonic-badge type="contrast">Contrast</sonic-badge>
|
|
14
|
-
</template>
|
|
15
|
-
</sonic-code>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
## Outline
|
|
19
|
-
<sonic-code>
|
|
20
|
-
<template>
|
|
21
|
-
<div class="flex items-center flex-wrap gap-3">
|
|
22
|
-
<sonic-badge variant="outline">Default</sonic-badge>
|
|
23
|
-
<sonic-badge variant="outline" type="primary">Primary</sonic-badge>
|
|
24
|
-
<sonic-badge variant="outline" type="neutral">Neutral</sonic-badge>
|
|
25
|
-
<sonic-badge variant="outline" type="warning">Warning</sonic-badge>
|
|
26
|
-
<sonic-badge variant="outline" type="info">Info</sonic-badge>
|
|
27
|
-
<sonic-badge variant="outline" type="success">Success</sonic-badge>
|
|
28
|
-
<sonic-badge variant="outline" type="danger">Danger</sonic-badge>
|
|
29
|
-
<sonic-badge variant="outline" type="contrast">Contrast</sonic-badge>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
</sonic-code>
|
|
33
|
-
|
|
34
|
-
## Ghost
|
|
35
|
-
<sonic-code>
|
|
36
|
-
<template>
|
|
37
|
-
<div class="flex items-center flex-wrap gap-3">
|
|
38
|
-
<sonic-badge variant="ghost">Default</sonic-badge>
|
|
39
|
-
<sonic-badge variant="ghost" type="primary">Primary</sonic-badge>
|
|
40
|
-
<sonic-badge variant="ghost" type="neutral">Neutral</sonic-badge>
|
|
41
|
-
<sonic-badge variant="ghost" type="warning">Warning</sonic-badge>
|
|
42
|
-
<sonic-badge variant="ghost" type="info">Info</sonic-badge>
|
|
43
|
-
<sonic-badge variant="ghost" type="success">Success</sonic-badge>
|
|
44
|
-
<sonic-badge variant="ghost" type="danger">Danger</sonic-badge>
|
|
45
|
-
<sonic-badge variant="ghost" type="contrast">Contrast</sonic-badge>
|
|
46
|
-
</div>
|
|
47
|
-
</template>
|
|
48
|
-
</sonic-code>
|
|
49
|
-
|
|
50
|
-
## Size
|
|
51
|
-
<sonic-code>
|
|
52
|
-
<template>
|
|
53
|
-
<sonic-badge size="2xs">2Xs badge</sonic-badge>
|
|
54
|
-
<sonic-badge size="xs">Xs badge</sonic-badge>
|
|
55
|
-
<sonic-badge size="sm">Sm badge</sonic-badge>
|
|
56
|
-
<sonic-badge>Md badge</sonic-badge>
|
|
57
|
-
<sonic-badge size="lg">Lg badge</sonic-badge>
|
|
58
|
-
<sonic-badge size="xl">Xl badge</sonic-badge>
|
|
59
|
-
<sonic-badge size="2xl">2Xl badge</sonic-badge>
|
|
60
|
-
</template>
|
|
61
|
-
</sonic-code>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
## Empty badges
|
|
65
|
-
<sonic-code>
|
|
66
|
-
<template>
|
|
67
|
-
<div class="flex items-center flex-wrap gap-3">
|
|
68
|
-
<sonic-badge type="danger" size="2xs"></sonic-badge>
|
|
69
|
-
<sonic-badge type="danger" size="xs"></sonic-badge>
|
|
70
|
-
<sonic-badge type="danger" size="sm"></sonic-badge>
|
|
71
|
-
<sonic-badge type="danger"></sonic-badge>
|
|
72
|
-
<sonic-badge type="danger" size="lg"></sonic-badge>
|
|
73
|
-
<sonic-badge type="danger" size="xl"></sonic-badge>
|
|
74
|
-
<sonic-badge type="danger" size="2xl"></sonic-badge>
|
|
75
|
-
</div>
|
|
76
|
-
</template>
|
|
77
|
-
</sonic-code>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
## Ellipsis
|
|
81
|
-
<sonic-code>
|
|
82
|
-
<template>
|
|
83
|
-
<div class="grid grid-cols-3 gap-4" >
|
|
84
|
-
<sonic-badge ellipsis size="sm" variant="outline" >
|
|
85
|
-
<sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon> Lorem ipsum dolor sit consectetur adipiscing elit. Lorem ipsum dolor sit consectetur adipiscing elit.</sonic-badge>
|
|
86
|
-
<sonic-badge ellipsis size="sm" > <sonic-icon slot="prefix" name="info-empty" library="iconoir"></sonic-icon> Lorem ipsum dolor sit consectetur adipiscing elit. Lorem ipsum dolor sit consectetur adipiscing elit.</sonic-badge>
|
|
87
|
-
</div>
|
|
88
|
-
</template>
|
|
89
|
-
</sonic-code>
|
|
90
|
-
|
|
91
|
-
## Badge in button
|
|
92
|
-
<sonic-code>
|
|
93
|
-
<template>
|
|
94
|
-
<div class="flex flex-wrap gap-4 items-center">
|
|
95
|
-
<sonic-button type="default">
|
|
96
|
-
Messages <sonic-badge slot="suffix" type="danger" size="xs">5</sonic-badge>
|
|
97
|
-
</sonic-button>
|
|
98
|
-
<div class="relative inline-block">
|
|
99
|
-
<sonic-button type="success" class="relative"> Mon compte </sonic-button>
|
|
100
|
-
<sonic-badge type="danger" size="xs" class="absolute right-1 top-0 pe-none transform -translate-y-1/2"
|
|
101
|
-
>12</sonic-badge
|
|
102
|
-
>
|
|
103
|
-
</div>
|
|
104
|
-
<div class="relative inline-block">
|
|
105
|
-
<sonic-button type="neutral" shape="circle" variant="outline"
|
|
106
|
-
><sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
107
|
-
</sonic-button>
|
|
108
|
-
<sonic-badge
|
|
109
|
-
type="danger"
|
|
110
|
-
size="xs"
|
|
111
|
-
class="absolute right-1 bottom-1 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
112
|
-
>33</sonic-badge
|
|
113
|
-
>
|
|
114
|
-
</div>
|
|
115
|
-
<div class="relative inline-block">
|
|
116
|
-
<sonic-button type="neutral" shape="circle" variant="outline"
|
|
117
|
-
><sonic-icon library="iconoir" name="user"></sonic-icon>
|
|
118
|
-
</sonic-button>
|
|
119
|
-
<sonic-badge
|
|
120
|
-
type="danger"
|
|
121
|
-
size="xs"
|
|
122
|
-
class="absolute right-2 bottom-2 pe-none transform translate-y-1/2 translate-x-1/2"
|
|
123
|
-
></sonic-badge>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</template>
|
|
127
|
-
</sonic-code>
|