@swiftwc/ui 0.0.0-dev.11 → 0.0.0-dev.110
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/generated/buses/alert-dialog.d.ts +2 -0
- package/generated/buses/alert-dialog.js +1 -0
- package/generated/buses/confirmation-dialog.d.ts +2 -0
- package/generated/buses/confirmation-dialog.js +1 -0
- package/generated/buses/index.d.ts +6 -0
- package/generated/buses/index.js +6 -0
- package/generated/buses/lifecycle-observer.d.ts +2 -0
- package/generated/buses/lifecycle-observer.js +1 -0
- package/generated/client/index.d.ts +24 -10
- package/generated/client/index.js +179 -194
- package/generated/components/alert-dialog.d.ts +11 -0
- package/generated/components/alert-dialog.js +94 -0
- package/generated/components/body-view.d.ts +8 -0
- package/generated/components/body-view.js +6 -2
- package/generated/components/bordered-button.d.ts +10 -0
- package/generated/components/bordered-button.js +36 -3
- package/generated/components/bordered-prominent-button.d.ts +10 -0
- package/generated/components/bordered-prominent-button.js +36 -3
- package/generated/components/borderless-button.d.ts +9 -1
- package/generated/components/borderless-button.js +29 -11
- package/generated/components/color-scheme.d.ts +12 -0
- package/generated/components/color-scheme.js +51 -0
- package/generated/components/confirmation-dialog.d.ts +4 -1
- package/generated/components/confirmation-dialog.js +38 -32
- package/generated/components/content-unavailable.d.ts +30 -0
- package/generated/components/content-unavailable.js +79 -0
- package/generated/components/date-picker.d.ts +21 -15
- package/generated/components/date-picker.js +126 -88
- package/generated/components/detail-placeholder.d.ts +11 -0
- package/generated/components/detail-placeholder.js +15 -0
- package/generated/components/disclosure-group.d.ts +8 -0
- package/generated/components/disclosure-group.js +18 -7
- package/generated/components/fine-tooltip.d.ts +15 -0
- package/generated/components/fine-tooltip.js +108 -0
- package/generated/components/form-view.d.ts +10 -0
- package/generated/components/form-view.js +8 -3
- package/generated/components/glass-button.d.ts +10 -0
- package/generated/components/glass-button.js +36 -3
- package/generated/components/glass-prominent-button.d.ts +10 -0
- package/generated/components/glass-prominent-button.js +36 -3
- package/generated/components/h-divider.d.ts +11 -0
- package/generated/components/h-divider.js +15 -0
- package/generated/components/h-stack.d.ts +22 -0
- package/generated/components/h-stack.js +24 -0
- package/generated/components/image-view.d.ts +18 -0
- package/generated/components/image-view.js +65 -0
- package/generated/components/index.d.ts +15 -3
- package/generated/components/index.js +15 -3
- package/generated/components/label-view.d.ts +19 -1
- package/generated/components/label-view.js +63 -62
- package/generated/components/labeled-content.d.ts +33 -0
- package/generated/components/labeled-content.js +160 -0
- package/generated/components/list-view.d.ts +14 -0
- package/generated/components/list-view.js +12 -17
- package/generated/components/menu-view.d.ts +12 -1
- package/generated/components/menu-view.js +63 -65
- package/generated/components/navigation-large-title.d.ts +11 -0
- package/generated/components/navigation-large-title.js +11 -5
- package/generated/components/navigation-split-view.d.ts +9 -1
- package/generated/components/navigation-split-view.js +10 -6
- package/generated/components/navigation-stack.d.ts +9 -1
- package/generated/components/navigation-stack.js +13 -11
- package/generated/components/navigation-title.d.ts +11 -1
- package/generated/components/navigation-title.js +58 -55
- package/generated/components/picker-view.d.ts +48 -7
- package/generated/components/picker-view.js +971 -261
- package/generated/components/plain-button.js +3 -3
- package/generated/components/progress-view.d.ts +20 -0
- package/generated/components/progress-view.js +120 -0
- package/generated/components/screen-view.js +2 -1
- package/generated/components/scroll-view-proxy.d.ts +13 -0
- package/generated/components/scroll-view-proxy.js +15 -0
- package/generated/components/scroll-view.d.ts +13 -1
- package/generated/components/scroll-view.js +140 -97
- package/generated/components/search-view.d.ts +12 -0
- package/generated/components/search-view.js +24 -0
- package/generated/components/section-view.d.ts +13 -1
- package/generated/components/section-view.js +38 -58
- package/generated/components/sheet-view.d.ts +4 -2
- package/generated/components/sheet-view.js +10 -39
- package/generated/components/sidebar-toggle.d.ts +9 -1
- package/generated/components/sidebar-toggle.js +46 -69
- package/generated/components/sidebar-view.d.ts +3 -0
- package/generated/components/sidebar-view.js +16 -9
- package/generated/components/sticky-container.d.ts +6 -1
- package/generated/components/sticky-container.js +9 -7
- package/generated/components/tab-bar.d.ts +3 -0
- package/generated/components/tab-bar.js +17 -13
- package/generated/components/tab-item.d.ts +3 -0
- package/generated/components/tab-item.js +20 -13
- package/generated/components/tab-view.d.ts +13 -4
- package/generated/components/tab-view.js +25 -89
- package/generated/components/table-view.d.ts +19 -0
- package/generated/components/table-view.js +88 -107
- package/generated/components/text-field.d.ts +19 -6
- package/generated/components/text-field.js +127 -99
- package/generated/components/text-view.d.ts +11 -0
- package/generated/components/text-view.js +16 -0
- package/generated/components/toggle-view.d.ts +43 -0
- package/generated/components/toggle-view.js +366 -0
- package/generated/components/tool-bar-item-group.d.ts +8 -0
- package/generated/components/tool-bar-item-group.js +22 -4
- package/generated/components/tool-bar-item.d.ts +12 -1
- package/generated/components/tool-bar-item.js +57 -10
- package/generated/components/tool-bar.d.ts +19 -0
- package/generated/components/tool-bar.js +48 -33
- package/generated/components/v-divider.d.ts +11 -0
- package/generated/components/v-divider.js +15 -0
- package/generated/components/v-keyboard.d.ts +8 -1
- package/generated/components/v-keyboard.js +11 -9
- package/generated/components/v-stack.d.ts +20 -0
- package/generated/components/v-stack.js +18 -2
- package/generated/css/index.css +4617 -1266
- package/generated/events/alert-dialog.d.ts +13 -0
- package/generated/events/alert-dialog.js +1 -0
- package/generated/events/confirmation-dialog.d.ts +7 -2
- package/generated/events/date-picker.d.ts +6 -1
- package/generated/events/index.d.ts +2 -0
- package/generated/events/index.js +2 -0
- package/generated/events/lifecycle-observer.d.ts +10 -2
- package/generated/events/picker-view.d.ts +22 -1
- package/generated/events/scroll-view.d.ts +10 -2
- package/generated/events/tab-view.d.ts +38 -8
- package/generated/events/text-field.d.ts +6 -1
- package/generated/events/toggle-view.d.ts +14 -0
- package/generated/events/toggle-view.js +1 -0
- package/generated/i18n/index.d.ts +19 -10
- package/generated/i18n/index.js +79 -54
- package/generated/i18n/locales/el.d.ts +16 -0
- package/generated/i18n/locales/el.js +16 -0
- package/generated/i18n/locales/en.d.ts +16 -0
- package/generated/i18n/locales/en.js +16 -0
- package/generated/i18n/locales/index.d.ts +4 -0
- package/generated/i18n/locales/index.js +4 -0
- package/generated/internal/class/css-style-observer.js +2 -2
- package/generated/internal/class/form-associated-base.d.ts +0 -4
- package/generated/internal/class/form-associated-base.js +22 -39
- package/generated/internal/class/mutation-observer-set.d.ts +9 -0
- package/generated/internal/class/mutation-observer-set.js +42 -0
- package/generated/internal/class/mutation-observer-singleton.js +18 -0
- package/generated/internal/class/navigation-view.d.ts +1 -1
- package/generated/internal/class/navigation-view.js +36 -43
- package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
- package/generated/internal/decorators/adaptive-slot.js +47 -0
- package/generated/internal/decorators/custom-element.d.ts +1 -1
- package/generated/internal/decorators/custom-element.js +2 -1
- package/generated/internal/decorators/index.d.ts +6 -0
- package/generated/internal/decorators/index.js +6 -0
- package/generated/internal/decorators/microtask-on-connected.d.ts +39 -0
- package/generated/internal/decorators/microtask-on-connected.js +67 -0
- package/generated/internal/flags.d.ts +4 -0
- package/generated/internal/flags.js +1 -0
- package/generated/internal/privateNamespace.d.ts +10 -0
- package/generated/internal/privateNamespace.js +159 -1
- package/generated/internal/utils/$.d.ts +9 -0
- package/generated/internal/utils/$.js +11 -0
- package/generated/internal/utils/compare-big-decimals.js +7 -17
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/define-translations.d.ts +1 -0
- package/generated/internal/utils/define-translations.js +3 -0
- package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
- package/generated/internal/utils/ensure-placeholder.js +41 -0
- package/generated/internal/utils/index.d.ts +39 -2
- package/generated/internal/utils/index.js +39 -3
- package/generated/internal/utils/is-inside.d.ts +1 -0
- package/generated/internal/utils/is-inside.js +4 -0
- package/generated/internal/utils/kebab-case.js +6 -9
- package/generated/internal/utils/list-active.js +67 -12
- package/generated/internal/utils/touch-glass.js +5 -5
- package/generated/internal/vendor/morphdom.d.ts +6 -0
- package/generated/internal/vendor/morphdom.js +720 -0
- package/generated/morphdom/index.d.ts +8 -0
- package/generated/morphdom/index.js +8 -0
- package/generated/morphdom/morph.d.ts +4 -0
- package/generated/morphdom/morph.js +10 -0
- package/generated/morphdom/query-morph.d.ts +5 -0
- package/generated/morphdom/query-morph.js +12 -0
- package/generated/morphdom/render-to-string.d.ts +12 -0
- package/generated/morphdom/render-to-string.js +48 -0
- package/generated/morphdom/unsafe-html.d.ts +2 -0
- package/generated/morphdom/unsafe-html.js +4 -0
- package/generated/namespace-browser/base.d.ts +12 -3
- package/generated/namespace-browser/base.js +41 -18
- package/generated/namespace-browser/event.d.ts +10 -0
- package/generated/namespace-browser/event.js +1 -0
- package/generated/snapshot/index.d.ts +3 -1
- package/generated/snapshot/index.js +23 -2
- package/generated/tpl/html.d.ts +5 -0
- package/generated/tpl/html.js +7 -0
- package/generated/tpl/index.d.ts +6 -0
- package/generated/tpl/index.js +6 -0
- package/generated/tpl/is-template-result.d.ts +3 -0
- package/generated/tpl/is-template-result.js +1 -0
- package/generated/tpl/render.d.ts +2 -0
- package/generated/tpl/render.js +132 -0
- package/package.json +32 -7
- package/scss/_components.scss +15 -0
- package/scss/_functions.scss +10 -0
- package/scss/_maps.scss +293 -0
- package/scss/_mixins.scss +4 -0
- package/scss/_transitions.scss +6 -1
- package/scss/_utils.scss +2 -0
- package/scss/_vars.scss +9 -115
- package/scss/base/_layout.scss +17 -7
- package/scss/base/_reboot.scss +34 -1
- package/scss/base/_root.scss +143 -124
- package/scss/colors/_index.scss +328 -88
- package/scss/components/_alert-dialog.scss +111 -0
- package/scss/components/_bordered-button.scss +37 -0
- package/scss/components/_bordered-prominent-button.scss +46 -0
- package/scss/components/_borderless-button.scss +26 -0
- package/scss/components/_confirmation-dialog.scss +41 -49
- package/scss/components/_content-unavailable.scss +57 -0
- package/scss/components/_date-picker.scss +15 -15
- package/scss/components/_detail-placeholder.scss +1 -3
- package/scss/components/_disclosure-group.scss +85 -34
- package/scss/components/_fine-tooltip.scss +84 -0
- package/scss/components/_form-view.scss +63 -24
- package/scss/components/_glass-button.scss +37 -0
- package/scss/components/_glass-prominent-button.scss +47 -0
- package/scss/components/_group-box.scss +27 -0
- package/scss/components/_h-flex-stack.scss +23 -0
- package/scss/components/_h-stack.scss +6 -17
- package/scss/components/_image-view.scss +20 -0
- package/scss/components/_index.scss +69 -36
- package/scss/components/_label-view copy.scss.txt +420 -0
- package/scss/components/_label-view.scss +105 -120
- package/scss/components/_label-view.scss.txt +536 -0
- package/scss/components/_labeled-content.scss +67 -1
- package/scss/components/_list-view.scss +70 -29
- package/scss/components/_menu-view.scss +96 -61
- package/scss/components/_navigation-large-title.scss +23 -0
- package/scss/components/_navigation-split-view.scss +3 -3
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_picker-view.scss +270 -63
- package/scss/components/_plain-button.scss +8 -0
- package/scss/components/_progress-view.scss +98 -0
- package/scss/components/_scroll-view-proxy.scss +24 -22
- package/scss/components/_scroll-view-toolbars.scss +8 -2
- package/scss/components/_scroll-view.scss +16 -0
- package/scss/components/_search-view.scss +23 -0
- package/scss/components/_section-view.scss +23 -22
- package/scss/components/_sheet-view.scss +16 -6
- package/scss/components/_sidebar-toggle.scss +1 -4
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +17 -3
- package/scss/components/_tab-view.scss +12 -2
- package/scss/components/_table-column.scss +4 -2
- package/scss/components/_table-row.scss +71 -3
- package/scss/components/_table-view.scss +27 -18
- package/scss/components/_text-field.scss +37 -17
- package/scss/components/_text-view.scss +57 -0
- package/scss/components/_toggle-view.scss +171 -0
- package/scss/components/_tool-bar-item.scss +34 -82
- package/scss/components/_tool-bar.scss +77 -57
- package/scss/components/_v-stack.scss +8 -2
- package/scss/final/_touch-glass.scss +31 -0
- package/scss/mixins/_button.scss +44 -0
- package/scss/mixins/_color.scss +16 -0
- package/scss/mixins/_dialog.scss +1 -0
- package/scss/mixins/_index.scss +73 -5
- package/scss/placeholders/_buttons.scss +46 -11
- package/scss/placeholders/_lists.scss +159 -126
- package/scss/transitions/_alert-dialog.scss +18 -0
- package/scss/transitions/_confirmation-dialog.scss +8 -0
- package/scss/transitions/_fine-tooltip.scss +21 -0
- package/scss/transitions/_menu-view.scss +17 -15
- package/scss/transitions/_progress-view.scss +23 -0
- package/scss/transitions/_sheet-view.scss +30 -0
- package/scss/transitions/_tab-bar.scss +6 -5
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_frame.scss +59 -40
- package/scss/utils/_index.scss +45 -56
- package/scss/utils/_scroll-view.scss +1 -1
- package/scss/utils/_spacing.scss +1 -1
- package/scss/utils/_stacks.scss +34 -164
- package/web-components.css-data/en.json +28 -0
- package/web-components.html-data/en.json +2456 -166
- package/generated/confirmation-dialog/index.d.ts +0 -1
- package/generated/confirmation-dialog/index.js +0 -1
- package/generated/internal/utils/cash/index.d.ts +0 -22
- package/generated/internal/utils/cash/index.js +0 -23
- package/generated/lifecycle-observer/index.d.ts +0 -1
- package/generated/lifecycle-observer/index.js +0 -1
- package/scss/transitions/_dialog.scss +0 -28
- /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
- /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
- /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
- /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
- /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
- /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
- /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
- /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
- /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
|
@@ -3,8 +3,12 @@ import { type NavigationStack } from './navigation-stack';
|
|
|
3
3
|
declare const TAB_BAR_PLACEMENTS: readonly ["bottom-bar", "ornament", "sidebar", "top-bar"];
|
|
4
4
|
export type TabBarPlacement = (typeof TAB_BAR_PLACEMENTS)[number];
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
7
|
-
*
|
|
6
|
+
* @summary A container view that switches between screens using tabs.
|
|
7
|
+
*
|
|
8
|
+
* @cssprop --adaptable-tab-bar-placement
|
|
9
|
+
*
|
|
10
|
+
* @fires tabshow — A Tab is shown
|
|
11
|
+
* @fires tabhide — A Tab is hidden
|
|
8
12
|
* @fires tab-view:toggle
|
|
9
13
|
* @fires tab-view:adaptable-tab-bar-placement-change
|
|
10
14
|
*/
|
|
@@ -16,7 +20,12 @@ export declare class TabView extends HTMLElement {
|
|
|
16
20
|
get tabBarPlacement(): "bottom-bar" | "ornament" | "sidebar" | "top-bar" | undefined;
|
|
17
21
|
get moreTab(): NavigationStack | null;
|
|
18
22
|
connectedCallback(): void;
|
|
19
|
-
get selectedTab(): (
|
|
20
|
-
set selectedTab(tabs: (
|
|
23
|
+
get selectedTab(): (NavigationSplitView | NavigationStack)[];
|
|
24
|
+
set selectedTab(tabs: (NavigationSplitView | NavigationStack)[]);
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'tab-view': TabView;
|
|
29
|
+
}
|
|
21
30
|
}
|
|
22
31
|
export {};
|
|
@@ -2,12 +2,16 @@ var _a;
|
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
4
|
import { NavigationPath } from '../internal/class/navigation-path';
|
|
5
|
-
import {
|
|
5
|
+
import { cssTime, debounce, debug, frame, onoff, siblings, timeout } from '../internal/utils';
|
|
6
6
|
import { Snapshot } from '../snapshot';
|
|
7
7
|
const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
10
|
-
*
|
|
9
|
+
* @summary A container view that switches between screens using tabs.
|
|
10
|
+
*
|
|
11
|
+
* @cssprop --adaptable-tab-bar-placement
|
|
12
|
+
*
|
|
13
|
+
* @fires tabshow — A Tab is shown
|
|
14
|
+
* @fires tabhide — A Tab is hidden
|
|
11
15
|
* @fires tab-view:toggle
|
|
12
16
|
* @fires tab-view:adaptable-tab-bar-placement-change
|
|
13
17
|
*/
|
|
@@ -25,7 +29,7 @@ export class TabView extends HTMLElement {
|
|
|
25
29
|
this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
|
|
26
30
|
}
|
|
27
31
|
disconnectedCallback() {
|
|
28
|
-
|
|
32
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
29
33
|
this.#afterTabRevealDelay.cancel();
|
|
30
34
|
this.#cssStyleObserver?.disconnect();
|
|
31
35
|
CleanupRegistry.unregister(this);
|
|
@@ -37,29 +41,12 @@ export class TabView extends HTMLElement {
|
|
|
37
41
|
return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
|
|
38
42
|
}
|
|
39
43
|
connectedCallback() {
|
|
40
|
-
|
|
44
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
41
45
|
this.#cssStyleObserver = new CSSStyleObserver({
|
|
42
46
|
properties: ['--adaptable-tab-bar-placement-index'],
|
|
43
47
|
});
|
|
44
48
|
this.#cssStyleObserver.observe(this, this.#handleStyleChange);
|
|
45
49
|
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange)); // Snapshot.waitReady.then(this.#handleStyleChange)
|
|
46
|
-
// NOTE: wait for config
|
|
47
|
-
// Snapshot.waitReady.then(() => { // FIXME: Check this removed!
|
|
48
|
-
// for (const [or, w, handler] of [
|
|
49
|
-
// ['portrait', `max-width:${Snapshot.config!['ipad-portrait-bp-max']}`, this.#handleMediaChange],
|
|
50
|
-
// ['landscape', `max-width:${Snapshot.config!['ipad-landscape-bp-max']}`, this.#handleMediaChange],
|
|
51
|
-
// ['portrait', `min-width:${Snapshot.config!['ipad-portrait-bp-min']}`, this.#handleMediaChange],
|
|
52
|
-
// ['landscape', `min-width:${Snapshot.config!['ipad-landscape-bp-min']}`, this.#handleMediaChange],
|
|
53
|
-
// ]) {
|
|
54
|
-
// const mediaQueryList = self.matchMedia(`(orientation:${or}) and (${w})`)
|
|
55
|
-
// if (mediaQueryList.matches)
|
|
56
|
-
// this.#handleMediaChange(
|
|
57
|
-
// new MediaQueryListEvent('media-change', {
|
|
58
|
-
// matches: mediaQueryList.matches,
|
|
59
|
-
// })
|
|
60
|
-
// ) // Initial check
|
|
61
|
-
// CleanupRegistry.register(this, onoff('change', handler as EventListener, mediaQueryList).on())
|
|
62
|
-
// }
|
|
63
50
|
CleanupRegistry.register(this, onoff([
|
|
64
51
|
{ types: 'tabreveal tabswap', listener: this.#debouncedHandler },
|
|
65
52
|
{ types: 'beforetabreveal beforetabswap', listener: this.#addAnimations },
|
|
@@ -70,13 +57,14 @@ export class TabView extends HTMLElement {
|
|
|
70
57
|
listener: this.#handleSummaryClick,
|
|
71
58
|
},
|
|
72
59
|
], this).on());
|
|
73
|
-
// })
|
|
74
60
|
}
|
|
75
|
-
#handleSummaryClick = (
|
|
76
|
-
|
|
61
|
+
#handleSummaryClick = ({ target }) => {
|
|
62
|
+
if (!(target instanceof HTMLElement))
|
|
63
|
+
return;
|
|
64
|
+
const summary = target.closest('summary');
|
|
77
65
|
if (!summary)
|
|
78
66
|
return;
|
|
79
|
-
if (0 ===
|
|
67
|
+
if (0 === siblings('[aria-selected=true]', summary).length)
|
|
80
68
|
return;
|
|
81
69
|
if (!summary.closest('scroll-view')?.matches('tab-view > [is=sidebar-view] > scroll-view'))
|
|
82
70
|
return;
|
|
@@ -86,14 +74,14 @@ export class TabView extends HTMLElement {
|
|
|
86
74
|
const style = self.getComputedStyle(form);
|
|
87
75
|
if ('sidebar' !== style.getPropertyValue('--list-style'))
|
|
88
76
|
return;
|
|
89
|
-
this.#addAnimations();
|
|
77
|
+
this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
|
|
90
78
|
};
|
|
91
79
|
#handleTabViewPagereveal = (evt) => {
|
|
92
|
-
|
|
80
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
93
81
|
void this.#syncBodyFace();
|
|
94
82
|
};
|
|
95
83
|
#handleStyleChange = () => {
|
|
96
|
-
|
|
84
|
+
debug(`${_a.name} ⚡️ style`);
|
|
97
85
|
const style = self.getComputedStyle(this);
|
|
98
86
|
const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
|
|
99
87
|
newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
|
|
@@ -107,59 +95,8 @@ export class TabView extends HTMLElement {
|
|
|
107
95
|
}));
|
|
108
96
|
}
|
|
109
97
|
};
|
|
110
|
-
// #handleMediaChange: (evt: MediaQueryListEvent) => void = (evt) => {
|
|
111
|
-
// console.debug(`${TabView.name} ⚡️ ${evt?.type}`)
|
|
112
|
-
// if (!evt.matches) return
|
|
113
|
-
// this.#handleStyleChange()
|
|
114
|
-
// // if (evt.matches) {
|
|
115
|
-
// // const placement = self.getComputedStyle(this).getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
|
|
116
|
-
// // newValue = (TAB_BAR_PLACEMENTS as readonly string[]).includes(placement) ? (placement as (typeof TAB_BAR_PLACEMENTS)[number]) : 'bottom-bar'
|
|
117
|
-
// // if (newValue !== this.#cachedAdaptableTabBarPlacement) {
|
|
118
|
-
// // const oldValue = this.#cachedAdaptableTabBarPlacement
|
|
119
|
-
// // this.#cachedAdaptableTabBarPlacement = newValue
|
|
120
|
-
// // this.dispatchEvent(
|
|
121
|
-
// // new CustomEvent<TabViewAdaptableTabBarPlacementDetail>('tab-view:adaptable-tab-bar-placement-change', {
|
|
122
|
-
// // detail: { oldValue, newValue },
|
|
123
|
-
// // bubbles: true,
|
|
124
|
-
// // composed: true,
|
|
125
|
-
// // })
|
|
126
|
-
// // )
|
|
127
|
-
// // }
|
|
128
|
-
// // }
|
|
129
|
-
// // // trigger more-stack (dis)allowed event
|
|
130
|
-
// // if (evt.matches !== this.#moreStackAllowed) {
|
|
131
|
-
// // this.#moreStackAllowed = evt.matches
|
|
132
|
-
// // const eventType = evt.matches ? 'tab-view:more-tab-allowed' : 'tab-view:more-tab-disallowed'
|
|
133
|
-
// // this.dispatchEvent(new CustomEvent<TabMoreStackAllowanceDetail>(eventType, { detail: { moreTab: this.moreTab }, bubbles: true, composed: true }))
|
|
134
|
-
// // }
|
|
135
|
-
// // if (evt.matches) return // no button triggers should happen, already on iphone portrait
|
|
136
|
-
// // const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id
|
|
137
|
-
// // if (innerSelection) {
|
|
138
|
-
// // const btn = this.querySelector<HTMLButtonElement>(`[is="tab-item"][value="${CSS.escape(innerSelection)}"]`)
|
|
139
|
-
// // // NOTE: simulate btn click BU WITHOUT tabroot functionality!
|
|
140
|
-
// // if (btn) {
|
|
141
|
-
// // const newTab = this.querySelector<NavigationStack | NavigationSplitView>(`#${btn.getAttribute('value')}`)
|
|
142
|
-
// // if (newTab) {
|
|
143
|
-
// // this.selectedTab = TabView.gatherTab(newTab)
|
|
144
|
-
// // return
|
|
145
|
-
// // }
|
|
146
|
-
// // }
|
|
147
|
-
// // }
|
|
148
|
-
// // const outerSelection = this?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id
|
|
149
|
-
// // if (outerSelection && outerSelection === this.moreTab?.id) {
|
|
150
|
-
// // const btn = this.querySelector<HTMLButtonElement>(`[is="tab-item"]:not([value="${CSS.escape(outerSelection)}"])`)
|
|
151
|
-
// // // NOTE: simulate btn click BU WITHOUT tabroot functionality!
|
|
152
|
-
// // if (btn) {
|
|
153
|
-
// // const newTab = this.querySelector<NavigationStack | NavigationSplitView>(`#${btn.getAttribute('value')}`)
|
|
154
|
-
// // if (newTab) {
|
|
155
|
-
// // this.selectedTab = TabView.gatherTab(newTab)
|
|
156
|
-
// // return
|
|
157
|
-
// // }
|
|
158
|
-
// // }
|
|
159
|
-
// // }
|
|
160
|
-
// }
|
|
161
98
|
#handleAdaptableTabBarPlacementChange = (evt) => {
|
|
162
|
-
|
|
99
|
+
debug(`${_a.name} ⚡️ ${evt?.type}`);
|
|
163
100
|
if ('bottom-bar' !== evt.detail.oldValue)
|
|
164
101
|
return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
|
|
165
102
|
const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
|
|
@@ -188,7 +125,6 @@ export class TabView extends HTMLElement {
|
|
|
188
125
|
}
|
|
189
126
|
};
|
|
190
127
|
get selectedTab() {
|
|
191
|
-
// return this.querySelector<NavigationStack | NavigationSplitView>(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')
|
|
192
128
|
return [...this.querySelectorAll('navigation-stack:not([hidden]),navigation-split-view:not([hidden])')];
|
|
193
129
|
}
|
|
194
130
|
set selectedTab(tabs) {
|
|
@@ -199,28 +135,28 @@ export class TabView extends HTMLElement {
|
|
|
199
135
|
throw new Error('selectedTab[] must be in order of parent>child. You provided an element that contains the previous sibling.');
|
|
200
136
|
//
|
|
201
137
|
const selectors = [':not(:is(:scope>{{tag}}))', ':is(:scope>{{tag}})']; // first nested ones, then root ones
|
|
138
|
+
const ms = cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`);
|
|
202
139
|
for (const selector of selectors)
|
|
203
140
|
for (const ns of this.querySelectorAll(`navigation-stack:not([hidden])${selector.replace('{{tag}}', 'navigation-stack')},navigation-split-view:not([hidden])${selector.replace('{{tag}}', 'navigation-split-view')}`)) {
|
|
204
141
|
if (!tabs.some((tab) => !ns.contains(tab)))
|
|
205
142
|
continue; // shouldRun
|
|
206
|
-
ns.dispatchEvent(new CustomEvent('beforetabswap', { detail: { tag: ns.id }, bubbles: true, composed: true }));
|
|
143
|
+
ns.dispatchEvent(new CustomEvent('beforetabswap', { detail: { tag: ns.id, ms }, bubbles: true, composed: true }));
|
|
207
144
|
ns.hidden = true; // triggers
|
|
208
145
|
}
|
|
209
146
|
for (const selector of selectors.reverse())
|
|
210
147
|
for (const ns of this.querySelectorAll(`navigation-stack[hidden]${selector.replace('{{tag}}', 'navigation-stack')},navigation-split-view[hidden]${selector.replace('{{tag}}', 'navigation-split-view')}`)) {
|
|
211
148
|
if (!tabs.some((tab) => ns.contains(tab)))
|
|
212
149
|
continue; // shouldRun
|
|
213
|
-
ns.dispatchEvent(new CustomEvent('beforetabreveal', { detail: { tag: ns.id }, bubbles: true, composed: true }));
|
|
150
|
+
ns.dispatchEvent(new CustomEvent('beforetabreveal', { detail: { tag: ns.id, ms }, bubbles: true, composed: true }));
|
|
214
151
|
ns.hidden = false; // triggers
|
|
215
152
|
}
|
|
216
153
|
}
|
|
217
|
-
#addAnimations = () => {
|
|
154
|
+
#addAnimations = (evt) => {
|
|
218
155
|
this.setAttribute('js-aftertabreveal', '');
|
|
156
|
+
// const ms = cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`)
|
|
219
157
|
this.#afterTabRevealDelay.next(() => {
|
|
220
158
|
this.removeAttribute('js-aftertabreveal');
|
|
221
|
-
},
|
|
222
|
-
// this.removeAttribute('js-aftertabreveal')
|
|
223
|
-
// this.#afterTabRevealDelay = undefined
|
|
159
|
+
}, evt.detail.ms);
|
|
224
160
|
};
|
|
225
161
|
#handleSelectionChange = (evt) => {
|
|
226
162
|
this.#triggerToggleEvent(evt);
|
|
@@ -228,7 +164,7 @@ export class TabView extends HTMLElement {
|
|
|
228
164
|
#triggerToggleEvent = (evt) => {
|
|
229
165
|
const eventType = 'tab-view:toggle';
|
|
230
166
|
void this.#syncBodyFace();
|
|
231
|
-
|
|
167
|
+
debug(`${_a.name} 💡 ${eventType}`);
|
|
232
168
|
this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
|
|
233
169
|
};
|
|
234
170
|
#syncBodyFace = async () => {
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @summary A container view that arranges data in rows and columns, optionally letting the user select one or more of them.
|
|
3
|
+
*
|
|
4
|
+
* @attr {title:trailing:subtitle|trailing:title:subtitle|title:subtitle:trailing|*} preferred-compact-template — Sets the template areas when the table is in compact mode
|
|
5
|
+
*
|
|
6
|
+
* @slot — The default slot.
|
|
7
|
+
* @slot header-leading
|
|
8
|
+
* @slot header-principal
|
|
9
|
+
* @slot header-trailing
|
|
10
|
+
* @slot column
|
|
11
|
+
* @slot footer-leading
|
|
12
|
+
* @slot footer-principal
|
|
13
|
+
* @slot footer-trailing
|
|
14
|
+
*/
|
|
1
15
|
export declare class TableView extends HTMLElement {
|
|
2
16
|
#private;
|
|
3
17
|
static get template(): DocumentFragment;
|
|
@@ -5,3 +19,8 @@ export declare class TableView extends HTMLElement {
|
|
|
5
19
|
disconnectedCallback(): void;
|
|
6
20
|
connectedCallback(): void;
|
|
7
21
|
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
'table-view': TableView;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,97 +1,82 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
3
|
import { CSSStyleObserver } from '../internal/class/css-style-observer';
|
|
4
|
-
import {
|
|
5
|
-
import { $, listActive, onoff } from '../internal/utils';
|
|
4
|
+
import { MutationObserverSet } from '../internal/class/mutation-observer-set';
|
|
5
|
+
import { $, debug, listActive, onoff } from '../internal/utils';
|
|
6
|
+
import { queryMorph } from '../morphdom';
|
|
6
7
|
import { Snapshot } from '../snapshot';
|
|
7
|
-
|
|
8
|
+
import { html } from '../tpl';
|
|
9
|
+
/**
|
|
10
|
+
* @summary A container view that arranges data in rows and columns, optionally letting the user select one or more of them.
|
|
11
|
+
*
|
|
12
|
+
* @attr {title:trailing:subtitle|trailing:title:subtitle|title:subtitle:trailing|*} preferred-compact-template — Sets the template areas when the table is in compact mode
|
|
13
|
+
*
|
|
14
|
+
* @slot — The default slot.
|
|
15
|
+
* @slot header-leading
|
|
16
|
+
* @slot header-principal
|
|
17
|
+
* @slot header-trailing
|
|
18
|
+
* @slot column
|
|
19
|
+
* @slot footer-leading
|
|
20
|
+
* @slot footer-principal
|
|
21
|
+
* @slot footer-trailing
|
|
22
|
+
*/
|
|
8
23
|
export class TableView extends HTMLElement {
|
|
9
24
|
#styleObserver;
|
|
10
25
|
#compactToolbarItem;
|
|
11
|
-
#trackedElements = new Set();
|
|
12
26
|
static #template;
|
|
13
27
|
static get template() {
|
|
14
|
-
return (this.#template ??= $(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
28
|
+
return (this.#template ??= $(html `<div part="root table-container">
|
|
29
|
+
<div part="root table-header-stack">
|
|
30
|
+
<div part="root table-header-leading-stack">
|
|
31
|
+
<slot name="header-leading"></slot>
|
|
32
|
+
</div>
|
|
33
|
+
<div part="root table-header-principal-stack">
|
|
34
|
+
<slot name="header-principal"></slot>
|
|
35
|
+
</div>
|
|
36
|
+
<div part="root table-header-trailing-stack">
|
|
37
|
+
<slot name="header-trailing"></slot>
|
|
38
|
+
</div>
|
|
19
39
|
</div>
|
|
20
|
-
<div part="root table-
|
|
21
|
-
<slot name="
|
|
40
|
+
<div part="root table-column-stack">
|
|
41
|
+
<slot name="column"></slot>
|
|
22
42
|
</div>
|
|
23
|
-
<
|
|
24
|
-
|
|
43
|
+
<slot><p>empty</p></slot>
|
|
44
|
+
<div part="root table-footer-stack">
|
|
45
|
+
<div part="root table-footer-leading-stack">
|
|
46
|
+
<slot name="footer-leading"></slot>
|
|
47
|
+
</div>
|
|
48
|
+
<div part="root table-footer-principal-stack">
|
|
49
|
+
<slot name="footer-principal"></slot>
|
|
50
|
+
</div>
|
|
51
|
+
<div part="root table-footer-trailing-stack">
|
|
52
|
+
<slot name="footer-trailing"></slot>
|
|
53
|
+
</div>
|
|
25
54
|
</div>
|
|
26
|
-
</div
|
|
27
|
-
<div part="root table-column-stack">
|
|
28
|
-
<slot name="column"></slot>
|
|
29
|
-
</div>
|
|
30
|
-
<slot><p>empty</p></slot>
|
|
31
|
-
<div part="root table-footer-stack">
|
|
32
|
-
<div part="root table-footer-leading-stack">
|
|
33
|
-
<slot name="footer-leading"></slot>
|
|
34
|
-
</div>
|
|
35
|
-
<div part="root table-footer-principal-stack">
|
|
36
|
-
<slot name="footer-principal"></slot>
|
|
37
|
-
</div>
|
|
38
|
-
<div part="root table-footer-trailing-stack">
|
|
39
|
-
<slot name="footer-trailing"></slot>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
</div>`, ''));
|
|
55
|
+
</div>`));
|
|
43
56
|
}
|
|
44
57
|
#shadowRoot;
|
|
45
|
-
#
|
|
46
|
-
// #slot?: HTMLSlotElement
|
|
58
|
+
#slots = new Map();
|
|
47
59
|
constructor() {
|
|
48
60
|
super();
|
|
49
61
|
this.#shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
50
62
|
this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// <button type="button" tabindex="0">
|
|
58
|
-
// <label-view system-image="dots-three" title="Scan Documents"></label-view>
|
|
59
|
-
// </button>
|
|
60
|
-
// <button type="button" tabindex="0">
|
|
61
|
-
// <label-view system-image="dots-three" title="Connect to Server"></label-view>
|
|
62
|
-
// </button>
|
|
63
|
-
// <button type="button" tabindex="0">
|
|
64
|
-
// <label-view title="Edit Sidebar"></label-view>
|
|
65
|
-
// </button>
|
|
66
|
-
// </menu-view>
|
|
67
|
-
// `)
|
|
68
|
-
// $(`<menu-view slot="header-trailing">
|
|
69
|
-
// <label-view slot="label" title="Delete"></label-view>
|
|
70
|
-
// <button type="button" tabindex="0">
|
|
71
|
-
// <label-view system-image="dots-three" title="Scan Documents"></label-view>
|
|
72
|
-
// </button>
|
|
73
|
-
// <button type="button" tabindex="0">
|
|
74
|
-
// <label-view system-image="dots-three" title="Connect to Server"></label-view>
|
|
75
|
-
// </button>
|
|
76
|
-
// <button type="button" tabindex="0">
|
|
77
|
-
// <label-view title="Edit Sidebar"></label-view>
|
|
78
|
-
// </button>
|
|
79
|
-
// </menu-view>
|
|
80
|
-
// <div slot="footer-leading">22</div>
|
|
81
|
-
// <div slot="footer-trailing"><button><</button> <button>></button></div>`)
|
|
82
|
-
// )
|
|
63
|
+
for (const slot of this.#shadowRoot.querySelectorAll('slot'))
|
|
64
|
+
this.#slots?.set(slot.name, slot);
|
|
65
|
+
CleanupRegistry.register(this, () => {
|
|
66
|
+
this.#slots = new Map();
|
|
67
|
+
});
|
|
68
|
+
this.#slots?.get('column')?.addEventListener('slotchange', this.#handleColumnSlotchange);
|
|
83
69
|
}
|
|
84
70
|
disconnectedCallback() {
|
|
85
|
-
|
|
71
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
86
72
|
CleanupRegistry.unregister(this);
|
|
87
73
|
this.#styleObserver?.disconnect();
|
|
88
|
-
observers.
|
|
74
|
+
this.#observers.unobserveAll();
|
|
89
75
|
this.#compactToolbarItem = undefined;
|
|
90
76
|
}
|
|
91
77
|
connectedCallback() {
|
|
92
|
-
|
|
78
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
93
79
|
CleanupRegistry.register(this, onoff(listActive(this), this).on());
|
|
94
|
-
// console.log(999, this.#shadowRoot.querySelector('[part*=table-column-stack]'))
|
|
95
80
|
this.#styleObserver = new CSSStyleObserver({
|
|
96
81
|
properties: ['--adaptable-table-style-index'],
|
|
97
82
|
});
|
|
@@ -101,48 +86,40 @@ export class TableView extends HTMLElement {
|
|
|
101
86
|
this.#styleObserver.observe(target, this.#handleStyleChange);
|
|
102
87
|
Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
|
|
103
88
|
}
|
|
104
|
-
#
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
89
|
+
#handleColumnSlotchange = ({ type, target: slot }) => {
|
|
90
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
91
|
+
if (!(slot instanceof HTMLSlotElement))
|
|
92
|
+
return;
|
|
93
|
+
const assigned = slot.assignedElements();
|
|
94
|
+
this.#observers.syncObservations(assigned);
|
|
95
|
+
// if (0 < assigned.length)
|
|
96
|
+
this.#renderColumns([]);
|
|
110
97
|
};
|
|
111
|
-
#
|
|
112
|
-
|
|
113
|
-
// const sourceSlot = 0 < (this.#colSlot?.assignedElements({ flatten: true }) ?? []).length ? this.#colSlot : this.#colSlot
|
|
114
|
-
// const menu = this.querySelector(':scope>menu-view:not([slot])') ?? this.appendChild($(`<menu-view></menu-view>`))
|
|
115
|
-
// menu.innerHTML = `<label-view slot="label" system-image="dots-three" title="rtyty"></label-view>`
|
|
116
|
-
// for (const el of sourceSlot?.assignedElements({ flatten: true }) ?? []) menu.insertAdjacentElement('beforeend', TableView.wrapTag(el, sourceSlot?.name))
|
|
117
|
-
//
|
|
98
|
+
#renderColumns = (entries) => {
|
|
99
|
+
debug(`${_a.name} ⚡️ mutation`);
|
|
118
100
|
if (!this.#compactToolbarItem) {
|
|
119
|
-
this.#compactToolbarItem = $(`<menu-view tabindex="0" slot="header-trailing"></menu-view
|
|
101
|
+
this.#compactToolbarItem = $(html `<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
|
|
120
102
|
CleanupRegistry.unregister(this, 'compact_toolbar');
|
|
121
103
|
CleanupRegistry.register(this, onoff('click', this.#handleMenuClick, this.#compactToolbarItem).on(), 'compact_toolbar');
|
|
122
104
|
}
|
|
123
105
|
this.#compactToolbarItem.innerHTML = `<label-view slot="label" system-image="dots-three"></label-view>`;
|
|
124
|
-
for (const node of this.#
|
|
106
|
+
for (const node of this.#slots?.get('column')?.assignedElements({ flatten: true }) ?? []) {
|
|
125
107
|
if (!node.matches('[is=table-column]'))
|
|
126
108
|
continue;
|
|
127
|
-
const btn = $(`<button type="button" tabindex="0">
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
109
|
+
const btn = $(html `<button type="button" tabindex="0">
|
|
110
|
+
<v-stack spacing="0" alignment="leading">
|
|
111
|
+
<label-view></label-view>
|
|
112
|
+
<label-view font="callout" foreground="secondary"></label-view>
|
|
113
|
+
</v-stack>
|
|
114
|
+
</button>`, '>1'), title = btn.querySelector('label-view:first-child') ?? undefined, subTitle = btn.querySelector('label-view:last-child') ?? undefined;
|
|
115
|
+
queryMorph(':not([slot])', html `<span>${node.textContent.trim()}</span>`, title, { removeIf: !node.textContent.trim() });
|
|
116
|
+
queryMorph(':not([slot])', html `<span>${node.ariaSort ?? ''}</span>`, subTitle, { removeIf: !(node.ariaSort ?? '') });
|
|
135
117
|
this.#compactToolbarItem.appendChild(btn);
|
|
136
118
|
}
|
|
137
|
-
// const wasConnected = this.#compactToolbarItem?.isConnected
|
|
138
|
-
// this.#compactToolbarItem?.removeEventListener('click', this.#handleMenuClick)
|
|
139
|
-
// this.#compactToolbarItem?.remove()
|
|
140
|
-
// this.#compactToolbarItem = menu
|
|
141
|
-
// this.#compactToolbarItem?.addEventListener('click', this.#handleMenuClick)
|
|
142
|
-
// if (wasConnected) this.insertAdjacentElement('beforeend', this.#compactToolbarItem)
|
|
143
119
|
};
|
|
120
|
+
#observers = new MutationObserverSet(this.#renderColumns);
|
|
144
121
|
#handleStyleChange = () => {
|
|
145
|
-
|
|
122
|
+
debug(`${_a.name} ⚡️ style`);
|
|
146
123
|
const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
|
|
147
124
|
if (!target)
|
|
148
125
|
return;
|
|
@@ -150,25 +127,29 @@ export class TableView extends HTMLElement {
|
|
|
150
127
|
const adaptableTableStyle = style.getPropertyValue('--adaptable-table-style') || 'compact';
|
|
151
128
|
switch (adaptableTableStyle) {
|
|
152
129
|
case 'expanded':
|
|
153
|
-
if (
|
|
154
|
-
|
|
155
|
-
this.#compactToolbarItem?.remove();
|
|
130
|
+
if (this.#compactToolbarItem?.isConnected)
|
|
131
|
+
this.#compactToolbarItem?.remove();
|
|
156
132
|
break;
|
|
157
133
|
default:
|
|
158
134
|
if (!this.#compactToolbarItem)
|
|
159
135
|
break;
|
|
160
|
-
if (this.#
|
|
136
|
+
if (!this.#slots
|
|
137
|
+
?.get('column')
|
|
138
|
+
?.assignedElements()
|
|
139
|
+
.filter((el) => el.matches(':is(button[is=table-column])')).length)
|
|
161
140
|
break;
|
|
162
|
-
|
|
141
|
+
if (!this.#compactToolbarItem?.isConnected)
|
|
142
|
+
this.insertAdjacentElement('beforeend', this.#compactToolbarItem);
|
|
163
143
|
break;
|
|
164
144
|
}
|
|
165
145
|
};
|
|
166
|
-
#handleMenuClick = (
|
|
167
|
-
|
|
146
|
+
#handleMenuClick = ({ target }) => {
|
|
147
|
+
if (!(target instanceof HTMLElement))
|
|
148
|
+
return;
|
|
149
|
+
const btn = target.closest('button');
|
|
168
150
|
if (!btn)
|
|
169
151
|
return;
|
|
170
|
-
const siblings = [...(btn.parentNode?.querySelectorAll(':scope>button') ?? [])];
|
|
171
|
-
const index = siblings.indexOf(btn);
|
|
152
|
+
const siblings = [...(btn.parentNode?.querySelectorAll(':scope>button') ?? [])], index = siblings.indexOf(btn);
|
|
172
153
|
this.querySelector(`:scope>[slot=column]:nth-of-type(${index + 1})`)?.click();
|
|
173
154
|
};
|
|
174
155
|
}
|
|
@@ -2,28 +2,41 @@ import { FormAssociatedBase } from '../internal/class/form-associated-base';
|
|
|
2
2
|
declare const keyboardTypes: readonly ["decimal-pad", "number-pad", "default"];
|
|
3
3
|
export type KeyboardType = (typeof keyboardTypes)[number];
|
|
4
4
|
/**
|
|
5
|
+
* @summary A control that displays an editable text area.
|
|
6
|
+
*
|
|
7
|
+
* @fires {{ detail: { text: string } }} commit — Triggered when user interacts with the input area
|
|
8
|
+
*
|
|
5
9
|
* @slot label
|
|
6
|
-
* @slot validity-options
|
|
10
|
+
* @slot {HTMLOptionElement[]} validity-options
|
|
7
11
|
*/
|
|
8
12
|
export declare class TextField extends FormAssociatedBase {
|
|
9
13
|
#private;
|
|
10
14
|
static get observedAttributes(): string[];
|
|
11
15
|
static get template(): DocumentFragment;
|
|
12
16
|
constructor();
|
|
13
|
-
connectedCallback(): void;
|
|
14
|
-
disconnectedCallback(): void;
|
|
15
17
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
connectedCallback(): void;
|
|
16
20
|
get keyboardType(): KeyboardType;
|
|
17
21
|
get text(): string;
|
|
18
22
|
set text(v: string);
|
|
23
|
+
/**
|
|
24
|
+
* Form participation property
|
|
25
|
+
*/
|
|
19
26
|
get name(): string;
|
|
20
27
|
get value(): string;
|
|
21
28
|
get valueAsNumber(): number | "";
|
|
22
29
|
get negativeNumbersAllowed(): boolean;
|
|
23
30
|
setValidity: (flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement) => void;
|
|
24
31
|
setCustomValidity: (message: string) => void;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
formStateRestoreCallback(state: string, reason: string): void;
|
|
33
|
+
formAssociatedCallback(form: HTMLFormElement): void;
|
|
34
|
+
formDisabledCallback(disabled: boolean): void;
|
|
35
|
+
formResetCallback(): void;
|
|
36
|
+
}
|
|
37
|
+
declare global {
|
|
38
|
+
interface HTMLElementTagNameMap {
|
|
39
|
+
'text-field': TextField;
|
|
40
|
+
}
|
|
28
41
|
}
|
|
29
42
|
export {};
|