@streamline-pulse/formkrafter-wc 0.1.1 → 0.3.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 +3 -3
- package/dist/cjs/fk-brick-actions_18.cjs.entry.js +258 -22476
- package/dist/cjs/formkrafter-wc.cjs.js +2 -2
- package/dist/cjs/index-Bhy1RJMV.js +3042 -0
- package/dist/cjs/{index-D_7eGIJ0.js → index-CImTe9BG.js} +40 -4
- package/dist/cjs/index-CdaT3-qx.js +5444 -0
- package/dist/cjs/{index-By4GGW_q.js → index-CkPPRg03.js} +237 -35
- package/dist/cjs/index-DHgK3reD.js +12233 -0
- package/dist/cjs/index-Ds0sDbXV.js +4019 -0
- package/dist/cjs/index-c9BL7y3N.js +1922 -0
- package/dist/cjs/index.cjs.js +3 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/fk-brick-render/fk-brick-render.js +31 -3
- package/dist/collection/components/fk-code-editor/fk-code-editor.js +17 -8
- package/dist/collection/components/fk-file-input/fk-file-input.css +26 -5
- package/dist/collection/components/fk-file-input/fk-file-input.js +96 -14
- package/dist/collection/components/fk-form-builder/fk-form-builder.css +30 -0
- package/dist/collection/components/fk-form-render/fk-form-render.js +1 -1
- package/dist/collection/components/fk-property-panel/fk-property-panel.js +5 -1
- package/dist/collection/components/fk-select-input/fk-select-input.css +9 -0
- package/dist/collection/components/fk-select-input/fk-select-input.js +118 -20
- package/dist/collection/components/fk-stepper/fk-stepper.css +14 -0
- package/dist/collection/components/fk-stepper/fk-stepper.js +4 -1
- package/dist/collection/components/fk-tabs/fk-tabs.js +15 -2
- package/dist/collection/i18n/i18n.js +20 -0
- package/dist/collection/index.js +1 -1
- package/dist/collection/registry/default-bricks.js +174 -34
- package/dist/components/fk-brick-actions.js +1 -1
- package/dist/components/fk-brick-list.js +1 -1
- package/dist/components/fk-brick-mold-item.js +1 -1
- package/dist/components/fk-brick-not-found.js +1 -1
- package/dist/components/fk-brick-render.js +1 -1
- package/dist/components/fk-code-editor.js +1 -1
- package/dist/components/fk-data-grid.js +1 -1
- package/dist/components/fk-drop-area.js +1 -1
- package/dist/components/fk-empty-form.js +1 -1
- package/dist/components/fk-file-input.js +1 -1
- package/dist/components/fk-form-builder.js +1 -1
- package/dist/components/fk-form-render.js +1 -1
- package/dist/components/fk-property-panel.js +1 -1
- package/dist/components/fk-rules-editor.js +1 -1
- package/dist/components/fk-select-input.js +1 -1
- package/dist/components/fk-signature-input.js +1 -1
- package/dist/components/fk-stepper.js +1 -1
- package/dist/components/fk-tabs.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-B4vAN-UA.js → p--vL6GR31.js} +1 -1
- package/dist/components/p-4COASNrZ.js +1 -0
- package/dist/components/p-BB4Llg42.js +1 -0
- package/dist/components/p-BGkZP87K.js +1 -0
- package/dist/components/p-BOmBVgfJ.js +1 -0
- package/dist/components/p-BWdm2a6q.js +1 -0
- package/dist/components/{p-D318uFl-.js → p-B_-x-GlA.js} +1 -1
- package/dist/components/p-Br1s4Ujx.js +1 -0
- package/dist/components/p-C-wnqV3i.js +1 -0
- package/dist/components/{p-ZEW2q-4b.js → p-CIfjRTky.js} +1 -1
- package/dist/components/{p-dX7Lo8Fe.js → p-CKMHMpID.js} +1 -1
- package/dist/components/p-CUF31e-P.js +1 -0
- package/dist/components/p-CWQX0sXS.js +1 -0
- package/dist/components/p-D6n74M9d.js +1 -0
- package/dist/components/{p-DJDrDvoC.js → p-DFe3zZCI.js} +1 -1
- package/dist/components/p-DMCkrZqi.js +1 -0
- package/dist/components/p-DOInQkG6.js +1 -0
- package/dist/components/{p-BNREw7TY.js → p-DYchD23x.js} +1 -1
- package/dist/components/p-DtcM1yw5.js +1 -0
- package/dist/components/{p-BB3BQPr8.js → p-NDbmiiYk.js} +1 -1
- package/dist/components/p-PAr7WoWG.js +1 -0
- package/dist/components/{p-Ctt--jpe.js → p-YyGnQmX-.js} +1 -1
- package/dist/components/{p-DtzMNM4i.js → p-fDJP6whN.js} +1 -1
- package/dist/components/p-swxZqinH.js +1 -0
- package/dist/components/{p-BXFug2Ql.js → p-v7LxwCAc.js} +1 -1
- package/dist/components/p-wuC5rVU7.js +1 -0
- package/dist/esm/fk-brick-actions_18.entry.js +254 -22472
- package/dist/esm/formkrafter-wc.js +3 -3
- package/dist/esm/index-BAcz7b5u.js +5416 -0
- package/dist/esm/index-BkRMoLXK.js +3029 -0
- package/dist/esm/index-CGMDfZ5m.js +1808 -0
- package/dist/esm/{index-BTmZ8XET.js → index-D7Cta1UB.js} +236 -36
- package/dist/esm/index-DtcM1yw5.js +3991 -0
- package/dist/esm/index-DuVf3NlP.js +12222 -0
- package/dist/esm/{index-BQqrzKxo.js → index-qLZlXROB.js} +40 -4
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
- package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
- package/dist/formkrafter-wc/index.esm.js +1 -1
- package/dist/formkrafter-wc/p-4COASNrZ.js +1 -0
- package/dist/formkrafter-wc/p-6d29555b.entry.js +1 -0
- package/dist/formkrafter-wc/p-C-wnqV3i.js +1 -0
- package/dist/formkrafter-wc/p-DMCkrZqi.js +1 -0
- package/dist/formkrafter-wc/p-DOInQkG6.js +1 -0
- package/dist/formkrafter-wc/{p-BXIsVlA6.js → p-Ddu6BquK.js} +4 -4
- package/dist/formkrafter-wc/p-DtcM1yw5.js +1 -0
- package/dist/formkrafter-wc/p-qLZlXROB.js +2 -0
- package/dist/types/components/fk-brick-render/fk-brick-render.d.ts +1 -0
- package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +2 -1
- package/dist/types/components/fk-file-input/fk-file-input.d.ts +9 -2
- package/dist/types/components/fk-select-input/fk-select-input.d.ts +9 -0
- package/dist/types/components.d.ts +27 -4
- package/dist/types/home/runner/work/formkrafter/formkrafter/packages/wc/.stencil/stencil.config.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/registry/default-bricks.d.ts +73 -54
- package/package.json +11 -2
- package/dist/components/p-BCQ-hj6j.js +0 -1
- package/dist/components/p-BIEpAM4V.js +0 -1
- package/dist/components/p-BLKRn62s.js +0 -1
- package/dist/components/p-BOvjVIvo.js +0 -1
- package/dist/components/p-BQP1WryV.js +0 -1
- package/dist/components/p-DKGyje7v.js +0 -1
- package/dist/components/p-DKoJovNt.js +0 -1
- package/dist/components/p-DWgjI3TW.js +0 -1
- package/dist/components/p-QC41Uj05.js +0 -1
- package/dist/components/p-TvmRksgg.js +0 -1
- package/dist/formkrafter-wc/p-BQqrzKxo.js +0 -2
- package/dist/formkrafter-wc/p-f6bc0be0.entry.js +0 -1
- package/dist/types/Users/datagnikan/Desktop/WorkSpace/streamline-pulse/formkrafter-js/formkrafter/packages/wc/.stencil/stencil.config.d.ts +0 -2
|
@@ -3,17 +3,33 @@ import { evalBrickCode, services } from "@streamline-pulse/formkrafter-core";
|
|
|
3
3
|
import { normalizeOptions } from "../../utils/options";
|
|
4
4
|
import { appendSearchParam, interpolateTemplate, parseHeaderLines, } from "../../utils/remote";
|
|
5
5
|
import { fkT } from "../../i18n/i18n";
|
|
6
|
+
let selectInstanceCounter = 0;
|
|
6
7
|
export class FkSelectInput {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.disabled = false;
|
|
9
10
|
this.multiple = false;
|
|
11
|
+
this.invalid = false;
|
|
10
12
|
this.open = false;
|
|
11
13
|
this.query = '';
|
|
14
|
+
this.activeIndex = 0;
|
|
15
|
+
this.instanceId = `fk-select-${++selectInstanceCounter}`;
|
|
12
16
|
this.remoteOptions = [];
|
|
13
17
|
this.outsideClick = (event) => {
|
|
14
18
|
if (!this.host.contains(event.target))
|
|
15
19
|
this.close();
|
|
16
20
|
};
|
|
21
|
+
this.onTriggerKeyDown = (event) => {
|
|
22
|
+
if (this.disabled)
|
|
23
|
+
return;
|
|
24
|
+
if (['Enter', ' ', 'ArrowDown', 'ArrowUp'].includes(event.key)) {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
this.openDropdown();
|
|
27
|
+
}
|
|
28
|
+
else if (event.key === 'Escape' && this.open) {
|
|
29
|
+
event.preventDefault();
|
|
30
|
+
this.close();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
17
33
|
}
|
|
18
34
|
componentWillLoad() {
|
|
19
35
|
return this.resolveRemote();
|
|
@@ -53,15 +69,76 @@ export class FkSelectInput {
|
|
|
53
69
|
return;
|
|
54
70
|
if (this.open)
|
|
55
71
|
this.close();
|
|
56
|
-
else
|
|
57
|
-
this.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
else
|
|
73
|
+
this.openDropdown();
|
|
74
|
+
}
|
|
75
|
+
openDropdown() {
|
|
76
|
+
if (this.disabled || this.open)
|
|
77
|
+
return;
|
|
78
|
+
this.open = true;
|
|
79
|
+
this.query = '';
|
|
80
|
+
const { options } = this.resolve();
|
|
81
|
+
const selected = this.selectedValues();
|
|
82
|
+
const selectedIndex = options.findIndex((option) => selected.includes(option.value));
|
|
83
|
+
this.activeIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
84
|
+
this.bindOutsideClick();
|
|
61
85
|
}
|
|
62
|
-
close() {
|
|
86
|
+
close(refocusTrigger = false) {
|
|
87
|
+
var _a;
|
|
63
88
|
this.open = false;
|
|
64
89
|
this.unbindOutsideClick();
|
|
90
|
+
if (refocusTrigger)
|
|
91
|
+
(_a = this.triggerEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
92
|
+
}
|
|
93
|
+
moveActive(delta, count) {
|
|
94
|
+
if (!count)
|
|
95
|
+
return;
|
|
96
|
+
this.activeIndex = (this.activeIndex + delta + count) % count;
|
|
97
|
+
this.scrollActiveIntoView();
|
|
98
|
+
}
|
|
99
|
+
scrollActiveIntoView() {
|
|
100
|
+
requestAnimationFrame(() => {
|
|
101
|
+
var _a;
|
|
102
|
+
const active = this.host.querySelector(`#${this.instanceId}-opt-${this.activeIndex}`);
|
|
103
|
+
(_a = active === null || active === void 0 ? void 0 : active.scrollIntoView) === null || _a === void 0 ? void 0 : _a.call(active, { block: 'nearest' });
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
onSearchKeyDown(event, filtered) {
|
|
107
|
+
var _a;
|
|
108
|
+
switch (event.key) {
|
|
109
|
+
case 'ArrowDown':
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
this.moveActive(1, filtered.length);
|
|
112
|
+
break;
|
|
113
|
+
case 'ArrowUp':
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
this.moveActive(-1, filtered.length);
|
|
116
|
+
break;
|
|
117
|
+
case 'Home':
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
this.activeIndex = 0;
|
|
120
|
+
this.scrollActiveIntoView();
|
|
121
|
+
break;
|
|
122
|
+
case 'End':
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
this.activeIndex = Math.max(filtered.length - 1, 0);
|
|
125
|
+
this.scrollActiveIntoView();
|
|
126
|
+
break;
|
|
127
|
+
case 'Enter': {
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
const option = (_a = filtered[this.activeIndex]) !== null && _a !== void 0 ? _a : filtered[0];
|
|
130
|
+
if (option)
|
|
131
|
+
this.pick(option);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case 'Escape':
|
|
135
|
+
event.preventDefault();
|
|
136
|
+
this.close(true);
|
|
137
|
+
break;
|
|
138
|
+
case 'Tab':
|
|
139
|
+
this.close();
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
65
142
|
}
|
|
66
143
|
source() {
|
|
67
144
|
var _a, _b;
|
|
@@ -150,7 +227,7 @@ export class FkSelectInput {
|
|
|
150
227
|
return;
|
|
151
228
|
}
|
|
152
229
|
this.selectValueChange.emit(option.value);
|
|
153
|
-
this.close();
|
|
230
|
+
this.close(true);
|
|
154
231
|
}
|
|
155
232
|
unpick(value) {
|
|
156
233
|
const next = this.selectedValues().filter((entry) => entry !== value);
|
|
@@ -169,30 +246,30 @@ export class FkSelectInput {
|
|
|
169
246
|
const { options, error } = this.resolve();
|
|
170
247
|
const selected = this.selectedValues();
|
|
171
248
|
const filtered = this.filteredOptions(options);
|
|
172
|
-
return (h("div", { key: '
|
|
249
|
+
return (h("div", { key: 'b891babd7bf125b1e388618ed12be7283136def1', class: { 'fk-select': true, 'fk-select--disabled': this.disabled } }, h("div", { key: 'ef9d0b05e422f78f92a74fcd7dd589c25bc2cbe0', class: { 'fk-select__trigger': true, 'fk-select__trigger--open': this.open }, role: "combobox", tabIndex: this.disabled ? undefined : 0, "aria-expanded": this.open ? 'true' : 'false', "aria-haspopup": "listbox", "aria-controls": `${this.instanceId}-listbox`, "aria-disabled": this.disabled ? 'true' : undefined, "aria-invalid": this.invalid ? 'true' : undefined, ref: (element) => (this.triggerEl = element), onKeyDown: this.onTriggerKeyDown, onClick: (event) => {
|
|
173
250
|
event.preventDefault();
|
|
174
251
|
this.toggleOpen();
|
|
175
|
-
} }, h("div", { key: '
|
|
252
|
+
} }, h("div", { key: '9f803f11783a2730865685c34770171a8bf92850', class: "fk-select__values" }, selected.length === 0 ? (h("span", { class: "fk-select__placeholder" }, String((_b = (_a = this.configs) === null || _a === void 0 ? void 0 : _a.placeholder) !== null && _b !== void 0 ? _b : ''))) : this.multiple ? (selected.map((value) => (h("span", { class: "fk-select__chip", key: value }, this.labelOf(value, options), h("button", { type: "button", class: "fk-select__chip-remove", "aria-label": `${fkT('select.clear')} — ${this.labelOf(value, options)}`, disabled: this.disabled, onClick: (event) => {
|
|
176
253
|
event.preventDefault();
|
|
177
254
|
event.stopPropagation();
|
|
178
255
|
this.unpick(value);
|
|
179
|
-
} }, "\u2715"))))) : (h("span", { class: "fk-select__value" }, this.labelOf(selected[0], options)))), !this.multiple && selected.length > 0 && !this.disabled ? (h("button", { type: "button", class: "fk-select__clear", title: fkT('select.clear'), onClick: (event) => {
|
|
256
|
+
} }, "\u2715"))))) : (h("span", { class: "fk-select__value" }, this.labelOf(selected[0], options)))), !this.multiple && selected.length > 0 && !this.disabled ? (h("button", { type: "button", class: "fk-select__clear", title: fkT('select.clear'), "aria-label": fkT('select.clear'), onClick: (event) => {
|
|
180
257
|
event.preventDefault();
|
|
181
258
|
event.stopPropagation();
|
|
182
259
|
this.selectValueChange.emit(undefined);
|
|
183
|
-
} }, "\u2715")) : null, h("span", { key: '
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
} }), h("div", { class: "fk-select__options", role: "listbox" }, filtered.map((option) => {
|
|
260
|
+
} }, "\u2715")) : null, h("span", { key: '2fabef683d5007a58b1b2c34e7005cd4d3eaef04', class: "fk-select__caret" }, "\u25BE")), this.open ? (h("div", { class: "fk-select__dropdown" }, h("input", { class: "fk-select__search", type: "text", placeholder: fkT('select.search'), value: this.query, role: "combobox", "aria-expanded": "true", "aria-autocomplete": "list", "aria-controls": `${this.instanceId}-listbox`, "aria-activedescendant": filtered.length
|
|
261
|
+
? `${this.instanceId}-opt-${Math.min(this.activeIndex, filtered.length - 1)}`
|
|
262
|
+
: undefined, ref: (element) => setTimeout(() => element === null || element === void 0 ? void 0 : element.focus(), 0), onInput: (event) => {
|
|
263
|
+
this.activeIndex = 0;
|
|
264
|
+
this.onSearchInput(event.target.value);
|
|
265
|
+
}, onKeyDown: (event) => this.onSearchKeyDown(event, filtered) }), h("div", { class: "fk-select__options", role: "listbox", id: `${this.instanceId}-listbox`, "aria-multiselectable": this.multiple ? 'true' : undefined }, filtered.map((option, index) => {
|
|
191
266
|
const isSelected = selected.includes(option.value);
|
|
192
|
-
|
|
267
|
+
const isActive = index === Math.min(this.activeIndex, filtered.length - 1);
|
|
268
|
+
return (h("div", { key: option.value, id: `${this.instanceId}-opt-${index}`, role: "option", "aria-selected": isSelected ? 'true' : 'false', class: {
|
|
193
269
|
'fk-select__option': true,
|
|
194
270
|
'fk-select__option--selected': isSelected,
|
|
195
|
-
|
|
271
|
+
'fk-select__option--active': isActive,
|
|
272
|
+
}, onMouseEnter: () => (this.activeIndex = index), onClick: (event) => {
|
|
196
273
|
event.preventDefault();
|
|
197
274
|
this.pick(option);
|
|
198
275
|
} }, h("span", { class: "fk-select__option-label" }, option.label), isSelected ? h("span", { class: "fk-select__check" }, "\u2713") : null));
|
|
@@ -293,6 +370,26 @@ export class FkSelectInput {
|
|
|
293
370
|
"attribute": "multiple",
|
|
294
371
|
"defaultValue": "false"
|
|
295
372
|
},
|
|
373
|
+
"invalid": {
|
|
374
|
+
"type": "boolean",
|
|
375
|
+
"mutable": false,
|
|
376
|
+
"complexType": {
|
|
377
|
+
"original": "boolean",
|
|
378
|
+
"resolved": "boolean",
|
|
379
|
+
"references": {}
|
|
380
|
+
},
|
|
381
|
+
"required": false,
|
|
382
|
+
"optional": false,
|
|
383
|
+
"docs": {
|
|
384
|
+
"tags": [],
|
|
385
|
+
"text": ""
|
|
386
|
+
},
|
|
387
|
+
"getter": false,
|
|
388
|
+
"setter": false,
|
|
389
|
+
"reflect": false,
|
|
390
|
+
"attribute": "invalid",
|
|
391
|
+
"defaultValue": "false"
|
|
392
|
+
},
|
|
296
393
|
"dataMap": {
|
|
297
394
|
"type": "unknown",
|
|
298
395
|
"mutable": false,
|
|
@@ -321,6 +418,7 @@ export class FkSelectInput {
|
|
|
321
418
|
return {
|
|
322
419
|
"open": {},
|
|
323
420
|
"query": {},
|
|
421
|
+
"activeIndex": {},
|
|
324
422
|
"remoteOptions": {},
|
|
325
423
|
"remoteError": {}
|
|
326
424
|
};
|
|
@@ -83,3 +83,17 @@
|
|
|
83
83
|
opacity: 0.45;
|
|
84
84
|
cursor: not-allowed;
|
|
85
85
|
}
|
|
86
|
+
|
|
87
|
+
.fk-stepper__step-button {
|
|
88
|
+
all: unset;
|
|
89
|
+
display: inline-flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
gap: inherit;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.fk-stepper__step-button:focus-visible {
|
|
96
|
+
outline: 2px solid color-mix(in srgb, var(--fk-color-primary) 55%, transparent);
|
|
97
|
+
outline-offset: 2px;
|
|
98
|
+
border-radius: calc(var(--fk-radius) / 2);
|
|
99
|
+
}
|
|
@@ -113,7 +113,10 @@ export class FkStepper {
|
|
|
113
113
|
'fk-stepper__step': true,
|
|
114
114
|
'fk-stepper__step--active': index === this.active,
|
|
115
115
|
'fk-stepper__step--done': !this.editable && index < this.active,
|
|
116
|
-
}
|
|
116
|
+
} }, h("button", { type: "button", class: "fk-stepper__step-button", "aria-current": index === this.active ? 'step' : undefined, onClick: (event) => {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
this.goToStep(index);
|
|
119
|
+
} }, h("span", { class: "fk-stepper__index" }, index + 1), h("span", { class: "fk-stepper__label" }, label)))))), h("div", { key: 'cd902a9df2d72a4d7f452e7621287df50a89d3c4', class: "fk-stepper__body" }, h("slot", { key: 'ab689448817eaf7b5ddfc9146e18411fe6b5924c' })), !this.editable && this.stepLabels.length > 1 ? (h("div", { class: "fk-stepper__actions" }, h("button", { type: "button", class: "fk-stepper__button", disabled: this.active === 0, onClick: this.back }, fkT('stepper.back')), this.active < lastStep ? (h("button", { type: "button", class: "fk-stepper__button fk-stepper__button--primary", onClick: this.next }, fkT('stepper.next'))) : null, showSubmit ? (h("button", { type: "button", class: "fk-stepper__button fk-stepper__button--primary", onClick: this.submit }, fkT('stepper.submit'))) : null)) : null));
|
|
117
120
|
}
|
|
118
121
|
static get is() { return "fk-stepper"; }
|
|
119
122
|
static get encapsulation() { return "scoped"; }
|
|
@@ -76,13 +76,26 @@ export class FkTabs {
|
|
|
76
76
|
this.active = index;
|
|
77
77
|
}
|
|
78
78
|
render() {
|
|
79
|
-
return (h("div", { key: 'dc3d42e16d4dd2c948b780326d13afce15bbd908', class: "fk-tabs" }, h("div", { key: 'a5cfd97f5decd63774b9054559f392c5c23447cc', class: "fk-tabs__nav", role: "tablist" }, this.tabLabels.map((label, index) => (h("button", { key: `${index}-${label}`, type: "button", role: "tab", class: {
|
|
79
|
+
return (h("div", { key: 'dc3d42e16d4dd2c948b780326d13afce15bbd908', class: "fk-tabs" }, h("div", { key: 'a5cfd97f5decd63774b9054559f392c5c23447cc', class: "fk-tabs__nav", role: "tablist" }, this.tabLabels.map((label, index) => (h("button", { key: `${index}-${label}`, type: "button", role: "tab", "aria-selected": index === this.active ? 'true' : 'false', tabIndex: index === this.active ? 0 : -1, class: {
|
|
80
80
|
'fk-tabs__tab': true,
|
|
81
81
|
'fk-tabs__tab--active': index === this.active,
|
|
82
|
+
}, onKeyDown: (event) => {
|
|
83
|
+
const count = this.tabLabels.length;
|
|
84
|
+
if (!count)
|
|
85
|
+
return;
|
|
86
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
const delta = event.key === 'ArrowRight' ? 1 : -1;
|
|
89
|
+
this.goToTab((index + delta + count) % count);
|
|
90
|
+
requestAnimationFrame(() => {
|
|
91
|
+
var _a;
|
|
92
|
+
(_a = this.host.querySelector('.fk-tabs__tab--active')) === null || _a === void 0 ? void 0 : _a.focus();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
82
95
|
}, onClick: (event) => {
|
|
83
96
|
event.preventDefault();
|
|
84
97
|
this.goToTab(index);
|
|
85
|
-
} }, label)))), h("div", { key: '
|
|
98
|
+
} }, label)))), h("div", { key: 'fe33c5bdfe8a876452850abfd8082b8e4325c355', class: "fk-tabs__body" }, h("slot", { key: 'b3de83a128f36d328c34554cc6df7b1cbeae4761' }))));
|
|
86
99
|
}
|
|
87
100
|
static get is() { return "fk-tabs"; }
|
|
88
101
|
static get encapsulation() { return "scoped"; }
|
|
@@ -34,6 +34,9 @@ const en = {
|
|
|
34
34
|
'panel.placeholder': 'Placeholder',
|
|
35
35
|
'panel.prefix': 'Prefix',
|
|
36
36
|
'panel.suffix': 'Suffix',
|
|
37
|
+
'panel.accept': 'Accepted file types',
|
|
38
|
+
'panel.uploadUrl': 'Upload URL',
|
|
39
|
+
'panel.cfg.multiple': 'Allow multiple files',
|
|
37
40
|
'panel.optionsSource': 'Options source',
|
|
38
41
|
'panel.options': 'Options (one per line)',
|
|
39
42
|
'panel.content': 'Content',
|
|
@@ -61,6 +64,7 @@ const en = {
|
|
|
61
64
|
'file.choose': 'Choose a file…',
|
|
62
65
|
'file.uploading': 'Uploading…',
|
|
63
66
|
'file.remove': 'Remove file',
|
|
67
|
+
'file.addAnother': '+ Add a file',
|
|
64
68
|
'address.street': 'Street',
|
|
65
69
|
'address.city': 'City',
|
|
66
70
|
'address.zip': 'Postal code',
|
|
@@ -106,6 +110,12 @@ const en = {
|
|
|
106
110
|
'brick.file.name': 'File',
|
|
107
111
|
'brick.hidden.name': 'Hidden',
|
|
108
112
|
'brick.content.name': 'Content',
|
|
113
|
+
'brick.recap.name': 'Recap',
|
|
114
|
+
'recap.empty': 'Nothing to summarize yet.',
|
|
115
|
+
'recap.yes': 'Yes',
|
|
116
|
+
'recap.no': 'No',
|
|
117
|
+
'panel.cfg.showEmpty': 'Show empty fields',
|
|
118
|
+
'panel.cfg.groupBySections': 'Group by section',
|
|
109
119
|
'brick.group.name': 'Group',
|
|
110
120
|
'brick.row.name': 'Row',
|
|
111
121
|
'brick.column.name': 'Column',
|
|
@@ -147,6 +157,9 @@ export const frFkTranslations = {
|
|
|
147
157
|
'panel.placeholder': 'Placeholder',
|
|
148
158
|
'panel.prefix': 'Préfixe',
|
|
149
159
|
'panel.suffix': 'Suffixe',
|
|
160
|
+
'panel.accept': 'Types de fichiers acceptés',
|
|
161
|
+
'panel.uploadUrl': "URL d'upload",
|
|
162
|
+
'panel.cfg.multiple': 'Autoriser plusieurs fichiers',
|
|
150
163
|
'panel.optionsSource': 'Source des options',
|
|
151
164
|
'panel.options': 'Options (une par ligne)',
|
|
152
165
|
'panel.content': 'Contenu',
|
|
@@ -174,6 +187,7 @@ export const frFkTranslations = {
|
|
|
174
187
|
'file.choose': 'Choisir un fichier…',
|
|
175
188
|
'file.uploading': 'Envoi en cours…',
|
|
176
189
|
'file.remove': 'Retirer le fichier',
|
|
190
|
+
'file.addAnother': '+ Ajouter un fichier',
|
|
177
191
|
'address.street': 'Rue',
|
|
178
192
|
'address.city': 'Ville',
|
|
179
193
|
'address.zip': 'Code postal',
|
|
@@ -219,6 +233,12 @@ export const frFkTranslations = {
|
|
|
219
233
|
'brick.file.name': 'Fichier',
|
|
220
234
|
'brick.hidden.name': 'Caché',
|
|
221
235
|
'brick.content.name': 'Contenu',
|
|
236
|
+
'brick.recap.name': 'Récapitulatif',
|
|
237
|
+
'recap.empty': 'Rien à récapituler pour le moment.',
|
|
238
|
+
'recap.yes': 'Oui',
|
|
239
|
+
'recap.no': 'Non',
|
|
240
|
+
'panel.cfg.showEmpty': 'Afficher les champs vides',
|
|
241
|
+
'panel.cfg.groupBySections': 'Regrouper par section',
|
|
222
242
|
'brick.group.name': 'Groupe',
|
|
223
243
|
'brick.row.name': 'Ligne',
|
|
224
244
|
'brick.column.name': 'Colonne',
|
package/dist/collection/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { h } from '@stencil/core';
|
|
2
2
|
export { registerBrick, registerBricks, getBrick, getBrickMolds, getBrickMoldsGroupedByCategory, newBrickSpec, } from './registry/registry';
|
|
3
3
|
export { createBrick } from './registry/create-brick';
|
|
4
|
-
export { registerDefaultBricks, textInputBrick, emailBrick, passwordBrick, urlBrick, phoneBrick, textareaBrick, numberBrick, dateBrick, timeBrick, datetimeBrick, selectBrick, multiSelectBrick, radioBrick, selectBoxesBrick, checkboxBrick, tagsBrick, signatureBrick, addressBrick, fileBrick, dataGridBrick, hiddenBrick, contentBrick, groupBrick, rowBrick, columnBrick, stepperBrick, tabsBrick, } from './registry/default-bricks';
|
|
4
|
+
export { registerDefaultBricks, textInputBrick, emailBrick, passwordBrick, urlBrick, phoneBrick, textareaBrick, numberBrick, dateBrick, timeBrick, datetimeBrick, selectBrick, multiSelectBrick, radioBrick, selectBoxesBrick, checkboxBrick, tagsBrick, signatureBrick, addressBrick, fileBrick, dataGridBrick, hiddenBrick, contentBrick, recapBrick, groupBrick, rowBrick, columnBrick, stepperBrick, tabsBrick, } from './registry/default-bricks';
|
|
5
5
|
export { setFkTranslations, fkT, fkTOr, frFkTranslations } from './i18n/i18n';
|