@supersoniks/concorde 3.1.1 → 3.1.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.
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +227 -142
- package/concorde-core.es.js +831 -726
- package/dist/concorde-core.bundle.js +227 -142
- package/dist/concorde-core.es.js +831 -726
- package/dist/img/paul_metrand.jpg +0 -0
- package/dist/img/paul_metrand_xs.jpg +0 -0
- package/package.json +1 -1
- package/src/core/_types/types.ts +1 -0
- package/src/core/components/functional/submit/submit.ts +3 -2
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +101 -35
- package/src/core/utils/PublisherProxy.ts +3 -2
- package/src/docs/header/header.ts +217 -217
- package/docs/assets/index--bDsd7qW.css +0 -1
- package/docs/assets/index-Ce3mr_lI.js +0 -4040
- package/docs/css/docs.css +0 -0
- package/docs/img/concorde-logo.svg +0 -1
- package/docs/img/concorde.png +0 -0
- package/docs/img/concorde_def.png +0 -0
- package/docs/index.html +0 -132
- package/docs/src/core/components/functional/date/date.md +0 -290
- package/docs/src/core/components/functional/fetch/fetch.md +0 -117
- package/docs/src/core/components/functional/if/if.md +0 -16
- package/docs/src/core/components/functional/list/list.md +0 -194
- package/docs/src/core/components/functional/mix/mix.md +0 -41
- package/docs/src/core/components/functional/queue/queue.md +0 -87
- package/docs/src/core/components/functional/router/router.md +0 -112
- 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 -48
- 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/badge/badge.md +0 -102
- package/docs/src/core/components/ui/button/button.md +0 -184
- package/docs/src/core/components/ui/captcha/captcha.md +0 -12
- package/docs/src/core/components/ui/card/card.md +0 -96
- package/docs/src/core/components/ui/divider/divider.md +0 -35
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +0 -96
- 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 -43
- package/docs/src/core/components/ui/form/input/input.md +0 -168
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +0 -130
- package/docs/src/core/components/ui/form/radio/radio.md +0 -86
- package/docs/src/core/components/ui/form/select/select.md +0 -99
- package/docs/src/core/components/ui/form/textarea/textarea.md +0 -66
- 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 -37
- package/docs/src/core/components/ui/menu/menu.md +0 -288
- package/docs/src/core/components/ui/modal/modal.md +0 -123
- package/docs/src/core/components/ui/pop/pop.md +0 -79
- package/docs/src/core/components/ui/progress/progress.md +0 -65
- package/docs/src/core/components/ui/table/table.md +0 -467
- package/docs/src/core/components/ui/tooltip/tooltip.md +0 -37
- package/docs/src/docs/_core-concept/overview.md +0 -57
- package/docs/src/docs/_core-concept/subscriber.md +0 -76
- package/docs/src/docs/_getting-started/concorde-outside.md +0 -141
- package/docs/src/docs/_getting-started/create-a-component.md +0 -137
- package/docs/src/docs/_getting-started/pubsub.md +0 -150
- package/docs/src/docs/_getting-started/start.md +0 -37
- package/docs/src/docs/_getting-started/theming.md +0 -91
- package/docs/src/docs/search/docs-search.json +0 -3737
- package/docs/src/tag-list.json +0 -1
- package/docs/src/tsconfig.json +0 -113
- package/docs/svg/regular/plane.svg +0 -1
- package/docs/svg/solid/plane.svg +0 -1
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/core/_types/types.ts
CHANGED
|
@@ -110,7 +110,7 @@ export class Submit extends Subscriber(LitElement) {
|
|
|
110
110
|
formPublisher.isFormValid = true;
|
|
111
111
|
formPublisher.invalidate();
|
|
112
112
|
if (!formPublisher.isFormValid.get()) return;
|
|
113
|
-
|
|
113
|
+
this.disabled = true;
|
|
114
114
|
formPublisher.isFormValid;
|
|
115
115
|
// support native html form
|
|
116
116
|
const native = this.hasAttribute("native");
|
|
@@ -137,6 +137,7 @@ export class Submit extends Subscriber(LitElement) {
|
|
|
137
137
|
const dataProvider = this.getAncestorAttributeValue("dataProvider");
|
|
138
138
|
const endPoint = this.endPoint || dataProvider;
|
|
139
139
|
Loader.show();
|
|
140
|
+
|
|
140
141
|
const sendData = async () => {
|
|
141
142
|
//
|
|
142
143
|
//envoi données
|
|
@@ -219,7 +220,7 @@ export class Submit extends Subscriber(LitElement) {
|
|
|
219
220
|
);
|
|
220
221
|
if (submitResultDataProvider)
|
|
221
222
|
PublisherManager.get(submitResultDataProvider).set(result);
|
|
222
|
-
|
|
223
|
+
this.disabled = false;
|
|
223
224
|
};
|
|
224
225
|
const captchaPublisher = headerPublisher?.needsCaptchaValidation.get()
|
|
225
226
|
? headerPublisher
|
|
@@ -1,17 +1,27 @@
|
|
|
1
|
-
import {html, LitElement, css, nothing} from "lit";
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { html, LitElement, css, nothing } from "lit";
|
|
2
|
+
import {
|
|
3
|
+
customElement,
|
|
4
|
+
property,
|
|
5
|
+
queryAssignedNodes,
|
|
6
|
+
state,
|
|
7
|
+
} from "lit/decorators.js";
|
|
8
|
+
import {
|
|
9
|
+
FormInput,
|
|
10
|
+
FormElement,
|
|
11
|
+
Subscriber,
|
|
12
|
+
TemplatesContainer,
|
|
13
|
+
} from "@supersoniks/concorde/mixins";
|
|
4
14
|
import "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
5
15
|
import "@supersoniks/concorde/core/components/ui/pop/pop";
|
|
6
16
|
import "@supersoniks/concorde/core/components/functional/queue/queue";
|
|
7
17
|
import "@supersoniks/concorde/core/components/ui/menu/menu-item";
|
|
8
|
-
import {ifDefined} from "lit/directives/if-defined.js";
|
|
9
|
-
import {PublisherManager} from "@supersoniks/concorde/utils";
|
|
10
|
-
import {PublisherProxy} from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
11
|
-
import {Size} from "../../_css/size";
|
|
12
|
-
import {Input} from "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
13
|
-
import {customScroll} from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
14
|
-
import {ResizeController} from "@lit-labs/observers/resize-controller.js";
|
|
18
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
19
|
+
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
20
|
+
import { PublisherProxy } from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
21
|
+
import { Size } from "../../_css/size";
|
|
22
|
+
import { Input } from "@supersoniks/concorde/core/components/ui/form/input/input";
|
|
23
|
+
import { customScroll } from "@supersoniks/concorde/core/components/ui/_css/scroll";
|
|
24
|
+
import { ResizeController } from "@lit-labs/observers/resize-controller.js";
|
|
15
25
|
|
|
16
26
|
type ListItem = Record<string, string>;
|
|
17
27
|
|
|
@@ -21,7 +31,9 @@ type ListItem = Record<string, string>;
|
|
|
21
31
|
* La valeur de cet input est ensuite retransmit au premier via un dataProvider.
|
|
22
32
|
*/
|
|
23
33
|
@customElement("sonic-input-autocomplete")
|
|
24
|
-
export class InputAutocomplete extends TemplatesContainer(
|
|
34
|
+
export class InputAutocomplete extends TemplatesContainer(
|
|
35
|
+
FormInput(FormElement(Subscriber(LitElement)))
|
|
36
|
+
) {
|
|
25
37
|
static styles = [
|
|
26
38
|
customScroll,
|
|
27
39
|
css`
|
|
@@ -41,20 +53,20 @@ export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(
|
|
|
41
53
|
/**
|
|
42
54
|
* Possibles mutualisation avec text
|
|
43
55
|
*/
|
|
44
|
-
@property({type: String}) size: Size = "md";
|
|
45
|
-
@property({type: String}) placeholder = "";
|
|
56
|
+
@property({ type: String }) size: Size = "md";
|
|
57
|
+
@property({ type: String }) placeholder = "";
|
|
46
58
|
@property() filteredFields = "";
|
|
47
|
-
@property({type: Boolean}) readonly: boolean | null = null;
|
|
59
|
+
@property({ type: Boolean }) readonly: boolean | null = null;
|
|
48
60
|
|
|
49
|
-
@property({type: String}) dataProviderExpression = "";
|
|
50
|
-
@property({type: Boolean}) select?: boolean;
|
|
51
|
-
@property({type: String}) key = "";
|
|
61
|
+
@property({ type: String }) dataProviderExpression = "";
|
|
62
|
+
@property({ type: Boolean }) select?: boolean;
|
|
63
|
+
@property({ type: String }) key = "";
|
|
52
64
|
/** The parameter name to use in dataProviderExpression route */
|
|
53
|
-
@property({type: String}) searchParameter = "";
|
|
65
|
+
@property({ type: String }) searchParameter = "";
|
|
54
66
|
/** The property name to search in the dataProviderExpression result, use "_self" if result is a string list */
|
|
55
|
-
@property({type: String}) propertyName = "";
|
|
67
|
+
@property({ type: String }) propertyName = "";
|
|
56
68
|
|
|
57
|
-
@queryAssignedNodes({slot: "prefix", flatten: true})
|
|
69
|
+
@queryAssignedNodes({ slot: "prefix", flatten: true })
|
|
58
70
|
slotInputPrefixNodes!: Array<Node>;
|
|
59
71
|
|
|
60
72
|
@state() hasInputPrefix = false;
|
|
@@ -90,7 +102,11 @@ export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(
|
|
|
90
102
|
this.lastValidSearch = "";
|
|
91
103
|
return;
|
|
92
104
|
}
|
|
93
|
-
const found = this.queryQueueListItem(
|
|
105
|
+
const found = this.queryQueueListItem(
|
|
106
|
+
this.queueDataProvider,
|
|
107
|
+
this.findSelection,
|
|
108
|
+
this.setSearchFromSelection
|
|
109
|
+
);
|
|
94
110
|
// Si la liste de this.queueDataProvider est bien initialisée, mais qu'aucun item ne correspond à la recherche
|
|
95
111
|
// On affiche quand même la valeur dans le champ de recherche, car il provient directement du formDataProvider
|
|
96
112
|
if (found === false) {
|
|
@@ -100,31 +116,58 @@ export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(
|
|
|
100
116
|
};
|
|
101
117
|
|
|
102
118
|
private initSearchParameter = () => {
|
|
103
|
-
this.queryQueueListItem(
|
|
119
|
+
this.queryQueueListItem(
|
|
120
|
+
this.initQueueDataProvider,
|
|
121
|
+
this.findSelection,
|
|
122
|
+
this.setSearchFromSelection
|
|
123
|
+
);
|
|
104
124
|
};
|
|
105
125
|
|
|
106
126
|
private selectListItem = (listItem: ListItem) => {
|
|
107
|
-
const value =
|
|
127
|
+
const value =
|
|
128
|
+
this.propertyName === "_self"
|
|
129
|
+
? listItem
|
|
130
|
+
: listItem[this.propertyName || this.name];
|
|
108
131
|
this.formValuePublisher?.set(value);
|
|
109
132
|
};
|
|
110
133
|
|
|
111
134
|
private findSearchedItem = (listItem: ListItem) => {
|
|
112
|
-
|
|
135
|
+
console.log(this.propertyName);
|
|
136
|
+
|
|
137
|
+
const value =
|
|
138
|
+
this.propertyName === "_self"
|
|
139
|
+
? listItem
|
|
140
|
+
: listItem[this.propertyName || this.searchParameter || this.name];
|
|
113
141
|
return value == this.searchPublisher?.get();
|
|
114
142
|
};
|
|
115
143
|
|
|
116
144
|
private findSelection = (listItem: ListItem) => {
|
|
117
|
-
const value =
|
|
145
|
+
const value =
|
|
146
|
+
this.propertyName === "_self"
|
|
147
|
+
? listItem
|
|
148
|
+
: listItem[this.propertyName || this.name];
|
|
118
149
|
return value == this.value;
|
|
119
150
|
};
|
|
120
151
|
|
|
121
152
|
private setSearchFromSelection = (listItem: ListItem) => {
|
|
122
|
-
this.lastValidSearch =
|
|
153
|
+
this.lastValidSearch =
|
|
154
|
+
this.propertyName === "_self"
|
|
155
|
+
? listItem
|
|
156
|
+
: listItem[this.searchParameter || this.propertyName || this.name];
|
|
123
157
|
this.searchPublisher?.set(this.lastValidSearch);
|
|
124
158
|
};
|
|
125
159
|
private updateActiveSelection = () => {
|
|
126
|
-
this.queryQueueListItem(
|
|
127
|
-
|
|
160
|
+
this.queryQueueListItem(
|
|
161
|
+
this.queueDataProvider,
|
|
162
|
+
this.findSearchedItem,
|
|
163
|
+
this.selectListItem
|
|
164
|
+
);
|
|
165
|
+
if (
|
|
166
|
+
!this.select &&
|
|
167
|
+
this.lastValidSearch &&
|
|
168
|
+
this.lastValidSearch != this.searchPublisher?.get() &&
|
|
169
|
+
this.formValuePublisher?.get()
|
|
170
|
+
) {
|
|
128
171
|
this.formValuePublisher?.set("");
|
|
129
172
|
}
|
|
130
173
|
};
|
|
@@ -153,10 +196,14 @@ export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(
|
|
|
153
196
|
* Les publishers utilisés plusieurs fois dans la classe son miss en propriétés privées de la classe
|
|
154
197
|
*/
|
|
155
198
|
const getPublisher = PublisherManager.get;
|
|
156
|
-
this.searchPublisher = getPublisher(this.searchDataProvider)[
|
|
199
|
+
this.searchPublisher = getPublisher(this.searchDataProvider)[
|
|
200
|
+
searchParameter
|
|
201
|
+
];
|
|
157
202
|
this.formValuePublisher = getPublisher(formDataProvider)[this.name];
|
|
158
203
|
this.countPublisher = getPublisher(this.queueDataProvider).resultCount;
|
|
159
|
-
this.initCountPublisher = getPublisher(
|
|
204
|
+
this.initCountPublisher = getPublisher(
|
|
205
|
+
this.initQueueDataProvider
|
|
206
|
+
).resultCount;
|
|
160
207
|
|
|
161
208
|
/**
|
|
162
209
|
* Si une valeur est fourrnie a l'initialisation, un queue spécifique appelle le service avec le name founi en paramètre
|
|
@@ -198,7 +245,11 @@ export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(
|
|
|
198
245
|
*
|
|
199
246
|
* @return bool|undefined True if item found, false otherwise, undefined if result is not a list
|
|
200
247
|
*/
|
|
201
|
-
queryQueueListItem(
|
|
248
|
+
queryQueueListItem(
|
|
249
|
+
queueDataProvider: string,
|
|
250
|
+
itemFinder: (listItem: ListItem) => boolean,
|
|
251
|
+
itemMutator: (listItem: ListItem) => void
|
|
252
|
+
) {
|
|
202
253
|
const queuePublisher = PublisherManager.get(queueDataProvider);
|
|
203
254
|
let listItem: ListItem | undefined;
|
|
204
255
|
const listsDescriptors = queuePublisher.get();
|
|
@@ -250,20 +301,35 @@ export class InputAutocomplete extends TemplatesContainer(FormInput(FormElement(
|
|
|
250
301
|
inlineContent
|
|
251
302
|
size=${this.size}
|
|
252
303
|
>
|
|
253
|
-
<slot
|
|
304
|
+
<slot
|
|
305
|
+
name="prefix"
|
|
306
|
+
slot="prefix"
|
|
307
|
+
@slotchange=${this.hasSlotOrProps}
|
|
308
|
+
></slot>
|
|
254
309
|
|
|
255
310
|
${this.select
|
|
256
|
-
? html`
|
|
311
|
+
? html`
|
|
312
|
+
<sonic-icon
|
|
313
|
+
slot="suffix"
|
|
314
|
+
class="select-chevron"
|
|
315
|
+
name="nav-arrow-down"
|
|
316
|
+
.size=${this.size}
|
|
317
|
+
></sonic-icon>
|
|
318
|
+
`
|
|
257
319
|
: nothing}
|
|
258
320
|
</sonic-input>
|
|
259
|
-
<sonic-menu
|
|
321
|
+
<sonic-menu
|
|
322
|
+
slot="content"
|
|
323
|
+
class="custom-scroll"
|
|
324
|
+
style="${this.offsetWidth ? `width: ${this.offsetWidth}px` : ""}"
|
|
325
|
+
>
|
|
260
326
|
<sonic-queue
|
|
261
327
|
dataProvider="${this.queueDataProvider}"
|
|
262
328
|
filteredFields=${this.filteredFields}
|
|
263
329
|
dataProviderExpression="${this.dataProviderExpression}"
|
|
264
330
|
dataFilterProvider="${this.searchDataProvider}"
|
|
265
331
|
key="${this.key}"
|
|
266
|
-
.templates=${this.templateList}
|
|
332
|
+
.templates=${this.templateList.concat(this.templatePartsList)}
|
|
267
333
|
displayContents
|
|
268
334
|
>
|
|
269
335
|
</sonic-queue>
|
|
@@ -77,8 +77,9 @@ export class PublisherProxy<T = any> {
|
|
|
77
77
|
* Supprime les écouteurs associés
|
|
78
78
|
*/
|
|
79
79
|
delete() {
|
|
80
|
-
for (const
|
|
81
|
-
|
|
80
|
+
for (const key in this._proxies_.keys()) {
|
|
81
|
+
if ((key as string) == "_parent_") continue;
|
|
82
|
+
this._proxies_.get(key)?.delete();
|
|
82
83
|
}
|
|
83
84
|
this._invalidateListeners_.clear();
|
|
84
85
|
this._assignListeners_.clear();
|