@sekiui/elements 0.0.88 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/p-C9-yH6MD.js +33 -0
- package/dist/cdn/p-CQQRfw1L.js +18 -0
- package/dist/cdn/seki-carousel-dots.js +7 -3
- package/dist/cdn/seki-carousel-next.js +8 -6
- package/dist/cdn/seki-carousel-previous.js +8 -6
- package/dist/cdn/seki-carousel.js +15 -1
- package/dist/cdn/seki-date-picker.js +71 -36
- package/dist/cdn/seki-drawer.js +76 -32
- package/dist/cdn/seki-hover-card-content.js +2 -2
- package/dist/cdn/seki-hover-card-trigger.js +3 -3
- package/dist/cdn/seki-hover-card.js +59 -4
- package/dist/cdn/seki-resizable-handle.js +11 -2
- package/dist/cdn/seki-resizable-panel-group.js +9 -3
- package/dist/cdn/seki-resizable-panel.js +42 -20
- package/dist/cdn/seki-select-content.js +21 -13
- package/dist/cdn/seki-select-group.js +3 -4
- package/dist/cdn/seki-select-option.js +33 -15
- package/dist/cdn/seki-select-trigger.js +6 -4
- package/dist/cdn/seki-select.js +2 -2
- package/dist/cdn/seki-sheet.js +71 -30
- package/dist/cdn/seki-sidebar-footer.js +3 -1
- package/dist/cdn/seki-sidebar-header.js +3 -1
- package/dist/cdn/seki-sidebar-menu-button.js +3 -1
- package/dist/cdn/seki-sidebar-rail.js +3 -1
- package/dist/cdn/seki-sidebar-trigger.js +6 -1
- package/dist/cdn/seki-sidebar.js +5 -2
- package/dist/cdn/seki-tooltip.js +47 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/option-id-wIa73qWK.js +20 -0
- package/dist/cjs/seki-carousel-dots.cjs.entry.js +7 -3
- package/dist/cjs/seki-carousel-next.cjs.entry.js +8 -6
- package/dist/cjs/seki-carousel-previous.cjs.entry.js +8 -6
- package/dist/cjs/seki-carousel.cjs.entry.js +15 -1
- package/dist/cjs/seki-date-picker.cjs.entry.js +64 -32
- package/dist/cjs/seki-drawer.cjs.entry.js +67 -27
- package/dist/cjs/seki-hover-card-content.cjs.entry.js +2 -2
- package/dist/cjs/seki-hover-card-trigger.cjs.entry.js +3 -3
- package/dist/cjs/seki-hover-card.cjs.entry.js +53 -3
- package/dist/cjs/seki-resizable-handle.cjs.entry.js +11 -2
- package/dist/cjs/seki-resizable-panel-group.cjs.entry.js +9 -3
- package/dist/cjs/seki-resizable-panel.cjs.entry.js +42 -20
- package/dist/cjs/seki-select-content.cjs.entry.js +20 -11
- package/dist/cjs/seki-select-group.cjs.entry.js +2 -2
- package/dist/cjs/seki-select-option.cjs.entry.js +32 -13
- package/dist/cjs/seki-select-trigger.cjs.entry.js +5 -2
- package/dist/cjs/seki-select.cjs.entry.js +2 -2
- package/dist/cjs/seki-sheet.cjs.entry.js +62 -25
- package/dist/cjs/seki-sidebar-footer.cjs.entry.js +3 -1
- package/dist/cjs/seki-sidebar-header.cjs.entry.js +3 -1
- package/dist/cjs/seki-sidebar-menu-button.cjs.entry.js +3 -1
- package/dist/cjs/seki-sidebar-rail.cjs.entry.js +3 -1
- package/dist/cjs/seki-sidebar-trigger.cjs.entry.js +6 -1
- package/dist/cjs/seki-sidebar.cjs.entry.js +5 -2
- package/dist/cjs/seki-tooltip.cjs.entry.js +43 -2
- package/dist/cjs/sekiui.cjs.js +1 -1
- package/dist/cjs/when-defined-B2Lkz6uR.js +36 -0
- package/dist/collection/components/carousel/seki-carousel-dots.js +7 -3
- package/dist/collection/components/carousel/seki-carousel-next.js +8 -6
- package/dist/collection/components/carousel/seki-carousel-previous.js +8 -6
- package/dist/collection/components/carousel/seki-carousel.js +15 -1
- package/dist/collection/components/date-picker/seki-date-picker.js +124 -36
- package/dist/collection/components/drawer/seki-drawer.js +132 -31
- package/dist/collection/components/hover-card/seki-hover-card-content.js +2 -2
- package/dist/collection/components/hover-card/seki-hover-card-trigger.js +3 -3
- package/dist/collection/components/hover-card/seki-hover-card.js +142 -6
- package/dist/collection/components/resizable/seki-resizable-handle.js +11 -2
- package/dist/collection/components/resizable/seki-resizable-panel-group.js +23 -3
- package/dist/collection/components/resizable/seki-resizable-panel.js +42 -20
- package/dist/collection/components/select/seki-select.js +6 -12
- package/dist/collection/components/select-content/seki-select-content.css +8 -0
- package/dist/collection/components/select-content/seki-select-content.js +20 -11
- package/dist/collection/components/select-group/seki-select-group.js +2 -2
- package/dist/collection/components/select-option/seki-select-option.js +32 -13
- package/dist/collection/components/select-trigger/seki-select-trigger.js +5 -2
- package/dist/collection/components/sheet/seki-sheet.js +127 -29
- package/dist/collection/components/sidebar/seki-sidebar-footer.js +3 -1
- package/dist/collection/components/sidebar/seki-sidebar-header.js +3 -1
- package/dist/collection/components/sidebar/seki-sidebar-menu-button.js +3 -1
- package/dist/collection/components/sidebar/seki-sidebar-rail.js +3 -1
- package/dist/collection/components/sidebar/seki-sidebar-trigger.js +6 -1
- package/dist/collection/components/sidebar/seki-sidebar.js +5 -2
- package/dist/collection/components/tooltip/seki-tooltip.js +92 -2
- package/dist/collection/utils/select/index.js +1 -0
- package/dist/collection/utils/select/option-id.js +16 -0
- package/dist/collection/utils/when-defined.js +31 -0
- package/dist/components/p-C9-yH6MD.js +33 -0
- package/dist/components/p-CQQRfw1L.js +18 -0
- package/dist/components/seki-carousel-dots.js +7 -3
- package/dist/components/seki-carousel-next.js +8 -6
- package/dist/components/seki-carousel-previous.js +8 -6
- package/dist/components/seki-carousel.js +15 -1
- package/dist/components/seki-date-picker.js +71 -36
- package/dist/components/seki-drawer.js +76 -32
- package/dist/components/seki-hover-card-content.js +2 -2
- package/dist/components/seki-hover-card-trigger.js +3 -3
- package/dist/components/seki-hover-card.js +59 -4
- package/dist/components/seki-resizable-handle.js +11 -2
- package/dist/components/seki-resizable-panel-group.js +9 -3
- package/dist/components/seki-resizable-panel.js +42 -20
- package/dist/components/seki-select-content.js +21 -13
- package/dist/components/seki-select-group.js +3 -4
- package/dist/components/seki-select-option.js +33 -15
- package/dist/components/seki-select-trigger.js +6 -4
- package/dist/components/seki-select.js +2 -2
- package/dist/components/seki-sheet.js +71 -30
- package/dist/components/seki-sidebar-footer.js +3 -1
- package/dist/components/seki-sidebar-header.js +3 -1
- package/dist/components/seki-sidebar-menu-button.js +3 -1
- package/dist/components/seki-sidebar-rail.js +3 -1
- package/dist/components/seki-sidebar-trigger.js +6 -1
- package/dist/components/seki-sidebar.js +5 -2
- package/dist/components/seki-tooltip.js +47 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/option-id-CQQRfw1L.js +18 -0
- package/dist/esm/seki-carousel-dots.entry.js +7 -3
- package/dist/esm/seki-carousel-next.entry.js +8 -6
- package/dist/esm/seki-carousel-previous.entry.js +8 -6
- package/dist/esm/seki-carousel.entry.js +15 -1
- package/dist/esm/seki-date-picker.entry.js +64 -32
- package/dist/esm/seki-drawer.entry.js +67 -27
- package/dist/esm/seki-hover-card-content.entry.js +2 -2
- package/dist/esm/seki-hover-card-trigger.entry.js +3 -3
- package/dist/esm/seki-hover-card.entry.js +53 -3
- package/dist/esm/seki-resizable-handle.entry.js +11 -2
- package/dist/esm/seki-resizable-panel-group.entry.js +9 -3
- package/dist/esm/seki-resizable-panel.entry.js +42 -20
- package/dist/esm/seki-select-content.entry.js +20 -11
- package/dist/esm/seki-select-group.entry.js +2 -2
- package/dist/esm/seki-select-option.entry.js +32 -13
- package/dist/esm/seki-select-trigger.entry.js +5 -2
- package/dist/esm/seki-select.entry.js +2 -2
- package/dist/esm/seki-sheet.entry.js +62 -25
- package/dist/esm/seki-sidebar-footer.entry.js +3 -1
- package/dist/esm/seki-sidebar-header.entry.js +3 -1
- package/dist/esm/seki-sidebar-menu-button.entry.js +3 -1
- package/dist/esm/seki-sidebar-rail.entry.js +3 -1
- package/dist/esm/seki-sidebar-trigger.entry.js +6 -1
- package/dist/esm/seki-sidebar.entry.js +5 -2
- package/dist/esm/seki-tooltip.entry.js +43 -2
- package/dist/esm/sekiui.js +1 -1
- package/dist/esm/when-defined-C9-yH6MD.js +33 -0
- package/dist/sekiui/p-02f1728e.entry.js +1 -0
- package/dist/sekiui/p-05b33a61.entry.js +1 -0
- package/dist/sekiui/p-12e36a4f.entry.js +1 -0
- package/dist/sekiui/p-1cd6b3e6.entry.js +1 -0
- package/dist/sekiui/p-1e24698b.entry.js +1 -0
- package/dist/sekiui/p-26bb17cb.entry.js +1 -0
- package/dist/sekiui/p-26d433ff.entry.js +1 -0
- package/dist/sekiui/p-26f96e2d.entry.js +1 -0
- package/dist/sekiui/p-29b22c0f.entry.js +1 -0
- package/dist/sekiui/p-30fafcc6.entry.js +1 -0
- package/dist/sekiui/p-3de5878b.entry.js +1 -0
- package/dist/sekiui/p-649dbdf0.entry.js +1 -0
- package/dist/sekiui/p-71656184.entry.js +1 -0
- package/dist/sekiui/p-7926c04a.entry.js +1 -0
- package/dist/sekiui/p-9f4149b9.entry.js +1 -0
- package/dist/sekiui/p-C9-yH6MD.js +1 -0
- package/dist/sekiui/p-CQQRfw1L.js +1 -0
- package/dist/sekiui/p-ae87ca35.entry.js +1 -0
- package/dist/sekiui/p-b82c2267.entry.js +1 -0
- package/dist/sekiui/p-bf151423.entry.js +1 -0
- package/dist/sekiui/{p-219c8350.entry.js → p-c0f21b6a.entry.js} +1 -1
- package/dist/sekiui/p-c3ef507f.entry.js +1 -0
- package/dist/sekiui/p-d10a186d.entry.js +1 -0
- package/dist/sekiui/p-d1c72c91.entry.js +1 -0
- package/dist/sekiui/p-d1d3ae40.entry.js +1 -0
- package/dist/sekiui/p-fba3fa73.entry.js +1 -0
- package/dist/sekiui/p-fe3e661d.entry.js +1 -0
- package/dist/sekiui/sekiui.esm.js +1 -1
- package/dist/types/components/carousel/seki-carousel.d.ts +1 -0
- package/dist/types/components/date-picker/seki-date-picker.d.ts +21 -5
- package/dist/types/components/drawer/seki-drawer.d.ts +22 -6
- package/dist/types/components/hover-card/seki-hover-card.d.ts +24 -4
- package/dist/types/components/resizable/seki-resizable-handle.d.ts +1 -0
- package/dist/types/components/resizable/seki-resizable-panel-group.d.ts +6 -0
- package/dist/types/components/resizable/seki-resizable-panel.d.ts +9 -0
- package/dist/types/components/select/seki-select.d.ts +3 -3
- package/dist/types/components/select-content/seki-select-content.d.ts +8 -5
- package/dist/types/components/select-option/seki-select-option.d.ts +6 -4
- package/dist/types/components/sheet/seki-sheet.d.ts +22 -6
- package/dist/types/components/tooltip/seki-tooltip.d.ts +13 -0
- package/dist/types/components.d.ts +145 -17
- package/dist/types/utils/select/index.d.ts +1 -0
- package/dist/types/utils/select/option-id.d.ts +14 -0
- package/dist/types/utils/select/types.d.ts +0 -7
- package/dist/types/utils/when-defined.d.ts +19 -0
- package/package.json +3 -1
- package/dist/sekiui/p-01f26bec.entry.js +0 -1
- package/dist/sekiui/p-117b6f5a.entry.js +0 -1
- package/dist/sekiui/p-1250cad1.entry.js +0 -1
- package/dist/sekiui/p-1866201e.entry.js +0 -1
- package/dist/sekiui/p-2e18933c.entry.js +0 -1
- package/dist/sekiui/p-2e2e7d0b.entry.js +0 -1
- package/dist/sekiui/p-346cc18f.entry.js +0 -1
- package/dist/sekiui/p-6311a4d8.entry.js +0 -1
- package/dist/sekiui/p-69843ed8.entry.js +0 -1
- package/dist/sekiui/p-779764c0.entry.js +0 -1
- package/dist/sekiui/p-786c153b.entry.js +0 -1
- package/dist/sekiui/p-87bcbb66.entry.js +0 -1
- package/dist/sekiui/p-88dd3e1f.entry.js +0 -1
- package/dist/sekiui/p-944c70a1.entry.js +0 -1
- package/dist/sekiui/p-9820cd16.entry.js +0 -1
- package/dist/sekiui/p-9abfa3a5.entry.js +0 -1
- package/dist/sekiui/p-ac7bd611.entry.js +0 -1
- package/dist/sekiui/p-b45e11d8.entry.js +0 -1
- package/dist/sekiui/p-c62c4ad7.entry.js +0 -1
- package/dist/sekiui/p-caa51bdf.entry.js +0 -1
- package/dist/sekiui/p-ce986fde.entry.js +0 -1
- package/dist/sekiui/p-e45e6992.entry.js +0 -1
- package/dist/sekiui/p-ede4bb0c.entry.js +0 -1
- package/dist/sekiui/p-f4abd9a2.entry.js +0 -1
|
@@ -54,6 +54,17 @@ export class SekiHoverCard {
|
|
|
54
54
|
* @default false
|
|
55
55
|
*/
|
|
56
56
|
this.disabled = false;
|
|
57
|
+
/**
|
|
58
|
+
* Controlled open state. Reflects to the `open` attribute, so
|
|
59
|
+
* `<seki-hover-card open>` renders open with no script involved.
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
this.open = false;
|
|
63
|
+
/**
|
|
64
|
+
* Initial open state for uncontrolled usage
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
this.defaultOpen = false;
|
|
57
68
|
/**
|
|
58
69
|
* Internal open state
|
|
59
70
|
*/
|
|
@@ -114,6 +125,20 @@ export class SekiHoverCard {
|
|
|
114
125
|
}
|
|
115
126
|
};
|
|
116
127
|
}
|
|
128
|
+
componentWillLoad() {
|
|
129
|
+
// `disabled` wins over a requested initial open state.
|
|
130
|
+
this._isOpen = (this.open || this.defaultOpen) && !this.disabled;
|
|
131
|
+
this.open = this._isOpen;
|
|
132
|
+
}
|
|
133
|
+
openChanged(newValue) {
|
|
134
|
+
// An outside assignment (`card.open = true`) has to win after first render;
|
|
135
|
+
// `open` is only read once in componentWillLoad otherwise.
|
|
136
|
+
if (newValue === this._isOpen)
|
|
137
|
+
return;
|
|
138
|
+
this.cancelOpen();
|
|
139
|
+
this.cancelClose();
|
|
140
|
+
this.setOpen(newValue);
|
|
141
|
+
}
|
|
117
142
|
disabledChanged(newValue) {
|
|
118
143
|
if (newValue && this._isOpen) {
|
|
119
144
|
this.setOpen(false);
|
|
@@ -123,11 +148,19 @@ export class SekiHoverCard {
|
|
|
123
148
|
* Set the open state and emit change event
|
|
124
149
|
*/
|
|
125
150
|
setOpen(open) {
|
|
126
|
-
if (this.
|
|
151
|
+
if (open && this.disabled) {
|
|
152
|
+
// Keep the reflected prop honest when an open request is refused.
|
|
153
|
+
this.open = false;
|
|
127
154
|
return;
|
|
155
|
+
}
|
|
156
|
+
if (this._isOpen === open) {
|
|
157
|
+
this.open = open;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
128
160
|
this._isOpen = open;
|
|
161
|
+
this.open = open;
|
|
129
162
|
this.updateContext();
|
|
130
|
-
this.sekiOpenChange.emit(
|
|
163
|
+
this.sekiOpenChange.emit(open);
|
|
131
164
|
if (open) {
|
|
132
165
|
this.setupScrollListener();
|
|
133
166
|
}
|
|
@@ -135,6 +168,22 @@ export class SekiHoverCard {
|
|
|
135
168
|
this.removeScrollListener();
|
|
136
169
|
}
|
|
137
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Open the hover card immediately, skipping `openDelay`
|
|
173
|
+
*/
|
|
174
|
+
async openHoverCard() {
|
|
175
|
+
this.cancelOpen();
|
|
176
|
+
this.cancelClose();
|
|
177
|
+
this.setOpen(true);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Close the hover card immediately, skipping `closeDelay`
|
|
181
|
+
*/
|
|
182
|
+
async closeHoverCard() {
|
|
183
|
+
this.cancelOpen();
|
|
184
|
+
this.cancelClose();
|
|
185
|
+
this.setOpen(false);
|
|
186
|
+
}
|
|
138
187
|
/**
|
|
139
188
|
* Close the hover card immediately and focus the trigger
|
|
140
189
|
*/
|
|
@@ -233,7 +282,7 @@ export class SekiHoverCard {
|
|
|
233
282
|
this.removeScrollListener();
|
|
234
283
|
}
|
|
235
284
|
render() {
|
|
236
|
-
return (h(Host, { key: '
|
|
285
|
+
return (h(Host, { key: '23c73aa997f26586621e616361279663c7d6f52a', "data-state": this._isOpen ? 'open' : 'closed' }, h("div", { key: 'beb5e0101353f32b2e706edd6b2caa8c9526c35f', class: "hover-card" }, h("slot", { key: 'e61dfec60b816e957d30e9d6504fb2f905cfb9e3' }))));
|
|
237
286
|
}
|
|
238
287
|
static get is() { return "seki-hover-card"; }
|
|
239
288
|
static get encapsulation() { return "shadow"; }
|
|
@@ -375,6 +424,52 @@ export class SekiHoverCard {
|
|
|
375
424
|
"reflect": false,
|
|
376
425
|
"attribute": "disabled",
|
|
377
426
|
"defaultValue": "false"
|
|
427
|
+
},
|
|
428
|
+
"open": {
|
|
429
|
+
"type": "boolean",
|
|
430
|
+
"mutable": true,
|
|
431
|
+
"complexType": {
|
|
432
|
+
"original": "boolean",
|
|
433
|
+
"resolved": "boolean",
|
|
434
|
+
"references": {}
|
|
435
|
+
},
|
|
436
|
+
"required": false,
|
|
437
|
+
"optional": false,
|
|
438
|
+
"docs": {
|
|
439
|
+
"tags": [{
|
|
440
|
+
"name": "default",
|
|
441
|
+
"text": "false"
|
|
442
|
+
}],
|
|
443
|
+
"text": "Controlled open state. Reflects to the `open` attribute, so\n`<seki-hover-card open>` renders open with no script involved."
|
|
444
|
+
},
|
|
445
|
+
"getter": false,
|
|
446
|
+
"setter": false,
|
|
447
|
+
"reflect": true,
|
|
448
|
+
"attribute": "open",
|
|
449
|
+
"defaultValue": "false"
|
|
450
|
+
},
|
|
451
|
+
"defaultOpen": {
|
|
452
|
+
"type": "boolean",
|
|
453
|
+
"mutable": false,
|
|
454
|
+
"complexType": {
|
|
455
|
+
"original": "boolean",
|
|
456
|
+
"resolved": "boolean",
|
|
457
|
+
"references": {}
|
|
458
|
+
},
|
|
459
|
+
"required": false,
|
|
460
|
+
"optional": false,
|
|
461
|
+
"docs": {
|
|
462
|
+
"tags": [{
|
|
463
|
+
"name": "default",
|
|
464
|
+
"text": "false"
|
|
465
|
+
}],
|
|
466
|
+
"text": "Initial open state for uncontrolled usage"
|
|
467
|
+
},
|
|
468
|
+
"getter": false,
|
|
469
|
+
"setter": false,
|
|
470
|
+
"reflect": false,
|
|
471
|
+
"attribute": "default-open",
|
|
472
|
+
"defaultValue": "false"
|
|
378
473
|
}
|
|
379
474
|
};
|
|
380
475
|
}
|
|
@@ -392,18 +487,59 @@ export class SekiHoverCard {
|
|
|
392
487
|
"composed": true,
|
|
393
488
|
"docs": {
|
|
394
489
|
"tags": [],
|
|
395
|
-
"text": "Emitted when open state changes"
|
|
490
|
+
"text": "Emitted when open state changes. `detail` is the new open state as a\nbare boolean, matching every other `sekiOpenChange` in the library."
|
|
396
491
|
},
|
|
397
492
|
"complexType": {
|
|
398
|
-
"original": "
|
|
399
|
-
"resolved": "
|
|
493
|
+
"original": "boolean",
|
|
494
|
+
"resolved": "boolean",
|
|
400
495
|
"references": {}
|
|
401
496
|
}
|
|
402
497
|
}];
|
|
403
498
|
}
|
|
499
|
+
static get methods() {
|
|
500
|
+
return {
|
|
501
|
+
"openHoverCard": {
|
|
502
|
+
"complexType": {
|
|
503
|
+
"signature": "() => Promise<void>",
|
|
504
|
+
"parameters": [],
|
|
505
|
+
"references": {
|
|
506
|
+
"Promise": {
|
|
507
|
+
"location": "global",
|
|
508
|
+
"id": "global::Promise"
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
"return": "Promise<void>"
|
|
512
|
+
},
|
|
513
|
+
"docs": {
|
|
514
|
+
"text": "Open the hover card immediately, skipping `openDelay`",
|
|
515
|
+
"tags": []
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
"closeHoverCard": {
|
|
519
|
+
"complexType": {
|
|
520
|
+
"signature": "() => Promise<void>",
|
|
521
|
+
"parameters": [],
|
|
522
|
+
"references": {
|
|
523
|
+
"Promise": {
|
|
524
|
+
"location": "global",
|
|
525
|
+
"id": "global::Promise"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
"return": "Promise<void>"
|
|
529
|
+
},
|
|
530
|
+
"docs": {
|
|
531
|
+
"text": "Close the hover card immediately, skipping `closeDelay`",
|
|
532
|
+
"tags": []
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
}
|
|
404
537
|
static get elementRef() { return "el"; }
|
|
405
538
|
static get watchers() {
|
|
406
539
|
return [{
|
|
540
|
+
"propName": "open",
|
|
541
|
+
"methodName": "openChanged"
|
|
542
|
+
}, {
|
|
407
543
|
"propName": "disabled",
|
|
408
544
|
"methodName": "disabledChanged"
|
|
409
545
|
}];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/components/resizable/seki-resizable-handle.tsx
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import { syncTheme } from "../../utils/theme-sync";
|
|
4
|
+
import { subscribeToContextChange } from "../../utils/context-bridge";
|
|
4
5
|
/**
|
|
5
6
|
* Resizable handle - draggable divider between panels
|
|
6
7
|
*
|
|
@@ -21,6 +22,7 @@ export class SekiResizableHandle {
|
|
|
21
22
|
this._direction = 'horizontal';
|
|
22
23
|
this.startPosition = 0;
|
|
23
24
|
this.groupElement = null;
|
|
25
|
+
this.contextSubscription = null;
|
|
24
26
|
this.handleDirectionChange = () => {
|
|
25
27
|
const context = this.getContext();
|
|
26
28
|
if (context) {
|
|
@@ -82,14 +84,21 @@ export class SekiResizableHandle {
|
|
|
82
84
|
this.groupElement = group;
|
|
83
85
|
group.addEventListener('sekiDirectionChange', this.handleDirectionChange);
|
|
84
86
|
}
|
|
87
|
+
// Pick up the direction once the group publishes its context, which may be
|
|
88
|
+
// after this handle loaded in the per-tag custom-elements build.
|
|
89
|
+
this.contextSubscription = subscribeToContextChange(this.el, 'seki-resizable-panel-group', this.handleDirectionChange);
|
|
90
|
+
this.handleDirectionChange();
|
|
85
91
|
}
|
|
86
92
|
connectedCallback() {
|
|
87
93
|
syncTheme(this.el);
|
|
88
94
|
}
|
|
89
95
|
disconnectedCallback() {
|
|
96
|
+
var _a;
|
|
90
97
|
if (this.groupElement) {
|
|
91
98
|
this.groupElement.removeEventListener('sekiDirectionChange', this.handleDirectionChange);
|
|
92
99
|
}
|
|
100
|
+
(_a = this.contextSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
101
|
+
this.contextSubscription = null;
|
|
93
102
|
}
|
|
94
103
|
handleKeyDown(event) {
|
|
95
104
|
if (this.disabled)
|
|
@@ -157,13 +166,13 @@ export class SekiResizableHandle {
|
|
|
157
166
|
}
|
|
158
167
|
render() {
|
|
159
168
|
const isHorizontal = this._direction === 'horizontal';
|
|
160
|
-
return (h(Host, { key: '
|
|
169
|
+
return (h(Host, { key: '567e976a7d1d4b1fedf048ff9a7596c2f91c1872' }, h("div", { key: 'ec73f064616fd898f17cbf01b99af34788c7530f', part: "handle", role: "separator", tabindex: this.disabled ? -1 : 0, "aria-valuenow": this.getAriaValue(), "aria-valuemin": 0, "aria-valuemax": 100, "aria-orientation": isHorizontal ? 'vertical' : 'horizontal', "aria-label": "Resize handle", class: {
|
|
161
170
|
'resizable-handle': true,
|
|
162
171
|
'resizable-handle--horizontal': isHorizontal,
|
|
163
172
|
'resizable-handle--vertical': !isHorizontal,
|
|
164
173
|
'resizable-handle--disabled': this.disabled,
|
|
165
174
|
'resizable-handle--dragging': this._isDragging,
|
|
166
|
-
}, onPointerDown: this.handlePointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp }, this.withHandle && (h("div", { key: '
|
|
175
|
+
}, onPointerDown: this.handlePointerDown, onPointerMove: this.handlePointerMove, onPointerUp: this.handlePointerUp }, this.withHandle && (h("div", { key: 'e3054a34cbc71079c006864adb10fce7fa338507', part: "grip", class: "resizable-handle__grip" }, h("svg", { key: 'de3899676f375377fb558dea1bb645f0d0e70388', class: "resizable-handle__grip-icon", viewBox: "0 0 6 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("circle", { key: 'e9c55beb3bc0039c9cd6562aa8e936d4dcfafdb2', cx: "1.5", cy: "2", r: "1", fill: "currentColor" }), h("circle", { key: 'f7ebf6269df4d7e88b2c903ec922666a06a594d7', cx: "4.5", cy: "2", r: "1", fill: "currentColor" }), h("circle", { key: 'beedd6149812012e9d5b32f3dd77f120aa0e0859', cx: "1.5", cy: "6", r: "1", fill: "currentColor" }), h("circle", { key: '9b42b8fb2e0e502e8195b520a08a760dc27a9eaa', cx: "4.5", cy: "6", r: "1", fill: "currentColor" }), h("circle", { key: '12d0dd2597037340c94792be04f82e5745ba20de', cx: "1.5", cy: "10", r: "1", fill: "currentColor" }), h("circle", { key: '12227cd7aed5dd71c26133e57e4dd9bb72efb88b', cx: "4.5", cy: "10", r: "1", fill: "currentColor" }), h("circle", { key: 'f0951f2f445e06af2419f6f4d56d008aed9c5316', cx: "1.5", cy: "14", r: "1", fill: "currentColor" }), h("circle", { key: '57e3b554bab80ce435e77722957fae11e4c29192', cx: "4.5", cy: "14", r: "1", fill: "currentColor" })))))));
|
|
167
176
|
}
|
|
168
177
|
static get is() { return "seki-resizable-handle"; }
|
|
169
178
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/components/resizable/seki-resizable-panel-group.tsx
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import { syncTheme } from "../../utils/theme-sync";
|
|
4
|
+
import { publishContext } from "../../utils/context-bridge";
|
|
4
5
|
const STORAGE_KEY_PREFIX = 'seki-resizable:';
|
|
5
6
|
function clamp(value, min, max) {
|
|
6
7
|
return Math.min(Math.max(value, min), max);
|
|
@@ -247,7 +248,7 @@ export class SekiResizablePanelGroup {
|
|
|
247
248
|
this.restoreLayout();
|
|
248
249
|
}
|
|
249
250
|
updateContext() {
|
|
250
|
-
|
|
251
|
+
const context = {
|
|
251
252
|
direction: this.direction,
|
|
252
253
|
disabled: this.disabled,
|
|
253
254
|
registerPanel: this.registerPanel,
|
|
@@ -260,6 +261,10 @@ export class SekiResizablePanelGroup {
|
|
|
260
261
|
isCollapsed: this.isCollapsed,
|
|
261
262
|
getHandleIndex: this.getHandleIndex,
|
|
262
263
|
};
|
|
264
|
+
this._resizableContext = context;
|
|
265
|
+
// Publish on the host so children reach it via closest() in every build,
|
|
266
|
+
// and notify any child that mounted before this group was defined.
|
|
267
|
+
publishContext(this.el, '_resizableContext', context, this.contextChange);
|
|
263
268
|
}
|
|
264
269
|
emitLayoutChange() {
|
|
265
270
|
const sizes = this._panelOrder.map((id) => { var _a, _b; return (_b = (_a = this._panels.get(id)) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0; });
|
|
@@ -311,11 +316,11 @@ export class SekiResizablePanelGroup {
|
|
|
311
316
|
syncTheme(this.el);
|
|
312
317
|
}
|
|
313
318
|
render() {
|
|
314
|
-
return (h(Host, { key: '
|
|
319
|
+
return (h(Host, { key: '4050d03c828d3bd09ddd73ab9009b81ffcb2a2cd' }, h("div", { key: '148dba7f6173a023c861cfdd49e626773e317c23', part: "group", role: "group", "aria-label": "Resizable panel group", class: {
|
|
315
320
|
'resizable-panel-group': true,
|
|
316
321
|
'resizable-panel-group--horizontal': this.direction === 'horizontal',
|
|
317
322
|
'resizable-panel-group--vertical': this.direction === 'vertical',
|
|
318
|
-
} }, h("slot", { key: '
|
|
323
|
+
} }, h("slot", { key: '076d2200fad74c84d01970985d443a8cdd7d00ff' }))));
|
|
319
324
|
}
|
|
320
325
|
static get is() { return "seki-resizable-panel-group"; }
|
|
321
326
|
static get encapsulation() { return "shadow"; }
|
|
@@ -429,6 +434,21 @@ export class SekiResizablePanelGroup {
|
|
|
429
434
|
"resolved": "\"horizontal\" | \"vertical\"",
|
|
430
435
|
"references": {}
|
|
431
436
|
}
|
|
437
|
+
}, {
|
|
438
|
+
"method": "contextChange",
|
|
439
|
+
"name": "sekiContextChange",
|
|
440
|
+
"bubbles": true,
|
|
441
|
+
"cancelable": true,
|
|
442
|
+
"composed": true,
|
|
443
|
+
"docs": {
|
|
444
|
+
"tags": [],
|
|
445
|
+
"text": "Internal: fired whenever `_resizableContext` is (re)published so panels and\nhandles that mounted before this group was defined can register late.\nSee utils/context-bridge.ts \u2014 no payload by design."
|
|
446
|
+
},
|
|
447
|
+
"complexType": {
|
|
448
|
+
"original": "void",
|
|
449
|
+
"resolved": "void",
|
|
450
|
+
"references": {}
|
|
451
|
+
}
|
|
432
452
|
}];
|
|
433
453
|
}
|
|
434
454
|
static get elementRef() { return "el"; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/components/resizable/seki-resizable-panel.tsx
|
|
2
2
|
import { h, Host } from "@stencil/core";
|
|
3
3
|
import { syncTheme } from "../../utils/theme-sync";
|
|
4
|
+
import { subscribeToContextChange } from "../../utils/context-bridge";
|
|
4
5
|
let panelIdCounter = 0;
|
|
5
6
|
/**
|
|
6
7
|
* Resizable panel - individual content panel with size constraints
|
|
@@ -31,9 +32,35 @@ export class SekiResizablePanel {
|
|
|
31
32
|
this.collapsedSize = 0;
|
|
32
33
|
this._size = 0;
|
|
33
34
|
this._isCollapsed = false;
|
|
35
|
+
this.hasRegistered = false;
|
|
36
|
+
this.contextSubscription = null;
|
|
34
37
|
this.handleLayoutChange = () => {
|
|
35
38
|
this.updateSize();
|
|
36
39
|
};
|
|
40
|
+
/**
|
|
41
|
+
* The group publishes its context when *it* loads, which in the per-tag
|
|
42
|
+
* custom-elements build can be after this panel's componentWillLoad. Register
|
|
43
|
+
* whenever the context is (re)published; the group ignores duplicates.
|
|
44
|
+
*/
|
|
45
|
+
this.handleParentContextChange = () => {
|
|
46
|
+
this.registerWithGroup();
|
|
47
|
+
this.updateSize();
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
registerWithGroup() {
|
|
51
|
+
if (this.hasRegistered)
|
|
52
|
+
return;
|
|
53
|
+
const context = this.getContext();
|
|
54
|
+
if (!context)
|
|
55
|
+
return;
|
|
56
|
+
context.registerPanel(this.panelId, {
|
|
57
|
+
defaultSize: this.defaultSize,
|
|
58
|
+
minSize: this.minSize,
|
|
59
|
+
maxSize: this.maxSize,
|
|
60
|
+
collapsible: this.collapsible,
|
|
61
|
+
collapsedSize: this.collapsedSize,
|
|
62
|
+
});
|
|
63
|
+
this.hasRegistered = true;
|
|
37
64
|
}
|
|
38
65
|
getContext() {
|
|
39
66
|
const group = this.el.closest('seki-resizable-panel-group');
|
|
@@ -42,16 +69,7 @@ export class SekiResizablePanel {
|
|
|
42
69
|
}
|
|
43
70
|
componentWillLoad() {
|
|
44
71
|
this.panelId = `panel-${++panelIdCounter}`;
|
|
45
|
-
|
|
46
|
-
if (context) {
|
|
47
|
-
context.registerPanel(this.panelId, {
|
|
48
|
-
defaultSize: this.defaultSize,
|
|
49
|
-
minSize: this.minSize,
|
|
50
|
-
maxSize: this.maxSize,
|
|
51
|
-
collapsible: this.collapsible,
|
|
52
|
-
collapsedSize: this.collapsedSize,
|
|
53
|
-
});
|
|
54
|
-
}
|
|
72
|
+
this.registerWithGroup();
|
|
55
73
|
}
|
|
56
74
|
componentDidLoad() {
|
|
57
75
|
const group = this.el.closest('seki-resizable-panel-group');
|
|
@@ -59,34 +77,38 @@ export class SekiResizablePanel {
|
|
|
59
77
|
this.groupElement = group;
|
|
60
78
|
group.addEventListener('sekiLayoutChange', this.handleLayoutChange);
|
|
61
79
|
}
|
|
80
|
+
this.contextSubscription = subscribeToContextChange(this.el, 'seki-resizable-panel-group', this.handleParentContextChange);
|
|
81
|
+
this.registerWithGroup();
|
|
62
82
|
this.updateSize();
|
|
63
83
|
}
|
|
64
84
|
connectedCallback() {
|
|
65
85
|
syncTheme(this.el);
|
|
86
|
+
// Re-register after a DOM move; componentWillLoad only fires once.
|
|
87
|
+
if (this.panelId)
|
|
88
|
+
this.registerWithGroup();
|
|
66
89
|
}
|
|
67
90
|
disconnectedCallback() {
|
|
91
|
+
var _a;
|
|
68
92
|
// Remove event listener to prevent memory leak
|
|
69
93
|
if (this.groupElement) {
|
|
70
94
|
this.groupElement.removeEventListener('sekiLayoutChange', this.handleLayoutChange);
|
|
71
95
|
}
|
|
96
|
+
(_a = this.contextSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
97
|
+
this.contextSubscription = null;
|
|
72
98
|
// Unregister panel from group
|
|
73
99
|
const context = this.getContext();
|
|
74
100
|
if (context) {
|
|
75
101
|
context.unregisterPanel(this.panelId);
|
|
76
102
|
}
|
|
103
|
+
this.hasRegistered = false;
|
|
77
104
|
}
|
|
78
105
|
handleConstraintChange() {
|
|
79
106
|
const context = this.getContext();
|
|
80
107
|
if (context) {
|
|
81
108
|
// Re-register with new constraints
|
|
82
109
|
context.unregisterPanel(this.panelId);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
minSize: this.minSize,
|
|
86
|
-
maxSize: this.maxSize,
|
|
87
|
-
collapsible: this.collapsible,
|
|
88
|
-
collapsedSize: this.collapsedSize,
|
|
89
|
-
});
|
|
110
|
+
this.hasRegistered = false;
|
|
111
|
+
this.registerWithGroup();
|
|
90
112
|
}
|
|
91
113
|
}
|
|
92
114
|
updateSize() {
|
|
@@ -144,14 +166,14 @@ export class SekiResizablePanel {
|
|
|
144
166
|
return this.panelId;
|
|
145
167
|
}
|
|
146
168
|
render() {
|
|
147
|
-
return (h(Host, { key: '
|
|
169
|
+
return (h(Host, { key: '69f32198c8537b16e91222dcfcbb23c18dc37782', style: {
|
|
148
170
|
flexBasis: `${this._size}%`,
|
|
149
171
|
flexGrow: '0',
|
|
150
172
|
flexShrink: '0',
|
|
151
|
-
} }, h("div", { key: '
|
|
173
|
+
} }, h("div", { key: 'f45c47381a87eca45473a2da2a035bbff4c1b745', part: "panel", role: "region", class: {
|
|
152
174
|
'resizable-panel': true,
|
|
153
175
|
'resizable-panel--collapsed': this._isCollapsed,
|
|
154
|
-
} }, h("slot", { key: '
|
|
176
|
+
} }, h("slot", { key: '1f9f46fd08e315a79cc806b72c56a450c75c7ed5' }))));
|
|
155
177
|
}
|
|
156
178
|
static get is() { return "seki-resizable-panel"; }
|
|
157
179
|
static get encapsulation() { return "shadow"; }
|
|
@@ -86,7 +86,7 @@ export class SekiSelect {
|
|
|
86
86
|
this.hasBeenActivated = true;
|
|
87
87
|
}
|
|
88
88
|
// Emit event
|
|
89
|
-
this.sekiOpenChange.emit(
|
|
89
|
+
this.sekiOpenChange.emit(open);
|
|
90
90
|
// Validate on close if required
|
|
91
91
|
if (!open && this.required && this.hasBeenActivated) {
|
|
92
92
|
this.validateRequired();
|
|
@@ -396,7 +396,7 @@ export class SekiSelect {
|
|
|
396
396
|
// Render
|
|
397
397
|
// ===========================
|
|
398
398
|
render() {
|
|
399
|
-
return (h(Host, { key: '
|
|
399
|
+
return (h(Host, { key: 'd89c2754151f8faf545b616b5dce64b4dbbfd1a4' }, h("slot", { key: 'b5bf2a24deed68b33849b9fbcb6b091297885367' })));
|
|
400
400
|
}
|
|
401
401
|
static get is() { return "seki-select"; }
|
|
402
402
|
static get encapsulation() { return "shadow"; }
|
|
@@ -767,18 +767,12 @@ export class SekiSelect {
|
|
|
767
767
|
"composed": true,
|
|
768
768
|
"docs": {
|
|
769
769
|
"tags": [],
|
|
770
|
-
"text": "Emitted when dropdown open state changes"
|
|
770
|
+
"text": "Emitted when dropdown open state changes; `detail` is the new open state as a bare boolean"
|
|
771
771
|
},
|
|
772
772
|
"complexType": {
|
|
773
|
-
"original": "
|
|
774
|
-
"resolved": "
|
|
775
|
-
"references": {
|
|
776
|
-
"SelectOpenChangeEventDetail": {
|
|
777
|
-
"location": "import",
|
|
778
|
-
"path": "../../utils/select",
|
|
779
|
-
"id": "src/utils/select/index.ts::SelectOpenChangeEventDetail"
|
|
780
|
-
}
|
|
781
|
-
}
|
|
773
|
+
"original": "boolean",
|
|
774
|
+
"resolved": "boolean",
|
|
775
|
+
"references": {}
|
|
782
776
|
}
|
|
783
777
|
}, {
|
|
784
778
|
"method": "sekiValidate",
|
|
@@ -816,6 +816,14 @@
|
|
|
816
816
|
min-width: 100%;
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
+
/* Hides the listbox (and, since it's no longer un-slotted, every option
|
|
820
|
+
inside it) while closed. See the comment on render()'s Host class in
|
|
821
|
+
seki-select-content.tsx for why this replaced a conditional `return null`.
|
|
822
|
+
Mirrors seki-combobox-content.css's identical :host(.hidden) rule. */
|
|
823
|
+
:host(.hidden) {
|
|
824
|
+
display: none;
|
|
825
|
+
}
|
|
826
|
+
|
|
819
827
|
.content-container {
|
|
820
828
|
background: var(--seki-select-content-bg);
|
|
821
829
|
border: var(--seki-select-content-border);
|
|
@@ -52,11 +52,14 @@ export class SekiSelectContent {
|
|
|
52
52
|
/**
|
|
53
53
|
* Accessible name for the listbox.
|
|
54
54
|
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* string
|
|
59
|
-
*
|
|
55
|
+
* As of #300, seki-select-trigger and this listbox render in the same real
|
|
56
|
+
* DOM tree scope (scoped, non-shadow mode), so an aria-labelledby pointing
|
|
57
|
+
* back at the trigger's combobox would technically resolve now. Kept as a
|
|
58
|
+
* mirrored literal string anyway — simpler and more robust than a live
|
|
59
|
+
* cross-component id reference, and it avoids coupling this component's
|
|
60
|
+
* accessible name to the trigger's specific DOM shape. An aria-labelledby
|
|
61
|
+
* on the <seki-select> host *can* still be resolved here, because the host
|
|
62
|
+
* and its label sit in the same tree (unchanged).
|
|
60
63
|
*/
|
|
61
64
|
getAccessibleName(selectContext) {
|
|
62
65
|
var _a, _b, _c;
|
|
@@ -81,16 +84,22 @@ export class SekiSelectContent {
|
|
|
81
84
|
return null;
|
|
82
85
|
}
|
|
83
86
|
const isOpen = selectContext.open;
|
|
84
|
-
// Lazy rendering - only render when open
|
|
85
|
-
if (!isOpen) {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
87
|
const parent = this.el.closest('seki-select');
|
|
89
88
|
const maxHeight = (parent === null || parent === void 0 ? void 0 : parent.maxHeight) || '12.5rem';
|
|
90
|
-
|
|
89
|
+
// Always render, hiding via CSS instead of `return null` when closed (the
|
|
90
|
+
// seki-combobox-content pattern this mirrors). Under shadow DOM this used
|
|
91
|
+
// to conditionally return null and rely on the browser's own behavior of
|
|
92
|
+
// never rendering un-slotted light-DOM children — with no <slot> to
|
|
93
|
+
// assign them to, the options were simply invisible. Scoped (non-shadow)
|
|
94
|
+
// mode has no such mechanism: each seki-select-option still renders its
|
|
95
|
+
// own role="option" div regardless of whether a parent slot exists for
|
|
96
|
+
// it, so returning null here left every option fully visible — and
|
|
97
|
+
// interactable — even while "closed" (#300 e2e regression). See
|
|
98
|
+
// :host(.hidden) in seki-select-content.css.
|
|
99
|
+
return (h(Host, { class: { hidden: !isOpen } }, h("div", { class: "content-container", role: "listbox", id: selectContext.contentId, "aria-label": this.getAccessibleName(selectContext), "aria-multiselectable": selectContext.multiple ? 'true' : undefined }, h("div", { ref: (el) => (this.scrollContainerRef = el), class: "content-scroll", style: { maxHeight } }, h("slot", null)))));
|
|
91
100
|
}
|
|
92
101
|
static get is() { return "seki-select-content"; }
|
|
93
|
-
static get encapsulation() { return "
|
|
102
|
+
static get encapsulation() { return "scoped"; }
|
|
94
103
|
static get originalStyleUrls() {
|
|
95
104
|
return {
|
|
96
105
|
"$": ["seki-select-content.css"]
|
|
@@ -15,10 +15,10 @@ export class SekiSelectGroup {
|
|
|
15
15
|
syncTheme(this.el);
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: 'e1cb8d09575a3851c93f823623cd9331be3e96cc' }, h("div", { key: 'ddb385f0668bb61461f9e5121be9b8394218b629', class: "group", role: "group", "aria-labelledby": this.groupLabelId }, h("div", { key: 'de153ac27303e514ab3f6c85547809523b41584a', class: "group-separator", "aria-hidden": "true" }), h("div", { key: 'f8e67ce663167d38ff6432b704abec5631c5d52c', class: "group-label", id: this.groupLabelId, role: "presentation" }, h("slot", { key: '622315b7efb3aafc12b93f0b0bbf32a22292c95b', name: "label" }, this.label)), h("div", { key: 'beb13a0aeac5543fb9dcde5da98caf81d92a23e2', class: "group-options" }, h("slot", { key: '8919337fddfeb602538eaca3914a1e4bb36c65ee' })))));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "seki-select-group"; }
|
|
21
|
-
static get encapsulation() { return "
|
|
21
|
+
static get encapsulation() { return "scoped"; }
|
|
22
22
|
static get originalStyleUrls() {
|
|
23
23
|
return {
|
|
24
24
|
"$": ["seki-select-group.css"]
|