@blotch/dolan 22.2.5 → 22.2.7
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/commands/install-packages.test.js +7 -2
- package/dist/commands/install-packages.test.js.map +1 -1
- package/dist/registry.js +8 -2
- package/dist/registry.js.map +1 -1
- package/dist/registry.test.js +1 -0
- package/dist/registry.test.js.map +1 -1
- package/dist/ui/components/accordion/accordion.test.ts +24 -7
- package/dist/ui/components/accordion/accordion.ts +34 -44
- package/dist/ui/components/action-sheet/action-sheet.test.ts +18 -1
- package/dist/ui/components/action-sheet/action-sheet.ts +55 -60
- package/dist/ui/components/alert/alert.test.ts +17 -0
- package/dist/ui/components/alert/alert.ts +23 -14
- package/dist/ui/components/alert-dialog/alert-dialog.test.ts +19 -4
- package/dist/ui/components/alert-dialog/alert-dialog.ts +31 -20
- package/dist/ui/components/aspect-ratio/aspect-ratio.test.ts +38 -2
- package/dist/ui/components/aspect-ratio/aspect-ratio.ts +11 -8
- package/dist/ui/components/avatar/avatar.test.ts +7 -0
- package/dist/ui/components/avatar/avatar.ts +35 -30
- package/dist/ui/components/badge/badge.test.ts +9 -0
- package/dist/ui/components/badge/badge.ts +12 -10
- package/dist/ui/components/bottom-sheet/bottom-sheet.test.ts +7 -0
- package/dist/ui/components/bottom-sheet/bottom-sheet.ts +5 -0
- package/dist/ui/components/button/button.test.ts +29 -3
- package/dist/ui/components/button/button.ts +67 -62
- package/dist/ui/components/button-group/button-group.test.ts +37 -4
- package/dist/ui/components/button-group/button-group.ts +60 -51
- package/dist/ui/components/card/card.test.ts +35 -2
- package/dist/ui/components/card/card.ts +41 -53
- package/dist/ui/components/chart/chart-presets.test.ts +16 -2
- package/dist/ui/components/chart/chart-presets.ts +22 -3
- package/dist/ui/components/chart/chart.test.ts +35 -6
- package/dist/ui/components/chart/chart.ts +14 -3
- package/dist/ui/components/checkbox/checkbox.test.ts +11 -4
- package/dist/ui/components/checkbox/checkbox.ts +21 -14
- package/dist/ui/components/collapsible/collapsible.test.ts +20 -10
- package/dist/ui/components/collapsible/collapsible.ts +29 -40
- package/dist/ui/components/dialog/dialog.test.ts +17 -1
- package/dist/ui/components/dialog/dialog.ts +24 -17
- package/dist/ui/components/dock/dock.test.ts +30 -5
- package/dist/ui/components/dock/dock.ts +29 -27
- package/dist/ui/components/empty-state/empty-state.test.ts +9 -0
- package/dist/ui/components/empty-state/empty-state.ts +20 -11
- package/dist/ui/components/icon/icon.test.ts +17 -0
- package/dist/ui/components/icon/icon.ts +19 -17
- package/dist/ui/components/input/input.test.ts +55 -3
- package/dist/ui/components/input/input.ts +91 -65
- package/dist/ui/components/label/label.test.ts +15 -0
- package/dist/ui/components/label/label.ts +12 -4
- package/dist/ui/components/list/list.test.ts +13 -3
- package/dist/ui/components/list/list.ts +14 -2
- package/dist/ui/components/menu/menu.test.ts +8 -0
- package/dist/ui/components/menu/menu.ts +4 -0
- package/dist/ui/components/nav-drawer/nav-drawer.test.ts +34 -21
- package/dist/ui/components/nav-drawer/nav-drawer.ts +60 -68
- package/dist/ui/components/navigation-bar/navigation-bar.test.ts +13 -0
- package/dist/ui/components/navigation-bar/navigation-bar.ts +5 -0
- package/dist/ui/components/pagination/pagination.test.ts +9 -0
- package/dist/ui/components/pagination/pagination.ts +52 -49
- package/dist/ui/components/popover/popover.test.ts +3 -0
- package/dist/ui/components/progress/progress.test.ts +7 -0
- package/dist/ui/components/progress/progress.ts +8 -6
- package/dist/ui/components/radio-group/radio-group.test.ts +8 -0
- package/dist/ui/components/radio-group/radio-group.ts +22 -19
- package/dist/ui/components/scroll-area/scroll-area.test.ts +14 -2
- package/dist/ui/components/scroll-area/scroll-area.ts +15 -3
- package/dist/ui/components/search-field/search-field.test.ts +25 -0
- package/dist/ui/components/search-field/search-field.ts +7 -1
- package/dist/ui/components/select/select.test.ts +32 -5
- package/dist/ui/components/select/select.ts +32 -11
- package/dist/ui/components/separator/separator.test.ts +3 -0
- package/dist/ui/components/sheet/sheet.test.ts +18 -0
- package/dist/ui/components/sheet/sheet.ts +24 -24
- package/dist/ui/components/skeleton/skeleton.test.ts +8 -0
- package/dist/ui/components/skeleton/skeleton.ts +13 -8
- package/dist/ui/components/slider/slider.test.ts +13 -1
- package/dist/ui/components/slider/slider.ts +16 -3
- package/dist/ui/components/spinner/spinner.test.ts +16 -1
- package/dist/ui/components/spinner/spinner.ts +15 -7
- package/dist/ui/components/switch/switch.test.ts +13 -2
- package/dist/ui/components/switch/switch.ts +15 -1
- package/dist/ui/components/tab-bar/tab-bar.test.ts +32 -6
- package/dist/ui/components/tab-bar/tab-bar.ts +28 -24
- package/dist/ui/components/tabs/tabs.test.ts +34 -32
- package/dist/ui/components/tabs/tabs.ts +56 -73
- package/dist/ui/components/textarea/textarea.test.ts +11 -1
- package/dist/ui/components/textarea/textarea.ts +77 -71
- package/dist/ui/components/toggle/toggle.test.ts +47 -16
- package/dist/ui/components/toggle/toggle.ts +78 -80
- package/dist/ui/components/typography/typography.test.ts +16 -0
- package/dist/ui/components/typography/typography.ts +12 -4
- package/package.json +1 -1
|
@@ -27,7 +27,11 @@ describe('installComponentPackages', () => {
|
|
|
27
27
|
});
|
|
28
28
|
it('does nothing when the project already depends on them', async () => {
|
|
29
29
|
writeFileSync(join(root, 'package.json'), JSON.stringify({
|
|
30
|
-
dependencies: {
|
|
30
|
+
dependencies: {
|
|
31
|
+
'@tanstack/charts': '^1.1.0',
|
|
32
|
+
'd3-shape': '^3.2.0',
|
|
33
|
+
'@types/d3-shape': '^3.1.8',
|
|
34
|
+
},
|
|
31
35
|
}));
|
|
32
36
|
const { installComponentPackages } = await import('./install-packages');
|
|
33
37
|
installComponentPackages(root, ['chart']);
|
|
@@ -40,6 +44,7 @@ describe('installComponentPackages', () => {
|
|
|
40
44
|
expect(installPackages).toHaveBeenCalledWith(root, [
|
|
41
45
|
'@tanstack/charts@^1.1.0',
|
|
42
46
|
'd3-shape@^3.2.0',
|
|
47
|
+
'@types/d3-shape@^3.1.8',
|
|
43
48
|
]);
|
|
44
49
|
const p = await import('@clack/prompts');
|
|
45
50
|
expect(p.log.warn).not.toHaveBeenCalled();
|
|
@@ -49,7 +54,7 @@ describe('installComponentPackages', () => {
|
|
|
49
54
|
const { installComponentPackages } = await import('./install-packages');
|
|
50
55
|
installComponentPackages(root, ['chart']);
|
|
51
56
|
const p = await import('@clack/prompts');
|
|
52
|
-
expect(p.log.warn).toHaveBeenCalledWith(expect.stringContaining('npm install @tanstack/charts@^1.1.0 d3-shape@^3.2.0'));
|
|
57
|
+
expect(p.log.warn).toHaveBeenCalledWith(expect.stringContaining('npm install @tanstack/charts@^1.1.0 d3-shape@^3.2.0 @types/d3-shape@^3.1.8'));
|
|
53
58
|
});
|
|
54
59
|
});
|
|
55
60
|
//# sourceMappingURL=install-packages.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-packages.test.js","sourceRoot":"","sources":["../../src/commands/install-packages.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAGzE,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/B,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;CACtC,CAAC,CAAC,CAAC;AAEJ,MAAM,eAAe,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;AAChC,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,CAAC,CAAC;IACz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BAAgB,EAAE,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,KAAK,IAAI,EAAE;QAChE,eAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,EAAE,wBAAwB,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;QACxE,wBAAwB,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1C,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;QACzC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,oBAAoB,CACrC,MAAM,CAAC,gBAAgB,CACrB,4EAA4E,CAC7E,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/registry.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TanStack Charts and the d3 curves the presets draw with
|
|
2
|
+
* TanStack Charts and the d3 curves the presets draw with, and the curves'
|
|
3
|
+
* types. TanStack Charts depends on the types too, so npm hoists them where
|
|
4
|
+
* the app finds them, but pnpm keeps them out of its reach. Kept in step with
|
|
3
5
|
* packages/ui/package.json by a test.
|
|
4
6
|
*/
|
|
5
|
-
const CHART_PACKAGES = [
|
|
7
|
+
const CHART_PACKAGES = [
|
|
8
|
+
'@tanstack/charts@^1.1.0',
|
|
9
|
+
'd3-shape@^3.2.0',
|
|
10
|
+
'@types/d3-shape@^3.1.8',
|
|
11
|
+
];
|
|
6
12
|
/**
|
|
7
13
|
* Builds the variant classes of the components that have `variant`/`size`
|
|
8
14
|
* inputs. Kept in step with packages/ui/package.json by the same test.
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAiBA
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot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AAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAC;IAEnC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;QAC/B,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,OAAO;QAC/B,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC;AACvB,CAAC,CAAC"}
|
package/dist/registry.test.js
CHANGED
|
@@ -111,6 +111,7 @@ describe('resolvePackages', () => {
|
|
|
111
111
|
expect(packages.map((spec) => spec.replace(/@[^@]*$/, ''))).toEqual([
|
|
112
112
|
'@tanstack/charts',
|
|
113
113
|
'd3-shape',
|
|
114
|
+
'@types/d3-shape',
|
|
114
115
|
]);
|
|
115
116
|
expect(resolvePackages(['card', 'nonexistent'])).toEqual([]);
|
|
116
117
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.test.js","sourceRoot":"","sources":["../src/registry.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAA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AAM,MAAM,GAAG,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;YAC5D,KAAK,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CACnC,oDAAoD,CACrD,EAAE,CAAC;gBACF,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;QACD,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAE,CAAC,WAAW,CAAC,CAAC,OAAO,CAC5C,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CACnC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -85,8 +85,6 @@ const CANCEL = 3;
|
|
|
85
85
|
describe('UiAccordion', () => {
|
|
86
86
|
it("merges each part's class with its own", async () => {
|
|
87
87
|
const { container, trigger, tap, content } = await renderAccordion();
|
|
88
|
-
// Each host element carries the given class too, so look for the view
|
|
89
|
-
// that has both its own and the given class.
|
|
90
88
|
expect(container.querySelector('.flex-col.w-80')).not.toBeNull();
|
|
91
89
|
expect(container.querySelector('.border-b.px-1')).not.toBeNull();
|
|
92
90
|
expect(trigger('Alpha').classList).toContain('justify-between');
|
|
@@ -97,6 +95,26 @@ describe('UiAccordion', () => {
|
|
|
97
95
|
expect(content('Alpha body')!.classList).toContain('pt-1');
|
|
98
96
|
});
|
|
99
97
|
|
|
98
|
+
// A class on a component lands on its host too (issue #181): each part is
|
|
99
|
+
// its host, so each class applies once, and collapsed content, which is
|
|
100
|
+
// hidden, takes no room for its padding.
|
|
101
|
+
it('puts each class on one element', async () => {
|
|
102
|
+
const { container, trigger, tap, getByText } = await renderAccordion();
|
|
103
|
+
expect(container.querySelectorAll('.w-80')).toHaveLength(1);
|
|
104
|
+
expect(container.querySelectorAll('.px-1')).toHaveLength(1);
|
|
105
|
+
expect([...container.querySelectorAll('.gap-2')]).toEqual([
|
|
106
|
+
trigger('Alpha'),
|
|
107
|
+
]);
|
|
108
|
+
const [collapsed] = container.querySelectorAll('.pt-1');
|
|
109
|
+
expect(collapsed!.classList).toContain('hidden');
|
|
110
|
+
|
|
111
|
+
await tap('Alpha');
|
|
112
|
+
expect([...container.querySelectorAll('.pt-1')]).toEqual([
|
|
113
|
+
getByText('Alpha body').parentElement,
|
|
114
|
+
]);
|
|
115
|
+
expect(collapsed!.classList).not.toContain('hidden');
|
|
116
|
+
});
|
|
117
|
+
|
|
100
118
|
it('expands an item when its trigger is tapped, and collapses it on a second tap', async () => {
|
|
101
119
|
const { tap, chevron, content } = await renderAccordion();
|
|
102
120
|
// Collapsed, the content isn't mounted at all.
|
|
@@ -172,7 +190,7 @@ describe('UiAccordion', () => {
|
|
|
172
190
|
{ transform: 'translateY(-8px)', opacity: 0 },
|
|
173
191
|
{ transform: 'translateY(0)', opacity: 1 },
|
|
174
192
|
],
|
|
175
|
-
// No fill: once it ends, the content's
|
|
193
|
+
// No fill: once it ends, the content's own style applies.
|
|
176
194
|
expect.objectContaining({ fill: 'none' }),
|
|
177
195
|
]);
|
|
178
196
|
const [firstKey] = startedOn(content('Alpha body'));
|
|
@@ -180,13 +198,12 @@ describe('UiAccordion', () => {
|
|
|
180
198
|
await tap('Alpha');
|
|
181
199
|
await tap('Alpha');
|
|
182
200
|
await waitForUpdate();
|
|
183
|
-
// Expanding again stops the previous reveal before it plays a new one
|
|
184
|
-
|
|
185
|
-
expect(animate).toHaveBeenCalledWith(expect.anything(), [
|
|
201
|
+
// Expanding again stops the previous reveal before it plays a new one.
|
|
202
|
+
expect(animate).toHaveBeenCalledWith(content('Alpha body'), [
|
|
186
203
|
CANCEL,
|
|
187
204
|
firstKey,
|
|
188
205
|
]);
|
|
189
|
-
expect(startedOn(content('Alpha body'))).toHaveLength(
|
|
206
|
+
expect(startedOn(content('Alpha body'))).toHaveLength(2);
|
|
190
207
|
});
|
|
191
208
|
|
|
192
209
|
it("doesn't animate content that collapsed before its reveal began", async () => {
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type ElementRef,
|
|
3
2
|
Component,
|
|
3
|
+
ElementRef,
|
|
4
4
|
ViewEncapsulation,
|
|
5
5
|
computed,
|
|
6
6
|
effect,
|
|
7
7
|
inject,
|
|
8
8
|
input,
|
|
9
9
|
signal,
|
|
10
|
-
viewChild,
|
|
11
10
|
} from '@angular/core';
|
|
12
11
|
import { LYNX_ELEMENTS } from '@blotch/angular-lynx';
|
|
13
12
|
|
|
14
13
|
import { type AnimationHandle, revealIn } from '../../utils/animate';
|
|
15
14
|
import { cn } from '../../utils/cn';
|
|
16
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Each part is its host element, styled through `host`, rather than a view
|
|
18
|
+
* inside the host. Angular gives a component's host every static attribute the
|
|
19
|
+
* app writes on it, so a class on <ui-accordion-item> or any other part lands
|
|
20
|
+
* on the host whatever the component does: with a styled view inside as well,
|
|
21
|
+
* a border or padding applied twice.
|
|
22
|
+
*/
|
|
17
23
|
@Component({
|
|
18
24
|
selector: 'ui-accordion',
|
|
19
|
-
standalone: true,
|
|
20
|
-
imports: [LYNX_ELEMENTS],
|
|
21
25
|
encapsulation: ViewEncapsulation.None,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<ng-content />
|
|
25
|
-
</view>
|
|
26
|
-
`,
|
|
26
|
+
host: { '[class]': 'containerClass()' },
|
|
27
|
+
template: '<ng-content />',
|
|
27
28
|
})
|
|
28
29
|
export class UiAccordion {
|
|
29
30
|
readonly type = input<'single' | 'multiple'>('single');
|
|
@@ -59,14 +60,9 @@ export class UiAccordion {
|
|
|
59
60
|
|
|
60
61
|
@Component({
|
|
61
62
|
selector: 'ui-accordion-item',
|
|
62
|
-
standalone: true,
|
|
63
|
-
imports: [LYNX_ELEMENTS],
|
|
64
63
|
encapsulation: ViewEncapsulation.None,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<ng-content />
|
|
68
|
-
</view>
|
|
69
|
-
`,
|
|
64
|
+
host: { '[class]': 'itemClass()' },
|
|
65
|
+
template: '<ng-content />',
|
|
70
66
|
})
|
|
71
67
|
export class UiAccordionItem {
|
|
72
68
|
readonly #accordion = inject(UiAccordion);
|
|
@@ -89,14 +85,15 @@ export class UiAccordionItem {
|
|
|
89
85
|
|
|
90
86
|
@Component({
|
|
91
87
|
selector: 'ui-accordion-trigger',
|
|
92
|
-
standalone: true,
|
|
93
88
|
imports: [LYNX_ELEMENTS],
|
|
94
89
|
encapsulation: ViewEncapsulation.None,
|
|
90
|
+
host: {
|
|
91
|
+
'[class]': 'triggerClass()',
|
|
92
|
+
'(bindtap)': 'onTap()',
|
|
93
|
+
},
|
|
95
94
|
template: `
|
|
96
|
-
<
|
|
97
|
-
|
|
98
|
-
<text [class]="chevronClass()">{{ item.isExpanded() ? '▼' : '▶' }}</text>
|
|
99
|
-
</view>
|
|
95
|
+
<text [class]="textClass()"><ng-content /></text>
|
|
96
|
+
<text [class]="chevronClass()">{{ item.isExpanded() ? '▼' : '▶' }}</text>
|
|
100
97
|
`,
|
|
101
98
|
})
|
|
102
99
|
export class UiAccordionTrigger {
|
|
@@ -122,26 +119,19 @@ export class UiAccordionTrigger {
|
|
|
122
119
|
|
|
123
120
|
@Component({
|
|
124
121
|
selector: 'ui-accordion-content',
|
|
125
|
-
standalone: true,
|
|
126
|
-
imports: [LYNX_ELEMENTS],
|
|
127
122
|
encapsulation: ViewEncapsulation.None,
|
|
128
123
|
// Mount the content only while expanded, via `@if`. On Lynx this works because
|
|
129
124
|
// the renderer recreates a destroyed element's native painting node when it is
|
|
130
125
|
// re-inserted (see LynxElement.#recreateSubtree in @blotch/angular-lynx): when
|
|
131
|
-
// the panel re-expands, the projected `<ng-content>`
|
|
132
|
-
//
|
|
133
|
-
//
|
|
134
|
-
// from opacity:0 / translateY(-8px) with
|
|
135
|
-
// over once the animation ends.
|
|
126
|
+
// the panel re-expands, the projected `<ng-content>` is rebuilt from cache and
|
|
127
|
+
// renders again, cycle after cycle. While collapsed the host is hidden, so
|
|
128
|
+
// the classes the app wrote on it (which Angular puts on the host either way)
|
|
129
|
+
// take no room. revealIn animates from opacity:0 / translateY(-8px) with
|
|
130
|
+
// fill:'none', so the host's own style takes over once the animation ends.
|
|
131
|
+
host: { '[class]': 'contentClass()' },
|
|
136
132
|
template: `
|
|
137
133
|
@if (item.isExpanded()) {
|
|
138
|
-
<
|
|
139
|
-
#content
|
|
140
|
-
[class]="contentClass()"
|
|
141
|
-
style="opacity: 1; transform: translateY(0);"
|
|
142
|
-
>
|
|
143
|
-
<ng-content />
|
|
144
|
-
</view>
|
|
134
|
+
<ng-content />
|
|
145
135
|
}
|
|
146
136
|
`,
|
|
147
137
|
})
|
|
@@ -149,7 +139,7 @@ export class UiAccordionContent {
|
|
|
149
139
|
protected readonly item = inject(UiAccordionItem);
|
|
150
140
|
readonly userClass = input<string>('', { alias: 'class' });
|
|
151
141
|
|
|
152
|
-
readonly
|
|
142
|
+
readonly #host = inject(ElementRef).nativeElement;
|
|
153
143
|
#anim?: AnimationHandle;
|
|
154
144
|
|
|
155
145
|
/**
|
|
@@ -157,22 +147,22 @@ export class UiAccordionContent {
|
|
|
157
147
|
* constructor: Angular's test build keeps a function for a constructor that
|
|
158
148
|
* nothing calls, which an app's coverage report would show as uncovered.
|
|
159
149
|
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
* which leaves nothing to animate.
|
|
150
|
+
* Deferred one macrotask so the re-inserted content is committed to the
|
|
151
|
+
* native tree before we animate it. By then the panel may have collapsed
|
|
152
|
+
* again, which leaves nothing to animate.
|
|
164
153
|
*/
|
|
165
154
|
protected readonly revealing = effect(() => {
|
|
166
155
|
if (!this.item.isExpanded()) return;
|
|
167
156
|
setTimeout(() => {
|
|
168
|
-
|
|
169
|
-
if (!el) return;
|
|
157
|
+
if (!this.item.isExpanded()) return;
|
|
170
158
|
this.#anim?.cancel();
|
|
171
|
-
this.#anim = revealIn(
|
|
159
|
+
this.#anim = revealIn(this.#host, { fromY: -8, fill: 'none' });
|
|
172
160
|
}, 0);
|
|
173
161
|
});
|
|
174
162
|
|
|
175
163
|
protected readonly contentClass = computed(() =>
|
|
176
|
-
|
|
164
|
+
this.item.isExpanded()
|
|
165
|
+
? cn('flex-col pb-4 flex', this.userClass())
|
|
166
|
+
: 'hidden',
|
|
177
167
|
);
|
|
178
168
|
}
|
|
@@ -160,7 +160,7 @@ const renderSheet = async () => {
|
|
|
160
160
|
overlay: container.querySelector('overlay')!,
|
|
161
161
|
backdrop: container.querySelector('overlay > view')!,
|
|
162
162
|
panel: container.querySelector('[accessibility-exclusive-focus]')!,
|
|
163
|
-
// A button's pressable tile: the view around its label.
|
|
163
|
+
// A button's pressable tile, its host: the view around its label.
|
|
164
164
|
button: (label: string) => result.getByText(label).parentElement!,
|
|
165
165
|
};
|
|
166
166
|
};
|
|
@@ -245,6 +245,23 @@ describe('UiActionSheet', () => {
|
|
|
245
245
|
expect(panel.classList).toContain('px-4');
|
|
246
246
|
});
|
|
247
247
|
|
|
248
|
+
// Angular gives a component's host every static attribute written on it
|
|
249
|
+
// (issue #181), so each class also styled a host: the sheet's in the page,
|
|
250
|
+
// where it is written, and each part's around its own view.
|
|
251
|
+
it('puts each class on one element: the panel, or the part', async () => {
|
|
252
|
+
const { container, panel, button, getByText } = await renderSheet();
|
|
253
|
+
expect([...container.querySelectorAll('.pb-8')]).toEqual([panel]);
|
|
254
|
+
expect([...container.querySelectorAll('.py-4')]).toEqual([
|
|
255
|
+
getByText('Pick').parentElement,
|
|
256
|
+
]);
|
|
257
|
+
expect([...container.querySelectorAll('.bg-muted')]).toEqual([
|
|
258
|
+
button('Delete'),
|
|
259
|
+
]);
|
|
260
|
+
expect([...container.querySelectorAll('.mt-2')]).toEqual([
|
|
261
|
+
button('Cancel'),
|
|
262
|
+
]);
|
|
263
|
+
});
|
|
264
|
+
|
|
248
265
|
it('fades the backdrop in and slides the panel up when opened', async () => {
|
|
249
266
|
const { host, backdrop, panel } = await renderSheet();
|
|
250
267
|
await openSheet(host);
|
|
@@ -71,6 +71,14 @@ const ANCHORED_WIDTH = { glass: 270, material: 280 } as const;
|
|
|
71
71
|
selector: 'ui-action-sheet',
|
|
72
72
|
imports: [LYNX_ELEMENTS, NgTemplateOutlet, UiPopoverPanel],
|
|
73
73
|
encapsulation: ViewEncapsulation.None,
|
|
74
|
+
// The sheet's class is its panel's, inside the overlay. Angular also gives
|
|
75
|
+
// the host every static attribute the app writes on <ui-action-sheet>, and
|
|
76
|
+
// the host sits in the page's layout where the sheet is written, so a
|
|
77
|
+
// `class="px-8"` padded the page there too. The host drops it. The title,
|
|
78
|
+
// items and cancel below are their host elements for the same reason: a
|
|
79
|
+
// class on one lands on its host anyway, so a view inside it styled with
|
|
80
|
+
// the same class applied it twice.
|
|
81
|
+
host: { '[attr.class]': 'null' },
|
|
74
82
|
template: `
|
|
75
83
|
<!-- Android's back button asks the overlay to close (requestclose),
|
|
76
84
|
which closes the sheet as Cancel does. -->
|
|
@@ -410,12 +418,11 @@ const ITEM_TEXT: Readonly<Record<ActionSheetLook, string>> = {
|
|
|
410
418
|
selector: 'ui-action-sheet-title',
|
|
411
419
|
imports: [LYNX_ELEMENTS],
|
|
412
420
|
encapsulation: ViewEncapsulation.None,
|
|
421
|
+
host: { '[class]': 'containerClass()' },
|
|
413
422
|
template: `
|
|
414
|
-
<
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
/></text>
|
|
418
|
-
</view>
|
|
423
|
+
<text [class]="textClass()" accessibility-traits="header"
|
|
424
|
+
><ng-content
|
|
425
|
+
/></text>
|
|
419
426
|
`,
|
|
420
427
|
})
|
|
421
428
|
export class UiActionSheetTitle {
|
|
@@ -438,30 +445,28 @@ export class UiActionSheetTitle {
|
|
|
438
445
|
selector: 'ui-action-sheet-item',
|
|
439
446
|
imports: [LYNX_ELEMENTS],
|
|
440
447
|
encapsulation: ViewEncapsulation.None,
|
|
448
|
+
host: {
|
|
449
|
+
'[class]': 'containerClass()',
|
|
450
|
+
'(bindtouchstart)': 'onPressStart()',
|
|
451
|
+
'(bindtouchend)': 'onPressEnd()',
|
|
452
|
+
'(bindtouchcancel)': 'onPressCancel()',
|
|
453
|
+
'(bindmousedown)': 'onPressStart()',
|
|
454
|
+
'(bindmouseup)': 'onPressEnd()',
|
|
455
|
+
'(bindmouseleave)': 'onPressCancel()',
|
|
456
|
+
'(bindtap)': 'onTap()',
|
|
457
|
+
},
|
|
441
458
|
template: `
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
>
|
|
453
|
-
@if (look() !== 'sheet') {
|
|
454
|
-
<!-- A menu row's pressed highlight (see UiMenuItem's highlightClass):
|
|
455
|
-
rows in a popover light up rather than shrink. -->
|
|
456
|
-
<view
|
|
457
|
-
[class]="highlightClass()"
|
|
458
|
-
[style.opacity]="held() ? highlightOpacity() : 0"
|
|
459
|
-
></view>
|
|
460
|
-
}
|
|
461
|
-
<text [class]="textClass()" accessibility-traits="button"
|
|
462
|
-
><ng-content
|
|
463
|
-
/></text>
|
|
464
|
-
</view>
|
|
459
|
+
@if (look() !== 'sheet') {
|
|
460
|
+
<!-- A menu row's pressed highlight (see UiMenuItem's highlightClass):
|
|
461
|
+
rows in a popover light up rather than shrink. -->
|
|
462
|
+
<view
|
|
463
|
+
[class]="highlightClass()"
|
|
464
|
+
[style.opacity]="held() ? highlightOpacity() : 0"
|
|
465
|
+
></view>
|
|
466
|
+
}
|
|
467
|
+
<text [class]="textClass()" accessibility-traits="button"
|
|
468
|
+
><ng-content
|
|
469
|
+
/></text>
|
|
465
470
|
`,
|
|
466
471
|
})
|
|
467
472
|
export class UiActionSheetItem {
|
|
@@ -473,8 +478,7 @@ export class UiActionSheetItem {
|
|
|
473
478
|
|
|
474
479
|
readonly pressed = output<void>();
|
|
475
480
|
|
|
476
|
-
|
|
477
|
-
readonly containerRef = viewChild.required<ElementRef>('container');
|
|
481
|
+
readonly #host = inject(ElementRef).nativeElement;
|
|
478
482
|
#pressAnim?: AnimationHandle;
|
|
479
483
|
|
|
480
484
|
/** Whether a finger (or the mouse) is down on a row in a popover. */
|
|
@@ -514,22 +518,19 @@ export class UiActionSheetItem {
|
|
|
514
518
|
return;
|
|
515
519
|
}
|
|
516
520
|
this.#pressAnim?.cancel();
|
|
517
|
-
this.#pressAnim = pressDown(
|
|
518
|
-
this.containerRef().nativeElement,
|
|
519
|
-
SCALE.pressDownLight,
|
|
520
|
-
);
|
|
521
|
+
this.#pressAnim = pressDown(this.#host, SCALE.pressDownLight);
|
|
521
522
|
}
|
|
522
523
|
|
|
523
524
|
protected onPressEnd(): void {
|
|
524
525
|
this.held.set(false);
|
|
525
526
|
this.#pressAnim?.cancel();
|
|
526
|
-
this.#pressAnim = pressRelease(this
|
|
527
|
+
this.#pressAnim = pressRelease(this.#host);
|
|
527
528
|
}
|
|
528
529
|
|
|
529
530
|
protected onPressCancel(): void {
|
|
530
531
|
this.held.set(false);
|
|
531
532
|
this.#pressAnim?.cancel();
|
|
532
|
-
this.#pressAnim = pressRelease(this
|
|
533
|
+
this.#pressAnim = pressRelease(this.#host);
|
|
533
534
|
}
|
|
534
535
|
|
|
535
536
|
protected onTap(): void {
|
|
@@ -547,23 +548,21 @@ export class UiActionSheetItem {
|
|
|
547
548
|
selector: 'ui-action-sheet-cancel',
|
|
548
549
|
imports: [LYNX_ELEMENTS],
|
|
549
550
|
encapsulation: ViewEncapsulation.None,
|
|
551
|
+
host: {
|
|
552
|
+
'[class]': 'containerClass()',
|
|
553
|
+
style: 'box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);',
|
|
554
|
+
'(bindtouchstart)': 'onPressStart()',
|
|
555
|
+
'(bindtouchend)': 'onPressEnd()',
|
|
556
|
+
'(bindtouchcancel)': 'onPressCancel()',
|
|
557
|
+
'(bindmousedown)': 'onPressStart()',
|
|
558
|
+
'(bindmouseup)': 'onPressEnd()',
|
|
559
|
+
'(bindmouseleave)': 'onPressCancel()',
|
|
560
|
+
'(bindtap)': 'onTap()',
|
|
561
|
+
},
|
|
550
562
|
template: `
|
|
551
|
-
<
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
style="box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);"
|
|
555
|
-
(bindtouchstart)="onPressStart()"
|
|
556
|
-
(bindtouchend)="onPressEnd()"
|
|
557
|
-
(bindtouchcancel)="onPressCancel()"
|
|
558
|
-
(bindmousedown)="onPressStart()"
|
|
559
|
-
(bindmouseup)="onPressEnd()"
|
|
560
|
-
(bindmouseleave)="onPressCancel()"
|
|
561
|
-
(bindtap)="onTap()"
|
|
562
|
-
>
|
|
563
|
-
<text [class]="textClass()" accessibility-traits="button">{{
|
|
564
|
-
label()
|
|
565
|
-
}}</text>
|
|
566
|
-
</view>
|
|
563
|
+
<text [class]="textClass()" accessibility-traits="button">{{
|
|
564
|
+
label()
|
|
565
|
+
}}</text>
|
|
567
566
|
`,
|
|
568
567
|
})
|
|
569
568
|
export class UiActionSheetCancel {
|
|
@@ -572,8 +571,7 @@ export class UiActionSheetCancel {
|
|
|
572
571
|
readonly label = input('Cancel');
|
|
573
572
|
readonly userClass = input<string>('', { alias: 'class' });
|
|
574
573
|
|
|
575
|
-
|
|
576
|
-
readonly containerRef = viewChild.required<ElementRef>('container');
|
|
574
|
+
readonly #host = inject(ElementRef).nativeElement;
|
|
577
575
|
#pressAnim?: AnimationHandle;
|
|
578
576
|
|
|
579
577
|
protected readonly containerClass = computed(() =>
|
|
@@ -589,20 +587,17 @@ export class UiActionSheetCancel {
|
|
|
589
587
|
|
|
590
588
|
protected onPressStart(): void {
|
|
591
589
|
this.#pressAnim?.cancel();
|
|
592
|
-
this.#pressAnim = pressDown(
|
|
593
|
-
this.containerRef().nativeElement,
|
|
594
|
-
SCALE.pressDownLight,
|
|
595
|
-
);
|
|
590
|
+
this.#pressAnim = pressDown(this.#host, SCALE.pressDownLight);
|
|
596
591
|
}
|
|
597
592
|
|
|
598
593
|
protected onPressEnd(): void {
|
|
599
594
|
this.#pressAnim?.cancel();
|
|
600
|
-
this.#pressAnim = pressRelease(this
|
|
595
|
+
this.#pressAnim = pressRelease(this.#host);
|
|
601
596
|
}
|
|
602
597
|
|
|
603
598
|
protected onPressCancel(): void {
|
|
604
599
|
this.#pressAnim?.cancel();
|
|
605
|
-
this.#pressAnim = pressRelease(this
|
|
600
|
+
this.#pressAnim = pressRelease(this.#host);
|
|
606
601
|
}
|
|
607
602
|
|
|
608
603
|
protected onTap(): void {
|
|
@@ -24,6 +24,12 @@ class AlertHost {
|
|
|
24
24
|
readonly description = signal('');
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
@Component({
|
|
28
|
+
imports: [UiAlert],
|
|
29
|
+
template: `<ui-alert title="Heads up" class="mt-2" />`,
|
|
30
|
+
})
|
|
31
|
+
class StaticAttributesHost {}
|
|
32
|
+
|
|
27
33
|
const renderAlert = async () => {
|
|
28
34
|
const result = await render(AlertHost);
|
|
29
35
|
return {
|
|
@@ -53,6 +59,17 @@ describe('UiAlert', () => {
|
|
|
53
59
|
expect(alert().classList).toContain('mt-2');
|
|
54
60
|
});
|
|
55
61
|
|
|
62
|
+
// Static attributes land on a component's host too (issue #181): the
|
|
63
|
+
// margin once, on the alert itself, and the title only as its text.
|
|
64
|
+
it('puts its class on one element, and its title only in its text', async () => {
|
|
65
|
+
const { container, getByText, queryAllByTitle } =
|
|
66
|
+
await render(StaticAttributesHost);
|
|
67
|
+
expect([...container.querySelectorAll('.mt-2')]).toEqual([
|
|
68
|
+
getByText('Heads up').parentElement,
|
|
69
|
+
]);
|
|
70
|
+
expect(queryAllByTitle('Heads up')).toEqual([]);
|
|
71
|
+
});
|
|
72
|
+
|
|
56
73
|
it('renders the title and description when set', async () => {
|
|
57
74
|
const { host, getByText } = await renderAlert();
|
|
58
75
|
host.title.set('Heads up');
|