You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/morfo/components/virtual-grid.ts

82 lines
2.3 KiB

import type { Morfo } from '../types';
import { v } from '../types';
export const virtualGridMorfo = {
name: 'VirtualGrid',
kebab: 'virtual-grid',
scope: ['soma', 'sema'],
// User scroll events use handle base; programmatic scroll events use
// shift.navigate base. Family defaults are appropriate.
expression: 'family-default',
texts: {
label: '#?components.virtual-grid.label|Virtual Grid'
},
events: [
{
// User-initiated viewport scroll on the row axis. Per book
// cap. 25, handle is direct manipulation of an object —
// scrolling the viewport rows fits. `scroll` extends book canon
// per Cap 8 §1. Was misclassified as shift.navigate.
name: 'handle-scroll-row',
semantic: {
family: 'handle',
verb: 'scroll',
target: v.partRef('viewport'),
sequence: 'post'
}
},
{
// User-initiated viewport scroll on the column axis. Same as
// above, axis split for sema cascade differentiation.
name: 'handle-scroll-column',
semantic: {
family: 'handle',
verb: 'scroll',
target: v.partRef('viewport'),
sequence: 'post'
}
},
{
// `scrollToCell` called imperatively → the SYSTEM moves the
// viewport (not handle, which requires direct user control).
// `shift.navigate` per book cap. 27 §5.
name: 'shift-navigate-to-cell',
semantic: {
family: 'shift',
verb: 'navigate',
target: v.partRef('viewport'),
sequence: 'post'
}
},
{
// `rowCount` or `columnCount` changed (data grew or shrank).
// The system applied a new size. `commit.set` per book cap. 23.
name: 'commit-set-resize',
semantic: {
family: 'commit',
verb: 'set',
target: v.partRef('provider'),
intent: 'neutral',
sequence: 'post'
}
}
],
parts: [
{ name: 'Provider', kebab: 'provider', kind: 'public', defaultElement: 'div', optional: false, data: [], aria: [] },
{ name: 'Viewport', kebab: 'viewport', kind: 'public', defaultElement: 'div', optional: false, data: [], aria: [] },
{
name: 'Cell',
kebab: 'cell',
archetype: 'item',
kind: 'public',
defaultElement: 'div',
optional: false,
data: [
{ attr: 'data-row-index', value: v.propRef('rowIndex'), emit: 'value' },
{ attr: 'data-column-index', value: v.propRef('columnIndex'), emit: 'value' }
],
aria: []
}
]
} as const satisfies Morfo;

Powered by TurnKey Linux.