@zeyos/zx 5.3.0 → 5.5.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/CHANGELOG.md +125 -0
- package/README.md +49 -16
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +33 -0
- package/dist/types/components/badge/badge.d.ts +5 -4
- package/dist/types/components/datebox/date-range-box.d.ts +15 -2
- package/dist/types/components/datebox/datebox.d.ts +37 -3
- package/dist/types/components/kbd/kbd.d.ts +41 -0
- package/dist/types/components/launcher/launcher.d.ts +4 -2
- package/dist/types/components/prose/prose.d.ts +69 -0
- package/dist/types/components/questionnaire/questionnaire.d.ts +0 -36
- package/dist/types/components/stat-tile/stat-tile.d.ts +20 -0
- package/dist/types/components/tag-picker/tag-picker.d.ts +11 -5
- package/dist/types/components/tree/tree.d.ts +44 -3
- package/dist/types/core/icons.d.ts +22 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/internal/app-rail.d.ts +10 -3
- package/dist/types/internal/row-actions.d.ts +151 -0
- package/dist/zx-zeyos.esm.js +264 -82
- package/dist/zx-zeyos.esm.min.js +4 -4
- package/dist/zx.css +1288 -439
- package/dist/zx.esm.js +952 -392
- package/dist/zx.esm.min.js +6 -6
- package/dist/zx.global.js +952 -392
- package/dist/zx.global.min.js +6 -6
- package/dist/zx.min.css +1 -1
- package/docs/api.json +112 -4
- package/docs/llms.md +433 -38
- package/docs/llms.txt +21 -1
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.js +2 -2
- package/src/components/app-rail/app-rail.css +11 -11
- package/src/components/app-sidebar/app-sidebar.css +90 -17
- package/src/components/app-sidebar/app-sidebar.js +120 -12
- package/src/components/badge/badge.css +33 -20
- package/src/components/badge/badge.js +5 -4
- package/src/components/breadcrumb/breadcrumb.css +28 -3
- package/src/components/breadcrumb/breadcrumb.js +2 -2
- package/src/components/button/button.css +24 -13
- package/src/components/button/button.js +20 -2
- package/src/components/calendar/calendar.css +14 -4
- package/src/components/card-view/card-view.js +2 -2
- package/src/components/chart/chart.js +20 -5
- package/src/components/check-button/check-button.css +11 -3
- package/src/components/check-button/check-button.js +3 -3
- package/src/components/context-menu/context-menu.css +7 -1
- package/src/components/date-picker/date-picker.css +6 -0
- package/src/components/date-picker/date-picker.js +5 -5
- package/src/components/date-picker/date-range-picker.css +6 -0
- package/src/components/date-picker/date-range-picker.js +3 -3
- package/src/components/date-picker/month-picker.js +3 -3
- package/src/components/date-picker/time-picker.css +6 -0
- package/src/components/datebox/date-range-box.js +30 -6
- package/src/components/datebox/datebox.js +44 -7
- package/src/components/dialog/dialog.css +0 -1
- package/src/components/dialog/dialog.js +2 -1
- package/src/components/dock/dock.js +2 -2
- package/src/components/dropdown/dropdown.css +2 -1
- package/src/components/entity-ref/entity-ref.css +8 -1
- package/src/components/file-item/file-item.css +1 -1
- package/src/components/finder/finder.js +2 -2
- package/src/components/groupbox/groupbox.js +2 -2
- package/src/components/kanban-view/kanban-view.css +8 -4
- package/src/components/kanban-view/kanban-view.js +3 -3
- package/src/components/kbd/kbd.css +64 -0
- package/src/components/kbd/kbd.js +121 -0
- package/src/components/launcher/launcher.css +30 -25
- package/src/components/launcher/launcher.js +15 -21
- package/src/components/list-toolbar/list-toolbar.css +7 -1
- package/src/components/menu-button/menu-button.css +9 -2
- package/src/components/message/message.css +6 -2
- package/src/components/message/message.js +2 -2
- package/src/components/module-bar/module-bar.css +11 -1
- package/src/components/multi-value-editor/multi-value-editor.js +4 -4
- package/src/components/navigation-bar/navigation-bar.css +3 -2
- package/src/components/pagination/pagination.js +2 -2
- package/src/components/panel/panel.js +2 -2
- package/src/components/prose/prose.css +53 -0
- package/src/components/prose/prose.js +152 -0
- package/src/components/questionnaire/questionnaire.css +7 -17
- package/src/components/questionnaire/questionnaire.js +16 -1
- package/src/components/rating/rating.css +3 -1
- package/src/components/search/search.js +2 -2
- package/src/components/select/glyphs.js +3 -3
- package/src/components/select/select.css +35 -7
- package/src/components/select/select.js +4 -4
- package/src/components/stat-tile/stat-tile.css +56 -2
- package/src/components/stat-tile/stat-tile.js +25 -2
- package/src/components/stepper/stepper.css +2 -1
- package/src/components/stepper/stepper.js +3 -3
- package/src/components/tabbox/tabbox.css +2 -2
- package/src/components/tabbox/tabbox.js +2 -2
- package/src/components/table/table.css +52 -16
- package/src/components/table/table.js +7 -5
- package/src/components/tag-picker/tag-picker.css +56 -43
- package/src/components/tag-picker/tag-picker.js +21 -16
- package/src/components/tree/tree.css +44 -0
- package/src/components/tree/tree.js +97 -9
- package/src/components/value-list/value-list.css +25 -4
- package/src/components/value-list/value-list.js +2 -1
- package/src/components/view/record-view.js +3 -3
- package/src/components/view-settings/view-settings.css +2 -1
- package/src/components/workspace-switcher/workspace-switcher.js +3 -3
- package/src/core/icons.js +34 -3
- package/src/elements/define.js +1 -0
- package/src/index.js +4 -2
- package/src/internal/app-rail.js +5 -1
- package/src/internal/row-actions.js +203 -0
- package/styles/base.css +26 -1
- package/styles/prose.css +306 -0
- package/styles/tokens/dark.css +108 -103
- package/styles/tokens/global.css +24 -9
- package/styles/tokens/semantic.css +520 -198
- package/styles/tokens/themes.css +9 -0
- package/styles/zx.css +3 -0
package/dist/zx-zeyos.esm.js
CHANGED
|
@@ -3000,6 +3000,22 @@ function loadFontAwesomeKit(kit) {
|
|
|
3000
3000
|
|
|
3001
3001
|
// src/core/icons.js
|
|
3002
3002
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
3003
|
+
var ICON_SIZE = Object.freeze({
|
|
3004
|
+
/** The default: an icon that is a control's content or leads its label. */
|
|
3005
|
+
control: 16,
|
|
3006
|
+
/** Dropdown, disclosure, and reorder chevrons; calendar and pager arrows; breadcrumb separators. */
|
|
3007
|
+
chevron: 14,
|
|
3008
|
+
/** The × that clears a field, closes a tab, dialog, or message, or removes a row. */
|
|
3009
|
+
dismiss: 14,
|
|
3010
|
+
/** The check of a selected option, a pressed toggle button, or a completed step. */
|
|
3011
|
+
check: 14,
|
|
3012
|
+
/** The sort-direction arrow beside a column heading. */
|
|
3013
|
+
sort: 14,
|
|
3014
|
+
/** Any glyph inside a chip or token, its remove × included. */
|
|
3015
|
+
chip: 12,
|
|
3016
|
+
/** A glyph drawn inside a small status marker. */
|
|
3017
|
+
marker: 8
|
|
3018
|
+
});
|
|
3003
3019
|
var VIEW_BOX = "0 0 24 24";
|
|
3004
3020
|
var STROKE_WIDTH = 1.75;
|
|
3005
3021
|
var MIN_STROKE_PX = 1;
|
|
@@ -3010,6 +3026,8 @@ var icons = Object.freeze({
|
|
|
3010
3026
|
// arrow-up-wide-narrow
|
|
3011
3027
|
"arrow-down-wide-short": outline("M3 16l4 4 4-4M7 20V4M11 4h10M11 8h7M11 12h4"),
|
|
3012
3028
|
// arrow-down-wide-narrow
|
|
3029
|
+
"arrow-up": outline("M5 12l7-7 7 7M12 19V5"),
|
|
3030
|
+
"arrow-down": outline("M12 5v14M19 12l-7 7-7-7"),
|
|
3013
3031
|
"chevron-down": outline("M6 9l6 6 6-6"),
|
|
3014
3032
|
"chevron-up": outline("M18 15l-6-6-6 6"),
|
|
3015
3033
|
"chevron-left": outline("M15 18l-6-6 6-6"),
|
|
@@ -3140,7 +3158,7 @@ function builtinIcon(name2, options) {
|
|
|
3140
3158
|
return svg;
|
|
3141
3159
|
}
|
|
3142
3160
|
function iconSvg(viewBox, paint, options) {
|
|
3143
|
-
const { size =
|
|
3161
|
+
const { size = ICON_SIZE.control } = options;
|
|
3144
3162
|
const svg = document.createElementNS(SVG_NS, "svg");
|
|
3145
3163
|
svg.setAttribute("class", classList("zx-icon", options.class));
|
|
3146
3164
|
svg.setAttribute("viewBox", viewBox);
|
|
@@ -3180,7 +3198,7 @@ function warnMissingIcon(name2) {
|
|
|
3180
3198
|
console.warn(`[zx.icon] Unknown icon "${name2}" \u2014 rendered an empty placeholder. Add it with registerIcons(), or render Font Awesome with useFontAwesome().`);
|
|
3181
3199
|
}
|
|
3182
3200
|
function faIcon(classes, options) {
|
|
3183
|
-
const { size =
|
|
3201
|
+
const { size = ICON_SIZE.control } = options;
|
|
3184
3202
|
const element = document.createElement("i");
|
|
3185
3203
|
element.className = classList("zx-icon", ...classes, options.class);
|
|
3186
3204
|
element.style.fontSize = typeof size === "number" ? `${size}px` : String(size);
|
|
@@ -3584,7 +3602,7 @@ var DatePicker = class extends Component {
|
|
|
3584
3602
|
class: "zx-date-picker__nav",
|
|
3585
3603
|
type: "button",
|
|
3586
3604
|
ariaLabel: this._message("datePicker.previousMonth", "Previous month")
|
|
3587
|
-
}, icon("chevron-left")),
|
|
3605
|
+
}, icon("chevron-left", { size: ICON_SIZE.chevron })),
|
|
3588
3606
|
h("button", {
|
|
3589
3607
|
ref: "heading",
|
|
3590
3608
|
class: "zx-date-picker__heading",
|
|
@@ -3597,7 +3615,7 @@ var DatePicker = class extends Component {
|
|
|
3597
3615
|
class: "zx-date-picker__nav",
|
|
3598
3616
|
type: "button",
|
|
3599
3617
|
ariaLabel: this._message("datePicker.nextMonth", "Next month")
|
|
3600
|
-
}, icon("chevron-right"))
|
|
3618
|
+
}, icon("chevron-right", { size: ICON_SIZE.chevron }))
|
|
3601
3619
|
),
|
|
3602
3620
|
h(
|
|
3603
3621
|
"div",
|
|
@@ -3614,14 +3632,14 @@ var DatePicker = class extends Component {
|
|
|
3614
3632
|
class: "zx-date-picker__nav",
|
|
3615
3633
|
type: "button",
|
|
3616
3634
|
ariaLabel: this._message("datePicker.previousYear", "Previous year")
|
|
3617
|
-
}, icon("chevron-left")),
|
|
3635
|
+
}, icon("chevron-left", { size: ICON_SIZE.chevron })),
|
|
3618
3636
|
h("span", { ref: "quickYear", class: "zx-date-picker__quick-year", ariaLive: "polite" }),
|
|
3619
3637
|
h("button", {
|
|
3620
3638
|
ref: "quickNext",
|
|
3621
3639
|
class: "zx-date-picker__nav",
|
|
3622
3640
|
type: "button",
|
|
3623
3641
|
ariaLabel: this._message("datePicker.nextYear", "Next year")
|
|
3624
|
-
}, icon("chevron-right"))
|
|
3642
|
+
}, icon("chevron-right", { size: ICON_SIZE.chevron }))
|
|
3625
3643
|
),
|
|
3626
3644
|
h("div", { ref: "quickGrid", class: "zx-date-picker__quick-grid", role: "grid" })
|
|
3627
3645
|
),
|
|
@@ -4039,14 +4057,14 @@ var MonthPicker = class extends DatePicker {
|
|
|
4039
4057
|
class: "zx-month-picker__nav",
|
|
4040
4058
|
type: "button",
|
|
4041
4059
|
ariaLabel: this._message("monthPicker.previousYear", "Previous year")
|
|
4042
|
-
}, icon("chevron-left")),
|
|
4060
|
+
}, icon("chevron-left", { size: ICON_SIZE.chevron })),
|
|
4043
4061
|
h("span", { ref: "year", class: "zx-month-picker__year", ariaLive: "polite" }),
|
|
4044
4062
|
h("button", {
|
|
4045
4063
|
ref: "nextYear",
|
|
4046
4064
|
class: "zx-month-picker__nav",
|
|
4047
4065
|
type: "button",
|
|
4048
4066
|
ariaLabel: this._message("monthPicker.nextYear", "Next year")
|
|
4049
|
-
}, icon("chevron-right"))
|
|
4067
|
+
}, icon("chevron-right", { size: ICON_SIZE.chevron }))
|
|
4050
4068
|
),
|
|
4051
4069
|
h("div", {
|
|
4052
4070
|
ref: "grid",
|
|
@@ -4936,14 +4954,14 @@ var DateRangePicker = class extends Component {
|
|
|
4936
4954
|
type: "button",
|
|
4937
4955
|
dataset: { nav: "previous" },
|
|
4938
4956
|
ariaLabel: text("daterange.previousMonth", "Previous month")
|
|
4939
|
-
}, icon("chevron-left")),
|
|
4957
|
+
}, icon("chevron-left", { size: ICON_SIZE.chevron })),
|
|
4940
4958
|
h("div", { class: "zx-date-range-picker__caption", ariaHidden: "true" }, caption),
|
|
4941
4959
|
h("button", {
|
|
4942
4960
|
class: "zx-date-range-picker__nav",
|
|
4943
4961
|
type: "button",
|
|
4944
4962
|
dataset: { nav: "next" },
|
|
4945
4963
|
ariaLabel: text("daterange.nextMonth", "Next month")
|
|
4946
|
-
}, icon("chevron-right"))
|
|
4964
|
+
}, icon("chevron-right", { size: ICON_SIZE.chevron }))
|
|
4947
4965
|
),
|
|
4948
4966
|
h(
|
|
4949
4967
|
"table",
|
|
@@ -5269,6 +5287,7 @@ var DateRangeBox = class extends Component {
|
|
|
5269
5287
|
start: null,
|
|
5270
5288
|
end: null,
|
|
5271
5289
|
format: "%d.%m.%Y",
|
|
5290
|
+
displayFormat: null,
|
|
5272
5291
|
separator: " \u2013 ",
|
|
5273
5292
|
placeholder: null,
|
|
5274
5293
|
clearable: true,
|
|
@@ -5296,9 +5315,11 @@ var DateRangeBox = class extends Component {
|
|
|
5296
5315
|
this._originalClearable = root.getAttribute("data-clearable");
|
|
5297
5316
|
root.toggleAttribute("data-clearable", Boolean(this.options.clearable));
|
|
5298
5317
|
this._format = String(this.options.format || "%d.%m.%Y");
|
|
5318
|
+
this._displayFormat = this.options.displayFormat ? String(this.options.displayFormat) : this._format;
|
|
5299
5319
|
this._separator = String(this.options.separator ?? " \u2013 ");
|
|
5300
5320
|
this._disabled = Boolean(this.options.disabled);
|
|
5301
5321
|
this._open = false;
|
|
5322
|
+
this._focused = false;
|
|
5302
5323
|
this._position = null;
|
|
5303
5324
|
this._range = this._coerce({ start: this.options.start, end: this.options.end });
|
|
5304
5325
|
const popoverId = uid("zx-date-range-box-popover");
|
|
@@ -5323,7 +5344,7 @@ var DateRangeBox = class extends Component {
|
|
|
5323
5344
|
class: "zx-icon-btn zx-date-range-box__clear",
|
|
5324
5345
|
type: "button",
|
|
5325
5346
|
ariaLabel: text2("daterange.clear", "Clear date range")
|
|
5326
|
-
}, icon("x", { size:
|
|
5347
|
+
}, icon("x", { size: ICON_SIZE.dismiss })),
|
|
5327
5348
|
h("button", {
|
|
5328
5349
|
ref: "toggle",
|
|
5329
5350
|
class: "zx-date-range-box__toggle",
|
|
@@ -5366,8 +5387,16 @@ var DateRangeBox = class extends Component {
|
|
|
5366
5387
|
this._apply({ start: event.detail.start, end: event.detail.end }, { push: false });
|
|
5367
5388
|
if (event.detail.start && event.detail.end) this._close(true);
|
|
5368
5389
|
});
|
|
5390
|
+
this.listen(this.refs.input, "focus", () => {
|
|
5391
|
+
this._focused = true;
|
|
5392
|
+
if (this.el.dataset.state !== "invalid") this._syncDisplay();
|
|
5393
|
+
});
|
|
5369
5394
|
this.listen(this.refs.input, "blur", () => {
|
|
5395
|
+
this._focused = false;
|
|
5370
5396
|
if (!this._open) this._commitText();
|
|
5397
|
+
else if (this.refs.input.value === formatRangeText(this._range, this._format, this._separator)) {
|
|
5398
|
+
this._syncDisplay();
|
|
5399
|
+
}
|
|
5371
5400
|
});
|
|
5372
5401
|
this.listen(this.refs.input, "keydown", (event) => this._onInputKeydown(event));
|
|
5373
5402
|
this.listen(this.refs.toggle, "click", () => this._open ? this.close() : this.open());
|
|
@@ -5581,9 +5610,16 @@ var DateRangeBox = class extends Component {
|
|
|
5581
5610
|
const one = this._format.replace(/%[demYy]/g, (token) => PLACEHOLDER_TOKENS[token] ?? token);
|
|
5582
5611
|
return `${one}${this._separator}${one}`;
|
|
5583
5612
|
}
|
|
5584
|
-
/**
|
|
5613
|
+
/**
|
|
5614
|
+
* Writes the range into the input: in the typing format while the input has focus, in the
|
|
5615
|
+
* display format otherwise. Text that is already there is left alone, so the caret stays put.
|
|
5616
|
+
* @returns {void}
|
|
5617
|
+
*/
|
|
5585
5618
|
_syncDisplay() {
|
|
5586
|
-
|
|
5619
|
+
const input = this.refs.input;
|
|
5620
|
+
const format2 = this._focused ? this._format : this._displayFormat;
|
|
5621
|
+
const text3 = formatRangeText(this._range, format2, this._separator);
|
|
5622
|
+
if (input.value !== text3) input.value = text3;
|
|
5587
5623
|
this._syncClear();
|
|
5588
5624
|
}
|
|
5589
5625
|
/** A disabled box offers no clear button: there is nothing it could do. @returns {void} */
|
|
@@ -5657,6 +5693,7 @@ var Datebox = class extends Component {
|
|
|
5657
5693
|
static defaults = {
|
|
5658
5694
|
value: null,
|
|
5659
5695
|
format: "%d.%m.%Y",
|
|
5696
|
+
displayFormat: null,
|
|
5660
5697
|
time: false,
|
|
5661
5698
|
min: null,
|
|
5662
5699
|
max: null,
|
|
@@ -5675,9 +5712,12 @@ var Datebox = class extends Component {
|
|
|
5675
5712
|
this._originalAriaDisabled = root.getAttribute("aria-disabled");
|
|
5676
5713
|
this._originalClearable = root.getAttribute("data-clearable");
|
|
5677
5714
|
root.toggleAttribute("data-clearable", Boolean(this.options.clearable));
|
|
5678
|
-
|
|
5715
|
+
const formats = dateboxFormats(this.options);
|
|
5716
|
+
this._format = formats.format;
|
|
5717
|
+
this._displayFormat = formats.display;
|
|
5679
5718
|
this._disabled = Boolean(this.options.disabled);
|
|
5680
5719
|
this._open = false;
|
|
5720
|
+
this._focused = false;
|
|
5681
5721
|
this._position = null;
|
|
5682
5722
|
this._min = validDate4(this.options.min);
|
|
5683
5723
|
this._max = validDate4(this.options.max);
|
|
@@ -5704,7 +5744,7 @@ var Datebox = class extends Component {
|
|
|
5704
5744
|
class: "zx-icon-btn zx-datebox__clear",
|
|
5705
5745
|
type: "button",
|
|
5706
5746
|
ariaLabel: "Clear date"
|
|
5707
|
-
}, icon("x", { size:
|
|
5747
|
+
}, icon("x", { size: ICON_SIZE.dismiss })),
|
|
5708
5748
|
h("button", {
|
|
5709
5749
|
ref: "toggle",
|
|
5710
5750
|
class: "zx-datebox__toggle",
|
|
@@ -5736,7 +5776,14 @@ var Datebox = class extends Component {
|
|
|
5736
5776
|
this.set(event.detail.date);
|
|
5737
5777
|
if (!this.options.time) this._close(true);
|
|
5738
5778
|
});
|
|
5739
|
-
this.listen(this.refs.input, "
|
|
5779
|
+
this.listen(this.refs.input, "focus", () => {
|
|
5780
|
+
this._focused = true;
|
|
5781
|
+
if (this.el.dataset.state !== "invalid") this._syncDisplay();
|
|
5782
|
+
});
|
|
5783
|
+
this.listen(this.refs.input, "blur", () => {
|
|
5784
|
+
this._focused = false;
|
|
5785
|
+
this._commitText();
|
|
5786
|
+
});
|
|
5740
5787
|
this.listen(this.refs.input, "keydown", (event) => this._onInputKeydown(event));
|
|
5741
5788
|
this.listen(this.refs.toggle, "click", () => this._open ? this.close() : this.open());
|
|
5742
5789
|
this.listen(this.refs.toggle, "keydown", (event) => {
|
|
@@ -5887,9 +5934,16 @@ var Datebox = class extends Component {
|
|
|
5887
5934
|
if (!date || Number.isNaN(date.getTime())) return null;
|
|
5888
5935
|
return clampDate(date, this._min, this._max);
|
|
5889
5936
|
}
|
|
5890
|
-
/**
|
|
5937
|
+
/**
|
|
5938
|
+
* Writes the value into the input: in the typing format while the input has focus, in the
|
|
5939
|
+
* display format otherwise. Text that is already there is left alone, so the caret stays put.
|
|
5940
|
+
* @returns {void}
|
|
5941
|
+
*/
|
|
5891
5942
|
_syncDisplay() {
|
|
5892
|
-
|
|
5943
|
+
const input = this.refs.input;
|
|
5944
|
+
const format2 = this._focused ? this._format : this._displayFormat;
|
|
5945
|
+
const text3 = this._value ? formatDate(this._value, format2) : "";
|
|
5946
|
+
if (input.value !== text3) input.value = text3;
|
|
5893
5947
|
this._syncClear();
|
|
5894
5948
|
}
|
|
5895
5949
|
/** A disabled box offers no clear button: there is nothing it could do. @returns {void} */
|
|
@@ -5935,6 +5989,10 @@ var DateTimeBox = function DateTimeBox2(target, options = {}) {
|
|
|
5935
5989
|
function validDate4(value) {
|
|
5936
5990
|
return value instanceof Date && !Number.isNaN(value.getTime()) ? new Date(value.getTime()) : null;
|
|
5937
5991
|
}
|
|
5992
|
+
function dateboxFormats({ format: format2 = null, displayFormat = null, time = false } = {}) {
|
|
5993
|
+
const typing = effectiveFormat(format2, time);
|
|
5994
|
+
return { format: typing, display: displayFormat ? effectiveFormat(displayFormat, time) : typing };
|
|
5995
|
+
}
|
|
5938
5996
|
function effectiveFormat(format2, time) {
|
|
5939
5997
|
const value = String(format2 || "%d.%m.%Y");
|
|
5940
5998
|
return time && !/%[HM]/.test(value) ? `${value} %H:%M` : value;
|
|
@@ -6489,20 +6547,20 @@ var MultiValueEditor = class extends Component {
|
|
|
6489
6547
|
ariaDisabled: String(index === 0),
|
|
6490
6548
|
ariaLabel: `Move value ${index + 1} up`,
|
|
6491
6549
|
dataset: { action: "up", index }
|
|
6492
|
-
}, icon("chevron-up", { size:
|
|
6550
|
+
}, icon("chevron-up", { size: ICON_SIZE.chevron })) : null,
|
|
6493
6551
|
buttons ? h("button", {
|
|
6494
6552
|
class: "zx-btn",
|
|
6495
6553
|
type: "button",
|
|
6496
6554
|
ariaDisabled: String(index === last),
|
|
6497
6555
|
ariaLabel: `Move value ${index + 1} down`,
|
|
6498
6556
|
dataset: { action: "down", index }
|
|
6499
|
-
}, icon("chevron-down", { size:
|
|
6557
|
+
}, icon("chevron-down", { size: ICON_SIZE.chevron })) : null,
|
|
6500
6558
|
h("button", {
|
|
6501
6559
|
class: "zx-btn",
|
|
6502
6560
|
type: "button",
|
|
6503
6561
|
ariaLabel: `Remove value ${index + 1}`,
|
|
6504
6562
|
dataset: { action: "remove", index }
|
|
6505
|
-
}, icon("x", { size:
|
|
6563
|
+
}, icon("x", { size: ICON_SIZE.dismiss }))
|
|
6506
6564
|
)
|
|
6507
6565
|
);
|
|
6508
6566
|
});
|
|
@@ -7677,8 +7735,8 @@ function statusIcon(status, options = {}) {
|
|
|
7677
7735
|
dataset: { indicator, tone }
|
|
7678
7736
|
})
|
|
7679
7737
|
);
|
|
7680
|
-
if (indicator === "done") marker.append(icon("check", { size:
|
|
7681
|
-
if (indicator === "canceled") marker.append(icon("x", { size:
|
|
7738
|
+
if (indicator === "done") marker.append(icon("check", { size: ICON_SIZE.marker }));
|
|
7739
|
+
if (indicator === "canceled") marker.append(icon("x", { size: ICON_SIZE.marker }));
|
|
7682
7740
|
return name(marker, options?.label);
|
|
7683
7741
|
}
|
|
7684
7742
|
function priorityIcon(level, options = {}) {
|
|
@@ -7797,7 +7855,7 @@ var Select = class _Select extends Component {
|
|
|
7797
7855
|
tabIndex: -1,
|
|
7798
7856
|
ariaLabel: this._message("select.clear", "Clear selection"),
|
|
7799
7857
|
hidden: true
|
|
7800
|
-
}, icon("x", { size:
|
|
7858
|
+
}, icon("x", { size: ICON_SIZE.dismiss }));
|
|
7801
7859
|
const loading = h("span", {
|
|
7802
7860
|
ref: "loading",
|
|
7803
7861
|
class: "zx-select__loading",
|
|
@@ -7811,7 +7869,7 @@ var Select = class _Select extends Component {
|
|
|
7811
7869
|
type: "button",
|
|
7812
7870
|
tabIndex: -1,
|
|
7813
7871
|
ariaLabel: this._message("select.toggle", "Toggle options")
|
|
7814
|
-
}, icon("chevron-down", { size:
|
|
7872
|
+
}, icon("chevron-down", { size: ICON_SIZE.chevron }));
|
|
7815
7873
|
const control = h(
|
|
7816
7874
|
"div",
|
|
7817
7875
|
{ ref: "control", class: "zx-select__control" },
|
|
@@ -8422,7 +8480,7 @@ var Select = class _Select extends Component {
|
|
|
8422
8480
|
ariaSelected: String(selected),
|
|
8423
8481
|
dataset: { index }
|
|
8424
8482
|
}, h("span", { class: "zx-select__option-content" }, content));
|
|
8425
|
-
if (selected) option.append(icon("check", { size:
|
|
8483
|
+
if (selected) option.append(icon("check", { size: ICON_SIZE.check }));
|
|
8426
8484
|
this.refs.list.append(option);
|
|
8427
8485
|
this._optionEntries.push({ item, clear, action: null, element: option });
|
|
8428
8486
|
}
|
|
@@ -9128,6 +9186,52 @@ var defaults = Object.freeze({
|
|
|
9128
9186
|
size: "md",
|
|
9129
9187
|
dot: false
|
|
9130
9188
|
});
|
|
9189
|
+
function badge(opts = {}) {
|
|
9190
|
+
const options = { ...defaults, ...opts };
|
|
9191
|
+
const element = (
|
|
9192
|
+
/** @type {HTMLSpanElement} */
|
|
9193
|
+
h("span", {
|
|
9194
|
+
class: "zx-badge",
|
|
9195
|
+
title: options.title,
|
|
9196
|
+
dataset: {
|
|
9197
|
+
kind: normalizeKind(options.kind),
|
|
9198
|
+
variant: normalizeVariant(options.variant),
|
|
9199
|
+
size: normalizeSize(options.size),
|
|
9200
|
+
tone: normalizeBadgeTone(options.tone) ?? void 0
|
|
9201
|
+
}
|
|
9202
|
+
})
|
|
9203
|
+
);
|
|
9204
|
+
if (options.dot) {
|
|
9205
|
+
element.append(h("span", { class: "zx-badge__dot", ariaHidden: "true" }));
|
|
9206
|
+
} else if (options.icon) {
|
|
9207
|
+
element.append(icon(options.icon, { size: 12, class: "zx-badge__icon" }));
|
|
9208
|
+
}
|
|
9209
|
+
if (options.label !== "" && options.label != null) {
|
|
9210
|
+
element.append(h("span", { class: "zx-badge__label" }, String(options.label)));
|
|
9211
|
+
} else if (options.title) {
|
|
9212
|
+
element.setAttribute("role", "img");
|
|
9213
|
+
element.setAttribute("aria-label", options.title);
|
|
9214
|
+
}
|
|
9215
|
+
return element;
|
|
9216
|
+
}
|
|
9217
|
+
function normalizeKind(value) {
|
|
9218
|
+
return KINDS.includes(
|
|
9219
|
+
/** @type {string} */
|
|
9220
|
+
value
|
|
9221
|
+
) ? (
|
|
9222
|
+
/** @type {'neutral'|'accent'|'success'|'warning'|'danger'|'info'} */
|
|
9223
|
+
value
|
|
9224
|
+
) : "neutral";
|
|
9225
|
+
}
|
|
9226
|
+
function normalizeVariant(value) {
|
|
9227
|
+
return VARIANTS.includes(
|
|
9228
|
+
/** @type {string} */
|
|
9229
|
+
value
|
|
9230
|
+
) ? (
|
|
9231
|
+
/** @type {'soft'|'solid'|'outline'} */
|
|
9232
|
+
value
|
|
9233
|
+
) : "soft";
|
|
9234
|
+
}
|
|
9131
9235
|
function normalizeBadgeTone(value) {
|
|
9132
9236
|
return BADGE_TONES.includes(
|
|
9133
9237
|
/** @type {BadgeTone} */
|
|
@@ -9137,6 +9241,9 @@ function normalizeBadgeTone(value) {
|
|
|
9137
9241
|
value
|
|
9138
9242
|
) : null;
|
|
9139
9243
|
}
|
|
9244
|
+
function normalizeSize(value) {
|
|
9245
|
+
return value === "sm" ? "sm" : "md";
|
|
9246
|
+
}
|
|
9140
9247
|
|
|
9141
9248
|
// src/components/tag-picker/tag-picker.js
|
|
9142
9249
|
var TagPicker = class extends Component {
|
|
@@ -9207,7 +9314,7 @@ var TagPicker = class extends Component {
|
|
|
9207
9314
|
type: "button",
|
|
9208
9315
|
tabIndex: -1,
|
|
9209
9316
|
ariaLabel: this._message("tagPicker.toggle", "Toggle options")
|
|
9210
|
-
}, icon("chevron-down", { size:
|
|
9317
|
+
}, icon("chevron-down", { size: ICON_SIZE.chevron }));
|
|
9211
9318
|
const control = h(
|
|
9212
9319
|
"div",
|
|
9213
9320
|
{ ref: "control", class: "zx-tag-picker__control" },
|
|
@@ -9486,24 +9593,28 @@ var TagPicker = class extends Component {
|
|
|
9486
9593
|
if (!this._createdRoot && root) restoreTarget(root, this._snapshot);
|
|
9487
9594
|
}
|
|
9488
9595
|
/* ------------------------------------------------------------------ rendering -- */
|
|
9489
|
-
/**
|
|
9596
|
+
/**
|
|
9597
|
+
* Draws the selection. A tag is a Badge — `badge({ tone })` with the picker's own class — so it
|
|
9598
|
+
* has one construction wherever a label appears, and only the remove button is the picker's.
|
|
9599
|
+
* @returns {void}
|
|
9600
|
+
*/
|
|
9490
9601
|
_renderTags() {
|
|
9491
9602
|
const tags = this._selected.map((item) => {
|
|
9492
9603
|
const label = this._labelOf(item);
|
|
9493
9604
|
const tone = this._toneOf(item);
|
|
9494
9605
|
const color = tone ? null : this._colorOf(item);
|
|
9495
|
-
const content = this.options.renderTag ? this.options.renderTag(item) : [this._iconOf(item), h("span", { class: "zx-tag-picker__tag-label" }, label)];
|
|
9496
|
-
const tag =
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9606
|
+
const content = this.options.renderTag ? [this.options.renderTag(item)] : [this._iconOf(item), h("span", { class: "zx-badge__label zx-tag-picker__tag-label" }, label)];
|
|
9607
|
+
const tag = badge({ tone });
|
|
9608
|
+
tag.classList.add("zx-tag-picker__tag");
|
|
9609
|
+
tag.dataset.colored = String(Boolean(color));
|
|
9610
|
+
if (color) tag.style.setProperty("--zx-tag-color", color);
|
|
9611
|
+
tag.append(...content.filter((node) => node !== null && node !== void 0));
|
|
9501
9612
|
if (!this._readonly && !this._disabled) {
|
|
9502
9613
|
tag.append(h("button", {
|
|
9503
9614
|
class: "zx-icon-btn zx-tag-picker__remove",
|
|
9504
9615
|
type: "button",
|
|
9505
9616
|
ariaLabel: this._message("tagPicker.remove", "Remove %1", [label])
|
|
9506
|
-
}, icon("x", { size:
|
|
9617
|
+
}, icon("x", { size: ICON_SIZE.chip })));
|
|
9507
9618
|
}
|
|
9508
9619
|
return tag;
|
|
9509
9620
|
});
|
|
@@ -9530,7 +9641,7 @@ var TagPicker = class extends Component {
|
|
|
9530
9641
|
h(
|
|
9531
9642
|
"span",
|
|
9532
9643
|
{ class: "zx-tag-picker__check", ariaHidden: "true" },
|
|
9533
|
-
selected ? icon("check", { size:
|
|
9644
|
+
selected ? icon("check", { size: ICON_SIZE.check }) : null
|
|
9534
9645
|
),
|
|
9535
9646
|
h(
|
|
9536
9647
|
"span",
|
|
@@ -9553,7 +9664,7 @@ var TagPicker = class extends Component {
|
|
|
9553
9664
|
ariaSelected: "false",
|
|
9554
9665
|
dataset: { create: "true" }
|
|
9555
9666
|
},
|
|
9556
|
-
h("span", { class: "zx-tag-picker__check", ariaHidden: "true" }, icon("plus", { size:
|
|
9667
|
+
h("span", { class: "zx-tag-picker__check", ariaHidden: "true" }, icon("plus", { size: ICON_SIZE.check })),
|
|
9557
9668
|
h(
|
|
9558
9669
|
"span",
|
|
9559
9670
|
{ class: "zx-tag-picker__option-label" },
|
|
@@ -10530,7 +10641,7 @@ var ValueList = class extends Component {
|
|
|
10530
10641
|
class: "zx-value-list__remove",
|
|
10531
10642
|
dataset: { remove: "" },
|
|
10532
10643
|
ariaHidden: "true"
|
|
10533
|
-
}, "
|
|
10644
|
+
}, icon("x", { size: ICON_SIZE.chip })) : null));
|
|
10534
10645
|
this._list.replaceChildren(...chips);
|
|
10535
10646
|
if (focusIndex >= 0) chips[Math.min(focusIndex, chips.length - 1)]?.focus();
|
|
10536
10647
|
}
|
|
@@ -11149,6 +11260,75 @@ function matches(element, selector, fallback) {
|
|
|
11149
11260
|
}
|
|
11150
11261
|
}
|
|
11151
11262
|
|
|
11263
|
+
// src/components/kbd/kbd.js
|
|
11264
|
+
var MODIFIERS = Object.freeze({
|
|
11265
|
+
mod: ["\u2318", "Ctrl"],
|
|
11266
|
+
meta: ["\u2318", "Meta"],
|
|
11267
|
+
cmd: ["\u2318", "Ctrl"],
|
|
11268
|
+
command: ["\u2318", "Ctrl"],
|
|
11269
|
+
ctrl: ["\u2303", "Ctrl"],
|
|
11270
|
+
control: ["\u2303", "Ctrl"],
|
|
11271
|
+
alt: ["\u2325", "Alt"],
|
|
11272
|
+
option: ["\u2325", "Alt"],
|
|
11273
|
+
shift: ["\u21E7", "Shift"],
|
|
11274
|
+
backspace: ["\u232B", "Backspace"],
|
|
11275
|
+
delete: ["\u2326", "Del"],
|
|
11276
|
+
tab: ["\u21E5", "Tab"]
|
|
11277
|
+
});
|
|
11278
|
+
var KEYS = Object.freeze({
|
|
11279
|
+
enter: "\u21B5",
|
|
11280
|
+
return: "\u21B5",
|
|
11281
|
+
escape: "Esc",
|
|
11282
|
+
esc: "Esc",
|
|
11283
|
+
space: "Space",
|
|
11284
|
+
arrowup: "\u2191",
|
|
11285
|
+
up: "\u2191",
|
|
11286
|
+
arrowdown: "\u2193",
|
|
11287
|
+
down: "\u2193",
|
|
11288
|
+
arrowleft: "\u2190",
|
|
11289
|
+
left: "\u2190",
|
|
11290
|
+
arrowright: "\u2192",
|
|
11291
|
+
right: "\u2192",
|
|
11292
|
+
pageup: "PgUp",
|
|
11293
|
+
pagedown: "PgDn",
|
|
11294
|
+
home: "Home",
|
|
11295
|
+
end: "End"
|
|
11296
|
+
});
|
|
11297
|
+
function isApplePlatform() {
|
|
11298
|
+
const nav = globalThis.navigator;
|
|
11299
|
+
if (!nav) return false;
|
|
11300
|
+
const platform = (
|
|
11301
|
+
/** @type {{userAgentData?: {platform?: string}}} */
|
|
11302
|
+
nav.userAgentData?.platform || nav.platform || ""
|
|
11303
|
+
);
|
|
11304
|
+
return /mac|iphone|ipad|ios/i.test(platform);
|
|
11305
|
+
}
|
|
11306
|
+
function splitChord(chord) {
|
|
11307
|
+
if (chord === "+") return ["+"];
|
|
11308
|
+
const keys = chord.split("+");
|
|
11309
|
+
if (chord.endsWith("++")) keys.splice(-2, 2, "+");
|
|
11310
|
+
return keys.map((key) => key.trim()).filter((key) => key !== "");
|
|
11311
|
+
}
|
|
11312
|
+
function keyLabel(key, apple) {
|
|
11313
|
+
const name2 = key.toLowerCase();
|
|
11314
|
+
if (Object.hasOwn(MODIFIERS, name2)) return MODIFIERS[name2][apple ? 0 : 1];
|
|
11315
|
+
if (Object.hasOwn(KEYS, name2)) return KEYS[name2];
|
|
11316
|
+
return key.length === 1 ? key.toUpperCase() : key;
|
|
11317
|
+
}
|
|
11318
|
+
function keyLabels(keys, { apple = isApplePlatform() } = {}) {
|
|
11319
|
+
const list = Array.isArray(keys) ? keys.map(String) : splitChord(String(keys));
|
|
11320
|
+
return list.map((key) => keyLabel(key, apple));
|
|
11321
|
+
}
|
|
11322
|
+
function kbd(keys, options = {}) {
|
|
11323
|
+
return h("kbd", {
|
|
11324
|
+
class: "zx-kbd",
|
|
11325
|
+
dataset: {
|
|
11326
|
+
size: options.size === "sm" ? "sm" : void 0,
|
|
11327
|
+
tone: options.tone === "inherit" ? "inherit" : void 0
|
|
11328
|
+
}
|
|
11329
|
+
}, keyLabels(keys).map((label) => h("kbd", { class: "zx-kbd__key" }, label)));
|
|
11330
|
+
}
|
|
11331
|
+
|
|
11152
11332
|
// src/components/loading/spinner.js
|
|
11153
11333
|
var defaults2 = Object.freeze({
|
|
11154
11334
|
size: "md",
|
|
@@ -11201,8 +11381,8 @@ function button(opts = {}) {
|
|
|
11201
11381
|
title: options.title ?? (options.shortcut ? `${options.label} (${options.shortcut.label})` : void 0),
|
|
11202
11382
|
ariaKeyshortcuts: options.shortcut?.keys,
|
|
11203
11383
|
dataset: {
|
|
11204
|
-
kind:
|
|
11205
|
-
size:
|
|
11384
|
+
kind: normalizeKind2(options.kind),
|
|
11385
|
+
size: normalizeSize2(options.size)
|
|
11206
11386
|
}
|
|
11207
11387
|
})
|
|
11208
11388
|
);
|
|
@@ -11212,7 +11392,7 @@ function button(opts = {}) {
|
|
|
11212
11392
|
if (options.label !== "") {
|
|
11213
11393
|
element.append(h("span", { class: "zx-btn__label" }, String(options.label)));
|
|
11214
11394
|
}
|
|
11215
|
-
if (options.shortcut) element.append(
|
|
11395
|
+
if (options.shortcut) element.append(shortcutHint(options.shortcut.label));
|
|
11216
11396
|
if (!options.label && options.title) element.setAttribute("aria-label", options.title);
|
|
11217
11397
|
if (typeof options.onclick === "function") element.onclick = options.onclick;
|
|
11218
11398
|
if (options.busy) setButtonBusy(element, true);
|
|
@@ -11240,13 +11420,19 @@ function setButtonBusy(element, busy) {
|
|
|
11240
11420
|
}
|
|
11241
11421
|
return element;
|
|
11242
11422
|
}
|
|
11243
|
-
function
|
|
11423
|
+
function shortcutHint(label) {
|
|
11424
|
+
const hint = kbd(String(label), { size: "sm" });
|
|
11425
|
+
hint.classList.add("zx-btn__shortcut");
|
|
11426
|
+
hint.setAttribute("aria-hidden", "true");
|
|
11427
|
+
return hint;
|
|
11428
|
+
}
|
|
11429
|
+
function normalizeKind2(value) {
|
|
11244
11430
|
return ["primary", "danger", "ghost"].includes(String(value)) ? (
|
|
11245
11431
|
/** @type {'primary'|'danger'|'ghost'} */
|
|
11246
11432
|
value
|
|
11247
11433
|
) : "default";
|
|
11248
11434
|
}
|
|
11249
|
-
function
|
|
11435
|
+
function normalizeSize2(value) {
|
|
11250
11436
|
return value === "sm" ? "sm" : "md";
|
|
11251
11437
|
}
|
|
11252
11438
|
|
|
@@ -12374,14 +12560,14 @@ var Table = class extends Component {
|
|
|
12374
12560
|
disabled: index === 0,
|
|
12375
12561
|
ariaLabel: `Move ${name2} earlier`,
|
|
12376
12562
|
dataset: { columnId: column.id, columnAction: "up" }
|
|
12377
|
-
}, icon("chevron-up", { size:
|
|
12563
|
+
}, icon("chevron-up", { size: ICON_SIZE.chevron })),
|
|
12378
12564
|
h("button", {
|
|
12379
12565
|
class: "zx-table__column-move",
|
|
12380
12566
|
type: "button",
|
|
12381
12567
|
disabled: index === this._columns.length - 1,
|
|
12382
12568
|
ariaLabel: `Move ${name2} later`,
|
|
12383
12569
|
dataset: { columnId: column.id, columnAction: "down" }
|
|
12384
|
-
}, icon("chevron-down", { size:
|
|
12570
|
+
}, icon("chevron-down", { size: ICON_SIZE.chevron }))
|
|
12385
12571
|
) : null;
|
|
12386
12572
|
return h("div", { class: "zx-table__column-option", dataset: { columnId: column.id } }, label, order);
|
|
12387
12573
|
});
|
|
@@ -12661,11 +12847,17 @@ var Table = class extends Component {
|
|
|
12661
12847
|
const name2 = tableHeaderName(column);
|
|
12662
12848
|
if (name2 !== null) th.setAttribute("aria-label", name2);
|
|
12663
12849
|
if (column.sortable && !this._spanning) {
|
|
12664
|
-
const button2 = h(
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12668
|
-
|
|
12850
|
+
const button2 = h(
|
|
12851
|
+
"button",
|
|
12852
|
+
{
|
|
12853
|
+
class: "zx-table__sort-button",
|
|
12854
|
+
type: "button",
|
|
12855
|
+
ariaLabel: name2 ?? void 0
|
|
12856
|
+
},
|
|
12857
|
+
h("span", { class: "zx-table__header-label" }, column.label),
|
|
12858
|
+
// One arrow per sortable header; `aria-sort` on the header shows it and says which way.
|
|
12859
|
+
h("span", { class: "zx-table__sort-icon", ariaHidden: "true" }, icon("arrow-up", { size: ICON_SIZE.sort }))
|
|
12860
|
+
);
|
|
12669
12861
|
this.listen(button2, "click", () => {
|
|
12670
12862
|
const direction = this._sort?.id === column.id && this._sort.dir === "asc" ? "desc" : "asc";
|
|
12671
12863
|
this.setSort(column.id, direction);
|
|
@@ -12865,7 +13057,7 @@ var Table = class extends Component {
|
|
|
12865
13057
|
type: "button",
|
|
12866
13058
|
tabIndex: -1,
|
|
12867
13059
|
ariaExpanded: String(expanded)
|
|
12868
|
-
}, icon(expanded ? "chevron-down" : "chevron-right", { size:
|
|
13060
|
+
}, icon(expanded ? "chevron-down" : "chevron-right", { size: ICON_SIZE.chevron })));
|
|
12869
13061
|
} else {
|
|
12870
13062
|
branch.append(h("span", { class: "zx-table__tree-spacer", ariaHidden: "true" }));
|
|
12871
13063
|
}
|
|
@@ -14638,7 +14830,7 @@ var AppIcon = class extends Component {
|
|
|
14638
14830
|
this.el.setAttribute("aria-hidden", "true");
|
|
14639
14831
|
}
|
|
14640
14832
|
const visual = resolveVisual(state.icon);
|
|
14641
|
-
const
|
|
14833
|
+
const badge2 = state.badge == null || state.badge === "" ? null : h("span", {
|
|
14642
14834
|
class: "zx-app-icon__badge",
|
|
14643
14835
|
ariaHidden: "true"
|
|
14644
14836
|
}, String(state.badge));
|
|
@@ -14649,7 +14841,7 @@ var AppIcon = class extends Component {
|
|
|
14649
14841
|
h("span", { class: "zx-app-icon__glyph", ariaHidden: "true" }, visual)
|
|
14650
14842
|
);
|
|
14651
14843
|
const children = [surface];
|
|
14652
|
-
if (
|
|
14844
|
+
if (badge2) children.push(badge2);
|
|
14653
14845
|
this.el.replaceChildren(...children);
|
|
14654
14846
|
}
|
|
14655
14847
|
};
|
|
@@ -14771,7 +14963,7 @@ var Launcher = class extends Component {
|
|
|
14771
14963
|
ref: "scopeBack",
|
|
14772
14964
|
class: "zx-icon-btn zx-launcher__scope-back",
|
|
14773
14965
|
type: "button"
|
|
14774
|
-
}, icon("x"));
|
|
14966
|
+
}, icon("x", { size: ICON_SIZE.dismiss }));
|
|
14775
14967
|
const scope2 = h(
|
|
14776
14968
|
"span",
|
|
14777
14969
|
{ ref: "scope", class: "zx-launcher__scope", hidden: true },
|
|
@@ -14783,7 +14975,7 @@ var Launcher = class extends Component {
|
|
|
14783
14975
|
class: "zx-icon-btn zx-launcher__close",
|
|
14784
14976
|
type: "button",
|
|
14785
14977
|
ariaLabel: this.options.closeLabel ?? this._message("launcher.close", "Close launcher")
|
|
14786
|
-
}, icon("x"));
|
|
14978
|
+
}, icon("x", { size: ICON_SIZE.dismiss }));
|
|
14787
14979
|
const status = h("div", {
|
|
14788
14980
|
ref: "status",
|
|
14789
14981
|
class: "zx-launcher__status",
|
|
@@ -14804,10 +14996,7 @@ var Launcher = class extends Component {
|
|
|
14804
14996
|
role: "listbox",
|
|
14805
14997
|
ariaLabel: this.options.resultsLabel ?? this._message("launcher.results", "Launcher results")
|
|
14806
14998
|
});
|
|
14807
|
-
const shortcut = this.options.shortcut === "mod+k" ? h("
|
|
14808
|
-
class: "zx-launcher__shortcut",
|
|
14809
|
-
ariaHidden: "true"
|
|
14810
|
-
}, launcherShortcutLabel()) : null;
|
|
14999
|
+
const shortcut = this.options.shortcut === "mod+k" ? h("span", { class: "zx-launcher__shortcut", ariaHidden: "true" }, kbd("Mod+K")) : null;
|
|
14811
15000
|
const footer = launcherHints(this.options.hints, {
|
|
14812
15001
|
move: this._message("launcher.hintMove", "Move"),
|
|
14813
15002
|
open: this._message("launcher.hintOpen", "Open"),
|
|
@@ -15321,9 +15510,9 @@ var Launcher = class extends Component {
|
|
|
15321
15510
|
if (caps.length) children.push(h(
|
|
15322
15511
|
"span",
|
|
15323
15512
|
{ class: "zx-launcher__keys", ariaHidden: keys ? "true" : null },
|
|
15324
|
-
caps
|
|
15513
|
+
kbd(caps, { size: "sm" })
|
|
15325
15514
|
));
|
|
15326
|
-
if (page) children.push(h("span", { class: "zx-launcher__chevron", ariaHidden: "true" }, icon("chevron-right")));
|
|
15515
|
+
if (page) children.push(h("span", { class: "zx-launcher__chevron", ariaHidden: "true" }, icon("chevron-right", { size: ICON_SIZE.chevron })));
|
|
15327
15516
|
return (
|
|
15328
15517
|
/** @type {HTMLElement} */
|
|
15329
15518
|
h(tag, {
|
|
@@ -15506,24 +15695,17 @@ var Launcher = class extends Component {
|
|
|
15506
15695
|
return message === key ? printf(fallback, args) : message;
|
|
15507
15696
|
}
|
|
15508
15697
|
};
|
|
15509
|
-
function launcherShortcutLabel() {
|
|
15510
|
-
const platform = String(
|
|
15511
|
-
/** @type {any} */
|
|
15512
|
-
navigator.userAgentData?.platform ?? navigator.platform ?? ""
|
|
15513
|
-
);
|
|
15514
|
-
return /mac|iphone|ipad/i.test(platform) ? "\u2318 K" : "Ctrl K";
|
|
15515
|
-
}
|
|
15516
15698
|
function launcherHints(hints, defaults4) {
|
|
15517
15699
|
if (hints === false) return null;
|
|
15518
15700
|
const labels = hints && typeof hints === "object" ? hints : {};
|
|
15519
15701
|
return h(
|
|
15520
15702
|
"footer",
|
|
15521
15703
|
{ class: "zx-launcher__hints", ariaHidden: "true" },
|
|
15522
|
-
h("span", {},
|
|
15523
|
-
h("span", {},
|
|
15704
|
+
h("span", {}, kbd(["\u2191\u2193\u2190\u2192"]), labels.move ?? defaults4.move),
|
|
15705
|
+
h("span", {}, kbd("Enter"), labels.open ?? defaults4.open),
|
|
15524
15706
|
// Shown only on a page (`_syncPage()`).
|
|
15525
|
-
h("span", { ref: "backHint", hidden: true },
|
|
15526
|
-
h("span", {},
|
|
15707
|
+
h("span", { ref: "backHint", hidden: true }, kbd("Backspace"), labels.back ?? defaults4.back),
|
|
15708
|
+
h("span", {}, kbd("Escape"), labels.close ?? defaults4.close)
|
|
15527
15709
|
);
|
|
15528
15710
|
}
|
|
15529
15711
|
function isLauncherPage(item) {
|
|
@@ -16854,11 +17036,11 @@ var ModuleBar = class extends AppRailPresenter {
|
|
|
16854
17036
|
* @param {string|number|null} badge New badge.
|
|
16855
17037
|
* @returns {this}
|
|
16856
17038
|
*/
|
|
16857
|
-
setBadge(id,
|
|
17039
|
+
setBadge(id, badge2) {
|
|
16858
17040
|
const item = findItem(this._items, id);
|
|
16859
17041
|
if (!item) return this;
|
|
16860
|
-
if (
|
|
16861
|
-
else item.badge =
|
|
17042
|
+
if (badge2 == null || badge2 === "") delete item.badge;
|
|
17043
|
+
else item.badge = badge2;
|
|
16862
17044
|
const key = String(id);
|
|
16863
17045
|
for (const control of this.refs.list.querySelectorAll(".zx-module-bar__item[data-app-nav-value-id]")) {
|
|
16864
17046
|
if (control.getAttribute("data-app-nav-value-id") === key) this._applyTileBadge(control, item);
|
|
@@ -17788,7 +17970,7 @@ var Message = class _Message extends Component {
|
|
|
17788
17970
|
show(msg, options = {}) {
|
|
17789
17971
|
const action = normalizeMessageAction(options.action);
|
|
17790
17972
|
const settings = {
|
|
17791
|
-
kind:
|
|
17973
|
+
kind: normalizeKind3(options.kind ?? this.options.kind),
|
|
17792
17974
|
timeout: messageTimeout(options.timeout ?? this.options.timeout, action !== null),
|
|
17793
17975
|
closable: options.closable ?? Boolean(this.options.closable),
|
|
17794
17976
|
action,
|
|
@@ -18009,7 +18191,7 @@ var Message = class _Message extends Component {
|
|
|
18009
18191
|
type: "button",
|
|
18010
18192
|
ariaLabel: this._message("message.close", "Close message"),
|
|
18011
18193
|
title: this._message("message.closeTitle", "Close")
|
|
18012
|
-
}, icon("x", { size:
|
|
18194
|
+
}, icon("x", { size: ICON_SIZE.dismiss }));
|
|
18013
18195
|
node.append(close);
|
|
18014
18196
|
this.listen(close, "click", () => this._close(entry));
|
|
18015
18197
|
}
|
|
@@ -18205,7 +18387,7 @@ var Message = class _Message extends Component {
|
|
|
18205
18387
|
region._disposeFloating();
|
|
18206
18388
|
}
|
|
18207
18389
|
};
|
|
18208
|
-
function
|
|
18390
|
+
function normalizeKind3(value) {
|
|
18209
18391
|
if (value === "danger") return "error";
|
|
18210
18392
|
return ["success", "warning", "error"].includes(String(value)) ? (
|
|
18211
18393
|
/** @type {MessageKind} */
|
|
@@ -21122,7 +21304,7 @@ function moduleChip(name2, options = {}) {
|
|
|
21122
21304
|
title = false,
|
|
21123
21305
|
standard = false,
|
|
21124
21306
|
color = null,
|
|
21125
|
-
badge = null,
|
|
21307
|
+
badge: badge2 = null,
|
|
21126
21308
|
selected = false
|
|
21127
21309
|
} = options;
|
|
21128
21310
|
const key = normalizeModuleName(name2);
|
|
@@ -21136,7 +21318,7 @@ function moduleChip(name2, options = {}) {
|
|
|
21136
21318
|
iconSize,
|
|
21137
21319
|
color: background,
|
|
21138
21320
|
label,
|
|
21139
|
-
badge,
|
|
21321
|
+
badge: badge2,
|
|
21140
21322
|
selected,
|
|
21141
21323
|
shape: options.shape ?? "tile",
|
|
21142
21324
|
glass: options.glass ?? "subtle",
|
|
@@ -21539,11 +21721,11 @@ function menuEntries(entries, badges) {
|
|
|
21539
21721
|
}
|
|
21540
21722
|
if (entry.id == null) return [];
|
|
21541
21723
|
const picked = Object.fromEntries(["id", "href", "target", "invoke", "icon", "value", "disabled"].filter((key) => entry[key] !== void 0).map((key) => [key, entry[key]]));
|
|
21542
|
-
const
|
|
21724
|
+
const badge2 = badges[String(entry.id)] ?? entry.badge;
|
|
21543
21725
|
return [{
|
|
21544
21726
|
...picked,
|
|
21545
21727
|
label: String(entry.label),
|
|
21546
|
-
...
|
|
21728
|
+
...badge2 != null ? { badge: badge2 } : {},
|
|
21547
21729
|
...children.length ? { children } : {}
|
|
21548
21730
|
}];
|
|
21549
21731
|
});
|