@swiftwc/ui 0.0.0-dev.113 → 0.0.0-dev.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/client/index.js +1 -1
- package/generated/components/{body-view.d.ts → content-view.d.ts} +2 -2
- package/generated/components/{body-view.js → content-view.js} +3 -3
- package/generated/components/index.d.ts +1 -1
- package/generated/components/index.js +1 -1
- package/generated/components/picker-view.js +11 -11
- package/generated/css/index.css +122 -116
- package/generated/internal/class/navigation-path.js +2 -2
- package/generated/internal/privateNamespace.d.ts +1 -1
- package/generated/internal/privateNamespace.js +3 -3
- package/html-data/en.json +18 -10
- package/package.json +1 -1
- package/scss/_components.scss +1 -1
- package/scss/_maps.scss +2 -0
- package/scss/base/_layout.scss +7 -7
- package/scss/colors/_index.scss +1 -1
- package/scss/components/{_body-view.scss → _content-view.scss} +1 -1
- package/scss/components/_detail-placeholder.scss +4 -4
- package/scss/components/_form-view.scss +2 -2
- package/scss/components/_index.scss +1 -1
- package/scss/components/_list-view.scss +2 -2
- package/scss/components/_navigation-split-view.scss +16 -16
- package/scss/components/_scroll-view.scss +1 -1
- package/scss/components/_sheet-view.scss +1 -1
- package/scss/components/_tab-view.scss +13 -13
- package/scss/mixins/_index.scss +2 -2
- package/scss/transitions/_bwd.scss +2 -2
|
@@ -263,7 +263,7 @@ export const confirmationDialog = async (trigger, title, message, actions, optio
|
|
|
263
263
|
}
|
|
264
264
|
dialog.insertAdjacentElement('beforeend', btn);
|
|
265
265
|
}
|
|
266
|
-
trigger.closest('
|
|
266
|
+
trigger.closest('content-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
|
|
267
267
|
const { promise, resolve } = Promise.withResolvers(), off = onoff('confirmation:return', (evt) => {
|
|
268
268
|
const { detail } = evt;
|
|
269
269
|
off();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
|
|
3
3
|
*/
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class ContentView extends HTMLElement {
|
|
5
5
|
constructor();
|
|
6
6
|
disconnectedCallback(): void;
|
|
7
7
|
connectedCallback(): void;
|
|
8
8
|
}
|
|
9
9
|
declare global {
|
|
10
10
|
interface HTMLElementTagNameMap {
|
|
11
|
-
'
|
|
11
|
+
'content-view': ContentView;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -2,14 +2,14 @@ import { debug } from '../internal/utils';
|
|
|
2
2
|
/**
|
|
3
3
|
* @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
|
|
4
4
|
*/
|
|
5
|
-
export class
|
|
5
|
+
export class ContentView extends HTMLElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
}
|
|
9
9
|
disconnectedCallback() {
|
|
10
|
-
debug(`${
|
|
10
|
+
debug(`${ContentView.name} ⚡️ disconnect`);
|
|
11
11
|
}
|
|
12
12
|
connectedCallback() {
|
|
13
|
-
debug(`${
|
|
13
|
+
debug(`${ContentView.name} ⚡️ connect`);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * from './alert-dialog';
|
|
2
|
-
export * from './body-view';
|
|
3
2
|
export * from './bordered-button';
|
|
4
3
|
export * from './bordered-prominent-button';
|
|
5
4
|
export * from './borderless-button';
|
|
6
5
|
export * from './color-scheme';
|
|
7
6
|
export * from './confirmation-dialog';
|
|
8
7
|
export * from './content-unavailable';
|
|
8
|
+
export * from './content-view';
|
|
9
9
|
export * from './date-picker';
|
|
10
10
|
export * from './detail-placeholder';
|
|
11
11
|
export * from './disclosure-group';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export * from './alert-dialog';
|
|
2
|
-
export * from './body-view';
|
|
3
2
|
export * from './bordered-button';
|
|
4
3
|
export * from './bordered-prominent-button';
|
|
5
4
|
export * from './borderless-button';
|
|
6
5
|
export * from './color-scheme';
|
|
7
6
|
export * from './confirmation-dialog';
|
|
8
7
|
export * from './content-unavailable';
|
|
8
|
+
export * from './content-view';
|
|
9
9
|
export * from './date-picker';
|
|
10
10
|
export * from './detail-placeholder';
|
|
11
11
|
export * from './disclosure-group';
|
|
@@ -184,7 +184,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
184
184
|
const { target } = evt;
|
|
185
185
|
if (!(target instanceof HTMLElement))
|
|
186
186
|
return;
|
|
187
|
-
const newPage = this.#spawnPage(el instanceof Element ? Array.from(el.children) : el.children, '
|
|
187
|
+
const newPage = this.#spawnPage(el instanceof Element ? Array.from(el.children) : el.children, 'content-view', groupId, this.hasAttribute('searchable'), extractLabel(el));
|
|
188
188
|
if (!newPage)
|
|
189
189
|
return;
|
|
190
190
|
newPage.dataset.groupId = groupId; // <-- tag the spawned page
|
|
@@ -212,7 +212,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
212
212
|
</tool-bar-item>
|
|
213
213
|
</tool-bar>
|
|
214
214
|
</dialog>`, '>1')
|
|
215
|
-
: $(html `<
|
|
215
|
+
: $(html `<content-view>
|
|
216
216
|
<scroll-view>
|
|
217
217
|
<v-stack placement="leading fill">
|
|
218
218
|
<list-view preferred-expanded-style="inset"></list-view>
|
|
@@ -225,7 +225,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
225
225
|
</button>
|
|
226
226
|
</tool-bar-item>
|
|
227
227
|
</tool-bar>
|
|
228
|
-
</
|
|
228
|
+
</content-view>`, '>1'), sv = body.querySelector('scroll-view'), list = body.querySelector('list-view'), backBtn = body.querySelector('button');
|
|
229
229
|
if (title)
|
|
230
230
|
sv?.setAttribute('navigation-inline-title', title);
|
|
231
231
|
if (searchable) {
|
|
@@ -336,8 +336,8 @@ export class PickerView extends FormAssociatedBase {
|
|
|
336
336
|
if (!this.#spawn)
|
|
337
337
|
return;
|
|
338
338
|
const groupMap = indexGroups(freshRoot);
|
|
339
|
-
for (const el of this.#spawn.querySelectorAll('
|
|
340
|
-
const depth = ancestors('
|
|
339
|
+
for (const el of this.#spawn.querySelectorAll('content-view')) {
|
|
340
|
+
const depth = ancestors('content-view,[is=sheet-view]', el).indexOf(this.#spawn);
|
|
341
341
|
if (0 >= depth)
|
|
342
342
|
continue;
|
|
343
343
|
const groupId = el.dataset.groupId;
|
|
@@ -348,7 +348,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
348
348
|
}
|
|
349
349
|
const children = source instanceof Element ? Array.from(source.children) : source.children;
|
|
350
350
|
const title = source instanceof Element ? extractLabel(source) : (source.title ?? null);
|
|
351
|
-
const newPage = this.#spawnPage(children, '
|
|
351
|
+
const newPage = this.#spawnPage(children, 'content-view', groupId, this.hasAttribute('searchable'), title);
|
|
352
352
|
newPage.dataset.groupId = groupId;
|
|
353
353
|
reflectSpawnedPage(el, newPage);
|
|
354
354
|
}
|
|
@@ -422,18 +422,18 @@ export class PickerView extends FormAssociatedBase {
|
|
|
422
422
|
if (!this.#spawn)
|
|
423
423
|
break;
|
|
424
424
|
// rerender level 0
|
|
425
|
-
reflectSpawnedPage(this.#spawn, this.#spawnPage(input.source, 'DIALOG' === this.#spawn.tagName ? 'sheet-view' : '
|
|
425
|
+
reflectSpawnedPage(this.#spawn, this.#spawnPage(input.source, 'DIALOG' === this.#spawn.tagName ? 'sheet-view' : 'content-view', undefined, this.hasAttribute('searchable'), this.getAttribute('label')));
|
|
426
426
|
this.#resyncSpawnedPages(input.source);
|
|
427
427
|
// // FIXME:
|
|
428
|
-
// for (const el of this.#spawn.querySelectorAll<HTMLElement>('
|
|
429
|
-
// const depth = $.ancestors('
|
|
428
|
+
// for (const el of this.#spawn.querySelectorAll<HTMLElement>('content-view')) {
|
|
429
|
+
// const depth = $.ancestors('content-view,[is=sheet-view]', el).indexOf(this.#spawn)
|
|
430
430
|
// if (0 >= depth) continue
|
|
431
431
|
// const datalist = this.querySelector<HTMLElement>(`:scope>${Array.from({ length: depth }, () => 'datalist').join('>')}`)
|
|
432
432
|
// if (!datalist) {
|
|
433
433
|
// el.remove()
|
|
434
434
|
// break
|
|
435
435
|
// }
|
|
436
|
-
// reflectSpawnedElement(el, this.#spawnPage(Array.from(datalist.children), '
|
|
436
|
+
// reflectSpawnedElement(el, this.#spawnPage(Array.from(datalist.children), 'content-view', this.hasAttribute('searchable'), datalist.dataset.label))
|
|
437
437
|
// }
|
|
438
438
|
break;
|
|
439
439
|
}
|
|
@@ -788,7 +788,7 @@ export class PickerView extends FormAssociatedBase {
|
|
|
788
788
|
this.#spawn?.remove?.();
|
|
789
789
|
const { source } = this.#resolveSource();
|
|
790
790
|
const level0 = this.#spawnPage(source, // this.hasAttribute('dictionary') ? parseDictionary(this.getAttribute('dictionary')) : (this.#slots?.get('list')?.assignedElements() ?? []),
|
|
791
|
-
'sheet' === this.pickerStyle ? 'sheet-view' : '
|
|
791
|
+
'sheet' === this.pickerStyle ? 'sheet-view' : 'content-view', undefined, this.hasAttribute('searchable'), this.getAttribute('label'));
|
|
792
792
|
if (!level0)
|
|
793
793
|
return;
|
|
794
794
|
const path = new NavigationPath(target)?.hydrate();
|