@ixfx/components 0.5.4 → 0.5.6
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/bundle/index.d.ts +57 -7
- package/bundle/index.d.ts.map +1 -1
- package/bundle/index.js +301 -37
- package/bundle/index.js.map +1 -1
- package/dist/{button-CTE8crYn.js → button-CU8eLcxB.js} +15 -1
- package/dist/button-CU8eLcxB.js.map +1 -0
- package/dist/button.d.ts +1 -0
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +1 -1
- package/dist/{colour-picker-C3Ag4uh-.js → colour-picker-Bb795sjX.js} +2 -2
- package/dist/{colour-picker-C3Ag4uh-.js.map → colour-picker-Bb795sjX.js.map} +1 -1
- package/dist/colour-picker.js +1 -1
- package/dist/crumbs.js +1 -1
- package/dist/index.d.ts +56 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +285 -38
- package/dist/index.js.map +1 -1
- package/dist/{menu-g6yd7ddN.js → menu-BYyeCAF7.js} +2 -2
- package/dist/{menu-g6yd7ddN.js.map → menu-BYyeCAF7.js.map} +1 -1
- package/dist/{menu-item-NUKwJ4s5.js → menu-item-BttvL89f.js} +3 -2
- package/dist/menu-item-BttvL89f.js.map +1 -0
- package/dist/menu-item-DSyf9f_L.d.ts.map +1 -1
- package/dist/menu.js +2 -2
- package/dist/{popup-DiWMxsWj.js → popup-D80sj2QC.js} +5 -3
- package/dist/popup-D80sj2QC.js.map +1 -0
- package/docs-user/README.md +1 -0
- package/docs-user/button.md +22 -1
- package/docs-user/snackbar.md +92 -0
- package/docs-user/vertical-list.md +37 -1
- package/package.json +1 -1
- package/dist/button-CTE8crYn.js.map +0 -1
- package/dist/menu-item-NUKwJ4s5.js.map +0 -1
- package/dist/popup-DiWMxsWj.js.map +0 -1
package/bundle/index.js
CHANGED
|
@@ -3066,6 +3066,15 @@ const buttonStyles = i$3`
|
|
|
3066
3066
|
:host([hide-icon]) .button-icon {
|
|
3067
3067
|
display: none;
|
|
3068
3068
|
}
|
|
3069
|
+
|
|
3070
|
+
:host([subtle]) button {
|
|
3071
|
+
background: color-mix(in oklch, var(--surface-4, #ccc) 40%, transparent);
|
|
3072
|
+
}
|
|
3073
|
+
|
|
3074
|
+
:host([subtle]) button:hover:not(:disabled),
|
|
3075
|
+
:host([subtle]) button:focus-visible:not(:disabled) {
|
|
3076
|
+
background: color-mix(in oklch, var(--surface-4, #ccc) 70%, transparent);
|
|
3077
|
+
}
|
|
3069
3078
|
`;
|
|
3070
3079
|
//#endregion
|
|
3071
3080
|
//#region src/button/button.ts
|
|
@@ -3075,6 +3084,7 @@ let ButtonElement = class ButtonElement extends i {
|
|
|
3075
3084
|
this.disabled = false;
|
|
3076
3085
|
this.hideIcon = false;
|
|
3077
3086
|
this.hideLabel = false;
|
|
3087
|
+
this.subtle = false;
|
|
3078
3088
|
}
|
|
3079
3089
|
_renderIcon() {
|
|
3080
3090
|
if (this.hideIcon || !this.icon) return A;
|
|
@@ -3102,6 +3112,10 @@ __decorate([property({
|
|
|
3102
3112
|
attribute: `hide-label`,
|
|
3103
3113
|
reflect: true
|
|
3104
3114
|
})], ButtonElement.prototype, "hideLabel", void 0);
|
|
3115
|
+
__decorate([property({
|
|
3116
|
+
type: Boolean,
|
|
3117
|
+
reflect: true
|
|
3118
|
+
})], ButtonElement.prototype, "subtle", void 0);
|
|
3105
3119
|
ButtonElement = __decorate([safeCustomElement(`ixfx-button`)], ButtonElement);
|
|
3106
3120
|
//#endregion
|
|
3107
3121
|
//#region src/button/radio-group.ts
|
|
@@ -3444,13 +3458,15 @@ RadioGroup = __decorate([safeCustomElement(`ixfx-radio-group`)], RadioGroup);
|
|
|
3444
3458
|
* Canonical surface styles for floating popup elements (menus, dropdowns,
|
|
3445
3459
|
* colour picker, tooltips). Apply by adding `popupSurfaceStyles` to a
|
|
3446
3460
|
* component's `static styles` array and the class `popup-surface` to the
|
|
3447
|
-
* popup container element.
|
|
3461
|
+
* popup container element - or to the host itself (via `this.classList.add`)
|
|
3462
|
+
* when the component's host element is the popup container.
|
|
3448
3463
|
*
|
|
3449
3464
|
* Intentionally omitted (remain per-component): positioning, padding,
|
|
3450
3465
|
* dimensions, z-index, and open/close animations.
|
|
3451
3466
|
*/
|
|
3452
3467
|
const popupSurfaceStyles = i$3`
|
|
3453
|
-
.popup-surface
|
|
3468
|
+
.popup-surface,
|
|
3469
|
+
:host(.popup-surface) {
|
|
3454
3470
|
background: var(--surface-5);
|
|
3455
3471
|
border: 1px solid var(--surface-6);
|
|
3456
3472
|
border-radius: var(--radius-l);
|
|
@@ -3939,6 +3955,7 @@ let MenuTrigger = class MenuTrigger extends i {
|
|
|
3939
3955
|
color: var(--surface-3-text);
|
|
3940
3956
|
cursor: pointer;
|
|
3941
3957
|
padding: var(--space-s) var(--space-m);
|
|
3958
|
+
font-family: var(--font-family, inherit);
|
|
3942
3959
|
font-size: var(--text-m);
|
|
3943
3960
|
font-weight: 600;
|
|
3944
3961
|
border-radius: var(--radius-s);
|
|
@@ -4229,7 +4246,6 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4229
4246
|
super(..._args);
|
|
4230
4247
|
this.mode = `default`;
|
|
4231
4248
|
this.defaultValue = ``;
|
|
4232
|
-
this._compact = false;
|
|
4233
4249
|
this._selectedCommand = ``;
|
|
4234
4250
|
this._selectedLabel = ``;
|
|
4235
4251
|
this._selectedIcon = ``;
|
|
@@ -4237,7 +4253,6 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4237
4253
|
this._dynamicItems = [];
|
|
4238
4254
|
this._loadingItems = false;
|
|
4239
4255
|
this._menuHasItems = false;
|
|
4240
|
-
this._widthNeeded = 0;
|
|
4241
4256
|
this._onDefaultMenuSlotChange = (e) => {
|
|
4242
4257
|
const slot = e.target;
|
|
4243
4258
|
this._menuHasItems = slot.assignedElements({ flatten: true }).length > 0;
|
|
@@ -4311,19 +4326,8 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4311
4326
|
}
|
|
4312
4327
|
};
|
|
4313
4328
|
}
|
|
4314
|
-
connectedCallback() {
|
|
4315
|
-
super.connectedCallback();
|
|
4316
|
-
this._resizeObserver = new ResizeObserver(([entry]) => {
|
|
4317
|
-
if (this._compact) {
|
|
4318
|
-
if (this._widthNeeded > 0 && entry.contentRect.width >= this._widthNeeded) this._compact = false;
|
|
4319
|
-
} else this._checkOverflow();
|
|
4320
|
-
});
|
|
4321
|
-
this._resizeObserver.observe(this);
|
|
4322
|
-
}
|
|
4323
4329
|
disconnectedCallback() {
|
|
4324
4330
|
super.disconnectedCallback();
|
|
4325
|
-
this._resizeObserver?.disconnect();
|
|
4326
|
-
this._resizeObserver = void 0;
|
|
4327
4331
|
this._menuTrigger?.removeEventListener(`menu-command`, this._handleSwitcherMenuCommand);
|
|
4328
4332
|
}
|
|
4329
4333
|
firstUpdated() {
|
|
@@ -4333,19 +4337,8 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4333
4337
|
}
|
|
4334
4338
|
updated(changedProperties) {
|
|
4335
4339
|
super.updated(changedProperties);
|
|
4336
|
-
this._checkOverflow();
|
|
4337
4340
|
if ((changedProperties.has(`items`) || changedProperties.has(`mode`)) && this.items && !this.itemsProvider) this._applyItems(this.items);
|
|
4338
4341
|
}
|
|
4339
|
-
_checkOverflow() {
|
|
4340
|
-
if (this._compact) return;
|
|
4341
|
-
const primary = this.shadowRoot?.querySelector(`button.primary`);
|
|
4342
|
-
if (!primary) return;
|
|
4343
|
-
if (primary.scrollWidth > primary.offsetWidth + 1) {
|
|
4344
|
-
const caret = this.shadowRoot?.querySelector(`button.caret`);
|
|
4345
|
-
this._widthNeeded = primary.scrollWidth + (caret?.offsetWidth ?? 32) + 4;
|
|
4346
|
-
this._compact = true;
|
|
4347
|
-
}
|
|
4348
|
-
}
|
|
4349
4342
|
_applyItems(items) {
|
|
4350
4343
|
if (this.mode === `switcher`) this._applySwitcherItems(items.map((i) => ({
|
|
4351
4344
|
command: i.command,
|
|
@@ -4415,7 +4408,7 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4415
4408
|
`);
|
|
4416
4409
|
}
|
|
4417
4410
|
_renderDefault() {
|
|
4418
|
-
const label =
|
|
4411
|
+
const label = this.hideLabel ? A : b`<span class="button-label"><slot></slot></span>`;
|
|
4419
4412
|
const menuContent = this.itemsProvider ? b`
|
|
4420
4413
|
<ixfx-menu-container slot="menu">
|
|
4421
4414
|
${this._renderLoadingOrItems(this._dynamicItems)}
|
|
@@ -4439,9 +4432,8 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4439
4432
|
`;
|
|
4440
4433
|
}
|
|
4441
4434
|
_renderSwitcher() {
|
|
4442
|
-
const showLabel = !this.hideLabel && !this._compact;
|
|
4443
4435
|
const primaryIcon = this._selectedIcon ? b`<ixfx-icon class="button-icon" name="${this._selectedIcon}"></ixfx-icon>` : A;
|
|
4444
|
-
const primaryLabel =
|
|
4436
|
+
const primaryLabel = this.hideLabel ? A : b`<span class="button-label">${this._selectedLabel}</span>`;
|
|
4445
4437
|
const popupItems = this.itemsProvider ? this._renderLoadingOrItems(this._dynamicItems) : this._switcherItems.filter((i) => i.command !== this._selectedCommand).map((i) => b`
|
|
4446
4438
|
<ixfx-menu-item
|
|
4447
4439
|
command=${i.command}
|
|
@@ -4480,6 +4472,7 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4480
4472
|
:host {
|
|
4481
4473
|
display: inline-flex;
|
|
4482
4474
|
max-width: 100%;
|
|
4475
|
+
min-width: var(--ixfx-split-button-min-width, 0);
|
|
4483
4476
|
vertical-align: middle;
|
|
4484
4477
|
}
|
|
4485
4478
|
|
|
@@ -4549,12 +4542,20 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4549
4542
|
|
|
4550
4543
|
button.primary {
|
|
4551
4544
|
flex: 1;
|
|
4545
|
+
min-width: 0;
|
|
4552
4546
|
padding: var(--space-m, 8px) var(--space-l, 12px);
|
|
4553
4547
|
gap: 0.5em;
|
|
4554
4548
|
overflow: hidden;
|
|
4555
4549
|
white-space: nowrap;
|
|
4556
4550
|
}
|
|
4557
4551
|
|
|
4552
|
+
button.primary .button-label {
|
|
4553
|
+
flex: 0 1 auto;
|
|
4554
|
+
min-width: 0;
|
|
4555
|
+
overflow: hidden;
|
|
4556
|
+
text-overflow: ellipsis;
|
|
4557
|
+
}
|
|
4558
|
+
|
|
4558
4559
|
button.caret {
|
|
4559
4560
|
padding: var(--space-m, 8px) var(--space-s, 6px);
|
|
4560
4561
|
border-inline-start: var(--border, 1px solid #999);
|
|
@@ -4585,6 +4586,22 @@ let SplitButton = class SplitButton extends ButtonElement {
|
|
|
4585
4586
|
outline-offset: -2px;
|
|
4586
4587
|
}
|
|
4587
4588
|
|
|
4589
|
+
:host([subtle]) button.primary,
|
|
4590
|
+
:host([subtle]) button.caret,
|
|
4591
|
+
:host([subtle]) button.primary:hover:not(:disabled),
|
|
4592
|
+
:host([subtle]) button.caret:hover:not(:disabled) {
|
|
4593
|
+
background: none;
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4596
|
+
:host([subtle]) .split {
|
|
4597
|
+
background: color-mix(in oklch, var(--surface-3, #ccc) 40%, transparent);
|
|
4598
|
+
}
|
|
4599
|
+
|
|
4600
|
+
:host([subtle]) .split:has(button:hover:not(:disabled)),
|
|
4601
|
+
:host([subtle]) .split:has(button:focus-visible:not(:disabled)) {
|
|
4602
|
+
background: color-mix(in oklch, var(--surface-3, #ccc) 70%, transparent);
|
|
4603
|
+
}
|
|
4604
|
+
|
|
4588
4605
|
ixfx-menu-trigger {
|
|
4589
4606
|
display: inline-flex;
|
|
4590
4607
|
align-items: stretch;
|
|
@@ -4603,7 +4620,6 @@ __decorate([property({
|
|
|
4603
4620
|
__decorate([property({ attribute: false })], SplitButton.prototype, "itemsProvider", void 0);
|
|
4604
4621
|
__decorate([property({ attribute: false })], SplitButton.prototype, "items", void 0);
|
|
4605
4622
|
__decorate([query(`ixfx-menu-trigger`)], SplitButton.prototype, "_menuTrigger", void 0);
|
|
4606
|
-
__decorate([state()], SplitButton.prototype, "_compact", void 0);
|
|
4607
4623
|
__decorate([state()], SplitButton.prototype, "_selectedCommand", void 0);
|
|
4608
4624
|
__decorate([state()], SplitButton.prototype, "_selectedLabel", void 0);
|
|
4609
4625
|
__decorate([state()], SplitButton.prototype, "_selectedIcon", void 0);
|
|
@@ -5697,7 +5713,7 @@ __decorate([query(`.preview`)], ColourPicker.prototype, "_previewEl", void 0);
|
|
|
5697
5713
|
ColourPicker = __decorate([safeCustomElement(`ixfx-colour-picker`)], ColourPicker);
|
|
5698
5714
|
//#endregion
|
|
5699
5715
|
//#region src/colour-picker/colour-picker-popup.ts
|
|
5700
|
-
let _instanceCounter = 0;
|
|
5716
|
+
let _instanceCounter$1 = 0;
|
|
5701
5717
|
const PICKER_SIZES = {
|
|
5702
5718
|
small: {
|
|
5703
5719
|
width: 130,
|
|
@@ -5819,7 +5835,7 @@ let ColourPickerPopup = class ColourPickerPopup extends i {
|
|
|
5819
5835
|
this._popupEl.showPopover();
|
|
5820
5836
|
} catch {}
|
|
5821
5837
|
};
|
|
5822
|
-
const id = ++_instanceCounter;
|
|
5838
|
+
const id = ++_instanceCounter$1;
|
|
5823
5839
|
this._uid = `cp-popup-${id}`;
|
|
5824
5840
|
this._anchorName = `--cp-popup-anchor-${id}`;
|
|
5825
5841
|
this._popupId = `cp-popup-panel-${id}`;
|
|
@@ -11633,7 +11649,7 @@ function createTreeListAdapter(toTreeItem, options) {
|
|
|
11633
11649
|
//#region src/vertical-list/vertical-list.ts
|
|
11634
11650
|
const ITEM_SELECTOR = `li, [data-list-item]`;
|
|
11635
11651
|
function isMultiMode(mode) {
|
|
11636
|
-
return mode === `checked` || mode === `vscode` || mode === `standard`;
|
|
11652
|
+
return mode === `checked` || mode === `sticky` || mode === `vscode` || mode === `standard`;
|
|
11637
11653
|
}
|
|
11638
11654
|
let VerticalListElement = class VerticalListElement extends i {
|
|
11639
11655
|
constructor(..._args2) {
|
|
@@ -11894,7 +11910,7 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11894
11910
|
_toggleItem(item) {
|
|
11895
11911
|
if (!this._isCheckable(item)) return;
|
|
11896
11912
|
const effectiveMultiple = this.selectionMode === `multiple` || isMultiMode(this.interactionMode);
|
|
11897
|
-
if (this.selectionMode === `none` && this.interactionMode !== `checked`) return;
|
|
11913
|
+
if (this.selectionMode === `none` && this.interactionMode !== `checked` && this.interactionMode !== `sticky`) return;
|
|
11898
11914
|
const previous = this._selectedItems;
|
|
11899
11915
|
const next = new Set(this._selectedItems);
|
|
11900
11916
|
if (next.has(item)) next.delete(item);
|
|
@@ -11959,7 +11975,7 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11959
11975
|
_handleClickSelection(item, e) {
|
|
11960
11976
|
const mode = this.interactionMode;
|
|
11961
11977
|
if (mode === `manual`) return;
|
|
11962
|
-
if (this.selectionMode === `none` && mode !== `checked`) return;
|
|
11978
|
+
if (this.selectionMode === `none` && mode !== `checked` && mode !== `sticky`) return;
|
|
11963
11979
|
switch (mode) {
|
|
11964
11980
|
case `implicit`:
|
|
11965
11981
|
this._replaceSelection(item);
|
|
@@ -11971,7 +11987,8 @@ let VerticalListElement = class VerticalListElement extends i {
|
|
|
11971
11987
|
} else if (e.shiftKey && (this.selectionMode === `multiple` || mode === `vscode`)) this._rangeSelectTo(item);
|
|
11972
11988
|
else this._replaceSelection(item);
|
|
11973
11989
|
break;
|
|
11974
|
-
case `checked`:
|
|
11990
|
+
case `checked`: break;
|
|
11991
|
+
case `sticky`: this._toggleItem(item);
|
|
11975
11992
|
}
|
|
11976
11993
|
}
|
|
11977
11994
|
_handleSpaceKey(item) {
|
|
@@ -22692,6 +22709,253 @@ __decorate([property({
|
|
|
22692
22709
|
})], SliderInputElement.prototype, "disabled", void 0);
|
|
22693
22710
|
SliderInputElement = __decorate([safeCustomElement(`ixfx-slider-input`)], SliderInputElement);
|
|
22694
22711
|
//#endregion
|
|
22712
|
+
//#region src/snackbar/snackbar.ts
|
|
22713
|
+
let _instanceCounter = 0;
|
|
22714
|
+
let SnackbarElement = class SnackbarElement extends i {
|
|
22715
|
+
constructor(..._args) {
|
|
22716
|
+
super(..._args);
|
|
22717
|
+
this.for = ``;
|
|
22718
|
+
this.mode = `explicit`;
|
|
22719
|
+
this.placement = `top`;
|
|
22720
|
+
this.dismiss = `auto`;
|
|
22721
|
+
this.showDelay = 150;
|
|
22722
|
+
this.hideDelay = 500;
|
|
22723
|
+
this._isOpen = false;
|
|
22724
|
+
this._anchorName = `--ixfx-snackbar-anchor-${++_instanceCounter}`;
|
|
22725
|
+
this._addedTabindex = false;
|
|
22726
|
+
this._addedRole = false;
|
|
22727
|
+
this._onTargetClick = () => this.toggle();
|
|
22728
|
+
this._onTargetKeydown = (e) => {
|
|
22729
|
+
if (e.key !== `Enter` && e.key !== ` `) return;
|
|
22730
|
+
e.preventDefault();
|
|
22731
|
+
this.toggle();
|
|
22732
|
+
};
|
|
22733
|
+
this._onTickleIn = () => this._scheduleShow();
|
|
22734
|
+
this._onTickleOut = () => this._scheduleHide();
|
|
22735
|
+
this._onPanelClick = () => {
|
|
22736
|
+
if (this.dismiss === `auto`) this.hide();
|
|
22737
|
+
};
|
|
22738
|
+
this._onToggle = (e) => {
|
|
22739
|
+
const { newState } = e;
|
|
22740
|
+
this._isOpen = newState === `open`;
|
|
22741
|
+
if (newState === `closed` && this.contains(document.activeElement)) this._target?.focus();
|
|
22742
|
+
};
|
|
22743
|
+
}
|
|
22744
|
+
get isOpen() {
|
|
22745
|
+
return this._isOpen;
|
|
22746
|
+
}
|
|
22747
|
+
show() {
|
|
22748
|
+
if (!this.popover) return;
|
|
22749
|
+
try {
|
|
22750
|
+
this.showPopover();
|
|
22751
|
+
} catch {}
|
|
22752
|
+
}
|
|
22753
|
+
hide() {
|
|
22754
|
+
if (!this.popover) return;
|
|
22755
|
+
try {
|
|
22756
|
+
this.hidePopover();
|
|
22757
|
+
} catch {}
|
|
22758
|
+
}
|
|
22759
|
+
toggle() {
|
|
22760
|
+
if (!this.popover) return;
|
|
22761
|
+
try {
|
|
22762
|
+
this.togglePopover();
|
|
22763
|
+
} catch {}
|
|
22764
|
+
}
|
|
22765
|
+
connectedCallback() {
|
|
22766
|
+
super.connectedCallback();
|
|
22767
|
+
if (!this.hasAttribute(`popover`)) this.popover = `auto`;
|
|
22768
|
+
this.classList.add(`popup-surface`);
|
|
22769
|
+
this.addEventListener(`toggle`, this._onToggle);
|
|
22770
|
+
this.addEventListener(`click`, this._onPanelClick);
|
|
22771
|
+
this.style.setProperty(`position-anchor`, this._anchorName);
|
|
22772
|
+
this._attachToTarget();
|
|
22773
|
+
}
|
|
22774
|
+
disconnectedCallback() {
|
|
22775
|
+
super.disconnectedCallback();
|
|
22776
|
+
this.removeEventListener(`toggle`, this._onToggle);
|
|
22777
|
+
this.removeEventListener(`click`, this._onPanelClick);
|
|
22778
|
+
this._detachFromTarget();
|
|
22779
|
+
this._cancelShow();
|
|
22780
|
+
this._cancelHide();
|
|
22781
|
+
}
|
|
22782
|
+
updated(changed) {
|
|
22783
|
+
super.updated(changed);
|
|
22784
|
+
if (changed.has(`for`) || changed.has(`mode`)) this._attachToTarget();
|
|
22785
|
+
}
|
|
22786
|
+
_resolveTarget() {
|
|
22787
|
+
if (!this.for) return void 0;
|
|
22788
|
+
return this.getRootNode().getElementById(this.for) ?? void 0;
|
|
22789
|
+
}
|
|
22790
|
+
_attachToTarget() {
|
|
22791
|
+
this._detachFromTarget();
|
|
22792
|
+
const target = this._resolveTarget();
|
|
22793
|
+
if (!target) {
|
|
22794
|
+
if (this.for) console.warn(`ixfx-snackbar: no element found with id "${this.for}"`);
|
|
22795
|
+
return;
|
|
22796
|
+
}
|
|
22797
|
+
this._target = target;
|
|
22798
|
+
target.style.setProperty(`anchor-name`, this._anchorName);
|
|
22799
|
+
if (this.mode === `explicit`) {
|
|
22800
|
+
const alreadyFocusable = target.tabIndex >= 0;
|
|
22801
|
+
if (!alreadyFocusable) {
|
|
22802
|
+
target.setAttribute(`tabindex`, `0`);
|
|
22803
|
+
this._addedTabindex = true;
|
|
22804
|
+
}
|
|
22805
|
+
if (!target.hasAttribute(`role`) && !alreadyFocusable) {
|
|
22806
|
+
target.setAttribute(`role`, `button`);
|
|
22807
|
+
this._addedRole = true;
|
|
22808
|
+
}
|
|
22809
|
+
target.setAttribute(`aria-haspopup`, `true`);
|
|
22810
|
+
target.addEventListener(`click`, this._onTargetClick);
|
|
22811
|
+
if (!alreadyFocusable) target.addEventListener(`keydown`, this._onTargetKeydown);
|
|
22812
|
+
} else if (this.mode === `implicit`) {
|
|
22813
|
+
target.addEventListener(`pointerenter`, this._onTickleIn);
|
|
22814
|
+
target.addEventListener(`focus`, this._onTickleIn);
|
|
22815
|
+
target.addEventListener(`pointerleave`, this._onTickleOut);
|
|
22816
|
+
target.addEventListener(`blur`, this._onTickleOut);
|
|
22817
|
+
this.addEventListener(`pointerenter`, this._onTickleIn);
|
|
22818
|
+
this.addEventListener(`focusin`, this._onTickleIn);
|
|
22819
|
+
this.addEventListener(`pointerleave`, this._onTickleOut);
|
|
22820
|
+
this.addEventListener(`focusout`, this._onTickleOut);
|
|
22821
|
+
}
|
|
22822
|
+
}
|
|
22823
|
+
_detachFromTarget() {
|
|
22824
|
+
const target = this._target;
|
|
22825
|
+
if (!target) return;
|
|
22826
|
+
target.style.removeProperty(`anchor-name`);
|
|
22827
|
+
if (this._addedTabindex) {
|
|
22828
|
+
target.removeAttribute(`tabindex`);
|
|
22829
|
+
this._addedTabindex = false;
|
|
22830
|
+
}
|
|
22831
|
+
if (this._addedRole) {
|
|
22832
|
+
target.removeAttribute(`role`);
|
|
22833
|
+
this._addedRole = false;
|
|
22834
|
+
}
|
|
22835
|
+
target.removeAttribute(`aria-haspopup`);
|
|
22836
|
+
target.removeEventListener(`click`, this._onTargetClick);
|
|
22837
|
+
target.removeEventListener(`keydown`, this._onTargetKeydown);
|
|
22838
|
+
target.removeEventListener(`pointerenter`, this._onTickleIn);
|
|
22839
|
+
target.removeEventListener(`focus`, this._onTickleIn);
|
|
22840
|
+
target.removeEventListener(`pointerleave`, this._onTickleOut);
|
|
22841
|
+
target.removeEventListener(`blur`, this._onTickleOut);
|
|
22842
|
+
this.removeEventListener(`pointerenter`, this._onTickleIn);
|
|
22843
|
+
this.removeEventListener(`focusin`, this._onTickleIn);
|
|
22844
|
+
this.removeEventListener(`pointerleave`, this._onTickleOut);
|
|
22845
|
+
this.removeEventListener(`focusout`, this._onTickleOut);
|
|
22846
|
+
this._target = void 0;
|
|
22847
|
+
}
|
|
22848
|
+
_scheduleShow() {
|
|
22849
|
+
this._cancelHide();
|
|
22850
|
+
this._cancelShow();
|
|
22851
|
+
if (this.showDelay <= 0) {
|
|
22852
|
+
this.show();
|
|
22853
|
+
return;
|
|
22854
|
+
}
|
|
22855
|
+
this._showTimeout = window.setTimeout(() => this.show(), this.showDelay);
|
|
22856
|
+
}
|
|
22857
|
+
_scheduleHide() {
|
|
22858
|
+
this._cancelShow();
|
|
22859
|
+
this._cancelHide();
|
|
22860
|
+
if (this.hideDelay <= 0) {
|
|
22861
|
+
this.hide();
|
|
22862
|
+
return;
|
|
22863
|
+
}
|
|
22864
|
+
this._hideTimeout = window.setTimeout(() => this.hide(), this.hideDelay);
|
|
22865
|
+
}
|
|
22866
|
+
_cancelShow() {
|
|
22867
|
+
if (this._showTimeout !== void 0) {
|
|
22868
|
+
window.clearTimeout(this._showTimeout);
|
|
22869
|
+
this._showTimeout = void 0;
|
|
22870
|
+
}
|
|
22871
|
+
}
|
|
22872
|
+
_cancelHide() {
|
|
22873
|
+
if (this._hideTimeout !== void 0) {
|
|
22874
|
+
window.clearTimeout(this._hideTimeout);
|
|
22875
|
+
this._hideTimeout = void 0;
|
|
22876
|
+
}
|
|
22877
|
+
}
|
|
22878
|
+
static {
|
|
22879
|
+
this.styles = [
|
|
22880
|
+
themeFallbacks,
|
|
22881
|
+
popupSurfaceStyles,
|
|
22882
|
+
i$3`
|
|
22883
|
+
:host {
|
|
22884
|
+
display: flex;
|
|
22885
|
+
align-items: center;
|
|
22886
|
+
gap: var(--space-s);
|
|
22887
|
+
padding: var(--space-s);
|
|
22888
|
+
|
|
22889
|
+
position: fixed;
|
|
22890
|
+
inset: unset;
|
|
22891
|
+
margin: 0;
|
|
22892
|
+
z-index: 100;
|
|
22893
|
+
position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
|
|
22894
|
+
|
|
22895
|
+
opacity: 0;
|
|
22896
|
+
scale: 0.97;
|
|
22897
|
+
pointer-events: none;
|
|
22898
|
+
transition: opacity 0.12s ease-out, scale 0.12s ease-out,
|
|
22899
|
+
display 0.12s allow-discrete, overlay 0.12s allow-discrete;
|
|
22900
|
+
}
|
|
22901
|
+
|
|
22902
|
+
:host(:popover-open) {
|
|
22903
|
+
opacity: 1;
|
|
22904
|
+
scale: 1;
|
|
22905
|
+
pointer-events: auto;
|
|
22906
|
+
}
|
|
22907
|
+
|
|
22908
|
+
@starting-style {
|
|
22909
|
+
:host(:popover-open) {
|
|
22910
|
+
opacity: 0;
|
|
22911
|
+
scale: 0.97;
|
|
22912
|
+
}
|
|
22913
|
+
}
|
|
22914
|
+
|
|
22915
|
+
:host([placement="top"]) {
|
|
22916
|
+
position-area: block-start;
|
|
22917
|
+
margin-block-end: var(--space-s);
|
|
22918
|
+
}
|
|
22919
|
+
|
|
22920
|
+
:host([placement="bottom"]) {
|
|
22921
|
+
position-area: block-end;
|
|
22922
|
+
margin-block-start: var(--space-s);
|
|
22923
|
+
}
|
|
22924
|
+
|
|
22925
|
+
:host([placement="left"]) {
|
|
22926
|
+
position-area: inline-start;
|
|
22927
|
+
margin-inline-end: var(--space-s);
|
|
22928
|
+
}
|
|
22929
|
+
|
|
22930
|
+
:host([placement="right"]) {
|
|
22931
|
+
position-area: inline-end;
|
|
22932
|
+
margin-inline-start: var(--space-s);
|
|
22933
|
+
}
|
|
22934
|
+
`
|
|
22935
|
+
];
|
|
22936
|
+
}
|
|
22937
|
+
render() {
|
|
22938
|
+
return b`<slot></slot>`;
|
|
22939
|
+
}
|
|
22940
|
+
};
|
|
22941
|
+
__decorate([property({ type: String })], SnackbarElement.prototype, "for", void 0);
|
|
22942
|
+
__decorate([property({ type: String })], SnackbarElement.prototype, "mode", void 0);
|
|
22943
|
+
__decorate([property({
|
|
22944
|
+
type: String,
|
|
22945
|
+
reflect: true
|
|
22946
|
+
})], SnackbarElement.prototype, "placement", void 0);
|
|
22947
|
+
__decorate([property({ type: String })], SnackbarElement.prototype, "dismiss", void 0);
|
|
22948
|
+
__decorate([property({
|
|
22949
|
+
type: Number,
|
|
22950
|
+
attribute: `show-delay`
|
|
22951
|
+
})], SnackbarElement.prototype, "showDelay", void 0);
|
|
22952
|
+
__decorate([property({
|
|
22953
|
+
type: Number,
|
|
22954
|
+
attribute: `hide-delay`
|
|
22955
|
+
})], SnackbarElement.prototype, "hideDelay", void 0);
|
|
22956
|
+
__decorate([state()], SnackbarElement.prototype, "_isOpen", void 0);
|
|
22957
|
+
SnackbarElement = __decorate([safeCustomElement(`ixfx-snackbar`)], SnackbarElement);
|
|
22958
|
+
//#endregion
|
|
22695
22959
|
//#region src/snap-container/snap-container.ts
|
|
22696
22960
|
let SnapContainer = class SnapContainer extends i {
|
|
22697
22961
|
constructor(..._args) {
|
|
@@ -27556,6 +27820,6 @@ function init() {
|
|
|
27556
27820
|
console.log(`Init`);
|
|
27557
27821
|
}
|
|
27558
27822
|
//#endregion
|
|
27559
|
-
export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataController, DataDisplayComponent, EditableLabel, EditableNumber, FormElement, FormGroupElement, FormPartElement, GroupedItemListerElement, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, NotificationManager, NotificationPillElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotHistogram, PlotMultiAxis, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SliderInputElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabController, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, collectDataResult, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, createPillRenderer, createTreeListAdapter, createVerticalListAdapter, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
|
|
27823
|
+
export { AcTextElement, AcTokenElement, ButtonElement, Checkbox, ColourPicker, ColourPickerPopup, CrumbNavigationElement, CrumbPathController, CrumbPathElement, DataController, DataDisplayComponent, EditableLabel, EditableNumber, FormElement, FormGroupElement, FormPartElement, GroupedItemListerElement, ICON_CARET_RIGHT, ICON_CHECK, ICON_CHEVRON_DOWN, ICON_CLOSE, IncrSearchTreeController as IncrSearchMillerController, IncrSearchTreeController, IxfxHexEditorElement, IxfxIconElement, IxfxTimelineElement, LabelledRadialInput, LabelledRangeInput, LedElement, menu_exports as Menu, MillerBaseElement, MillerListElement, MillerTreeController, NarrowedTextElement, NotificationManager, NotificationPillElement, PanelElement, PanelGroupElement, PlotDataSeries, PlotHistogram, PlotMultiAxis, PlotSingleAxis, PlotXyAxis, PolarPad, RadialInputElement, RadioGroup, RangeElement, RangeInput, RangeMultiElement, SelectHorizontalElement, SliderInputElement, SnackbarElement, SnapContainer, SplitButton, SplitLayoutElement, SwipeElement, TabController, TabListElement, TabListItemElement, TabPanelElement, TabPanelsElement, TimelineController, TimelineTrackTabElement, TooltipElement, TransitoryLabelElement, TreeBaseElement, TreeController, TreeDataModel, TreeListElement, VerticalListElement, XyPad, applyAgeModification, applyHighlights, attachTimelineInteractions, buildHighlightTargets, clearHighlights, collectDataResult, computeColour, createAcCompletionProvider, createElementIncrSearch, createFuzzySearch, createIncrSearch, createPillRenderer, createTreeListAdapter, createVerticalListAdapter, getIcon, hasIcon, iconBus, init, monitorIndeterminate, parseColourScaleAttr, readBaseColour, registerIcon, resolveCssVars, resolveGrid, svgToDataUri, timelineStyles };
|
|
27560
27824
|
|
|
27561
27825
|
//# sourceMappingURL=index.js.map
|