@kubex/zinc 1.1.80 → 1.1.81
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/dist/custom-elements.json +392 -122
- package/dist/vscode.html-custom-data.json +40 -15
- package/dist/web-types.json +109 -29
- package/dist/zn.d.ts +372 -297
- package/dist/zn.min.js +282 -265
- package/docs/pages/components/inline-edit.md +3 -2
- package/docs/pages/components/input.md +21 -0
- package/docs/pages/components/remarkd-editor.md +43 -0
- package/docs/pages/components/slash-menu.md +7 -14
- package/docs/pages/components/translations.md +3 -3
- package/package.json +1 -1
- package/src/components/inline-edit/inline-edit.component.ts +7 -2
- package/src/components/input/input.component.ts +143 -0
- package/src/components/input/input.test.ts +113 -1
- package/src/components/remarkd-editor/remarkd-editor.component.ts +157 -95
- package/src/components/remarkd-editor/remarkd-editor.scss +24 -36
- package/src/components/remarkd-editor/remarkd-editor.test.ts +110 -6
- package/src/components/slash-menu/slash-menu.component.ts +23 -1
- package/src/components/translations/translations.component.ts +1 -1
|
@@ -188,7 +188,24 @@ export default class ZnSlashMenu extends ZincElement {
|
|
|
188
188
|
|
|
189
189
|
private scrollActiveIntoView() {
|
|
190
190
|
const active = this.renderRoot.querySelector<HTMLElement>('[data-slash-item][aria-selected="true"]');
|
|
191
|
-
active
|
|
191
|
+
if (!active) return;
|
|
192
|
+
|
|
193
|
+
const items = this.visibleItems;
|
|
194
|
+
const panel = this.panel;
|
|
195
|
+
|
|
196
|
+
// The heading and footer scroll with the list, and `nearest` stops at the item's own box — so
|
|
197
|
+
// landing on the first or last item goes all the way to the panel's edge to bring them back
|
|
198
|
+
if (panel && items.slice(0, this.activeIndex).every(item => item.disabled)) {
|
|
199
|
+
panel.scrollTop = 0;
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (panel && items.slice(this.activeIndex + 1).every(item => item.disabled)) {
|
|
204
|
+
panel.scrollTop = panel.scrollHeight;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
active.scrollIntoView({block: 'nearest'});
|
|
192
209
|
}
|
|
193
210
|
|
|
194
211
|
// mousedown, not click: preventDefault keeps focus (and the caret) in the field
|
|
@@ -216,6 +233,11 @@ export default class ZnSlashMenu extends ZincElement {
|
|
|
216
233
|
protected updated(changed: PropertyValues) {
|
|
217
234
|
super.updated(changed);
|
|
218
235
|
|
|
236
|
+
// A new list, or a reopen, starts at the top rather than wherever the last one was scrolled to
|
|
237
|
+
if (changed.has('items') || (changed.has('open') && this.open)) {
|
|
238
|
+
this.scrollActiveIntoView();
|
|
239
|
+
}
|
|
240
|
+
|
|
219
241
|
if (changed.has('open') || changed.has('anchor')) {
|
|
220
242
|
if (this.open) {
|
|
221
243
|
this.startPositioner();
|
|
@@ -45,7 +45,7 @@ export default class ZnTranslations extends ZincElement implements ZincFormContr
|
|
|
45
45
|
@property({attribute: "textarea-rows", type: Number}) textareaRows: number | undefined;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Quick insertions offered by the slash menu
|
|
48
|
+
* Quick insertions offered by the slash menu on `text` and `textarea` inputs. Accepts a JSON array of items, or
|
|
49
49
|
* the shorthand `Brand name={{BRAND_NAME}}, Support email={{SUPPORT_EMAIL}}`. Every language shares the list.
|
|
50
50
|
*/
|
|
51
51
|
@property({
|