Skip to content

horizontal DND and move to show new position? #26

@Rar9

Description

@Rar9

is it possible to make item list horizontal as well?

for now I have hacked it

<div
				class="horizontal-tree-tokens flex w-full flex-wrap justify-center gap-2 p-2 border-2 border-dashed border-secondary-500/50 rounded-container transition-all hover:border-secondary-500"
			>
				<Tree
					bind:data={treeData}
					nodeTemplate={badgeTemplate}
					onNodeDrop={handleColumnDrop}
					idMember="id"
					pathMember="id"
					displayValueMember="label"
				/>
			</div>

/* Horizontal Tree Tokens Override */
:global(.horizontal-tree-tokens .svelte-tree-view) {
background: transparent;
--tree-level-indent: 0px;
--tree-branch-width: 0px;
--tree-row-height: auto;
}

/* Flex Container */
:global(.horizontal-tree-tokens .svelte-tree-view-nodes) {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	gap: 0.5rem !important;
	justify-content: center !important;
	padding: 0 !important;
	margin: 0 !important;
	width: 100% !important;
}

/* Flex Items - Correct class is .ltree-node */
:global(.horizontal-tree-tokens .ltree-node) {
	display: inline-flex !important;
	width: auto !important;
	margin: 0.25rem !important;
	flex: 0 0 auto !important;
}

/* Inner row wrapper */
:global(.horizontal-tree-tokens .ltree-node-row) {
	display: flex !important;
	width: auto !important;
	padding: 0 !important;
}

/* Hide styling elements */
:global(.horizontal-tree-tokens .toggle),
:global(.horizontal-tree-tokens .indent) {
	display: none !important;
}
Image

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions