@bk2k/ui 0.6.7 → 0.6.8
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/BUILDING.md +32 -0
- package/CHANGELOG.md +57 -0
- package/USAGE.md +14 -8
- package/custom-elements.json +1 -1
- package/dist/charts/frame.d.ts +2 -0
- package/dist/charts/frame.js +2 -1
- package/dist/components/bk-button.d.ts +18 -3
- package/dist/components/bk-button.js +19 -8
- package/dist/components/bk-chart-bar.d.ts +46 -9
- package/dist/components/bk-chart-bar.js +127 -37
- package/dist/components/bk-combobox.d.ts +29 -5
- package/dist/components/bk-combobox.js +61 -19
- package/dist/components/bk-dialog.d.ts +4 -1
- package/dist/components/bk-dialog.js +6 -2
- package/dist/components/bk-facts-item.js +8 -6
- package/dist/components/bk-facts.d.ts +6 -4
- package/dist/components/bk-facts.js +19 -8
- package/dist/components/bk-input-time-zone.d.ts +3 -0
- package/dist/components/bk-model-viewer.d.ts +12 -1
- package/dist/components/bk-model-viewer.js +15 -2
- package/dist/components/bk-period-nav.d.ts +102 -0
- package/dist/components/bk-period-nav.js +69 -0
- package/dist/components/bk-select.js +2 -1
- package/dist/components/bk-shell-app.d.ts +3 -2
- package/dist/components/bk-shell-app.js +16 -3
- package/dist/components/bk-sortable.d.ts +3 -0
- package/dist/components/bk-sortable.js +3 -0
- package/dist/components/bk-split.d.ts +3 -0
- package/dist/components/bk-split.js +3 -0
- package/dist/components/bk-table.d.ts +16 -12
- package/dist/components/bk-table.js +96 -14
- package/dist/i18n/de.js +7 -0
- package/dist/i18n.d.ts +7 -0
- package/dist/i18n.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/cloak.d.ts +3 -0
- package/dist/internal/cloak.js +4 -0
- package/dist/internal/handle-menu.d.ts +2 -3
- package/dist/internal/handle-menu.js +14 -3
- package/dist/internal/late.d.ts +15 -0
- package/dist/internal/late.js +30 -0
- package/dist/jsx.d.ts +36 -5
- package/dist/standalone/all.js +119 -118
- package/dist/standalone/bk-action-bar.js +1 -1
- package/dist/standalone/bk-alert-offline.js +1 -1
- package/dist/standalone/bk-alert.js +1 -1
- package/dist/standalone/bk-attachment.js +1 -1
- package/dist/standalone/bk-avatar-group.js +1 -1
- package/dist/standalone/bk-avatar.js +1 -1
- package/dist/standalone/bk-breadcrumbs.js +1 -1
- package/dist/standalone/bk-button-copy.js +2 -2
- package/dist/standalone/bk-button-group.js +2 -2
- package/dist/standalone/bk-button-share.js +2 -2
- package/dist/standalone/bk-button-top.js +1 -1
- package/dist/standalone/bk-button.js +15 -7
- package/dist/standalone/bk-calendar-week.js +1 -1
- package/dist/standalone/bk-calendar.js +1 -1
- package/dist/standalone/bk-card.js +1 -1
- package/dist/standalone/bk-carousel-controls.js +2 -2
- package/dist/standalone/bk-carousel.js +1 -1
- package/dist/standalone/bk-chart-bar-list.js +3 -3
- package/dist/standalone/bk-chart-bar.js +164 -105
- package/dist/standalone/bk-chart-bridge.js +4 -4
- package/dist/standalone/bk-chart-bullet.js +3 -3
- package/dist/standalone/bk-chart-calendar.js +4 -4
- package/dist/standalone/bk-chart-heatmap.js +4 -4
- package/dist/standalone/bk-chart-histogram.js +2 -2
- package/dist/standalone/bk-chart-legend.js +3 -3
- package/dist/standalone/bk-chart-line.js +5 -5
- package/dist/standalone/bk-chart-scatter.js +3 -3
- package/dist/standalone/bk-chart-sparkline.js +3 -3
- package/dist/standalone/bk-chart-stacked-bar.js +4 -4
- package/dist/standalone/bk-chart-tracker.js +3 -3
- package/dist/standalone/bk-chart-waterfall.js +2 -2
- package/dist/standalone/bk-checkbox-group.js +2 -2
- package/dist/standalone/bk-checkbox.js +1 -1
- package/dist/standalone/bk-chip-group.js +2 -2
- package/dist/standalone/bk-chip.js +2 -2
- package/dist/standalone/bk-code-diff.js +1 -1
- package/dist/standalone/bk-code-stack.js +2 -2
- package/dist/standalone/bk-code.js +2 -2
- package/dist/standalone/bk-color-panel.js +2 -2
- package/dist/standalone/bk-columns.js +1 -1
- package/dist/standalone/bk-combobox.js +49 -30
- package/dist/standalone/bk-command-menu.js +2 -2
- package/dist/standalone/bk-command-palette.js +3 -3
- package/dist/standalone/bk-composer.js +2 -2
- package/dist/standalone/bk-delta.js +1 -1
- package/dist/standalone/bk-diagram.js +1 -1
- package/dist/standalone/bk-dialog.js +1 -1
- package/dist/standalone/bk-drawer.js +2 -2
- package/dist/standalone/bk-error-summary.js +1 -1
- package/dist/standalone/bk-facts-item.js +8 -6
- package/dist/standalone/bk-facts.js +19 -8
- package/dist/standalone/bk-fieldset.js +1 -1
- package/dist/standalone/bk-filter-bar.js +1 -1
- package/dist/standalone/bk-folder-browser.js +1 -1
- package/dist/standalone/bk-form-guard.js +1 -1
- package/dist/standalone/bk-form-steps.js +1 -1
- package/dist/standalone/bk-image-compare.js +1 -1
- package/dist/standalone/bk-image-crop.js +2 -2
- package/dist/standalone/bk-image-editor.js +2 -1
- package/dist/standalone/bk-image-viewer.js +1 -1
- package/dist/standalone/bk-input-code.js +2 -2
- package/dist/standalone/bk-input-color.js +1 -1
- package/dist/standalone/bk-input-date-range.js +2 -2
- package/dist/standalone/bk-input-date.js +1 -1
- package/dist/standalone/bk-input-file.js +2 -2
- package/dist/standalone/bk-input-group.js +2 -2
- package/dist/standalone/bk-input-inline.js +2 -2
- package/dist/standalone/bk-input-number.js +2 -2
- package/dist/standalone/bk-input-rating.js +2 -2
- package/dist/standalone/bk-input-rich.js +1 -1
- package/dist/standalone/bk-input-search.js +1 -1
- package/dist/standalone/bk-input-slider-range.js +2 -2
- package/dist/standalone/bk-input-slider.js +2 -2
- package/dist/standalone/bk-input-text.js +1 -1
- package/dist/standalone/bk-input-time.js +3 -3
- package/dist/standalone/bk-item.js +1 -1
- package/dist/standalone/bk-kbd-shortcuts.js +1 -1
- package/dist/standalone/bk-kbd.js +1 -1
- package/dist/standalone/bk-lightbox.js +2 -2
- package/dist/standalone/bk-listbox-columns.js +2 -2
- package/dist/standalone/bk-listbox-search.js +3 -3
- package/dist/standalone/bk-listbox-transfer.js +3 -3
- package/dist/standalone/bk-listbox.js +2 -2
- package/dist/standalone/bk-logo.js +1 -1
- package/dist/standalone/bk-menu-bar.js +1 -1
- package/dist/standalone/bk-menu-item.js +1 -1
- package/dist/standalone/bk-menu-list.js +1 -1
- package/dist/standalone/bk-menu.js +2 -2
- package/dist/standalone/bk-message-approval.js +1 -1
- package/dist/standalone/bk-message-branches.js +1 -1
- package/dist/standalone/bk-message-citation.js +1 -1
- package/dist/standalone/bk-message-feedback.js +1 -1
- package/dist/standalone/bk-message-list.js +1 -1
- package/dist/standalone/bk-message-reasoning.js +1 -1
- package/dist/standalone/bk-message-source.js +1 -1
- package/dist/standalone/bk-message-tool-group.js +1 -1
- package/dist/standalone/bk-message-tool.js +1 -1
- package/dist/standalone/bk-message.js +1 -1
- package/dist/standalone/bk-meter.js +1 -1
- package/dist/standalone/bk-model-viewer.js +1 -1
- package/dist/standalone/bk-nav-group.js +1 -1
- package/dist/standalone/bk-nav-item.js +1 -1
- package/dist/standalone/bk-nav-toc.js +1 -1
- package/dist/standalone/bk-nav.js +1 -1
- package/dist/standalone/bk-overflow.js +1 -1
- package/dist/standalone/bk-page-footer.js +1 -1
- package/dist/standalone/bk-page-pager.js +1 -1
- package/dist/standalone/bk-pagination.js +1 -1
- package/dist/standalone/bk-pane.js +1 -1
- package/dist/standalone/bk-panel.js +1 -1
- package/dist/standalone/bk-period-nav.js +69 -0
- package/dist/standalone/bk-picture.js +1 -1
- package/dist/standalone/bk-popover-help.js +1 -1
- package/dist/standalone/bk-popover.js +1 -1
- package/dist/standalone/bk-preview.js +1 -1
- package/dist/standalone/bk-progress.js +1 -1
- package/dist/standalone/bk-qr-code.js +1 -1
- package/dist/standalone/bk-radio-group.js +2 -2
- package/dist/standalone/bk-radio.js +1 -1
- package/dist/standalone/bk-rating.js +1 -1
- package/dist/standalone/bk-scroll.js +1 -1
- package/dist/standalone/bk-segmented.js +2 -2
- package/dist/standalone/bk-select-cascade.js +1 -1
- package/dist/standalone/bk-select-tree.js +1 -1
- package/dist/standalone/bk-select.js +3 -2
- package/dist/standalone/bk-shell-app.js +42 -38
- package/dist/standalone/bk-shell-sites.js +1 -1
- package/dist/standalone/bk-sortable.js +7 -4
- package/dist/standalone/bk-split-grid.js +1 -1
- package/dist/standalone/bk-split.js +7 -4
- package/dist/standalone/bk-stat.js +2 -2
- package/dist/standalone/bk-steps-item.js +1 -1
- package/dist/standalone/bk-swatch-group.js +2 -2
- package/dist/standalone/bk-switch.js +2 -2
- package/dist/standalone/bk-table.js +130 -80
- package/dist/standalone/bk-tabs-item.js +1 -1
- package/dist/standalone/bk-tabs.js +1 -1
- package/dist/standalone/bk-tasks-item.js +1 -1
- package/dist/standalone/bk-text.js +1 -1
- package/dist/standalone/bk-time-countdown.js +1 -1
- package/dist/standalone/bk-time-relative.js +1 -1
- package/dist/standalone/bk-timeline-item.js +1 -1
- package/dist/standalone/bk-toast-group.js +1 -1
- package/dist/standalone/bk-toast.js +1 -1
- package/dist/standalone/bk-tooltip.js +1 -1
- package/dist/standalone/bk-tree-item.js +2 -2
- package/dist/standalone/bk-video.js +1 -1
- package/dist/standalone/bk-zoom.js +3 -3
- package/dist/standalone/chunks/{bk-alert-offline-BoMEYxnE.js → bk-alert-offline-B1bQxOZp.js} +1 -1
- package/dist/standalone/chunks/{bk-carousel-B7-9OanA.js → bk-carousel-BCwIQhG5.js} +1 -1
- package/dist/standalone/chunks/{bk-diagram-CpOpicmo.js → bk-diagram-DWK8CvRZ.js} +2 -2
- package/dist/standalone/chunks/{bk-dialog-a2BtUBf2.js → bk-dialog-DX0cPJ1o.js} +7 -3
- package/dist/standalone/chunks/{bk-image-editor-z_Uj83fy.js → bk-image-editor-DXEj9gCu.js} +1 -1
- package/dist/standalone/chunks/{bk-input-date-range-BQkbPlSJ.js → bk-input-date-range-Cbx_lpf0.js} +1 -1
- package/dist/standalone/chunks/{bk-input-rich-Dte_b4Ev.js → bk-input-rich-ZB68vziu.js} +3 -3
- package/dist/standalone/chunks/{bk-input-text-CUNQG1ah.js → bk-input-text-DD32uWNO.js} +1 -1
- package/dist/standalone/chunks/{bk-kbd-B7bz8hmV.js → bk-kbd-B_TlKzWj.js} +1 -1
- package/dist/standalone/chunks/{bk-model-viewer-D1XJPgAG.js → bk-model-viewer-Dr81ahVv.js} +19 -5
- package/dist/standalone/chunks/{bk-qr-code-CbI9rdOK.js → bk-qr-code-QaYvZwOR.js} +1 -1
- package/dist/standalone/chunks/{bk-toast-group-Cix-Urgi.js → bk-toast-group-BSeO_rPs.js} +1 -1
- package/dist/standalone/chunks/{choice-field-BnuK9mp_.js → choice-field-CGvE4tyb.js} +1 -1
- package/dist/standalone/chunks/{clipboard-DBGdJ-1S.js → clipboard-BKlrP5rj.js} +1 -28
- package/dist/standalone/chunks/clipboard-Crzt1Sh9.js +29 -0
- package/dist/standalone/chunks/{date-field-BQ5k-DDL.js → date-field-BlI6grfT.js} +2 -2
- package/dist/standalone/chunks/{form-control-D7dqSP9M.js → form-control-CyXQIJ2x.js} +1 -1
- package/dist/standalone/chunks/{frame-BW1nKuoM.js → frame-abXBnl8a.js} +3 -1
- package/dist/standalone/chunks/handle-menu-ZVR_msk2.js +49 -0
- package/dist/standalone/chunks/{i18n-CNsBRNPu.js → i18n-B6Al9xCK.js} +7 -0
- package/dist/standalone/chunks/{i18n-CrZgrRu9.js → i18n-BI16HQmm.js} +1 -1
- package/dist/standalone/chunks/{marks-CdqbbJpM.js → marks-0kbeB4n8.js} +2 -2
- package/dist/standalone/chunks/{popover-base-oDhxsYMr.js → popover-base-ac49G87f.js} +1 -1
- package/dist/standalone/chunks/{ramp-EclrETaQ.js → ramp-ggoyjMvC.js} +1 -1
- package/dist/standalone/chunks/{summary-BwL-Gp8w.js → summary-BK-B4m5A.js} +1 -1
- package/dist/standalone/chunks/{text-field-CTp2b-Ai.js → text-field-4IUUpRHE.js} +2 -2
- package/dist/standalone/chunks/{toggle-control-DXkgmz7R.js → toggle-control-ioV2jhNY.js} +1 -1
- package/dist/standalone/confirm.js +3 -3
- package/dist/standalone/i18n-de.js +8 -1
- package/dist/standalone/toast.js +1 -1
- package/dist/standalone/tokens.css +4 -1
- package/dist/tokens.css +4 -1
- package/package.json +1 -1
- package/dist/standalone/chunks/handle-menu-DsxWvv4D.js +0 -22
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import "./bk-button.js";
|
|
3
|
+
import "./bk-icon.js";
|
|
4
|
+
import "../icons/set/chevron-left.js";
|
|
5
|
+
import "../icons/set/chevron-right.js";
|
|
6
|
+
export type { NavigateDetail } from "../internal/link.js";
|
|
7
|
+
export type PeriodNavSize = "sm" | "md" | "lg";
|
|
8
|
+
/**
|
|
9
|
+
* Navigation between periods of a dashboard: a link to the previous period, the range as text, a link to the
|
|
10
|
+
* next period, a link to the current period and a note about the state of the period.
|
|
11
|
+
* For views by day, week or month. The pages of a document use `bk-page-pager`.
|
|
12
|
+
*
|
|
13
|
+
* ```html
|
|
14
|
+
* <bk-period-nav previous-href="?week=2026-W23" next-href="?week=2026-W25" current-href="?week=2026-W26">
|
|
15
|
+
* Mon, Jun 8 – Sun, Jun 14
|
|
16
|
+
* <span slot="note">Week still running, 3 of 7 days.</span>
|
|
17
|
+
* </bk-period-nav>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* The app formats the range and the note. The element places them and names the links. Each link is a real `<a>`,
|
|
21
|
+
* so it works without JavaScript and follows the link resolver of the app.
|
|
22
|
+
*
|
|
23
|
+
* Without `next-href` the period is the newest one. The next button then stays in its place as a disabled
|
|
24
|
+
* native button, so the row does not move. Without `current-href` the current button does not show. Set it only
|
|
25
|
+
* when the user is not on the current period. The arrows follow the writing direction.
|
|
26
|
+
*
|
|
27
|
+
* @slot - The range of the period as text.
|
|
28
|
+
* @slot note - A note about the state of the period. It wraps under the row in a narrow place.
|
|
29
|
+
* @csspart nav - The `<nav>`.
|
|
30
|
+
* @csspart previous - The previous button.
|
|
31
|
+
* @csspart next - The next button.
|
|
32
|
+
* @csspart current - The button for the current period.
|
|
33
|
+
* @csspart range - The range text.
|
|
34
|
+
* @csspart note - The note.
|
|
35
|
+
* @cssprop --bk-period-nav-gap - Space between the parts of the row (default --bk-space-cluster).
|
|
36
|
+
* @cssprop --bk-period-nav-range-fg - Colour of the range (default --bk-text).
|
|
37
|
+
* @cssprop --bk-period-nav-range-size - Size of the range (default --bk-type-body).
|
|
38
|
+
* @cssprop --bk-period-nav-range-weight - Weight of the range (default --bk-weight-medium).
|
|
39
|
+
* @cssprop --bk-period-nav-note-fg - Colour of the note (default --bk-text-muted).
|
|
40
|
+
* @cssprop --bk-period-nav-note-size - Size of the note (default --bk-type-small).
|
|
41
|
+
*
|
|
42
|
+
* @keyboard Tab - Move focus to the next enabled button.
|
|
43
|
+
* @keyboard Enter - Follow the link of the focused button.
|
|
44
|
+
* @a11y A `navigation` landmark named "Period navigation" (`label`). The buttons are links with an icon and the names "Previous period" and "Next period"; the arrows are hidden. At the newest period the next button is a native disabled button. The current button shows its name as text.
|
|
45
|
+
* @fires {CustomEvent<NavigateDetail>} navigate - The user makes a plain click on a link (primary button, no modifier key). `detail.href` is the resolved address. Bubbles, composed, cancelable: `preventDefault()` stops the browser, and the router of the app handles the navigation.
|
|
46
|
+
* @tag bk-period-nav
|
|
47
|
+
*/
|
|
48
|
+
export declare class BkPeriodNav extends LitElement {
|
|
49
|
+
static properties: {
|
|
50
|
+
previousHref: {
|
|
51
|
+
attribute: string;
|
|
52
|
+
};
|
|
53
|
+
nextHref: {
|
|
54
|
+
attribute: string;
|
|
55
|
+
};
|
|
56
|
+
currentHref: {
|
|
57
|
+
attribute: string;
|
|
58
|
+
};
|
|
59
|
+
label: {};
|
|
60
|
+
previousLabel: {
|
|
61
|
+
attribute: string;
|
|
62
|
+
};
|
|
63
|
+
nextLabel: {
|
|
64
|
+
attribute: string;
|
|
65
|
+
};
|
|
66
|
+
currentLabel: {
|
|
67
|
+
attribute: string;
|
|
68
|
+
};
|
|
69
|
+
size: {
|
|
70
|
+
reflect: boolean;
|
|
71
|
+
useDefault: boolean;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/** Address of the previous period. Unset: the previous button is disabled. */
|
|
75
|
+
previousHref: string | undefined;
|
|
76
|
+
/** Address of the next period. Unset: the next button is disabled. */
|
|
77
|
+
nextHref: string | undefined;
|
|
78
|
+
/** Address of the current period. Unset: no button for the current period. */
|
|
79
|
+
currentHref: string | undefined;
|
|
80
|
+
/** Name of the landmark (default "Period navigation"). */
|
|
81
|
+
label: string | undefined;
|
|
82
|
+
/** Name of the previous button (default "Previous period"). */
|
|
83
|
+
previousLabel: string | undefined;
|
|
84
|
+
/** Name of the next button (default "Next period"). */
|
|
85
|
+
nextLabel: string | undefined;
|
|
86
|
+
/** Text of the current button (default "Current period"). */
|
|
87
|
+
currentLabel: string | undefined;
|
|
88
|
+
/** Size of the buttons: `sm`, `md` (default) or `lg`. */
|
|
89
|
+
size: PeriodNavSize;
|
|
90
|
+
private i18n;
|
|
91
|
+
private slots;
|
|
92
|
+
constructor();
|
|
93
|
+
static styles: import("lit").CSSResult[];
|
|
94
|
+
private arrow;
|
|
95
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
"bk-period-nav": BkPeriodNav;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=bk-period-nav.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { LitElement, css, html, nothing } from "lit";
|
|
2
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
3
|
+
import { define } from "../internal/define.js";
|
|
4
|
+
import { LocalizeController } from "../i18n.js";
|
|
5
|
+
import { SlotController } from "../internal/slots.js";
|
|
6
|
+
import { base } from "../internal/styles.js";
|
|
7
|
+
import "./bk-button.js";
|
|
8
|
+
import "./bk-icon.js";
|
|
9
|
+
import "../icons/set/chevron-left.js";
|
|
10
|
+
import "../icons/set/chevron-right.js";
|
|
11
|
+
class BkPeriodNav extends LitElement {
|
|
12
|
+
static properties = {
|
|
13
|
+
previousHref: { attribute: "previous-href" },
|
|
14
|
+
nextHref: { attribute: "next-href" },
|
|
15
|
+
currentHref: { attribute: "current-href" },
|
|
16
|
+
label: {},
|
|
17
|
+
previousLabel: { attribute: "previous-label" },
|
|
18
|
+
nextLabel: { attribute: "next-label" },
|
|
19
|
+
currentLabel: { attribute: "current-label" },
|
|
20
|
+
size: { reflect: true, useDefault: true }
|
|
21
|
+
};
|
|
22
|
+
i18n = new LocalizeController(this);
|
|
23
|
+
slots = new SlotController(this);
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.size = "md";
|
|
27
|
+
}
|
|
28
|
+
static styles = [base, css`
|
|
29
|
+
:host { display: block; }
|
|
30
|
+
nav {
|
|
31
|
+
display: flex; flex-wrap: wrap; align-items: center;
|
|
32
|
+
gap: var(--bk-period-nav-gap, var(--bk-space-cluster));
|
|
33
|
+
}
|
|
34
|
+
.step { display: inline-flex; max-inline-size: 100%; align-items: center; gap: var(--bk-period-nav-gap, var(--bk-space-cluster)); }
|
|
35
|
+
.range {
|
|
36
|
+
color: var(--bk-period-nav-range-fg, var(--bk-text)); font-size: var(--bk-period-nav-range-size, var(--bk-type-body));
|
|
37
|
+
font-weight: var(--bk-period-nav-range-weight, var(--bk-weight-medium)); line-height: var(--bk-line-height-body);
|
|
38
|
+
font-variant-numeric: tabular-nums; text-wrap: balance;
|
|
39
|
+
}
|
|
40
|
+
.note {
|
|
41
|
+
color: var(--bk-period-nav-note-fg, var(--bk-text-muted)); font-size: var(--bk-period-nav-note-size, var(--bk-type-small));
|
|
42
|
+
line-height: var(--bk-line-height-body); flex: 1 1 auto;
|
|
43
|
+
}
|
|
44
|
+
.note[hidden] { display: none; }
|
|
45
|
+
bk-icon:dir(rtl) { scale: -1 1; }
|
|
46
|
+
`];
|
|
47
|
+
arrow(kind, href, label) {
|
|
48
|
+
return html`<bk-button part=${kind} size=${this.size} variant="outline" label=${label} href=${ifDefined(href || void 0)} ?disabled=${!href}
|
|
49
|
+
rel=${ifDefined(href ? kind === "previous" ? "prev" : "next" : void 0)}>
|
|
50
|
+
<bk-icon name=${kind === "previous" ? "chevron-left" : "chevron-right"} aria-hidden="true"></bk-icon>
|
|
51
|
+
</bk-button>`;
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return html`<nav part="nav" aria-label=${this.label || this.i18n.t("periodNavLabel")}>
|
|
55
|
+
<span class="step">
|
|
56
|
+
${this.arrow("previous", this.previousHref, this.previousLabel || this.i18n.t("periodPrevious"))}
|
|
57
|
+
<span class="range" part="range"><slot></slot></span>
|
|
58
|
+
${this.arrow("next", this.nextHref, this.nextLabel || this.i18n.t("periodNext"))}
|
|
59
|
+
</span>
|
|
60
|
+
${this.currentHref ? html`<bk-button part="current" size=${this.size} variant="outline" href=${this.currentHref}>${this.currentLabel || this.i18n.t("periodCurrent")}</bk-button>` : nothing}
|
|
61
|
+
<span class="note" part="note" ?hidden=${!this.slots.has("note")}><slot name="note"></slot></span>
|
|
62
|
+
</nav>`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
define("bk-period-nav", BkPeriodNav);
|
|
66
|
+
export {
|
|
67
|
+
BkPeriodNav
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=bk-period-nav.js.map
|
|
@@ -102,7 +102,8 @@ class BkSelect extends ChoiceField {
|
|
|
102
102
|
static styles = [...choiceFieldStyles("select"), css`
|
|
103
103
|
.box { position: relative; cursor: pointer; user-select: none; }
|
|
104
104
|
/* fit: the box takes the width of the longest option; the hidden labels share one grid cell with the shown one. */
|
|
105
|
-
|
|
105
|
+
/* max-content, not fit-content: in an auto table cell fit-content is the min-content width, and the chevron covers the text. */
|
|
106
|
+
:host([fit]) { inline-size: var(--bk-field-width, max-content); max-inline-size: 100%; }
|
|
106
107
|
:host([fit]) .value { flex: none; min-width: max-content; }
|
|
107
108
|
.fit { display: grid; }
|
|
108
109
|
.fit > * { grid-area: 1 / 1; display: flex; align-items: center; gap: var(--bk-space-inline); white-space: nowrap; }
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
|
-
import "./bk-drawer.js";
|
|
3
2
|
import "./bk-icon.js";
|
|
4
3
|
import "./bk-button.js";
|
|
5
4
|
import "./bk-nav-item.js";
|
|
@@ -538,6 +537,8 @@ export declare class BkShellApp extends LitElement {
|
|
|
538
537
|
/** Closes the navigation drawer. */
|
|
539
538
|
hideNavigation(): void;
|
|
540
539
|
private fireToggle;
|
|
540
|
+
/** The drawers are in use: the shell is narrow, or the aside is an overlay. */
|
|
541
|
+
private get drawers();
|
|
541
542
|
protected willUpdate(changed: PropertyValues): void;
|
|
542
543
|
/** Turns a custom state on or off. */
|
|
543
544
|
private setState;
|
|
@@ -546,7 +547,7 @@ export declare class BkShellApp extends LitElement {
|
|
|
546
547
|
protected updated(changed: PropertyValues): void;
|
|
547
548
|
/** Placed `<bk-button variant="ghost">`s and `<bk-nav-item>`s follow the state like the shell's own toggle. */
|
|
548
549
|
private syncToggleLook;
|
|
549
|
-
/** `updateComplete` includes the drawers
|
|
550
|
+
/** `updateComplete` includes the drawers (their load and their own update that opens and closes them) and the load of the handle menu. */
|
|
550
551
|
protected getUpdateComplete(): Promise<boolean>;
|
|
551
552
|
/** The width of the sidebar's kept scroll bar room, which its end padding gives up. */
|
|
552
553
|
private measureScrollbar;
|
|
@@ -6,15 +6,16 @@ import { define } from "../internal/define.js";
|
|
|
6
6
|
import { LinkController } from "../internal/link.js";
|
|
7
7
|
import { LocalizeController } from "../i18n.js";
|
|
8
8
|
import { emitDetail, emitLifecycle } from "../internal/events.js";
|
|
9
|
-
import { handleMenu, handleMenuStyles, openHandleMenu } from "../internal/handle-menu.js";
|
|
9
|
+
import { handleMenu, handleMenuStyles, loadHandleMenu, openHandleMenu } from "../internal/handle-menu.js";
|
|
10
10
|
import { StateController } from "../internal/state.js";
|
|
11
11
|
import { onShortcut, registerShortcuts } from "../shortcuts.js";
|
|
12
12
|
import { base, countBadge, grip, interactive } from "../internal/styles.js";
|
|
13
|
-
import "
|
|
13
|
+
import { LateLoad } from "../internal/late.js";
|
|
14
14
|
import "./bk-icon.js";
|
|
15
15
|
import "./bk-button.js";
|
|
16
16
|
import "./bk-nav-item.js";
|
|
17
17
|
import { mutationObserver, lightDom } from "../internal/server.js";
|
|
18
|
+
const drawerParts = new LateLoad(() => import("./bk-drawer.js"));
|
|
18
19
|
import "../icons/set/close.js";
|
|
19
20
|
import "../icons/set/menu.js";
|
|
20
21
|
import "../icons/set/search.js";
|
|
@@ -522,6 +523,8 @@ class BkShellApp extends LitElement {
|
|
|
522
523
|
}
|
|
523
524
|
|
|
524
525
|
/* Drawers: bk-drawer gives surface, motion and modality; here they have square corners and a line only towards the page. */
|
|
526
|
+
/* A drawer loads late (narrow shell, aside overlay): until then its content stays out of view. */
|
|
527
|
+
bk-drawer:not(:defined) { display: none; }
|
|
525
528
|
bk-drawer { --bk-drawer-radius: 0px; --bk-drawer-size: min(var(--_bk-shell-app-drawer-width), calc(100vw - var(--bk-space-12))); }
|
|
526
529
|
bk-drawer.end { --bk-drawer-size: min(var(--_bk-shell-app-aw), calc(100vw - var(--bk-space-12))); }
|
|
527
530
|
bk-drawer::part(dialog) { border-width: 0; }
|
|
@@ -905,8 +908,14 @@ class BkShellApp extends LitElement {
|
|
|
905
908
|
const open = region === "sidebar" ? !this.sidebarCollapsed : this.asideVisible;
|
|
906
909
|
this.dispatchEvent(new ShellAppToggleEvent(region, open));
|
|
907
910
|
}
|
|
911
|
+
/** The drawers are in use: the shell is narrow, or the aside is an overlay. */
|
|
912
|
+
get drawers() {
|
|
913
|
+
return this.narrow || this.asideOverlay;
|
|
914
|
+
}
|
|
908
915
|
willUpdate(changed) {
|
|
909
916
|
super.willUpdate(changed);
|
|
917
|
+
if (this.drawers)
|
|
918
|
+
void drawerParts.start();
|
|
910
919
|
const used = /* @__PURE__ */ new Set();
|
|
911
920
|
let workspace = false;
|
|
912
921
|
let sectionCount = 0;
|
|
@@ -1013,9 +1022,13 @@ class BkShellApp extends LitElement {
|
|
|
1013
1022
|
el.hidden = this.narrow && this.slotOf(el) === "sidebar-footer";
|
|
1014
1023
|
}
|
|
1015
1024
|
}
|
|
1016
|
-
/** `updateComplete` includes the drawers
|
|
1025
|
+
/** `updateComplete` includes the drawers (their load and their own update that opens and closes them) and the load of the handle menu. */
|
|
1017
1026
|
async getUpdateComplete() {
|
|
1018
1027
|
const done = await super.getUpdateComplete();
|
|
1028
|
+
if (this.drawers)
|
|
1029
|
+
await drawerParts.start();
|
|
1030
|
+
if (this.asideMoves.length)
|
|
1031
|
+
await loadHandleMenu();
|
|
1019
1032
|
await Promise.all([...this.renderRoot.querySelectorAll("bk-drawer")].map((d) => d.updateComplete));
|
|
1020
1033
|
return done;
|
|
1021
1034
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from "lit";
|
|
2
2
|
import { LocalizeController } from "../i18n.js";
|
|
3
|
+
import "./bk-menu-context.js";
|
|
4
|
+
import "./bk-menu-divider.js";
|
|
5
|
+
import "./bk-menu-item.js";
|
|
3
6
|
import "../icons/set/grid.js";
|
|
4
7
|
import "../icons/set/keyboard.js";
|
|
5
8
|
/** Detail of the `reorder` event. `to` is the index in `toList` after the move. */
|
|
@@ -4,6 +4,9 @@ import { setTriggerAria } from "../internal/anchor.js";
|
|
|
4
4
|
import { define } from "../internal/define.js";
|
|
5
5
|
import { emitDetail } from "../internal/events.js";
|
|
6
6
|
import { handleMenu, handleMenuStyles, openHandleMenu } from "../internal/handle-menu.js";
|
|
7
|
+
import "./bk-menu-context.js";
|
|
8
|
+
import "./bk-menu-divider.js";
|
|
9
|
+
import "./bk-menu-item.js";
|
|
7
10
|
import { adoptLightStyles } from "../internal/light-styles.js";
|
|
8
11
|
import { base, srOnly } from "../internal/styles.js";
|
|
9
12
|
import "../icons/set/grid.js";
|
|
@@ -2,6 +2,9 @@ import { LitElement, css, html, nothing } from "lit";
|
|
|
2
2
|
import { define } from "../internal/define.js";
|
|
3
3
|
import { emitDetail } from "../internal/events.js";
|
|
4
4
|
import { handleMenu, handleMenuStyles, openHandleMenu } from "../internal/handle-menu.js";
|
|
5
|
+
import "./bk-menu-context.js";
|
|
6
|
+
import "./bk-menu-divider.js";
|
|
7
|
+
import "./bk-menu-item.js";
|
|
5
8
|
import { LocalizeController } from "../i18n.js";
|
|
6
9
|
import { deepActiveElement } from "../internal/anchor.js";
|
|
7
10
|
import { StateController } from "../internal/state.js";
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
2
|
import { LoadMoreController } from "../internal/virtual.js";
|
|
3
3
|
import "./bk-button.js";
|
|
4
|
-
import "./bk-checkbox.js";
|
|
5
|
-
import "./bk-filter-bar.js";
|
|
6
4
|
import "./bk-icon.js";
|
|
7
|
-
import "./bk-input-number.js";
|
|
8
|
-
import "./bk-input-text.js";
|
|
9
|
-
import "./bk-menu-context.js";
|
|
10
|
-
import "./bk-menu-divider.js";
|
|
11
|
-
import "./bk-menu-item.js";
|
|
12
|
-
import "./bk-menu-label.js";
|
|
13
|
-
import "./bk-popover.js";
|
|
14
|
-
import "./bk-skeleton.js";
|
|
15
5
|
import "../icons/set/add.js";
|
|
16
6
|
import "../icons/set/arrow-back.js";
|
|
17
7
|
import "../icons/set/arrow-down.js";
|
|
@@ -245,11 +235,13 @@ export type TableCSVOptions = {
|
|
|
245
235
|
* its header cell. `th[data-card="title"]` marks the column that is the title of a card (default: the row headers,
|
|
246
236
|
* `th` in the body), `th[data-card="hidden"]` leaves a column out. `th[data-card="meta"]` shows a short value (a
|
|
247
237
|
* position, a change, the disclosure button of an expandable row) in the head of the card, next to the title, without
|
|
248
|
-
* its label. A text value is at the end beside its label while it fits. A longer text wraps under its label, starts at
|
|
238
|
+
* its label. A meta value that does not fit next to the title moves under it. A text value is at the end beside its label while it fits. A longer text wraps under its label, starts at
|
|
249
239
|
* the start edge and uses the full width of the card. A
|
|
250
240
|
* number (`data-type="number"` on the header cell or the cell) and a yes/no mark always stay at the end beside their label.
|
|
251
241
|
* `th[data-card="block"]` puts the value of a column under its label in every card. The header row stays as a row of its
|
|
252
|
-
* controls (
|
|
242
|
+
* controls (select-all, filters). In a `sortable` table, one select ("Sort by") above the table sorts the cards, and a
|
|
243
|
+
* button next to it changes the direction. The select contains every sortable column, also a hidden one. The sort
|
|
244
|
+
* buttons of the header cells do not show. The table keeps its roles (set explicitly while it shows cards).
|
|
253
245
|
* The element has the custom state `cards` while it shows cards (`bk-table:state(cards)`). It sets the labels, the
|
|
254
246
|
* marks and the roles on the cells only while it shows cards, so a wide table keeps the markup of the server.
|
|
255
247
|
*
|
|
@@ -282,6 +274,7 @@ export type TableCSVOptions = {
|
|
|
282
274
|
* @csspart scroller - The scroll container around the table.
|
|
283
275
|
* @csspart state - The box of the empty and the error slot.
|
|
284
276
|
* @csspart filter-bar - The `bk-filter-bar` with the active filters.
|
|
277
|
+
* @csspart card-sort - In card mode: the box of the "Sort by" select and the direction button above the table.
|
|
285
278
|
* @csspart filter-popover - The `bk-popover` of a filter.
|
|
286
279
|
* @csspart column-menu - The menu of a column (column menu button, or a click on a resize handle).
|
|
287
280
|
* @csspart busy - The veil over the rows while `busy` reloads them.
|
|
@@ -612,6 +605,13 @@ export declare class BkTable extends LitElement {
|
|
|
612
605
|
static styles: import("lit").CSSResult[];
|
|
613
606
|
connectedCallback(): void;
|
|
614
607
|
disconnectedCallback(): void;
|
|
608
|
+
/**
|
|
609
|
+
* The update waits for the elements of the features in use: the selection, the filters and the column menu
|
|
610
|
+
* render with defined elements, and `updateComplete` includes their load. Skeletons and the editors of a cell
|
|
611
|
+
* do not hold the update: the busy state starts at once, and an edit waits for its field itself.
|
|
612
|
+
*/
|
|
613
|
+
protected scheduleUpdate(): void | Promise<unknown>;
|
|
614
|
+
private lateParts;
|
|
615
615
|
protected willUpdate(changed: PropertyValues): void;
|
|
616
616
|
/** The table has no data rows. */
|
|
617
617
|
private get isEmpty();
|
|
@@ -652,6 +652,10 @@ export declare class BkTable extends LitElement {
|
|
|
652
652
|
private get sortHeaders();
|
|
653
653
|
/** Puts a sort button with its icon into each sortable header cell and sets `aria-sort` (light DOM: after updates only). */
|
|
654
654
|
private syncSort;
|
|
655
|
+
/** Card mode: the select chose a column. The column sorts in its first direction. */
|
|
656
|
+
private onCardSort;
|
|
657
|
+
/** Card mode: the button changes the direction of the sorted column. */
|
|
658
|
+
private onCardSortDir;
|
|
655
659
|
/** Asks for a sort of the column of `th`: the given direction, else the next one. */
|
|
656
660
|
private requestSort;
|
|
657
661
|
/**
|
|
@@ -14,19 +14,20 @@ import { containsDeep, deepActiveElement, setTriggerAria } from "../internal/anc
|
|
|
14
14
|
import { copyText } from "../internal/clipboard.js";
|
|
15
15
|
import { LocalizeController } from "../i18n.js";
|
|
16
16
|
import { base, gripRules, srOnlyRules } from "../internal/styles.js";
|
|
17
|
+
import { LateLoad, lateLoads } from "../internal/late.js";
|
|
17
18
|
import "./bk-button.js";
|
|
18
|
-
import "./bk-checkbox.js";
|
|
19
|
-
import "./bk-filter-bar.js";
|
|
20
19
|
import "./bk-icon.js";
|
|
21
|
-
import "./bk-input-number.js";
|
|
22
|
-
import "./bk-input-text.js";
|
|
23
|
-
import "./bk-menu-context.js";
|
|
24
|
-
import "./bk-menu-divider.js";
|
|
25
|
-
import "./bk-menu-item.js";
|
|
26
|
-
import "./bk-menu-label.js";
|
|
27
|
-
import "./bk-popover.js";
|
|
28
|
-
import "./bk-skeleton.js";
|
|
29
20
|
import { mutationObserver, resizeObserver, lightDom } from "../internal/server.js";
|
|
21
|
+
const selectParts = new LateLoad(() => import("./bk-checkbox.js"));
|
|
22
|
+
const filterParts = new LateLoad(() => Promise.all([import("./bk-filter-bar.js"), import("./bk-popover.js")]));
|
|
23
|
+
const menuParts = new LateLoad(() => Promise.all([
|
|
24
|
+
import("./bk-menu-context.js"),
|
|
25
|
+
import("./bk-menu-item.js"),
|
|
26
|
+
import("./bk-menu-divider.js"),
|
|
27
|
+
import("./bk-menu-label.js")
|
|
28
|
+
]));
|
|
29
|
+
const editParts = new LateLoad(() => Promise.all([import("./bk-input-number.js"), import("./bk-input-text.js")]));
|
|
30
|
+
const skeletonParts = new LateLoad(() => import("./bk-skeleton.js"));
|
|
30
31
|
import "../icons/set/add.js";
|
|
31
32
|
import "../icons/set/arrow-back.js";
|
|
32
33
|
import "../icons/set/arrow-down.js";
|
|
@@ -313,8 +314,28 @@ const tableStyles = css`
|
|
|
313
314
|
padding-block-end: var(--bk-table-card-gap, var(--bk-space-2));
|
|
314
315
|
}
|
|
315
316
|
bk-table:state(cards) > table > thead > tr > th { display: block; position: static; padding: 0; border: 0; background: none; inline-size: auto; }
|
|
316
|
-
bk-table:state(cards) > table > thead > tr > th:not(:has(>
|
|
317
|
+
bk-table:state(cards) > table > thead > tr > th:not(:has(> .bk-table-tool, > bk-checkbox)) { ${srOnlyRules} }
|
|
318
|
+
/* The select above the table sorts the cards: the sort buttons of the header cells do not show. */
|
|
319
|
+
bk-table:state(cards) > table > thead > tr > th > .bk-table-sort { ${srOnlyRules} }
|
|
320
|
+
bk-table:state(cards) > table > thead > tr:not(:has(> th > :is(.bk-table-tool, bk-checkbox))) { padding-block-end: 0; }
|
|
317
321
|
bk-table:state(cards) > table > thead > tr > th > .bk-table-resize { display: none; }
|
|
322
|
+
/*
|
|
323
|
+
* The card is the surface of the row: a selected row and the row under the pointer tint the whole card, not the
|
|
324
|
+
* cells inside its padding. The cells have no background of their own in card mode (no stripes, no pin surface).
|
|
325
|
+
*/
|
|
326
|
+
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:not([data-bk-spacer]) > :is(th, td):not([data-bk-handle]) { background: none; }
|
|
327
|
+
bk-table:state(cards) > table > tbody > tr:is([data-selected], [aria-selected="true"]) {
|
|
328
|
+
background-image: linear-gradient(var(--bk-table-selected, var(--bk-selected)), var(--bk-table-selected, var(--bk-selected)));
|
|
329
|
+
}
|
|
330
|
+
@media (hover: hover) {
|
|
331
|
+
bk-table:state(cards)[hover-rows] > table > tbody > tr:hover {
|
|
332
|
+
background-image: linear-gradient(var(--bk-table-row-hover, var(--bk-hover)), var(--bk-table-row-hover, var(--bk-hover)));
|
|
333
|
+
}
|
|
334
|
+
bk-table:state(cards)[hover-rows] > table > tbody > tr:is([data-selected], [aria-selected="true"]):hover {
|
|
335
|
+
background-image: linear-gradient(var(--bk-table-row-hover, var(--bk-hover)), var(--bk-table-row-hover, var(--bk-hover))),
|
|
336
|
+
linear-gradient(var(--bk-table-selected, var(--bk-selected)), var(--bk-table-selected, var(--bk-selected)));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
318
339
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr {
|
|
319
340
|
margin-block-end: var(--bk-table-card-gap, var(--bk-space-2)); padding: var(--bk-table-card-padding, var(--bk-space-3));
|
|
320
341
|
border: var(--bk-border-width) solid var(--bk-table-card-border, var(--bk-layer-raised-border));
|
|
@@ -360,10 +381,11 @@ const tableStyles = css`
|
|
|
360
381
|
flex: none; order: 0;
|
|
361
382
|
}
|
|
362
383
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr:has(> [data-bk-card="meta"]) > :is([data-bk-card="title"], th:not([data-bk-card], ${unsafeCSS(GENERATED)})) {
|
|
363
|
-
|
|
384
|
+
/* The title keeps the width of its longest word (at most the card): a meta value that does not fit then wraps under it. */
|
|
385
|
+
flex: 1 1 0; min-inline-size: min(min-content, 100%); order: 0;
|
|
364
386
|
}
|
|
365
387
|
bk-table:state(cards) > table > :is(tbody, tfoot) > tr > [data-bk-card="meta"] {
|
|
366
|
-
justify-content: start; align-items: center; gap: var(--bk-table-card-meta-gap, var(--bk-space-2));
|
|
388
|
+
justify-content: start; align-items: center; gap: var(--bk-table-card-meta-gap, var(--bk-space-2)); max-inline-size: 100%;
|
|
367
389
|
text-align: start; color: var(--bk-table-card-meta-fg, var(--bk-text-muted));
|
|
368
390
|
}
|
|
369
391
|
/* An open row and its detail form one card. The text of the detail starts at the start edge. */
|
|
@@ -534,6 +556,9 @@ class BkTable extends LitElement {
|
|
|
534
556
|
.scroller { overflow: auto; flex: 1 1 auto; min-block-size: 0; max-block-size: inherit; overscroll-behavior-inline: contain; }
|
|
535
557
|
.scroller:focus-visible { outline: var(--bk-focus-ring); outline-offset: var(--bk-focus-offset-inset); }
|
|
536
558
|
.filter-bar { margin-block-end: var(--bk-table-filter-bar-gap, var(--bk-space-2)); }
|
|
559
|
+
/* Card mode: the sort of the cards is one select and a button for the direction, above the table. */
|
|
560
|
+
.card-sort { display: flex; align-items: end; gap: var(--bk-table-card-gap, var(--bk-space-2)); margin-block-end: var(--bk-table-card-gap, var(--bk-space-2)); }
|
|
561
|
+
.card-sort bk-select { flex: 1 1 auto; min-inline-size: 0; --bk-field-label-width: max-content; }
|
|
537
562
|
.state { padding: var(--bk-table-state-padding, var(--bk-space-4)); }
|
|
538
563
|
.sentinel { block-size: var(--bk-border-width); }
|
|
539
564
|
.probe { position: absolute; visibility: hidden; pointer-events: none; inline-size: 0; block-size: 0; margin-inline-start: var(--bk-table-cards-below, calc(var(--bk-width-panel) * 1.5)); }
|
|
@@ -555,6 +580,25 @@ class BkTable extends LitElement {
|
|
|
555
580
|
this.rowLinks.disconnect();
|
|
556
581
|
this.observedTable = null;
|
|
557
582
|
}
|
|
583
|
+
/**
|
|
584
|
+
* The update waits for the elements of the features in use: the selection, the filters and the column menu
|
|
585
|
+
* render with defined elements, and `updateComplete` includes their load. Skeletons and the editors of a cell
|
|
586
|
+
* do not hold the update: the busy state starts at once, and an edit waits for its field itself.
|
|
587
|
+
*/
|
|
588
|
+
scheduleUpdate() {
|
|
589
|
+
const wait = this.lateParts();
|
|
590
|
+
return wait ? wait.then(() => super.scheduleUpdate()) : super.scheduleUpdate();
|
|
591
|
+
}
|
|
592
|
+
lateParts() {
|
|
593
|
+
if (this.busy)
|
|
594
|
+
void skeletonParts.start();
|
|
595
|
+
if (this.navigation === "cell")
|
|
596
|
+
void editParts.start();
|
|
597
|
+
const head = filterParts.loaded && menuParts.loaded ? null : this.headRow;
|
|
598
|
+
const filters = this.filterable || Object.keys(this.filters ?? {}).length > 0 || !!head?.querySelector(":scope > [data-filter]");
|
|
599
|
+
const menu = this.columnMenu || this.resizable || this.reorderable || !!head?.querySelector(":scope > [data-resizable]");
|
|
600
|
+
return lateLoads(this.selection && selectParts.start(), filters && filterParts.start(), menu && menuParts.start());
|
|
601
|
+
}
|
|
558
602
|
willUpdate(changed) {
|
|
559
603
|
super.willUpdate(changed);
|
|
560
604
|
if (this.virtual && this.renderRow)
|
|
@@ -788,6 +832,11 @@ class BkTable extends LitElement {
|
|
|
788
832
|
icon.className = "bk-table-sort-icon";
|
|
789
833
|
button.append(icon);
|
|
790
834
|
}
|
|
835
|
+
if (this.cards) {
|
|
836
|
+
if (button.getAttribute("tabindex") !== "-1")
|
|
837
|
+
button.setAttribute("tabindex", "-1");
|
|
838
|
+
} else if (button.getAttribute("tabindex") === "-1")
|
|
839
|
+
button.removeAttribute("tabindex");
|
|
791
840
|
const sorted = th.dataset.sort === this.sortKey;
|
|
792
841
|
const name = sorted ? this.sortDir === "desc" ? "arrow-down" : "arrow-up" : "unfold-more";
|
|
793
842
|
if (icon.getAttribute("name") !== name)
|
|
@@ -799,6 +848,20 @@ class BkTable extends LitElement {
|
|
|
799
848
|
th.setAttribute("aria-sort", sort);
|
|
800
849
|
}
|
|
801
850
|
}
|
|
851
|
+
/** Card mode: the select chose a column. The column sorts in its first direction. */
|
|
852
|
+
onCardSort = (e) => {
|
|
853
|
+
e.stopPropagation();
|
|
854
|
+
const key = e.target.value;
|
|
855
|
+
const th = this.headRow && this.appCells(this.headRow).find((c) => c.dataset.sort === key);
|
|
856
|
+
if (th && key !== this.sortKey)
|
|
857
|
+
this.requestSort(th);
|
|
858
|
+
};
|
|
859
|
+
/** Card mode: the button changes the direction of the sorted column. */
|
|
860
|
+
onCardSortDir = () => {
|
|
861
|
+
const th = this.headRow && this.appCells(this.headRow).find((c) => c.dataset.sort === this.sortKey);
|
|
862
|
+
if (th)
|
|
863
|
+
this.requestSort(th, this.sortDir === "desc" ? "asc" : "desc");
|
|
864
|
+
};
|
|
802
865
|
/** Asks for a sort of the column of `th`: the given direction, else the next one. */
|
|
803
866
|
requestSort(th, want) {
|
|
804
867
|
const key = th.dataset.sort;
|
|
@@ -2244,6 +2307,12 @@ class BkTable extends LitElement {
|
|
|
2244
2307
|
async startEdit(cell) {
|
|
2245
2308
|
if (this.editing || !cell.hasAttribute("data-editable") || this.navigation !== "cell")
|
|
2246
2309
|
return;
|
|
2310
|
+
const load = editParts.start();
|
|
2311
|
+
if (load) {
|
|
2312
|
+
await load;
|
|
2313
|
+
if (this.editing)
|
|
2314
|
+
return;
|
|
2315
|
+
}
|
|
2247
2316
|
const head = this.headOf(cell);
|
|
2248
2317
|
const old = cell.dataset.value ?? this.text(cell);
|
|
2249
2318
|
const field = document.createElement(cell.dataset.field === "number" ? "bk-input-number" : "bk-input-text");
|
|
@@ -2591,6 +2660,9 @@ class BkTable extends LitElement {
|
|
|
2591
2660
|
else
|
|
2592
2661
|
this.internals.states.delete("cards");
|
|
2593
2662
|
this.syncAll();
|
|
2663
|
+
this.requestUpdate();
|
|
2664
|
+
if (cards && this.sortable)
|
|
2665
|
+
void import("./bk-select.js");
|
|
2594
2666
|
}
|
|
2595
2667
|
const head = this.headRow;
|
|
2596
2668
|
if (head && head.querySelector("[data-pin]"))
|
|
@@ -2607,7 +2679,17 @@ class BkTable extends LitElement {
|
|
|
2607
2679
|
const empty = this.empty && !this.busy && !error && this.slots.has("empty");
|
|
2608
2680
|
const filterHead = this.filterKey ? this.headRow && this.appCells(this.headRow).find((c) => c.dataset.filter === this.filterKey) : null;
|
|
2609
2681
|
const filterName = this.i18n.t("tableFilterColumn", { column: filterHead ? this.text(filterHead) : "" });
|
|
2610
|
-
|
|
2682
|
+
const sorts = this.sortable && this.cards && this.headRow ? this.appCells(this.headRow).filter((th) => th.dataset.sort).map((th) => ({ key: th.dataset.sort, text: this.text(th) || th.dataset.sort })) : [];
|
|
2683
|
+
const desc = this.sortDir === "desc";
|
|
2684
|
+
return html`${sorts.length ? html`<div class="card-sort" part="card-sort">
|
|
2685
|
+
<bk-select size="sm" label-position="start" label=${this.i18n.t("tableSortBy")} placeholder=${this.sortKey ? nothing : this.i18n.t("tableSortBy")}
|
|
2686
|
+
.value=${this.sortKey ?? ""} @input=${(e) => e.stopPropagation()} @change=${this.onCardSort}>
|
|
2687
|
+
${sorts.map((c) => html`<option value=${c.key}>${c.text}</option>`)}
|
|
2688
|
+
</bk-select>
|
|
2689
|
+
<bk-button size="sm" variant="outline" icon=${desc ? "arrow-down" : "arrow-up"} ?disabled=${!this.sortKey}
|
|
2690
|
+
label=${this.i18n.t(desc ? "tableSortAscending" : "tableSortDescending")} @click=${this.onCardSortDir}></bk-button>
|
|
2691
|
+
</div>` : nothing}
|
|
2692
|
+
${filters.length ? html`<bk-filter-bar class="filter-bar" part="filter-bar" .items=${filters}
|
|
2611
2693
|
@remove=${this.onFilterRemove} @clear=${this.onFilterClear}></bk-filter-bar>` : nothing}
|
|
2612
2694
|
<div class="frame">
|
|
2613
2695
|
<div class="scroller" part="scroller" tabindex=${this.scrolling ? "0" : nothing} ?inert=${this.busyState.inert && !this.empty}
|
package/dist/i18n/de.js
CHANGED
|
@@ -346,6 +346,8 @@ const de = {
|
|
|
346
346
|
chartReference: "Referenz",
|
|
347
347
|
chartNoData: "Keine Daten",
|
|
348
348
|
chartMark: "{category}, {series}: {value}",
|
|
349
|
+
chartNoValue: "kein Wert",
|
|
350
|
+
chartCategoryDetail: "{category}, {detail}",
|
|
349
351
|
chartTrend: "Verlauf",
|
|
350
352
|
chartSummary: "{label}: Minimum {min}, Maximum {max}, zuletzt {last}",
|
|
351
353
|
chartRange: "Bereich",
|
|
@@ -460,6 +462,7 @@ const de = {
|
|
|
460
462
|
tableColumnMenu: "Optionen f\xFCr {column}",
|
|
461
463
|
tableSortAscending: "Aufsteigend sortieren",
|
|
462
464
|
tableSortDescending: "Absteigend sortieren",
|
|
465
|
+
tableSortBy: "Sortieren nach",
|
|
463
466
|
tablePinStart: "Am Anfang fixieren",
|
|
464
467
|
tablePinEnd: "Am Ende fixieren",
|
|
465
468
|
tableUnpin: "Nicht mehr fixieren",
|
|
@@ -521,6 +524,10 @@ const de = {
|
|
|
521
524
|
previousPage: "Zur\xFCck",
|
|
522
525
|
nextPage: "Weiter",
|
|
523
526
|
pagerLabel: "Weitere Seiten",
|
|
527
|
+
periodNavLabel: "Zeitraum-Navigation",
|
|
528
|
+
periodPrevious: "Vorheriger Zeitraum",
|
|
529
|
+
periodNext: "N\xE4chster Zeitraum",
|
|
530
|
+
periodCurrent: "Aktueller Zeitraum",
|
|
524
531
|
pageNumber: "Seite {page}",
|
|
525
532
|
pageOf: "Seite {page} von {pages}",
|
|
526
533
|
paginationSummary: "{from}\u2013{to} von {total}",
|
package/dist/i18n.d.ts
CHANGED
|
@@ -422,6 +422,8 @@ declare const en: {
|
|
|
422
422
|
chartReference: string;
|
|
423
423
|
chartNoData: string;
|
|
424
424
|
chartMark: string;
|
|
425
|
+
chartNoValue: string;
|
|
426
|
+
chartCategoryDetail: string;
|
|
425
427
|
chartTrend: string;
|
|
426
428
|
chartSummary: string;
|
|
427
429
|
chartRange: string;
|
|
@@ -576,6 +578,7 @@ declare const en: {
|
|
|
576
578
|
tableColumnMenu: string;
|
|
577
579
|
tableSortAscending: string;
|
|
578
580
|
tableSortDescending: string;
|
|
581
|
+
tableSortBy: string;
|
|
579
582
|
tablePinStart: string;
|
|
580
583
|
tablePinEnd: string;
|
|
581
584
|
tableUnpin: string;
|
|
@@ -646,6 +649,10 @@ declare const en: {
|
|
|
646
649
|
previousPage: string;
|
|
647
650
|
nextPage: string;
|
|
648
651
|
pagerLabel: string;
|
|
652
|
+
periodNavLabel: string;
|
|
653
|
+
periodPrevious: string;
|
|
654
|
+
periodNext: string;
|
|
655
|
+
periodCurrent: string;
|
|
649
656
|
pageNumber: string;
|
|
650
657
|
pageOf: string;
|
|
651
658
|
paginationSummary: string;
|
package/dist/i18n.js
CHANGED
|
@@ -376,6 +376,8 @@ const en = {
|
|
|
376
376
|
chartReference: "Reference",
|
|
377
377
|
chartNoData: "No data",
|
|
378
378
|
chartMark: "{category}, {series}: {value}",
|
|
379
|
+
chartNoValue: "no value",
|
|
380
|
+
chartCategoryDetail: "{category}, {detail}",
|
|
379
381
|
chartTrend: "Trend",
|
|
380
382
|
chartSummary: "{label}: minimum {min}, maximum {max}, last {last}",
|
|
381
383
|
chartRange: "Range",
|
|
@@ -492,6 +494,7 @@ const en = {
|
|
|
492
494
|
tableColumnMenu: "Options for {column}",
|
|
493
495
|
tableSortAscending: "Sort ascending",
|
|
494
496
|
tableSortDescending: "Sort descending",
|
|
497
|
+
tableSortBy: "Sort by",
|
|
495
498
|
tablePinStart: "Pin to start",
|
|
496
499
|
tablePinEnd: "Pin to end",
|
|
497
500
|
tableUnpin: "Unpin",
|
|
@@ -555,6 +558,10 @@ const en = {
|
|
|
555
558
|
previousPage: "Previous",
|
|
556
559
|
nextPage: "Next",
|
|
557
560
|
pagerLabel: "More pages",
|
|
561
|
+
periodNavLabel: "Period navigation",
|
|
562
|
+
periodPrevious: "Previous period",
|
|
563
|
+
periodNext: "Next period",
|
|
564
|
+
periodCurrent: "Current period",
|
|
558
565
|
pageNumber: "Page {page}",
|
|
559
566
|
pageOf: "Page {page} of {pages}",
|
|
560
567
|
paginationSummary: "{from}\u2013{to} of {total}",
|
package/dist/index.d.ts
CHANGED
|
@@ -124,6 +124,7 @@ export * from "./components/bk-input-number.js";
|
|
|
124
124
|
export * from "./components/bk-page-header.js";
|
|
125
125
|
export * from "./components/bk-pagination.js";
|
|
126
126
|
export * from "./components/bk-page-pager.js";
|
|
127
|
+
export * from "./components/bk-period-nav.js";
|
|
127
128
|
export * from "./components/bk-pane.js";
|
|
128
129
|
export * from "./components/bk-panel.js";
|
|
129
130
|
export * from "./components/bk-popover.js";
|