@sixbell-telco/sdk 4.3.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -1
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/dropdown-chevron/dropdown-chevron.component.d.ts +1 -1
- package/components/dropdown/dropdown-trigger/dropdown-trigger.component.d.ts +10 -13
- package/components/dropdown-menu/README.md +1 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-content/dropdown-menu-bar-content.component.d.ts +5 -1
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +2 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +2 -0
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +1 -0
- package/components/dropdown-menu/src/dropdown-menu-content/dropdown-menu-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-content/dropdown-menu-sub-content.component.d.ts +2 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +1 -0
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +1 -0
- package/components/forms/combobox/README.md +1 -1
- package/components/forms/combobox/src/combobox.component.d.ts +10 -11
- package/components/forms/select/README.md +1 -1
- package/components/forms/select/src/select.component.d.ts +10 -11
- package/components/overlay/README.md +6 -1
- package/components/overlay/src/overlay.component.d.ts +9 -8
- package/components/tooltip/README.md +3 -2
- package/components/tooltip/src/tooltip.component.d.ts +8 -8
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +18 -9
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +5 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +20 -9
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +26 -55
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +35 -49
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +35 -43
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs +39 -77
- package/fesm2022/sixbell-telco-sdk-components-overlay.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +33 -52
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +29 -9
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs +186 -0
- package/fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +129 -14
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/layouts/README.md +7 -1
- package/layouts/public-api.d.ts +1 -1
- package/layouts/src/menu/menu-active.d.ts +2 -1
- package/layouts/src/menu/menu-url.d.ts +2 -0
- package/layouts/src/page-banner/page-banner.component.d.ts +13 -1
- package/package.json +35 -31
- package/src/_index.css +85 -0
- package/utils/popover-motion/README.md +38 -0
- package/utils/popover-motion/index.d.ts +5 -0
- package/utils/popover-motion/public-api.d.ts +2 -0
- package/utils/popover-motion/src/popover-menu-motion.d.ts +37 -0
- package/utils/popover-motion/src/popover-motion.d.ts +31 -0
- package/utils/translation/README.md +2 -0
- package/utils/translation/src/translation.service.d.ts +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixbell-telco/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "A collection of reusable components designed for use in Sixbell Telco Angular projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sixbell",
|
|
@@ -119,14 +119,14 @@
|
|
|
119
119
|
"types": "./components/notification/index.d.ts",
|
|
120
120
|
"default": "./fesm2022/sixbell-telco-sdk-components-notification.mjs"
|
|
121
121
|
},
|
|
122
|
-
"./components/overlay": {
|
|
123
|
-
"types": "./components/overlay/index.d.ts",
|
|
124
|
-
"default": "./fesm2022/sixbell-telco-sdk-components-overlay.mjs"
|
|
125
|
-
},
|
|
126
122
|
"./components/paginator": {
|
|
127
123
|
"types": "./components/paginator/index.d.ts",
|
|
128
124
|
"default": "./fesm2022/sixbell-telco-sdk-components-paginator.mjs"
|
|
129
125
|
},
|
|
126
|
+
"./components/overlay": {
|
|
127
|
+
"types": "./components/overlay/index.d.ts",
|
|
128
|
+
"default": "./fesm2022/sixbell-telco-sdk-components-overlay.mjs"
|
|
129
|
+
},
|
|
130
130
|
"./components/product-card": {
|
|
131
131
|
"types": "./components/product-card/index.d.ts",
|
|
132
132
|
"default": "./fesm2022/sixbell-telco-sdk-components-product-card.mjs"
|
|
@@ -191,26 +191,30 @@
|
|
|
191
191
|
"types": "./utils/cn/index.d.ts",
|
|
192
192
|
"default": "./fesm2022/sixbell-telco-sdk-utils-cn.mjs"
|
|
193
193
|
},
|
|
194
|
-
"./utils/date": {
|
|
195
|
-
"types": "./utils/date/index.d.ts",
|
|
196
|
-
"default": "./fesm2022/sixbell-telco-sdk-utils-date.mjs"
|
|
197
|
-
},
|
|
198
194
|
"./utils/formatting": {
|
|
199
195
|
"types": "./utils/formatting/index.d.ts",
|
|
200
196
|
"default": "./fesm2022/sixbell-telco-sdk-utils-formatting.mjs"
|
|
201
197
|
},
|
|
202
|
-
"./utils/
|
|
203
|
-
"types": "./utils/
|
|
204
|
-
"default": "./fesm2022/sixbell-telco-sdk-utils-
|
|
198
|
+
"./utils/date": {
|
|
199
|
+
"types": "./utils/date/index.d.ts",
|
|
200
|
+
"default": "./fesm2022/sixbell-telco-sdk-utils-date.mjs"
|
|
205
201
|
},
|
|
206
202
|
"./utils/logger": {
|
|
207
203
|
"types": "./utils/logger/index.d.ts",
|
|
208
204
|
"default": "./fesm2022/sixbell-telco-sdk-utils-logger.mjs"
|
|
209
205
|
},
|
|
206
|
+
"./utils/http": {
|
|
207
|
+
"types": "./utils/http/index.d.ts",
|
|
208
|
+
"default": "./fesm2022/sixbell-telco-sdk-utils-http.mjs"
|
|
209
|
+
},
|
|
210
210
|
"./utils/mfe": {
|
|
211
211
|
"types": "./utils/mfe/index.d.ts",
|
|
212
212
|
"default": "./fesm2022/sixbell-telco-sdk-utils-mfe.mjs"
|
|
213
213
|
},
|
|
214
|
+
"./utils/popover-motion": {
|
|
215
|
+
"types": "./utils/popover-motion/index.d.ts",
|
|
216
|
+
"default": "./fesm2022/sixbell-telco-sdk-utils-popover-motion.mjs"
|
|
217
|
+
},
|
|
214
218
|
"./utils/runtime-config": {
|
|
215
219
|
"types": "./utils/runtime-config/index.d.ts",
|
|
216
220
|
"default": "./fesm2022/sixbell-telco-sdk-utils-runtime-config.mjs"
|
|
@@ -223,14 +227,14 @@
|
|
|
223
227
|
"types": "./utils/theme/index.d.ts",
|
|
224
228
|
"default": "./fesm2022/sixbell-telco-sdk-utils-theme.mjs"
|
|
225
229
|
},
|
|
226
|
-
"./utils/translation": {
|
|
227
|
-
"types": "./utils/translation/index.d.ts",
|
|
228
|
-
"default": "./fesm2022/sixbell-telco-sdk-utils-translation.mjs"
|
|
229
|
-
},
|
|
230
230
|
"./utils/unsaved-changes": {
|
|
231
231
|
"types": "./utils/unsaved-changes/index.d.ts",
|
|
232
232
|
"default": "./fesm2022/sixbell-telco-sdk-utils-unsaved-changes.mjs"
|
|
233
233
|
},
|
|
234
|
+
"./utils/translation": {
|
|
235
|
+
"types": "./utils/translation/index.d.ts",
|
|
236
|
+
"default": "./fesm2022/sixbell-telco-sdk-utils-translation.mjs"
|
|
237
|
+
},
|
|
234
238
|
"./components/data-table/sub-component-toggle": {
|
|
235
239
|
"types": "./components/data-table/sub-component-toggle/index.d.ts",
|
|
236
240
|
"default": "./fesm2022/sixbell-telco-sdk-components-data-table-sub-component-toggle.mjs"
|
|
@@ -283,14 +287,14 @@
|
|
|
283
287
|
"types": "./components/forms/range/index.d.ts",
|
|
284
288
|
"default": "./fesm2022/sixbell-telco-sdk-components-forms-range.mjs"
|
|
285
289
|
},
|
|
286
|
-
"./components/forms/select": {
|
|
287
|
-
"types": "./components/forms/select/index.d.ts",
|
|
288
|
-
"default": "./fesm2022/sixbell-telco-sdk-components-forms-select.mjs"
|
|
289
|
-
},
|
|
290
290
|
"./components/forms/switch": {
|
|
291
291
|
"types": "./components/forms/switch/index.d.ts",
|
|
292
292
|
"default": "./fesm2022/sixbell-telco-sdk-components-forms-switch.mjs"
|
|
293
293
|
},
|
|
294
|
+
"./components/forms/select": {
|
|
295
|
+
"types": "./components/forms/select/index.d.ts",
|
|
296
|
+
"default": "./fesm2022/sixbell-telco-sdk-components-forms-select.mjs"
|
|
297
|
+
},
|
|
294
298
|
"./components/forms/textarea": {
|
|
295
299
|
"types": "./components/forms/textarea/index.d.ts",
|
|
296
300
|
"default": "./fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs"
|
|
@@ -335,29 +339,29 @@
|
|
|
335
339
|
"types": "./components/icon/heroicons/mini/index.d.ts",
|
|
336
340
|
"default": "./fesm2022/sixbell-telco-sdk-components-icon-heroicons-mini.mjs"
|
|
337
341
|
},
|
|
338
|
-
"./components/icon/heroicons/solid": {
|
|
339
|
-
"types": "./components/icon/heroicons/solid/index.d.ts",
|
|
340
|
-
"default": "./fesm2022/sixbell-telco-sdk-components-icon-heroicons-solid.mjs"
|
|
341
|
-
},
|
|
342
342
|
"./components/icon/heroicons/outline": {
|
|
343
343
|
"types": "./components/icon/heroicons/outline/index.d.ts",
|
|
344
344
|
"default": "./fesm2022/sixbell-telco-sdk-components-icon-heroicons-outline.mjs"
|
|
345
345
|
},
|
|
346
|
-
"./components/icon/
|
|
347
|
-
"types": "./components/icon/
|
|
348
|
-
"default": "./fesm2022/sixbell-telco-sdk-components-icon-
|
|
346
|
+
"./components/icon/heroicons/solid": {
|
|
347
|
+
"types": "./components/icon/heroicons/solid/index.d.ts",
|
|
348
|
+
"default": "./fesm2022/sixbell-telco-sdk-components-icon-heroicons-solid.mjs"
|
|
349
349
|
},
|
|
350
350
|
"./components/icon/material/baseline": {
|
|
351
351
|
"types": "./components/icon/material/baseline/index.d.ts",
|
|
352
352
|
"default": "./fesm2022/sixbell-telco-sdk-components-icon-material-baseline.mjs"
|
|
353
353
|
},
|
|
354
|
-
"./components/icon/material/sharp": {
|
|
355
|
-
"types": "./components/icon/material/sharp/index.d.ts",
|
|
356
|
-
"default": "./fesm2022/sixbell-telco-sdk-components-icon-material-sharp.mjs"
|
|
357
|
-
},
|
|
358
354
|
"./components/icon/material/round": {
|
|
359
355
|
"types": "./components/icon/material/round/index.d.ts",
|
|
360
356
|
"default": "./fesm2022/sixbell-telco-sdk-components-icon-material-round.mjs"
|
|
357
|
+
},
|
|
358
|
+
"./components/icon/material/outline": {
|
|
359
|
+
"types": "./components/icon/material/outline/index.d.ts",
|
|
360
|
+
"default": "./fesm2022/sixbell-telco-sdk-components-icon-material-outline.mjs"
|
|
361
|
+
},
|
|
362
|
+
"./components/icon/material/sharp": {
|
|
363
|
+
"types": "./components/icon/material/sharp/index.d.ts",
|
|
364
|
+
"default": "./fesm2022/sixbell-telco-sdk-components-icon-material-sharp.mjs"
|
|
361
365
|
}
|
|
362
366
|
},
|
|
363
367
|
"peerDependencies": {
|
package/src/_index.css
CHANGED
|
@@ -1614,3 +1614,88 @@ st-side-menu [data-st-menu-group][data-state='closing'] {
|
|
|
1614
1614
|
margin: 0 !important;
|
|
1615
1615
|
}
|
|
1616
1616
|
}
|
|
1617
|
+
|
|
1618
|
+
/*
|
|
1619
|
+
* Popover motion: the one open/close animation of st-dropdown, st-dropdown-menu, st-overlay, st-tooltip,
|
|
1620
|
+
* st-select and st-combobox panels. The panel carries `popover-motion` and `data-state`
|
|
1621
|
+
* (opening | open | closing | closed); once the CDK reports where it placed the panel it also carries
|
|
1622
|
+
* `data-side` (top | right | bottom | left) and `data-align` (start | center | end).
|
|
1623
|
+
* Opening waits for `data-side`, so a flip before the first position never restarts it.
|
|
1624
|
+
* Reduced motion drops the travel and the scale; the global 0.01ms backstop keeps animationend firing.
|
|
1625
|
+
*/
|
|
1626
|
+
@theme {
|
|
1627
|
+
--popover-in-duration: 160ms;
|
|
1628
|
+
--popover-out-duration: 110ms;
|
|
1629
|
+
--ease-popover-in: cubic-bezier(0.16, 1, 0.3, 1);
|
|
1630
|
+
--ease-popover-out: cubic-bezier(0.4, 0, 1, 1);
|
|
1631
|
+
--popover-distance: 4px;
|
|
1632
|
+
--popover-scale: 0.96;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
@keyframes st-popover-in {
|
|
1636
|
+
from {
|
|
1637
|
+
opacity: 0;
|
|
1638
|
+
transform: translate(var(--_popover-x), var(--_popover-y)) scale(var(--_popover-scale));
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
|
|
1642
|
+
@keyframes st-popover-out {
|
|
1643
|
+
to {
|
|
1644
|
+
opacity: 0;
|
|
1645
|
+
transform: translate(var(--_popover-x), var(--_popover-y));
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
@utility popover-motion {
|
|
1650
|
+
--_popover-distance: var(--popover-distance);
|
|
1651
|
+
--_popover-scale: var(--popover-scale);
|
|
1652
|
+
--_popover-x: 0px;
|
|
1653
|
+
--_popover-y: 0px;
|
|
1654
|
+
--_popover-origin-x: center;
|
|
1655
|
+
--_popover-origin-y: center;
|
|
1656
|
+
transform-origin: var(--_popover-origin-x) var(--_popover-origin-y);
|
|
1657
|
+
|
|
1658
|
+
&[data-side='bottom'] {
|
|
1659
|
+
--_popover-y: calc(var(--_popover-distance) * -1);
|
|
1660
|
+
--_popover-origin-y: top;
|
|
1661
|
+
}
|
|
1662
|
+
&[data-side='top'] {
|
|
1663
|
+
--_popover-y: var(--_popover-distance);
|
|
1664
|
+
--_popover-origin-y: bottom;
|
|
1665
|
+
}
|
|
1666
|
+
&[data-side='right'] {
|
|
1667
|
+
--_popover-x: calc(var(--_popover-distance) * -1);
|
|
1668
|
+
--_popover-origin-x: left;
|
|
1669
|
+
}
|
|
1670
|
+
&[data-side='left'] {
|
|
1671
|
+
--_popover-x: var(--_popover-distance);
|
|
1672
|
+
--_popover-origin-x: right;
|
|
1673
|
+
}
|
|
1674
|
+
&:is([data-side='bottom'], [data-side='top'])[data-align='start'] {
|
|
1675
|
+
--_popover-origin-x: left;
|
|
1676
|
+
}
|
|
1677
|
+
&:is([data-side='bottom'], [data-side='top'])[data-align='end'] {
|
|
1678
|
+
--_popover-origin-x: right;
|
|
1679
|
+
}
|
|
1680
|
+
&:is([data-side='left'], [data-side='right'])[data-align='start'] {
|
|
1681
|
+
--_popover-origin-y: top;
|
|
1682
|
+
}
|
|
1683
|
+
&:is([data-side='left'], [data-side='right'])[data-align='end'] {
|
|
1684
|
+
--_popover-origin-y: bottom;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
&[data-state='opening']:not([data-side]) {
|
|
1688
|
+
opacity: 0;
|
|
1689
|
+
}
|
|
1690
|
+
&[data-state='opening'][data-side] {
|
|
1691
|
+
animation: st-popover-in var(--popover-in-duration) var(--ease-popover-in) both;
|
|
1692
|
+
}
|
|
1693
|
+
&[data-state='closing'] {
|
|
1694
|
+
animation: st-popover-out var(--popover-out-duration) var(--ease-popover-out) both;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1698
|
+
--_popover-distance: 0px;
|
|
1699
|
+
--_popover-scale: 1;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Popover Motion
|
|
2
|
+
|
|
3
|
+
Import: `@sixbell-telco/sdk/utils/popover-motion`
|
|
4
|
+
|
|
5
|
+
The one open/close animation of SDK popovers (`st-dropdown`, `st-dropdown-menu`, `st-overlay`, `st-tooltip`, `st-select`, `st-combobox`). The motion itself is the `popover-motion` utility in `_index.css`; this entry maps CDK positions onto it.
|
|
6
|
+
|
|
7
|
+
| Phase | Duration | Easing | Movement |
|
|
8
|
+
| ------- | -------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------- |
|
|
9
|
+
| Opening | `--popover-in-duration` (160ms) | `--ease-popover-in` (`cubic-bezier(0.16, 1, 0.3, 1)`) | opacity 0 to 1, 4px toward the trigger, scale 0.96 to 1 from the placement side |
|
|
10
|
+
| Closing | `--popover-out-duration` (110ms) | `--ease-popover-out` (`cubic-bezier(0.4, 0, 1, 1)`) | opacity 1 to 0, 4px back toward the trigger, no scale |
|
|
11
|
+
|
|
12
|
+
Under `prefers-reduced-motion` there is no travel or scale.
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
Bind the panel's `data-state` (`opening | open | closing | closed`) and, once the CDK reports a position, `data-side` / `data-align`. The entrance waits for `data-side`.
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<div
|
|
20
|
+
class="popover-motion"
|
|
21
|
+
[attr.data-state]="state()"
|
|
22
|
+
[attr.data-side]="placement()?.side"
|
|
23
|
+
[attr.data-align]="placement()?.align"
|
|
24
|
+
(animationend)="settle($event)"
|
|
25
|
+
></div>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
onPositionChange({ connectionPair }: ConnectedOverlayPositionChange) {
|
|
30
|
+
this.placement.set(popoverPlacement(connectionPair));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
settle(event: AnimationEvent) {
|
|
34
|
+
if (isPopoverMotionAnimation(event, 'opening')) this.state.set('open');
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For `cdkMenu` panels, put `stPopoverMenuMotion` on the menu (with `[stPopoverMenuMotionTheme]` set to the element that declares it, so the portaled panel keeps that theme) and give its trigger `popoverMenuPositions()` (or `popoverContextMenuPositions()`), which tag each position with its placement.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ConnectedPosition } from '@angular/cdk/overlay';
|
|
2
|
+
import { PopoverMotionState, PopoverPlacement } from './popover-motion';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Positions for a CDK menu trigger, the same placements the CDK picks by default (below a root or
|
|
6
|
+
* menu-bar trigger with a 4px gap, beside a trigger inside a vertical menu), tagged for `popover-motion`.
|
|
7
|
+
* Call it in the injection context of the trigger.
|
|
8
|
+
*/
|
|
9
|
+
export declare function popoverMenuPositions(): ConnectedPosition[];
|
|
10
|
+
/** Positions for a CDK context menu trigger (the CDK defaults), tagged for `popover-motion` */
|
|
11
|
+
export declare function popoverContextMenuPositions(): ConnectedPosition[];
|
|
12
|
+
/**
|
|
13
|
+
* `popover-motion` for a CDK menu panel (`cdkMenu`). The entrance starts once the CDK placed the pane.
|
|
14
|
+
* The CDK detaches a menu the moment it closes, so the exit plays on an inert, hidden-from-AT snapshot
|
|
15
|
+
* of the panel at the same spot, removed when its animation ends.
|
|
16
|
+
* The panel is portaled out of its page, so it takes the theme of `stPopoverMenuMotionTheme` (the element
|
|
17
|
+
* that declares the menu), as `st-dropdown` does for its panel; the snapshot keeps it.
|
|
18
|
+
*/
|
|
19
|
+
export declare class PopoverMenuMotionDirective {
|
|
20
|
+
private readonly element;
|
|
21
|
+
private readonly trigger;
|
|
22
|
+
private readonly themeDom;
|
|
23
|
+
/** Element whose nearest `data-theme` the portaled panel takes */
|
|
24
|
+
readonly stPopoverMenuMotionTheme: import("@angular/core").InputSignal<Element | null>;
|
|
25
|
+
/** @internal */
|
|
26
|
+
protected theme(): string | null;
|
|
27
|
+
/** @internal */
|
|
28
|
+
protected readonly state: import("@angular/core").WritableSignal<PopoverMotionState>;
|
|
29
|
+
/** @internal */
|
|
30
|
+
protected readonly placement: import("@angular/core").WritableSignal<PopoverPlacement | null>;
|
|
31
|
+
constructor();
|
|
32
|
+
/** @internal */
|
|
33
|
+
protected onAnimationEnd(event: AnimationEvent): void;
|
|
34
|
+
private playExit;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PopoverMenuMotionDirective, never>;
|
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<PopoverMenuMotionDirective, "[stPopoverMenuMotion]", never, { "stPopoverMenuMotionTheme": { "alias": "stPopoverMenuMotionTheme"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ConnectedPosition } from '@angular/cdk/overlay';
|
|
2
|
+
/** Side of the trigger the panel was placed on. */
|
|
3
|
+
export type PopoverSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
/** Edge of the trigger the panel lines up with, along the side. */
|
|
5
|
+
export type PopoverAlign = 'start' | 'center' | 'end';
|
|
6
|
+
/** Where the CDK placed a panel, as `data-side` / `data-align` on a `popover-motion` element. */
|
|
7
|
+
export interface PopoverPlacement {
|
|
8
|
+
readonly side: PopoverSide;
|
|
9
|
+
readonly align: PopoverAlign;
|
|
10
|
+
}
|
|
11
|
+
/** Lifecycle of a `popover-motion` panel, bound to its `data-state`. */
|
|
12
|
+
export type PopoverMotionState = 'closed' | 'opening' | 'open' | 'closing';
|
|
13
|
+
/** Keyframe names the `popover-motion` utility plays while opening and closing. */
|
|
14
|
+
export declare const POPOVER_MOTION_ANIMATIONS: {
|
|
15
|
+
readonly opening: "st-popover-in";
|
|
16
|
+
readonly closing: "st-popover-out";
|
|
17
|
+
};
|
|
18
|
+
type PositionPair = Pick<ConnectedPosition, 'originX' | 'originY' | 'overlayX' | 'overlayY'>;
|
|
19
|
+
/**
|
|
20
|
+
* Placement of a panel from the CDK connection pair it was applied with (`positionChange`).
|
|
21
|
+
* A pair that overlaps the trigger instead of sitting beside it falls back to its vertical anchor.
|
|
22
|
+
*/
|
|
23
|
+
export declare function popoverPlacement(pair: PositionPair): PopoverPlacement;
|
|
24
|
+
/** Whether an `animationend` / `animationcancel` belongs to the `popover-motion` phase. */
|
|
25
|
+
export declare function isPopoverMotionAnimation(event: Pick<AnimationEvent, 'animationName'>, phase: 'opening' | 'closing'): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Offset for a fallback position derived from a primary one: negated when the fallback anchors the
|
|
28
|
+
* opposite edge (a flip), so a gap between trigger and panel stays a gap on either side.
|
|
29
|
+
*/
|
|
30
|
+
export declare function mirrorPopoverOffset(offset: number | undefined, from: string, to: string): number;
|
|
31
|
+
export {};
|
|
@@ -114,6 +114,8 @@ Translation config is a JSON file that lists available languages, translation pa
|
|
|
114
114
|
- Applies selected language and updates ngx-translate.
|
|
115
115
|
- Prefetches other languages in background (default on).
|
|
116
116
|
|
|
117
|
+
`setRuntimeConfig()` after the first load (a host adding a remote's i18n path, a refreshed config) keeps the loaded translations on screen: `ready()` stays `true` while the new bundle is fetched, the bundle is then merged over the loaded one, `onLangChange` (`onLanguageChange$`) emits once for the active language and `changes()` / `onLanguageChange` tick once. A failed fetch keeps the loaded translations and logs an error. A `setLanguage()` made while the bundle is fetched wins (the refresh does not write the old language back to storage or `<html lang>`), and when refreshes overlap only the latest one is applied. Only the first load leaves `ready()` `false` until the bundle is in.
|
|
118
|
+
|
|
117
119
|
### Mermaid: Boot Flow
|
|
118
120
|
|
|
119
121
|
```mermaid
|
|
@@ -20,6 +20,8 @@ export declare class TranslationService {
|
|
|
20
20
|
private isUsingFallbackConfig;
|
|
21
21
|
private prefetchLanguages;
|
|
22
22
|
private isApplyingRuntimeConfig;
|
|
23
|
+
private bundleRefreshId;
|
|
24
|
+
private readonly inactiveRefreshIds;
|
|
23
25
|
private runtimeHash;
|
|
24
26
|
private runtimeLoader?;
|
|
25
27
|
private runtimeMeta?;
|
|
@@ -39,7 +41,29 @@ export declare class TranslationService {
|
|
|
39
41
|
constructor();
|
|
40
42
|
configure(config: TranslationConfig): void;
|
|
41
43
|
private resolveStoredLanguage;
|
|
44
|
+
private reloadForNewPaths;
|
|
45
|
+
/**
|
|
46
|
+
* Applies a runtime config. On the first load `ready()` stays false until the bundle is in. Once
|
|
47
|
+
* translations are ready, a refresh (e.g. a host adding a remote's i18n path) fetches the new bundle
|
|
48
|
+
* first and merges it over the loaded one, so `ready()` and the visible translations never drop.
|
|
49
|
+
*/
|
|
42
50
|
setRuntimeConfig(config: TranslationConfig): Promise<void>;
|
|
51
|
+
private refreshRuntimeConfig;
|
|
52
|
+
private refreshLoadedLanguage;
|
|
53
|
+
/**
|
|
54
|
+
* Re-selects the refreshed active language so `onLangChange` fires once, as it did when a refresh
|
|
55
|
+
* went through `use()`. Its listener ticks `changes()` and `onLanguageChange`; before `init()`
|
|
56
|
+
* subscribes, they are ticked here instead.
|
|
57
|
+
*/
|
|
58
|
+
private announceRefreshedLanguage;
|
|
59
|
+
/**
|
|
60
|
+
* Fetches `lang` through the active loader without touching the loaded bundle. Unlike
|
|
61
|
+
* `TranslateService.reloadLang`, nothing is deleted first, so `instant()` keeps returning the
|
|
62
|
+
* previous values until the caller merges the result, and a failed fetch returns `null`.
|
|
63
|
+
*/
|
|
64
|
+
private fetchBundle;
|
|
65
|
+
private swapTranslations;
|
|
66
|
+
private notifyTranslationsChanged;
|
|
43
67
|
enablePrefetch(enable: boolean): void;
|
|
44
68
|
private loadSelectedLanguage;
|
|
45
69
|
private prefetchRemainingLanguages;
|