@infineon/infineon-design-system-stencil 33.6.0--canary.1869.b1674220449fed92bf0dee5aead2bd511f2c78f1.0 → 33.6.0--canary.1869.7438a96be80961b83f2346f57d219844afbd5c18.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.
@@ -1 +1 @@
1
- {"version":3,"file":"tree-view.stories.js","sourceRoot":"","sources":["../../../src/components/tree-view/tree-view.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAGlD,MAAM,qBAAqB,GAAG,CAAC,WAAqB,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG;QACf,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW;KAC1D,CAAC;IACF,MAAM,QAAQ,GAAwB,EAAE,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG;IACjC,0BAA0B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACxD,2BAA2B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACzD,2BAA2B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACzD,0BAA0B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACxD,4BAA4B,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC3D,CAAC;AAEF,M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4B,CAAC,CAAC,CAAC;IACxF,EAAE,CAAC,gBAAgB,CAAC,6BAA6B,EAAE,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC1F,EAAE,CAAC,gBAAgB,CAAC,6BAA6B,EAAE,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC1F,EAAE,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,MAAM,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACxF,EAAE,CAAC,gBAAgB,CAAC,8BAA8B,EAAE,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE5F,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,gBAAgB,CAAC,IAAI,GAAG;IACtB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,WAAW;CAC3B,CAAC;AAEF,gBAAgB,CAAC,SAAS,GAAG,iCAAiC,CAAC;AAC/D,gBAAgB,CAAC,UAAU,GAAG;IAC5B,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;CAC5B,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport type { Meta, StoryFn } from '@storybook/html';\n\nconst hideAllControlsExcept = (allowedKeys: string[]) => {\n const allProps = [\n 'label', 'disableAllItems', 'expandAllItems', 'ariaLabel'\n ];\n const argTypes: Record<string, any> = {};\n for (const prop of allProps) {\n if (!allowedKeys.includes(prop)) {\n argTypes[prop] = { table: { disable: true } };\n }\n }\n return argTypes;\n};\n\nconst disableCustomEventControls = {\n ifxTreeViewExpandAllChange: { table: { disable: true } },\n ifxTreeViewDisableAllChange: { table: { disable: true } },\n ifxTreeViewItemExpandChange: { table: { disable: true } },\n ifxTreeViewItemCheckChange: { table: { disable: true } },\n ifxTreeViewItemDisableChange: { table: { disable: true } }\n};\n\nconst meta: Meta = {\n title: 'Components/Tree View',\n tags: ['autodocs'],\n parameters: {\n controls: { expanded: true },\n docs: {\n description: {\n component: 'Tree View component with nested items, checkboxes, keyboard navigation, and accessibility.',\n },\n },\n },\n argTypes: {\n // --- FUNCTION ---\n disableAllItems: {\n control: 'boolean',\n description: 'Disables all tree items.',\n table: { category: 'Function', defaultValue: { summary: 'false' } },\n },\n expandAllItems: {\n control: 'boolean',\n description: 'Expands all tree items.',\n table: { category: 'Function', defaultValue: { summary: 'false' } },\n },\n initiallyExpanded: {\n table: { category: 'Function', type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },\n description: 'Expands this tree item initially (set as attribute on the item). No interactive control.',\n control: false,\n },\n disableItem: {\n table: { category: 'Function', type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },\n description: 'Disables this tree item (set as attribute on the item). No interactive control.',\n control: false,\n },\n\n // --- Label ---\n label: {\n control: 'text',\n description: 'Label / Heading for tree view.',\n table: { category: 'Label', defaultValue: { summary: 'false' } },\n },\n\n // --- ARIA LABELS ---\n ariaLabel: {\n control: 'text',\n description: 'ARIA label for the tree view.',\n table: { category: 'Aria Labels', defaultValue: { summary: 'Tree View' } },\n },\n ariaLabelItem: {\n control: 'text',\n description: 'ARIA label for all tree view items.',\n table: { category: 'Aria Labels', defaultValue: { summary: 'Tree Item' } },\n },\n\n // --- CUSTOM EVENTS ---\n ifxTreeViewExpandAllChange: {\n action: 'ifxTreeViewExpandAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when expandAllItems changes.',\n },\n ifxTreeViewDisableAllChange: {\n action: 'ifxTreeViewDisableAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when disableAllItems changes.',\n },\n ifxTreeViewItemExpandChange: {\n action: 'ifxTreeViewItemExpandChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is expanded/collapsed.',\n },\n ifxTreeViewItemCheckChange: {\n action: 'ifxTreeViewItemCheckChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is checked/unchecked.',\n },\n ifxTreeViewItemDisableChange: {\n action: 'ifxTreeViewItemDisableChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is disabled/enabled.',\n },\n }\n};\n\nexport default meta;\n\nconst BaseTemplate: StoryFn = (args) => {\n const el = document.createElement('ifx-tree-view');\n if (args.label) el.setAttribute('label', args.label);\n el.setAttribute('aria-label', args.ariaLabel);\n\n if (args.disableAllItems) el.setAttribute('disable-all-items', 'true');\n else el.removeAttribute('disable-all-items');\n\n if (args.expandAllItems) el.setAttribute('expand-all-items', 'true');\n else el.removeAttribute('expand-all-items');\n\n const ariaLabelItemAttr = args.ariaLabelItem\n ? `aria-label=\"${args.ariaLabelItem}\"`\n : '';\n\n el.innerHTML = `\n <ifx-tree-view-item label=\"Root Folder\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"Subfolder 1\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"File at root.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Another Root Folder\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File A.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File B.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Single File\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n `;\n\n el.addEventListener('ifxTreeViewExpandAllChange', action('ifxTreeViewExpandAllChange'));\n el.addEventListener('ifxTreeViewDisableAllChange', action('ifxTreeViewDisableAllChange'));\n el.addEventListener('ifxTreeViewItemExpandChange', action('ifxTreeViewItemExpandChange'));\n el.addEventListener('ifxTreeViewItemCheckChange', action('ifxTreeViewItemCheckChange'));\n el.addEventListener('ifxTreeViewItemDisableChange', action('ifxTreeViewItemDisableChange'));\n\n return el;\n};\n\nexport const Default = BaseTemplate.bind({});\nDefault.args = {\n disableAllItems: false,\n expandAllItems: false,\n label: 'Tree Example',\n ariaLabel: 'Tree View',\n ariaLabelItem: 'Tree Item',\n};\n\nDefault.argTypes = {\n ...hideAllControlsExcept(['label', 'disableAllItems', 'expandAllItems', 'ariaLabel']),\n ...disableCustomEventControls,\n\n ifxTreeViewExpandAllChange: {\n action: 'ifxTreeViewExpandAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when expandAllItems changes.',\n },\n ifxTreeViewDisableAllChange: {\n action: 'ifxTreeViewDisableAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when disableAllItems changes.',\n },\n ifxTreeViewItemExpandChange: {\n action: 'ifxTreeViewItemExpandChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is expanded/collapsed.',\n },\n ifxTreeViewItemCheckChange: {\n action: 'ifxTreeViewItemCheckChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is checked/unchecked.',\n },\n ifxTreeViewItemDisableChange: {\n action: 'ifxTreeViewItemDisableChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is disabled/enabled.',\n },\n};\n\nexport const ContainerDemo: StoryFn = (args) => {\n const ariaLabelItemAttr = args.ariaLabelItem\n ? `aria-label=\"${args.ariaLabelItem}\"`\n : '';\n\n\n const wrapper = document.createElement('div');\n wrapper.style.maxWidth = '225px';\n wrapper.style.border = '1px solid #ccc';\n wrapper.style.padding = '8px';\n wrapper.style.overflow = 'auto';\n\n const el = document.createElement('ifx-tree-view');\n el.setAttribute('label', args.label);\n el.setAttribute('aria-label', args.ariaLabel);\n\n if (args.disableAllItems) el.setAttribute('disable-all-items', 'true');\n if (args.expandAllItems) el.setAttribute('expand-all-items', 'true');\n\n el.innerHTML = `\n <ifx-tree-view-item label=\"Root Folder\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"Subfolder 1\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"File at root.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Another Root Folder\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File A.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File B.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Single File\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n `;\n\n el.addEventListener('ifxTreeViewExpandAllChange', action('ifxTreeViewExpandAllChange'));\n el.addEventListener('ifxTreeViewDisableAllChange', action('ifxTreeViewDisableAllChange'));\n el.addEventListener('ifxTreeViewItemExpandChange', action('ifxTreeViewItemExpandChange'));\n el.addEventListener('ifxTreeViewItemCheckChange', action('ifxTreeViewItemCheckChange'));\n el.addEventListener('ifxTreeViewItemDisableChange', action('ifxTreeViewItemDisableChange'));\n\n wrapper.appendChild(el);\n return wrapper;\n};\n\nContainerDemo.args = {\n disableAllItems: false,\n expandAllItems: false,\n label: 'Tree Example',\n ariaLabel: 'Tree View',\n ariaLabelItem: 'Tree Item',\n};\n\nContainerDemo.storyName = 'TreeView with scrollbar';\nContainerDemo.parameters = {\n controls: { disable: true }\n};\n\nexport const SingleItemStates: StoryFn = (args) => {\n const el = document.createElement('ifx-tree-view');\n el.setAttribute('aria-label', args.ariaLabel);\n\n const ariaLabelItemAttr = args.ariaLabelItem\n ? `aria-label=\"${args.ariaLabelItem}\"`\n : '';\n\n el.innerHTML = `\n <ifx-tree-view-item label=\"File\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File disabled\" ${ariaLabelItemAttr} disable-item=\"true\"></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Folder initially expanded\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File disabled\" disable-item=\"true\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Normal Item\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Normal Item\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n `;\n\n el.addEventListener('ifxTreeViewExpandAllChange', action('ifxTreeViewExpandAllChange'));\n el.addEventListener('ifxTreeViewDisableAllChange', action('ifxTreeViewDisableAllChange'));\n el.addEventListener('ifxTreeViewItemExpandChange', action('ifxTreeViewItemExpandChange'));\n el.addEventListener('ifxTreeViewItemCheckChange', action('ifxTreeViewItemCheckChange'));\n el.addEventListener('ifxTreeViewItemDisableChange', action('ifxTreeViewItemDisableChange'));\n\n return el;\n};\n\nSingleItemStates.args = {\n ariaLabel: 'Tree View',\n ariaLabelItem: 'Tree Item',\n};\n\nSingleItemStates.storyName = 'Single Item Expanded & disabled';\nSingleItemStates.parameters = {\n controls: { disable: true }\n};\n"]}
1
+ {"version":3,"file":"tree-view.stories.js","sourceRoot":"","sources":["../../../src/components/tree-view/tree-view.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;A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AiB;gDACR,iBAAiB;sFACqB,iBAAiB;yCAC9D,iBAAiB;sEACY,iBAAiB;;8CAEzC,iBAAiB;8CACjB,iBAAiB;GAC5D,CAAC;IAEF,EAAE,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,MAAM,CAAC,4BAA4B,CAAC,CAAC,CAAC;IACxF,EAAE,CAAC,gBAAgB,CAAC,6BAA6B,EAAE,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC1F,EAAE,CAAC,gBAAgB,CAAC,6BAA6B,EAAE,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC;IAC1F,EAAE,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,KAAK,EAAE,EAAE;QAC1D,MAAM,WAAW,GAAG,KAAoB,CAAC;QACzC,MAAM,CAAC,4BAA4B,CAAC,CAAC;YACnC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,OAAO;YACnC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,aAAa;YAC/C,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE;SAChE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,gBAAgB,CAAC,8BAA8B,EAAE,MAAM,CAAC,8BAA8B,CAAC,CAAC,CAAC;IAE5F,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC;AAEF,gBAAgB,CAAC,IAAI,GAAG;IACtB,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,WAAW;CAC3B,CAAC;AAEF,gBAAgB,CAAC,SAAS,GAAG,iCAAiC,CAAC;AAC/D,gBAAgB,CAAC,UAAU,GAAG;IAC5B,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;CAC5B,CAAC","sourcesContent":["import { action } from '@storybook/addon-actions';\nimport type { Meta, StoryFn } from '@storybook/html';\n\nconst hideAllControlsExcept = (allowedKeys: string[]) => {\n const allProps = [\n 'label', 'disableAllItems', 'expandAllItems', 'ariaLabel'\n ];\n const argTypes: Record<string, any> = {};\n for (const prop of allProps) {\n if (!allowedKeys.includes(prop)) {\n argTypes[prop] = { table: { disable: true } };\n }\n }\n return argTypes;\n};\n\nconst disableCustomEventControls = {\n ifxTreeViewExpandAllChange: { table: { disable: true } },\n ifxTreeViewDisableAllChange: { table: { disable: true } },\n ifxTreeViewItemExpandChange: { table: { disable: true } },\n ifxTreeViewItemCheckChange: { table: { disable: true } },\n ifxTreeViewItemDisableChange: { table: { disable: true } }\n};\n\nconst meta: Meta = {\n title: 'Components/Tree View',\n tags: ['autodocs'],\n parameters: {\n controls: { expanded: true },\n docs: {\n description: {\n component: 'Tree View component with nested items, checkboxes, keyboard navigation, and accessibility.',\n },\n },\n },\n argTypes: {\n // --- FUNCTION ---\n disableAllItems: {\n control: 'boolean',\n description: 'Disables all tree items.',\n table: { category: 'Function', defaultValue: { summary: 'false' } },\n },\n expandAllItems: {\n control: 'boolean',\n description: 'Expands all tree items.',\n table: { category: 'Function', defaultValue: { summary: 'false' } },\n },\n initiallyExpanded: {\n table: { category: 'Function', type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },\n description: 'Expands this tree item initially (set as attribute on the item). No interactive control.',\n control: false,\n },\n disableItem: {\n table: { category: 'Function', type: { summary: 'boolean' }, defaultValue: { summary: 'false' } },\n description: 'Disables this tree item (set as attribute on the item). No interactive control.',\n control: false,\n },\n\n // --- Label ---\n label: {\n control: 'text',\n description: 'Label / Heading for tree view.',\n table: { category: 'Label', defaultValue: { summary: 'false' } },\n },\n\n // --- ARIA LABELS ---\n ariaLabel: {\n control: 'text',\n description: 'ARIA label for the tree view.',\n table: { category: 'Aria Labels', defaultValue: { summary: 'Tree View' } },\n },\n ariaLabelItem: {\n control: 'text',\n description: 'ARIA label for all tree view items.',\n table: { category: 'Aria Labels', defaultValue: { summary: 'Tree Item' } },\n },\n\n // --- CUSTOM EVENTS ---\n ifxTreeViewExpandAllChange: {\n action: 'ifxTreeViewExpandAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when expandAllItems changes.',\n },\n ifxTreeViewDisableAllChange: {\n action: 'ifxTreeViewDisableAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when disableAllItems changes.',\n },\n ifxTreeViewItemExpandChange: {\n action: 'ifxTreeViewItemExpandChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is expanded/collapsed.',\n },\n ifxTreeViewItemCheckChange: {\n action: 'ifxTreeViewItemCheckChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is checked/unchecked. For parent items, includes affectedChildItems array with all affected descendants.',\n },\n ifxTreeViewItemDisableChange: {\n action: 'ifxTreeViewItemDisableChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is disabled/enabled.',\n },\n }\n};\n\nexport default meta;\n\nconst BaseTemplate: StoryFn = (args) => {\n const el = document.createElement('ifx-tree-view');\n if (args.label) el.setAttribute('label', args.label);\n el.setAttribute('aria-label', args.ariaLabel);\n\n if (args.disableAllItems) el.setAttribute('disable-all-items', 'true');\n else el.removeAttribute('disable-all-items');\n\n if (args.expandAllItems) el.setAttribute('expand-all-items', 'true');\n else el.removeAttribute('expand-all-items');\n\n const ariaLabelItemAttr = args.ariaLabelItem\n ? `aria-label=\"${args.ariaLabelItem}\"`\n : '';\n\n el.innerHTML = `\n <ifx-tree-view-item label=\"Root Folder\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"Subfolder 1\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"File at root.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Another Root Folder\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File A.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File B.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Single File\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n `;\n\n el.addEventListener('ifxTreeViewExpandAllChange', action('ifxTreeViewExpandAllChange'));\n el.addEventListener('ifxTreeViewDisableAllChange', action('ifxTreeViewDisableAllChange'));\n el.addEventListener('ifxTreeViewItemExpandChange', action('ifxTreeViewItemExpandChange'));\n el.addEventListener('ifxTreeViewItemCheckChange', (event) => {\n const customEvent = event as CustomEvent;\n action('ifxTreeViewItemCheckChange')({\n checked: customEvent.detail.checked,\n indeterminate: customEvent.detail.indeterminate,\n affectedChildItems: customEvent.detail.affectedChildItems || []\n });\n });\n el.addEventListener('ifxTreeViewItemDisableChange', action('ifxTreeViewItemDisableChange'));\n\n return el;\n};\n\nexport const Default = BaseTemplate.bind({});\nDefault.args = {\n disableAllItems: false,\n expandAllItems: false,\n label: 'Tree Example',\n ariaLabel: 'Tree View',\n ariaLabelItem: 'Tree Item',\n};\n\nDefault.argTypes = {\n ...hideAllControlsExcept(['label', 'disableAllItems', 'expandAllItems', 'ariaLabel']),\n ...disableCustomEventControls,\n\n ifxTreeViewExpandAllChange: {\n action: 'ifxTreeViewExpandAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when expandAllItems changes.',\n },\n ifxTreeViewDisableAllChange: {\n action: 'ifxTreeViewDisableAllChange',\n table: { category: 'Custom Events' },\n description: 'Fired when disableAllItems changes.',\n },\n ifxTreeViewItemExpandChange: {\n action: 'ifxTreeViewItemExpandChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is expanded/collapsed.',\n },\n ifxTreeViewItemCheckChange: {\n action: 'ifxTreeViewItemCheckChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is checked/unchecked. For parent items, includes affectedChildItems array with all affected descendants.',\n },\n ifxTreeViewItemDisableChange: {\n action: 'ifxTreeViewItemDisableChange',\n table: { category: 'Custom Events' },\n description: 'Fired when a tree item is disabled/enabled.',\n },\n};\n\nexport const ContainerDemo: StoryFn = (args) => {\n const ariaLabelItemAttr = args.ariaLabelItem\n ? `aria-label=\"${args.ariaLabelItem}\"`\n : '';\n\n\n const wrapper = document.createElement('div');\n wrapper.style.maxWidth = '225px';\n wrapper.style.border = '1px solid #ccc';\n wrapper.style.padding = '8px';\n wrapper.style.overflow = 'auto';\n\n const el = document.createElement('ifx-tree-view');\n el.setAttribute('label', args.label);\n el.setAttribute('aria-label', args.ariaLabel);\n\n if (args.disableAllItems) el.setAttribute('disable-all-items', 'true');\n if (args.expandAllItems) el.setAttribute('expand-all-items', 'true');\n\n el.innerHTML = `\n <ifx-tree-view-item label=\"Root Folder\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"Subfolder 1\" icon=\"folder\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File 1-1-2.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Subfolder 2-1-1\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File 2-1-1-1.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"File at root.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Another Root Folder\" icon=\"folder\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File A.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File B.txt\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Single File\" icon=\"file\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n `;\n\n el.addEventListener('ifxTreeViewExpandAllChange', action('ifxTreeViewExpandAllChange'));\n el.addEventListener('ifxTreeViewDisableAllChange', action('ifxTreeViewDisableAllChange'));\n el.addEventListener('ifxTreeViewItemExpandChange', action('ifxTreeViewItemExpandChange'));\n el.addEventListener('ifxTreeViewItemCheckChange', (event) => {\n const customEvent = event as CustomEvent;\n action('ifxTreeViewItemCheckChange')({\n checked: customEvent.detail.checked,\n indeterminate: customEvent.detail.indeterminate,\n affectedChildItems: customEvent.detail.affectedChildItems || []\n });\n });\n el.addEventListener('ifxTreeViewItemDisableChange', action('ifxTreeViewItemDisableChange'));\n\n wrapper.appendChild(el);\n return wrapper;\n};\n\nContainerDemo.args = {\n disableAllItems: false,\n expandAllItems: false,\n label: 'Tree Example',\n ariaLabel: 'Tree View',\n ariaLabelItem: 'Tree Item',\n};\n\nContainerDemo.storyName = 'TreeView with scrollbar';\nContainerDemo.parameters = {\n controls: { disable: true }\n};\n\nexport const SingleItemStates: StoryFn = (args) => {\n const el = document.createElement('ifx-tree-view');\n el.setAttribute('aria-label', args.ariaLabel);\n\n const ariaLabelItemAttr = args.ariaLabelItem\n ? `aria-label=\"${args.ariaLabelItem}\"`\n : '';\n\n el.innerHTML = `\n <ifx-tree-view-item label=\"File\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File disabled\" ${ariaLabelItemAttr} disable-item=\"true\"></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Folder initially expanded\" initially-expanded=\"true\" ${ariaLabelItemAttr}>\n <ifx-tree-view-item label=\"File\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"File disabled\" disable-item=\"true\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n </ifx-tree-view-item>\n <ifx-tree-view-item label=\"Normal Item\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n <ifx-tree-view-item label=\"Normal Item\" ${ariaLabelItemAttr}></ifx-tree-view-item>\n `;\n\n el.addEventListener('ifxTreeViewExpandAllChange', action('ifxTreeViewExpandAllChange'));\n el.addEventListener('ifxTreeViewDisableAllChange', action('ifxTreeViewDisableAllChange'));\n el.addEventListener('ifxTreeViewItemExpandChange', action('ifxTreeViewItemExpandChange'));\n el.addEventListener('ifxTreeViewItemCheckChange', (event) => {\n const customEvent = event as CustomEvent;\n action('ifxTreeViewItemCheckChange')({\n checked: customEvent.detail.checked,\n indeterminate: customEvent.detail.indeterminate,\n affectedChildItems: customEvent.detail.affectedChildItems || []\n });\n });\n el.addEventListener('ifxTreeViewItemDisableChange', action('ifxTreeViewItemDisableChange'));\n\n return el;\n};\n\nSingleItemStates.args = {\n ariaLabel: 'Tree View',\n ariaLabelItem: 'Tree Item',\n};\n\nSingleItemStates.storyName = 'Single Item Expanded & disabled';\nSingleItemStates.parameters = {\n controls: { disable: true }\n};\n"]}
@@ -155,6 +155,7 @@ const TreeViewItem = /*@__PURE__*/ proxyCustomElement(class TreeViewItem extends
155
155
  if (this.shouldExpandFromParent()) {
156
156
  this.expandAllDescendants();
157
157
  }
158
+ this.host['__stencil_instance'] = this;
158
159
  }
159
160
  shouldExpandFromParent() {
160
161
  let parent = this.host.parentElement;
@@ -228,12 +229,38 @@ const TreeViewItem = /*@__PURE__*/ proxyCustomElement(class TreeViewItem extends
228
229
  setupEventListeners() {
229
230
  this.host.addEventListener('internal-check-state-change', this.handleStateChange);
230
231
  }
231
- async updateCheckState(checked) {
232
+ async updateCheckState(checked, fromParent = false) {
232
233
  if (this.disabled)
233
234
  return;
234
- this.setNodeState({ isChecked: checked, partialChecked: false });
235
- await this.updateChildrenState(checked);
236
- this.updateParentState();
235
+ if (!fromParent && this.hasChildren) {
236
+ const affected = this.collectDescendantStates(checked);
237
+ this.setNodeState({ isChecked: checked, partialChecked: false }, false);
238
+ await this.updateChildrenSilently(checked);
239
+ this.ifxTreeViewItemCheckChange.emit({
240
+ checked,
241
+ indeterminate: false,
242
+ affectedChildItems: affected,
243
+ });
244
+ this.updateParentState();
245
+ }
246
+ else if (fromParent) {
247
+ this.setNodeState({ isChecked: checked, partialChecked: false }, false);
248
+ }
249
+ else {
250
+ this.setNodeState({ isChecked: checked, partialChecked: false });
251
+ await this.updateChildrenState(checked);
252
+ this.updateParentState();
253
+ }
254
+ }
255
+ async updateChildrenSilently(checked) {
256
+ const children = this.findChildren();
257
+ for (const child of children) {
258
+ const childInstance = child['__stencil_instance'];
259
+ if (childInstance) {
260
+ childInstance.setNodeState({ isChecked: checked, partialChecked: false }, false);
261
+ await childInstance.updateChildrenSilently(checked);
262
+ }
263
+ }
237
264
  }
238
265
  handleExpandedChange(newValue) {
239
266
  this.ifxTreeViewItemExpandChange.emit(newValue);
@@ -241,13 +268,42 @@ const TreeViewItem = /*@__PURE__*/ proxyCustomElement(class TreeViewItem extends
241
268
  handleDisableItemChange(newValue) {
242
269
  this.ifxTreeViewItemDisableChange.emit(newValue);
243
270
  }
244
- setNodeState(state) {
271
+ setNodeState(state, emitEvent = true) {
245
272
  this.isChecked = state.isChecked;
246
273
  this.partialChecked = state.partialChecked;
247
- this.ifxTreeViewItemCheckChange.emit({
248
- checked: this.isChecked,
249
- indeterminate: this.partialChecked,
250
- });
274
+ if (emitEvent) {
275
+ this.ifxTreeViewItemCheckChange.emit({
276
+ checked: this.isChecked,
277
+ indeterminate: this.partialChecked,
278
+ });
279
+ }
280
+ }
281
+ collectDescendantStates(checked) {
282
+ const descendants = [];
283
+ const collect = (el) => {
284
+ var _a, _b;
285
+ let instance = null;
286
+ if (el === this.host) {
287
+ instance = this;
288
+ }
289
+ else if (el['__stencil_instance']) {
290
+ instance = el['__stencil_instance'];
291
+ }
292
+ const label = (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.label) !== null && _a !== void 0 ? _a : el.label) !== null && _b !== void 0 ? _b : '';
293
+ descendants.push({
294
+ label,
295
+ checked,
296
+ indeterminate: false,
297
+ });
298
+ Array.from(el.children)
299
+ .forEach(child => {
300
+ if (child.tagName === 'IFX-TREE-VIEW-ITEM') {
301
+ collect(child);
302
+ }
303
+ });
304
+ };
305
+ collect(this.host);
306
+ return descendants;
251
307
  }
252
308
  async updateChildrenState(checked) {
253
309
  const children = this.findChildren();
@@ -294,12 +350,12 @@ const TreeViewItem = /*@__PURE__*/ proxyCustomElement(class TreeViewItem extends
294
350
  };
295
351
  }
296
352
  render() {
297
- return (h("div", { key: '10a31a82078320a73d026ec8d42ae23d78049a9b', class: {
353
+ return (h("div", { key: 'a626535eaa7807016da9b015daecc1c4ecba4283', class: {
298
354
  'tree-item': true,
299
355
  'tree-item--expanded': this.isExpanded,
300
356
  'tree-item--has-children': this.hasChildren,
301
357
  'tree-item--disabled': this.disabled,
302
- }, role: "treeitem", "aria-expanded": this.isExpanded ? 'true' : 'false', "data-level": this.level, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel }, h("div", { key: 'ad1dcf1ca93fd3f35f00d411e8740bfc54dc7c9f', class: "tree-item__content" }, this.renderCheckbox(), this.renderHeader()), this.isExpanded && h("div", { key: '1023010ffb83954bc852cafc18f3b79003ffbf3e', class: "tree-item__children" }, h("slot", { key: 'c7cd0a61015b29a99b963576c8bc3fd0725541f3' }))));
358
+ }, role: "treeitem", "aria-expanded": this.isExpanded ? 'true' : 'false', "data-level": this.level, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel }, h("div", { key: 'e6e9bf260e0c1f5584826189ae44de0abbeed4e0', class: "tree-item__content" }, this.renderCheckbox(), this.renderHeader()), this.isExpanded && h("div", { key: 'e24cad37fc29633023d9e2b7216c2281056fc76e', class: "tree-item__children" }, h("slot", { key: '65d7afa55a28667bed348cafd784636256cd23d5' }))));
303
359
  }
304
360
  renderHeader() {
305
361
  return (h("div", { class: "tree-item__header", style: { paddingLeft: `${this.level * 24 + 10}px` }, onClick: this.handleHeaderClick, tabIndex: -1, "aria-disabled": this.disabled ? 'true' : undefined }, this.renderControls()));
@@ -1 +1 @@
1
- {"file":"ifx-tree-view-item.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,i/DAAi/D,CAAC;AAC1gE,8BAAe,eAAe;;MCajB,YAAY;IALzB;;;;;;;QAQ0C,aAAQ,GAAY,KAAK,CAAC;QAC1D,sBAAiB,GAAY,KAAK,CAAC;QACnC,gBAAW,GAAY,KAAK,CAAC;QAOpB,gBAAW,GAAY,KAAK,CAAC;QAC7B,cAAS,GAAY,KAAK,CAAC;QAC3B,mBAAc,GAAY,KAAK,CAAC;QAChC,UAAK,GAAW,CAAC,CAAC;QAClB,oBAAe,GAAY,KAAK,CAAC;QACjC,mBAAc,GAAY,KAAK,CAAC;QAUzC,iBAAY,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;aACxD,MAAM,CAAC,CAAC,KAAK,KACZ,KAAK,YAAYA,CAAW,IAAI,KAAK,CAAC,OAAO,KAAK,oBAAoB,CACvE,CAAC;QAEI,uBAAkB,GAAG;YAC3B,IAAI,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;YAChD,OAAO,MAAM,EAAE;gBACb,IAAI,MAAM,CAAC,OAAO,KAAK,oBAAoB;oBAAE,KAAK,EAAE,CAAC;gBACrD,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;aAC/B;YACD,OAAO,KAAK,CAAC;SACd,CAAC;QAmGM,sBAAiB,GAAG,CAAC,KAAkB;YAC7C,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAC1B,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SAC7C,CAAC;QAE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;;;;;;;","names":["HTMLElement"],"sources":["src/components/tree-view/tree-view-item.scss?tag=ifx-tree-view-item&encapsulation=shadow","src/components/tree-view/tree-view-item.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n\n.tree-item {\n position: relative;\n cursor: pointer;\n list-style: none;\n\n &.tree-item--expanded {\n position: relative;\n }\n\n &.tree-item--has-children {\n position: relative;\n\n .tree-item__header > .tree-item__chevron-container {\n display: flex;\n }\n\n &.tree-item--expanded {\n .tree-item__header > .tree-item__chevron-container::after {\n display: block;\n }\n }\n }\n\n &--disabled {\n cursor: not-allowed;\n pointer-events: none;\n color: tokens.$ifxColorEngineering300;\n }\n\n &__content {\n display: flex;\n flex-direction: row;\n\n &:hover {\n .tree-item__checkbox-container,\n .tree-item__header {\n background-color: tokens.$ifxColorEngineering100;\n }\n }\n }\n\n &__checkbox-container {\n position: sticky;\n left: 0;\n z-index: 10;\n padding: tokens.$ifxSpace50;\n background-color: tokens.$ifxColorBaseWhite;\n }\n\n &__header {\n flex-grow: 1;\n display: flex;\n align-items: center;\n white-space: nowrap;\n height: tokens.$ifxSize250;\n padding-top: tokens.$ifxSpace50;\n padding-right: tokens.$ifxSpace200;\n padding-bottom: tokens.$ifxSpace50;\n padding-left: tokens.$ifxSpace100;\n }\n\n &__chevron-container {\n display: none;\n align-items: center;\n margin-right: tokens.$ifxSpace100;\n height: tokens.$ifxSize250;\n\n &::after {\n --height-line-start: 28px;\n\n display: none;\n content: '';\n position: absolute;\n z-index: 1;\n top: var(--height-line-start);\n left: auto;\n margin-left: tokens.$ifxSpace100;\n width: tokens.$ifxSize12;\n height: calc(100% - var(--height-line-start));\n background-color: tokens.$ifxColorEngineering200;\n\n .tree-item--disabled & {\n color: tokens.$ifxColorEngineering200;\n }\n }\n }\n\n &__chevron {\n &.chevron-down {\n transform: rotate(90deg);\n }\n\n &.chevron-right {\n transform: rotate(0);\n }\n }\n\n &__label-icon-container {\n display: flex;\n align-items: center;\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n border-radius: tokens.$ifxBorderRadius12;\n }\n }\n\n &__icon-container {\n position: relative;\n width: tokens.$ifxSize200;\n height: tokens.$ifxSize200;\n\n ifx-icon {\n position: absolute;\n left: 0;\n top: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n\n &.icon--hidden {\n opacity: 0;\n }\n }\n }\n\n &__label {\n padding-left: tokens.$ifxSpace100;\n }\n\n &__children {\n display: none;\n\n .tree-item[aria-expanded=\"true\"] > & {\n display: block;\n }\n }\n}\n\n","import { Component, h, Prop, State, Element, Fragment, Event, EventEmitter, Watch } from '@stencil/core';\n\ninterface TreeState {\n isChecked: boolean;\n partialChecked: boolean;\n}\n\ntype HTMLIfxTreeViewItemElement = HTMLElement & { componentOnReady: () => Promise<unknown> };\n\n@Component({\n tag: 'ifx-tree-view-item',\n styleUrl: 'tree-view-item.scss',\n shadow: true,\n})\nexport class TreeViewItem {\n @Element() host: HTMLElement;\n @Prop() label: string;\n @Prop({ reflect: true, mutable: true }) expanded: boolean = false;\n @Prop() initiallyExpanded: boolean = false;\n @Prop() disableItem: boolean = false;\n @Prop() ariaLabel: string | null;\n\n @Event() ifxTreeViewItemExpandChange: EventEmitter<boolean>;\n @Event() ifxTreeViewItemCheckChange: EventEmitter<{ checked: boolean; indeterminate: boolean }>;\n @Event() ifxTreeViewItemDisableChange: EventEmitter<boolean>;\n\n @State() private hasChildren: boolean = false;\n @State() private isChecked: boolean = false;\n @State() private partialChecked: boolean = false;\n @State() private level: number = 0;\n @State() private disableAllItems: boolean = false;\n @State() private expandAllItems: boolean = false;\n\n private get disabled() {\n return this.disableAllItems || this.disableItem;\n }\n\n private get isExpanded() {\n return this.expandAllItems || this.expanded;\n }\n\n private findChildren = () => Array.from(this.host.children)\n .filter((child): child is HTMLElement =>\n child instanceof HTMLElement && child.tagName === 'IFX-TREE-VIEW-ITEM'\n );\n\n private calculateNodeLevel = (): number => {\n let level = 0, parent = this.host.parentElement;\n while (parent) {\n if (parent.tagName === 'IFX-TREE-VIEW-ITEM') level++;\n parent = parent.parentElement;\n }\n return level;\n };\n\n componentWillLoad() {\n this.initializeNode();\n this.setupEventListeners();\n }\n\n componentDidLoad() {\n this.observeDisableAllItems();\n this.observeExpandAllItems();\n if (this.shouldExpandFromParent()) {\n this.expandAllDescendants();\n }\n }\n\n private shouldExpandFromParent(): boolean {\n let parent = this.host.parentElement;\n while (parent) {\n if (\n parent.tagName === 'IFX-TREE-VIEW' &&\n (parent.hasAttribute('expand-all-items') || parent.hasAttribute('data-expand-all-items'))\n ) {\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n }\n\n private expandAllDescendants() {\n this.expanded = true;\n const children = this.findChildren();\n for (const child of children) {\n if (typeof (child as any).expanded !== 'undefined') {\n (child as any).expanded = true;\n }\n if (typeof (child as any).expandAllDescendants === 'function') {\n (child as any).expandAllDescendants();\n }\n }\n }\n\n private observeDisableAllItems() {\n let parent = this.host.parentElement;\n while (parent) {\n if (parent.tagName === 'IFX-TREE-VIEW') {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'disable-all-items'\n ) {\n const disableAll = (parent as any).disableAllItems;\n this.disableAllItems = !!disableAll || parent.hasAttribute('disable-all-items');\n }\n }\n });\n observer.observe(parent, { attributes: true });\n const disableAll = (parent as any).disableAllItems;\n this.disableAllItems = !!disableAll || parent.hasAttribute('disable-all-items');\n break;\n }\n parent = parent.parentElement;\n }\n }\n\n private observeExpandAllItems() {\n let parent = this.host.parentElement;\n while (parent) {\n if (parent.tagName === 'IFX-TREE-VIEW' || parent.hasAttribute('data-expand-all-items')) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'data-expand-all-items'\n ) {\n this.expandAllItems = parent.hasAttribute('data-expand-all-items');\n }\n }\n });\n observer.observe(parent, { attributes: true });\n this.expandAllItems = parent.hasAttribute('data-expand-all-items');\n break;\n }\n parent = parent.parentElement;\n }\n }\n\n private initializeNode() {\n this.expanded = this.initiallyExpanded;\n this.hasChildren = this.findChildren().length > 0;\n this.level = this.calculateNodeLevel();\n this.host.setAttribute('data-level', this.level.toString());\n }\n\n private setupEventListeners() {\n this.host.addEventListener('internal-check-state-change', this.handleStateChange);\n }\n\n private handleStateChange = (event: CustomEvent) => {\n if (this.disabled) return;\n event.stopPropagation();\n this.updateCheckState(event.detail.checked);\n };\n\n private handleCheckboxChange = (event: CustomEvent) => {\n if (this.disabled) return;\n this.updateCheckState(event.detail?.checked ?? !this.isChecked);\n };\n\n private handleHeaderClick = ({ target }: MouseEvent) => {\n if (this.disabled) return;\n if (!(target as HTMLElement).closest('.tree-item__checkbox-container, .tree-item__chevron-container')) {\n this.updateCheckState(!this.isChecked);\n }\n };\n\n private async updateCheckState(checked: boolean) {\n if (this.disabled) return;\n this.setNodeState({ isChecked: checked, partialChecked: false });\n await this.updateChildrenState(checked);\n this.updateParentState();\n }\n\n @Watch('expanded')\n handleExpandedChange(newValue: boolean) {\n this.ifxTreeViewItemExpandChange.emit(newValue);\n }\n\n @Watch('disableItem')\n handleDisableItemChange(newValue: boolean) {\n this.ifxTreeViewItemDisableChange.emit(newValue);\n }\n\n private setNodeState(state: TreeState) {\n this.isChecked = state.isChecked;\n this.partialChecked = state.partialChecked;\n this.ifxTreeViewItemCheckChange.emit({\n checked: this.isChecked,\n indeterminate: this.partialChecked,\n });\n }\n\n private async updateChildrenState(checked: boolean) {\n const children = this.findChildren();\n for (const child of children) {\n await (child as HTMLIfxTreeViewItemElement).componentOnReady();\n child.dispatchEvent(new CustomEvent('internal-check-state-change', {\n detail: { checked },\n bubbles: false,\n composed: true\n }));\n }\n }\n\n private findSiblingNodes(parent: HTMLElement): HTMLIfxTreeViewItemElement[] {\n const parentEl = parent.parentElement;\n if (!parentEl) return [];\n return Array.from(\n parentEl.querySelectorAll('ifx-tree-view-item')\n ).map(el => el as HTMLIfxTreeViewItemElement);\n }\n\n private updateParentState() {\n const parent = this.host.parentElement?.closest('ifx-tree-view-item') as HTMLIfxTreeViewItemElement;\n if (!parent) return;\n parent.componentOnReady().then(resolved => {\n const parentNode = resolved as unknown as TreeViewItem;\n if (!parentNode?.updateParentState) return;\n const siblings = this.findSiblingNodes(parent);\n const states = this.calculateSiblingStates(siblings);\n parentNode.setNodeState({\n isChecked: states.allChecked,\n partialChecked: !states.allChecked && states.someChecked\n });\n parentNode.updateParentState();\n });\n }\n\n private calculateSiblingStates(siblings: HTMLIfxTreeViewItemElement[]) {\n return {\n allChecked: siblings.every(sib => (sib as unknown as TreeViewItem).isChecked),\n someChecked: siblings.some(sib => {\n const node = sib as unknown as TreeViewItem;\n return node.isChecked || node.partialChecked;\n })\n };\n }\n\n private toggleExpand = () => {\n if (this.disabled) return;\n this.hasChildren && (this.expanded = !this.expanded);\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n\n const allItems = Array.from(\n this.host\n .closest('ifx-tree-view')\n ?.querySelectorAll('ifx-tree-view-item') || []\n );\n\n const visibleItems = allItems.filter(item => {\n let parent = item.parentElement?.closest('ifx-tree-view-item');\n while (parent) {\n const parentCmp = parent as any;\n if (!(parentCmp.expandAllItems || parentCmp.expanded)) {\n return false;\n }\n parent = parent.parentElement?.closest('ifx-tree-view-item');\n }\n return true;\n });\n\n const currentIndex = visibleItems.findIndex(el => el === this.host);\n\n function focusLabelIcon(el: Element | null) {\n (el as HTMLElement | null)?.focus();\n }\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault();\n let nextIndex = currentIndex + 1;\n while (nextIndex < visibleItems.length) {\n const next = visibleItems[nextIndex] as any;\n if (!next.disabled) {\n focusLabelIcon(next.shadowRoot?.querySelector('.tree-item__label-icon-container'));\n break;\n }\n nextIndex++;\n }\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n let prevIndex = currentIndex - 1;\n while (prevIndex >= 0) {\n const prev = visibleItems[prevIndex] as any;\n if (!prev.disabled) {\n focusLabelIcon(prev.shadowRoot?.querySelector('.tree-item__label-icon-container'));\n break;\n }\n prevIndex--;\n }\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n if (!this.isExpanded && this.hasChildren) {\n this.expanded = true;\n } else if (this.isExpanded && this.hasChildren) {\n const firstChild = this.host.querySelector('ifx-tree-view-item');\n if (firstChild && !(firstChild as any).disabled) {\n focusLabelIcon((firstChild as HTMLElement).shadowRoot?.querySelector('.tree-item__label-icon-container'));\n }\n }\n break;\n }\n case 'ArrowLeft': {\n event.preventDefault();\n if (this.isExpanded && this.hasChildren) {\n this.expanded = false;\n } else {\n const parent = this.host.parentElement?.closest('ifx-tree-view-item');\n if (parent && !(parent as any).disabled) {\n focusLabelIcon((parent as HTMLElement).shadowRoot?.querySelector('.tree-item__label-icon-container'));\n }\n }\n break;\n }\n case ' ':\n case 'Enter': {\n event.preventDefault();\n this.updateCheckState(!this.isChecked);\n break;\n }\n }\n };\n\n render() {\n return (\n <div\n class={{\n 'tree-item': true,\n 'tree-item--expanded': this.isExpanded,\n 'tree-item--has-children': this.hasChildren,\n 'tree-item--disabled': this.disabled,\n }}\n role=\"treeitem\"\n aria-expanded={this.isExpanded ? 'true' : 'false'}\n data-level={this.level}\n aria-disabled={this.disabled ? 'true' : undefined}\n aria-label={this.ariaLabel}\n >\n <div class=\"tree-item__content\">\n {this.renderCheckbox()}\n {this.renderHeader()}\n </div>\n {this.isExpanded && <div class=\"tree-item__children\"><slot/></div>}\n </div>\n );\n }\n\n private renderHeader() {\n return (\n <div\n class=\"tree-item__header\"\n style={{ paddingLeft: `${this.level * 24 + 10}px` }}\n onClick={this.handleHeaderClick}\n tabIndex={-1}\n aria-disabled={this.disabled ? 'true' : undefined}\n >\n {this.renderControls()}\n </div>\n );\n }\n\n private renderCheckbox() {\n return (\n <div class=\"tree-item__checkbox-container\" onClick={e => e.stopPropagation()}>\n <ifx-checkbox\n size='s'\n checked={this.isChecked}\n indeterminate={this.partialChecked}\n onIfxChange={this.handleCheckboxChange}\n disabled={this.disabled}\n />\n </div>\n );\n }\n\n private renderControls() {\n return [\n this.hasChildren && (\n <div class=\"tree-item__chevron-container\" onClick={this.toggleExpand}>\n <ifx-icon class={`tree-item__chevron ${this.isExpanded ? 'chevron-down' : 'chevron-right'}`}\n icon=\"chevron-right-16\"/>\n <div class=\"tree-item__line\"/>\n </div>\n ),\n <div\n class=\"tree-item__label-icon-container\"\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n >\n <div class=\"tree-item__icon-container\">\n {\n this.hasChildren ? (\n <Fragment>\n <ifx-icon class={{'icon--hidden': this.isExpanded}} icon=\"folder-16\"/>\n <ifx-icon class={{'icon--hidden': !this.isExpanded}} icon=\"folder-open-16\"/>\n </Fragment>\n ) : (\n <ifx-icon icon=\"file-16\"/>\n )\n }\n </div>\n <span class=\"tree-item__label\">{this.label}</span>\n </div>\n ];\n }\n}\n"],"version":3}
1
+ {"file":"ifx-tree-view-item.js","mappings":";;;;AAAA,MAAM,eAAe,GAAG,i/DAAi/D,CAAC;AAC1gE,8BAAe,eAAe;;MCmBjB,YAAY;IALzB;;;;;;;QAQ0C,aAAQ,GAAY,KAAK,CAAC;QAC1D,sBAAiB,GAAY,KAAK,CAAC;QACnC,gBAAW,GAAY,KAAK,CAAC;QAOpB,gBAAW,GAAY,KAAK,CAAC;QAC7B,cAAS,GAAY,KAAK,CAAC;QAC3B,mBAAc,GAAY,KAAK,CAAC;QAChC,UAAK,GAAW,CAAC,CAAC;QAClB,oBAAe,GAAY,KAAK,CAAC;QACjC,mBAAc,GAAY,KAAK,CAAC;QAUzC,iBAAY,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;aACxD,MAAM,CAAC,CAAC,KAAK,KACZ,KAAK,YAAYA,CAAW,IAAI,KAAK,CAAC,OAAO,KAAK,oBAAoB,CACvE,CAAC;QAEI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;;;;;;;;;;;;;;;;;;;;","names":["HTMLElement"],"sources":["src/components/tree-view/tree-view-item.scss?tag=ifx-tree-view-item&encapsulation=shadow","src/components/tree-view/tree-view-item.tsx"],"sourcesContent":["@use \"~@infineon/design-system-tokens/dist/tokens\";\n\n.tree-item {\n position: relative;\n cursor: pointer;\n list-style: none;\n\n &.tree-item--expanded {\n position: relative;\n }\n\n &.tree-item--has-children {\n position: relative;\n\n .tree-item__header > .tree-item__chevron-container {\n display: flex;\n }\n\n &.tree-item--expanded {\n .tree-item__header > .tree-item__chevron-container::after {\n display: block;\n }\n }\n }\n\n &--disabled {\n cursor: not-allowed;\n pointer-events: none;\n color: tokens.$ifxColorEngineering300;\n }\n\n &__content {\n display: flex;\n flex-direction: row;\n\n &:hover {\n .tree-item__checkbox-container,\n .tree-item__header {\n background-color: tokens.$ifxColorEngineering100;\n }\n }\n }\n\n &__checkbox-container {\n position: sticky;\n left: 0;\n z-index: 10;\n padding: tokens.$ifxSpace50;\n background-color: tokens.$ifxColorBaseWhite;\n }\n\n &__header {\n flex-grow: 1;\n display: flex;\n align-items: center;\n white-space: nowrap;\n height: tokens.$ifxSize250;\n padding-top: tokens.$ifxSpace50;\n padding-right: tokens.$ifxSpace200;\n padding-bottom: tokens.$ifxSpace50;\n padding-left: tokens.$ifxSpace100;\n }\n\n &__chevron-container {\n display: none;\n align-items: center;\n margin-right: tokens.$ifxSpace100;\n height: tokens.$ifxSize250;\n\n &::after {\n --height-line-start: 28px;\n\n display: none;\n content: '';\n position: absolute;\n z-index: 1;\n top: var(--height-line-start);\n left: auto;\n margin-left: tokens.$ifxSpace100;\n width: tokens.$ifxSize12;\n height: calc(100% - var(--height-line-start));\n background-color: tokens.$ifxColorEngineering200;\n\n .tree-item--disabled & {\n color: tokens.$ifxColorEngineering200;\n }\n }\n }\n\n &__chevron {\n &.chevron-down {\n transform: rotate(90deg);\n }\n\n &.chevron-right {\n transform: rotate(0);\n }\n }\n\n &__label-icon-container {\n display: flex;\n align-items: center;\n\n &:focus {\n outline: none;\n }\n\n &:focus-visible {\n outline: 2px solid tokens.$ifxColorOcean500;\n outline-offset: 2px;\n border-radius: tokens.$ifxBorderRadius12;\n }\n }\n\n &__icon-container {\n position: relative;\n width: tokens.$ifxSize200;\n height: tokens.$ifxSize200;\n\n ifx-icon {\n position: absolute;\n left: 0;\n top: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n\n &.icon--hidden {\n opacity: 0;\n }\n }\n }\n\n &__label {\n padding-left: tokens.$ifxSpace100;\n }\n\n &__children {\n display: none;\n\n .tree-item[aria-expanded=\"true\"] > & {\n display: block;\n }\n }\n}\n\n","import { Component, h, Prop, State, Element, Fragment, Event, EventEmitter, Watch } from '@stencil/core';\n\nexport interface TreeViewCheckChangeEvent {\n checked: boolean;\n indeterminate: boolean;\n affectedChildItems?: Array<{ label: string; checked: boolean; indeterminate: boolean }>;\n}\n\ninterface TreeState {\n isChecked: boolean;\n partialChecked: boolean;\n}\n\ntype HTMLIfxTreeViewItemElement = HTMLElement & { componentOnReady: () => Promise<unknown> };\n\n@Component({\n tag: 'ifx-tree-view-item',\n styleUrl: 'tree-view-item.scss',\n shadow: true,\n})\nexport class TreeViewItem {\n @Element() host: HTMLElement;\n @Prop() label: string;\n @Prop({ reflect: true, mutable: true }) expanded: boolean = false;\n @Prop() initiallyExpanded: boolean = false;\n @Prop() disableItem: boolean = false;\n @Prop() ariaLabel: string | null;\n\n @Event() ifxTreeViewItemExpandChange: EventEmitter<boolean>;\n @Event() ifxTreeViewItemCheckChange: EventEmitter<TreeViewCheckChangeEvent>;\n @Event() ifxTreeViewItemDisableChange: EventEmitter<boolean>;\n\n @State() private hasChildren: boolean = false;\n @State() private isChecked: boolean = false;\n @State() private partialChecked: boolean = false;\n @State() private level: number = 0;\n @State() private disableAllItems: boolean = false;\n @State() private expandAllItems: boolean = false;\n\n private get disabled() {\n return this.disableAllItems || this.disableItem;\n }\n\n private get isExpanded() {\n return this.expandAllItems || this.expanded;\n }\n\n private findChildren = () => Array.from(this.host.children)\n .filter((child): child is HTMLElement =>\n child instanceof HTMLElement && child.tagName === 'IFX-TREE-VIEW-ITEM'\n );\n\n private calculateNodeLevel = (): number => {\n let level = 0, parent = this.host.parentElement;\n while (parent) {\n if (parent.tagName === 'IFX-TREE-VIEW-ITEM') level++;\n parent = parent.parentElement;\n }\n return level;\n };\n\n componentWillLoad() {\n this.initializeNode();\n this.setupEventListeners();\n }\n\n componentDidLoad() {\n this.observeDisableAllItems();\n this.observeExpandAllItems();\n if (this.shouldExpandFromParent()) {\n this.expandAllDescendants();\n }\n (this.host as any)['__stencil_instance'] = this;\n }\n\n private shouldExpandFromParent(): boolean {\n let parent = this.host.parentElement;\n while (parent) {\n if (\n parent.tagName === 'IFX-TREE-VIEW' &&\n (parent.hasAttribute('expand-all-items') || parent.hasAttribute('data-expand-all-items'))\n ) {\n return true;\n }\n parent = parent.parentElement;\n }\n return false;\n }\n\n private expandAllDescendants() {\n this.expanded = true;\n const children = this.findChildren();\n for (const child of children) {\n if (typeof (child as any).expanded !== 'undefined') {\n (child as any).expanded = true;\n }\n if (typeof (child as any).expandAllDescendants === 'function') {\n (child as any).expandAllDescendants();\n }\n }\n }\n\n private observeDisableAllItems() {\n let parent = this.host.parentElement;\n while (parent) {\n if (parent.tagName === 'IFX-TREE-VIEW') {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'disable-all-items'\n ) {\n const disableAll = (parent as any).disableAllItems;\n this.disableAllItems = !!disableAll || parent.hasAttribute('disable-all-items');\n }\n }\n });\n observer.observe(parent, { attributes: true });\n const disableAll = (parent as any).disableAllItems;\n this.disableAllItems = !!disableAll || parent.hasAttribute('disable-all-items');\n break;\n }\n parent = parent.parentElement;\n }\n }\n\n private observeExpandAllItems() {\n let parent = this.host.parentElement;\n while (parent) {\n if (parent.tagName === 'IFX-TREE-VIEW' || parent.hasAttribute('data-expand-all-items')) {\n const observer = new MutationObserver(mutations => {\n for (const mutation of mutations) {\n if (\n mutation.type === 'attributes' &&\n mutation.attributeName === 'data-expand-all-items'\n ) {\n this.expandAllItems = parent.hasAttribute('data-expand-all-items');\n }\n }\n });\n observer.observe(parent, { attributes: true });\n this.expandAllItems = parent.hasAttribute('data-expand-all-items');\n break;\n }\n parent = parent.parentElement;\n }\n }\n\n private initializeNode() {\n this.expanded = this.initiallyExpanded;\n this.hasChildren = this.findChildren().length > 0;\n this.level = this.calculateNodeLevel();\n this.host.setAttribute('data-level', this.level.toString());\n }\n\n private setupEventListeners() {\n this.host.addEventListener('internal-check-state-change', this.handleStateChange);\n }\n\n private handleStateChange = (event: CustomEvent) => {\n if (this.disabled) return;\n event.stopPropagation();\n this.updateCheckState(event.detail.checked);\n };\n\n private handleCheckboxChange = (event: CustomEvent) => {\n if (this.disabled) return;\n this.updateCheckState(event.detail?.checked ?? !this.isChecked);\n };\n\n private handleHeaderClick = ({ target }: MouseEvent) => {\n if (this.disabled) return;\n if (!(target as HTMLElement).closest('.tree-item__checkbox-container, .tree-item__chevron-container')) {\n this.updateCheckState(!this.isChecked);\n }\n };\n\n private async updateCheckState(checked: boolean, fromParent = false) {\n if (this.disabled) return;\n\n if (!fromParent && this.hasChildren) {\n const affected = this.collectDescendantStates(checked);\n this.setNodeState({ isChecked: checked, partialChecked: false }, false);\n await this.updateChildrenSilently(checked);\n this.ifxTreeViewItemCheckChange.emit({\n checked,\n indeterminate: false,\n affectedChildItems: affected,\n });\n this.updateParentState();\n } else if (fromParent) {\n this.setNodeState({ isChecked: checked, partialChecked: false }, false);\n } else {\n this.setNodeState({ isChecked: checked, partialChecked: false });\n await this.updateChildrenState(checked);\n this.updateParentState();\n }\n }\n\n private async updateChildrenSilently(checked: boolean) {\n const children = this.findChildren();\n for (const child of children) {\n const childInstance = (child as any)['__stencil_instance'];\n if (childInstance) {\n childInstance.setNodeState({ isChecked: checked, partialChecked: false }, false);\n await childInstance.updateChildrenSilently(checked);\n }\n }\n }\n\n @Watch('expanded')\n handleExpandedChange(newValue: boolean) {\n this.ifxTreeViewItemExpandChange.emit(newValue);\n }\n\n @Watch('disableItem')\n handleDisableItemChange(newValue: boolean) {\n this.ifxTreeViewItemDisableChange.emit(newValue);\n }\n\n private setNodeState(state: TreeState, emitEvent = true) {\n this.isChecked = state.isChecked;\n this.partialChecked = state.partialChecked;\n if (emitEvent) {\n this.ifxTreeViewItemCheckChange.emit({\n checked: this.isChecked,\n indeterminate: this.partialChecked,\n });\n }\n }\n\n private collectDescendantStates(checked: boolean) {\n const descendants: Array<{ label: string; checked: boolean; indeterminate: boolean }> = [];\n const collect = (el: Element) => {\n let instance: any = null;\n if (el === this.host) {\n instance = this;\n } else if ((el as any)['__stencil_instance']) {\n instance = (el as any)['__stencil_instance'];\n }\n const label = instance?.label ?? (el as any).label ?? '';\n descendants.push({\n label,\n checked,\n indeterminate: false,\n });\n Array.from(el.children)\n .forEach(child => {\n if (child.tagName === 'IFX-TREE-VIEW-ITEM') {\n collect(child);\n }\n });\n };\n collect(this.host);\n return descendants;\n }\n\n private async updateChildrenState(checked: boolean) {\n const children = this.findChildren();\n for (const child of children) {\n await (child as HTMLIfxTreeViewItemElement).componentOnReady();\n child.dispatchEvent(new CustomEvent('internal-check-state-change', {\n detail: { checked },\n bubbles: false,\n composed: true\n }));\n }\n }\n\n private findSiblingNodes(parent: HTMLElement): HTMLIfxTreeViewItemElement[] {\n const parentEl = parent.parentElement;\n if (!parentEl) return [];\n return Array.from(\n parentEl.querySelectorAll('ifx-tree-view-item')\n ).map(el => el as HTMLIfxTreeViewItemElement);\n }\n\n private updateParentState() {\n const parent = this.host.parentElement?.closest('ifx-tree-view-item') as HTMLIfxTreeViewItemElement;\n if (!parent) return;\n parent.componentOnReady().then(resolved => {\n const parentNode = resolved as unknown as TreeViewItem;\n if (!parentNode?.updateParentState) return;\n const siblings = this.findSiblingNodes(parent);\n const states = this.calculateSiblingStates(siblings);\n parentNode.setNodeState({\n isChecked: states.allChecked,\n partialChecked: !states.allChecked && states.someChecked\n });\n parentNode.updateParentState();\n });\n }\n\n private calculateSiblingStates(siblings: HTMLIfxTreeViewItemElement[]) {\n return {\n allChecked: siblings.every(sib => (sib as unknown as TreeViewItem).isChecked),\n someChecked: siblings.some(sib => {\n const node = sib as unknown as TreeViewItem;\n return node.isChecked || node.partialChecked;\n })\n };\n }\n\n private toggleExpand = () => {\n if (this.disabled) return;\n this.hasChildren && (this.expanded = !this.expanded);\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n\n const allItems = Array.from(\n this.host\n .closest('ifx-tree-view')\n ?.querySelectorAll('ifx-tree-view-item') || []\n );\n\n const visibleItems = allItems.filter(item => {\n let parent = item.parentElement?.closest('ifx-tree-view-item');\n while (parent) {\n const parentCmp = parent as any;\n if (!(parentCmp.expandAllItems || parentCmp.expanded)) {\n return false;\n }\n parent = parent.parentElement?.closest('ifx-tree-view-item');\n }\n return true;\n });\n\n const currentIndex = visibleItems.findIndex(el => el === this.host);\n\n function focusLabelIcon(el: Element | null) {\n (el as HTMLElement | null)?.focus();\n }\n\n switch (event.key) {\n case 'ArrowDown': {\n event.preventDefault();\n let nextIndex = currentIndex + 1;\n while (nextIndex < visibleItems.length) {\n const next = visibleItems[nextIndex] as any;\n if (!next.disabled) {\n focusLabelIcon(next.shadowRoot?.querySelector('.tree-item__label-icon-container'));\n break;\n }\n nextIndex++;\n }\n break;\n }\n case 'ArrowUp': {\n event.preventDefault();\n let prevIndex = currentIndex - 1;\n while (prevIndex >= 0) {\n const prev = visibleItems[prevIndex] as any;\n if (!prev.disabled) {\n focusLabelIcon(prev.shadowRoot?.querySelector('.tree-item__label-icon-container'));\n break;\n }\n prevIndex--;\n }\n break;\n }\n case 'ArrowRight': {\n event.preventDefault();\n if (!this.isExpanded && this.hasChildren) {\n this.expanded = true;\n } else if (this.isExpanded && this.hasChildren) {\n const firstChild = this.host.querySelector('ifx-tree-view-item');\n if (firstChild && !(firstChild as any).disabled) {\n focusLabelIcon((firstChild as HTMLElement).shadowRoot?.querySelector('.tree-item__label-icon-container'));\n }\n }\n break;\n }\n case 'ArrowLeft': {\n event.preventDefault();\n if (this.isExpanded && this.hasChildren) {\n this.expanded = false;\n } else {\n const parent = this.host.parentElement?.closest('ifx-tree-view-item');\n if (parent && !(parent as any).disabled) {\n focusLabelIcon((parent as HTMLElement).shadowRoot?.querySelector('.tree-item__label-icon-container'));\n }\n }\n break;\n }\n case ' ':\n case 'Enter': {\n event.preventDefault();\n this.updateCheckState(!this.isChecked);\n break;\n }\n }\n };\n\n render() {\n return (\n <div\n class={{\n 'tree-item': true,\n 'tree-item--expanded': this.isExpanded,\n 'tree-item--has-children': this.hasChildren,\n 'tree-item--disabled': this.disabled,\n }}\n role=\"treeitem\"\n aria-expanded={this.isExpanded ? 'true' : 'false'}\n data-level={this.level}\n aria-disabled={this.disabled ? 'true' : undefined}\n aria-label={this.ariaLabel}\n >\n <div class=\"tree-item__content\">\n {this.renderCheckbox()}\n {this.renderHeader()}\n </div>\n {this.isExpanded && <div class=\"tree-item__children\"><slot/></div>}\n </div>\n );\n }\n\n private renderHeader() {\n return (\n <div\n class=\"tree-item__header\"\n style={{ paddingLeft: `${this.level * 24 + 10}px` }}\n onClick={this.handleHeaderClick}\n tabIndex={-1}\n aria-disabled={this.disabled ? 'true' : undefined}\n >\n {this.renderControls()}\n </div>\n );\n }\n\n private renderCheckbox() {\n return (\n <div class=\"tree-item__checkbox-container\" onClick={e => e.stopPropagation()}>\n <ifx-checkbox\n size='s'\n checked={this.isChecked}\n indeterminate={this.partialChecked}\n onIfxChange={this.handleCheckboxChange}\n disabled={this.disabled}\n />\n </div>\n );\n }\n\n private renderControls() {\n return [\n this.hasChildren && (\n <div class=\"tree-item__chevron-container\" onClick={this.toggleExpand}>\n <ifx-icon class={`tree-item__chevron ${this.isExpanded ? 'chevron-down' : 'chevron-right'}`}\n icon=\"chevron-right-16\"/>\n <div class=\"tree-item__line\"/>\n </div>\n ),\n <div\n class=\"tree-item__label-icon-container\"\n tabIndex={this.disabled ? -1 : 0}\n onKeyDown={this.handleKeyDown}\n >\n <div class=\"tree-item__icon-container\">\n {\n this.hasChildren ? (\n <Fragment>\n <ifx-icon class={{'icon--hidden': this.isExpanded}} icon=\"folder-16\"/>\n <ifx-icon class={{'icon--hidden': !this.isExpanded}} icon=\"folder-open-16\"/>\n </Fragment>\n ) : (\n <ifx-icon icon=\"file-16\"/>\n )\n }\n </div>\n <span class=\"tree-item__label\">{this.label}</span>\n </div>\n ];\n }\n}\n"],"version":3}
@@ -151,6 +151,7 @@ const TreeViewItem = class {
151
151
  if (this.shouldExpandFromParent()) {
152
152
  this.expandAllDescendants();
153
153
  }
154
+ this.host['__stencil_instance'] = this;
154
155
  }
155
156
  shouldExpandFromParent() {
156
157
  let parent = this.host.parentElement;
@@ -224,12 +225,38 @@ const TreeViewItem = class {
224
225
  setupEventListeners() {
225
226
  this.host.addEventListener('internal-check-state-change', this.handleStateChange);
226
227
  }
227
- async updateCheckState(checked) {
228
+ async updateCheckState(checked, fromParent = false) {
228
229
  if (this.disabled)
229
230
  return;
230
- this.setNodeState({ isChecked: checked, partialChecked: false });
231
- await this.updateChildrenState(checked);
232
- this.updateParentState();
231
+ if (!fromParent && this.hasChildren) {
232
+ const affected = this.collectDescendantStates(checked);
233
+ this.setNodeState({ isChecked: checked, partialChecked: false }, false);
234
+ await this.updateChildrenSilently(checked);
235
+ this.ifxTreeViewItemCheckChange.emit({
236
+ checked,
237
+ indeterminate: false,
238
+ affectedChildItems: affected,
239
+ });
240
+ this.updateParentState();
241
+ }
242
+ else if (fromParent) {
243
+ this.setNodeState({ isChecked: checked, partialChecked: false }, false);
244
+ }
245
+ else {
246
+ this.setNodeState({ isChecked: checked, partialChecked: false });
247
+ await this.updateChildrenState(checked);
248
+ this.updateParentState();
249
+ }
250
+ }
251
+ async updateChildrenSilently(checked) {
252
+ const children = this.findChildren();
253
+ for (const child of children) {
254
+ const childInstance = child['__stencil_instance'];
255
+ if (childInstance) {
256
+ childInstance.setNodeState({ isChecked: checked, partialChecked: false }, false);
257
+ await childInstance.updateChildrenSilently(checked);
258
+ }
259
+ }
233
260
  }
234
261
  handleExpandedChange(newValue) {
235
262
  this.ifxTreeViewItemExpandChange.emit(newValue);
@@ -237,13 +264,42 @@ const TreeViewItem = class {
237
264
  handleDisableItemChange(newValue) {
238
265
  this.ifxTreeViewItemDisableChange.emit(newValue);
239
266
  }
240
- setNodeState(state) {
267
+ setNodeState(state, emitEvent = true) {
241
268
  this.isChecked = state.isChecked;
242
269
  this.partialChecked = state.partialChecked;
243
- this.ifxTreeViewItemCheckChange.emit({
244
- checked: this.isChecked,
245
- indeterminate: this.partialChecked,
246
- });
270
+ if (emitEvent) {
271
+ this.ifxTreeViewItemCheckChange.emit({
272
+ checked: this.isChecked,
273
+ indeterminate: this.partialChecked,
274
+ });
275
+ }
276
+ }
277
+ collectDescendantStates(checked) {
278
+ const descendants = [];
279
+ const collect = (el) => {
280
+ var _a, _b;
281
+ let instance = null;
282
+ if (el === this.host) {
283
+ instance = this;
284
+ }
285
+ else if (el['__stencil_instance']) {
286
+ instance = el['__stencil_instance'];
287
+ }
288
+ const label = (_b = (_a = instance === null || instance === void 0 ? void 0 : instance.label) !== null && _a !== void 0 ? _a : el.label) !== null && _b !== void 0 ? _b : '';
289
+ descendants.push({
290
+ label,
291
+ checked,
292
+ indeterminate: false,
293
+ });
294
+ Array.from(el.children)
295
+ .forEach(child => {
296
+ if (child.tagName === 'IFX-TREE-VIEW-ITEM') {
297
+ collect(child);
298
+ }
299
+ });
300
+ };
301
+ collect(this.host);
302
+ return descendants;
247
303
  }
248
304
  async updateChildrenState(checked) {
249
305
  const children = this.findChildren();
@@ -290,12 +346,12 @@ const TreeViewItem = class {
290
346
  };
291
347
  }
292
348
  render() {
293
- return (h("div", { key: '10a31a82078320a73d026ec8d42ae23d78049a9b', class: {
349
+ return (h("div", { key: 'a626535eaa7807016da9b015daecc1c4ecba4283', class: {
294
350
  'tree-item': true,
295
351
  'tree-item--expanded': this.isExpanded,
296
352
  'tree-item--has-children': this.hasChildren,
297
353
  'tree-item--disabled': this.disabled,
298
- }, role: "treeitem", "aria-expanded": this.isExpanded ? 'true' : 'false', "data-level": this.level, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel }, h("div", { key: 'ad1dcf1ca93fd3f35f00d411e8740bfc54dc7c9f', class: "tree-item__content" }, this.renderCheckbox(), this.renderHeader()), this.isExpanded && h("div", { key: '1023010ffb83954bc852cafc18f3b79003ffbf3e', class: "tree-item__children" }, h("slot", { key: 'c7cd0a61015b29a99b963576c8bc3fd0725541f3' }))));
354
+ }, role: "treeitem", "aria-expanded": this.isExpanded ? 'true' : 'false', "data-level": this.level, "aria-disabled": this.disabled ? 'true' : undefined, "aria-label": this.ariaLabel }, h("div", { key: 'e6e9bf260e0c1f5584826189ae44de0abbeed4e0', class: "tree-item__content" }, this.renderCheckbox(), this.renderHeader()), this.isExpanded && h("div", { key: 'e24cad37fc29633023d9e2b7216c2281056fc76e', class: "tree-item__children" }, h("slot", { key: '65d7afa55a28667bed348cafd784636256cd23d5' }))));
299
355
  }
300
356
  renderHeader() {
301
357
  return (h("div", { class: "tree-item__header", style: { paddingLeft: `${this.level * 24 + 10}px` }, onClick: this.handleHeaderClick, tabIndex: -1, "aria-disabled": this.disabled ? 'true' : undefined }, this.renderControls()));