@ukic/canary-web-components 2.0.0-canary.20 → 2.0.0-canary.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/core.cjs.js +1 -1
- package/dist/cjs/{helpers-73d277d1.js → helpers-093368be.js} +6 -2
- package/dist/cjs/helpers-093368be.js.map +1 -0
- package/dist/cjs/{helpers-fc9441f8.js → helpers-85c5ca15.js} +94 -1
- package/dist/cjs/helpers-85c5ca15.js.map +1 -0
- package/dist/cjs/ic-accordion-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-accordion.cjs.entry.js +1 -1
- package/dist/cjs/ic-alert.cjs.entry.js +17 -1
- package/dist/cjs/ic-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-back-to-top.cjs.entry.js +1 -1
- package/dist/cjs/ic-badge.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/ic-button_3.cjs.entry.js +11 -6
- package/dist/cjs/ic-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-card-horizontal.cjs.entry.js +131 -0
- package/dist/cjs/ic-card-horizontal.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-card.cjs.entry.js +25 -1
- package/dist/cjs/ic-card.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/ic-chip.cjs.entry.js +9 -3
- package/dist/cjs/ic-chip.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-classification-banner.cjs.entry.js +12 -3
- package/dist/cjs/ic-classification-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-data-row.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-table-title-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-data-table.cjs.entry.js +526 -71
- package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-input.cjs.entry.js +4 -3
- package/dist/cjs/ic-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-date-picker.cjs.entry.js +15 -4
- package/dist/cjs/ic-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ic-divider.cjs.entry.js +1 -1
- package/dist/cjs/ic-empty-state_2.cjs.entry.js +21 -2
- package/dist/cjs/ic-empty-state_2.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-footer-link-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-footer.cjs.entry.js +1 -1
- package/dist/cjs/ic-hero.cjs.entry.js +17 -1
- package/dist/cjs/ic-hero.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-horizontal-scroll.cjs.entry.js +1 -1
- package/dist/cjs/ic-input-component-container_4.cjs.entry.js +1 -1
- package/dist/cjs/ic-link.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu-with-multi.cjs.entry.js +1 -1
- package/dist/cjs/ic-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-item.cjs.entry.js +1 -1
- package/dist/cjs/ic-navigation-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-page-header.cjs.entry.js +1 -1
- package/dist/cjs/ic-pagination_4.cjs.entry.js +1 -1
- package/dist/cjs/ic-popover-menu.cjs.entry.js +1 -1
- package/dist/cjs/ic-radio-group.cjs.entry.js +41 -22
- package/dist/cjs/ic-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-radio-option.cjs.entry.js +1 -1
- package/dist/cjs/ic-search-bar.cjs.entry.js +1 -1
- package/dist/cjs/ic-select-with-multi.cjs.entry.js +2 -30
- package/dist/cjs/ic-select-with-multi.cjs.entry.js.map +1 -1
- package/dist/cjs/ic-side-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-status-tag.cjs.entry.js +1 -1
- package/dist/cjs/ic-step.cjs.entry.js +1 -1
- package/dist/cjs/ic-stepper.cjs.entry.js +1 -1
- package/dist/cjs/ic-switch.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-group.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/ic-tab.cjs.entry.js +1 -1
- package/dist/cjs/ic-theme.cjs.entry.js +1 -1
- package/dist/cjs/ic-toast.cjs.entry.js +1 -1
- package/dist/cjs/ic-toggle-button.cjs.entry.js +1 -1
- package/dist/cjs/ic-top-navigation.cjs.entry.js +1 -1
- package/dist/cjs/ic-tree-item.cjs.entry.js +241 -0
- package/dist/cjs/ic-tree-item.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-tree-view.cjs.entry.js +203 -0
- package/dist/cjs/ic-tree-view.cjs.entry.js.map +1 -0
- package/dist/cjs/ic-typography.cjs.entry.js +47 -12
- package/dist/cjs/ic-typography.cjs.entry.js.map +1 -1
- package/dist/cjs/index-4cf27b16.js +12 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/assets/arrow-dropdown.svg +3 -0
- package/dist/collection/collection-manifest.json +4 -1
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.css +655 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js +373 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.js.map +1 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.types.js +2 -0
- package/dist/collection/components/ic-card-horizontal/ic-card-horizontal.types.js.map +1 -0
- package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js +130 -0
- package/dist/collection/components/ic-card-horizontal/test/basic/ic-card-horizontal.spec.js.map +1 -0
- package/dist/collection/components/ic-data-table/ic-data-table.css +55 -5
- package/dist/collection/components/ic-data-table/ic-data-table.js +570 -77
- package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
- package/dist/collection/components/ic-data-table/ic-data-table.types.js.map +1 -1
- package/dist/collection/components/ic-data-table/story-data.js +364 -21
- package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +1 -1
- package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
- package/dist/collection/components/ic-date-input/ic-date-input.js +21 -2
- package/dist/collection/components/ic-date-input/ic-date-input.js.map +1 -1
- package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js +7 -0
- package/dist/collection/components/ic-date-input/test/basic/ic-date-input.spec.js.map +1 -1
- package/dist/collection/components/ic-date-picker/ic-date-picker.js +34 -3
- package/dist/collection/components/ic-date-picker/ic-date-picker.js.map +1 -1
- package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js +29 -0
- package/dist/collection/components/ic-date-picker/test/basic/ic-date-picker.spec.js.map +1 -1
- package/dist/collection/components/ic-tree-item/ic-tree-item.css +150 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.js +592 -0
- package/dist/collection/components/ic-tree-item/ic-tree-item.js.map +1 -0
- package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js +114 -0
- package/dist/collection/components/ic-tree-item/test/basic/ic-tree-item.spec.js.map +1 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.css +56 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.js +296 -0
- package/dist/collection/components/ic-tree-view/ic-tree-view.js.map +1 -0
- package/dist/collection/components/ic-tree-view/test/basic/ic-tree-view.spec.js +85 -0
- package/dist/collection/components/ic-tree-view/test/basic/ic-tree-view.spec.js.map +1 -0
- package/dist/collection/utils/helpers.js +4 -0
- package/dist/collection/utils/helpers.js.map +1 -1
- package/dist/components/helpers.js +5 -2
- package/dist/components/helpers.js.map +1 -1
- package/dist/components/helpers2.js +88 -1
- package/dist/components/helpers2.js.map +1 -1
- package/dist/components/ic-alert2.js +18 -2
- package/dist/components/ic-alert2.js.map +1 -1
- package/dist/components/ic-back-to-top.js +1 -1
- package/dist/components/ic-badge.js +1 -1
- package/dist/components/ic-breadcrumb-group.js +1 -1
- package/dist/components/ic-breadcrumb2.js +1 -1
- package/dist/components/ic-button2.js +1 -1
- package/dist/components/ic-card-horizontal.d.ts +11 -0
- package/dist/components/ic-card-horizontal.js +167 -0
- package/dist/components/ic-card-horizontal.js.map +1 -0
- package/dist/components/ic-card.js +26 -2
- package/dist/components/ic-card.js.map +1 -1
- package/dist/components/ic-checkbox-group.js +1 -1
- package/dist/components/ic-checkbox.js +1 -1
- package/dist/components/ic-chip.js +9 -3
- package/dist/components/ic-chip.js.map +1 -1
- package/dist/components/ic-classification-banner.js +12 -3
- package/dist/components/ic-classification-banner.js.map +1 -1
- package/dist/components/ic-data-row.js +1 -1
- package/dist/components/ic-data-table.js +531 -72
- package/dist/components/ic-data-table.js.map +1 -1
- package/dist/components/ic-date-input2.js +5 -3
- package/dist/components/ic-date-input2.js.map +1 -1
- package/dist/components/ic-date-picker.js +17 -4
- package/dist/components/ic-date-picker.js.map +1 -1
- package/dist/components/ic-dialog.js +1 -1
- package/dist/components/ic-divider2.js +1 -1
- package/dist/components/ic-empty-state2.js +21 -2
- package/dist/components/ic-empty-state2.js.map +1 -1
- package/dist/components/ic-footer-link-group.js +1 -1
- package/dist/components/ic-footer-link.js +1 -1
- package/dist/components/ic-footer.js +1 -1
- package/dist/components/ic-hero.js +18 -2
- package/dist/components/ic-hero.js.map +1 -1
- package/dist/components/ic-horizontal-scroll2.js +1 -1
- package/dist/components/ic-input-component-container2.js +1 -1
- package/dist/components/ic-input-label2.js +1 -1
- package/dist/components/ic-input-validation2.js +1 -1
- package/dist/components/ic-link2.js +1 -1
- package/dist/components/ic-loading-indicator2.js +1 -1
- package/dist/components/ic-menu-group.js +1 -1
- package/dist/components/ic-menu-item2.js +1 -1
- package/dist/components/ic-menu3.js +1 -1
- package/dist/components/ic-navigation-button.js +1 -1
- package/dist/components/ic-navigation-group.js +1 -1
- package/dist/components/ic-navigation-item.js +1 -1
- package/dist/components/ic-navigation-menu2.js +1 -1
- package/dist/components/ic-page-header.js +1 -1
- package/dist/components/ic-pagination-bar2.js +1 -1
- package/dist/components/ic-pagination-item2.js +1 -1
- package/dist/components/ic-popover-menu.js +1 -1
- package/dist/components/ic-radio-group.js +41 -22
- package/dist/components/ic-radio-group.js.map +1 -1
- package/dist/components/ic-radio-option.js +1 -1
- package/dist/components/ic-search-bar.js +1 -1
- package/dist/components/ic-select-with-multi.js +1 -29
- package/dist/components/ic-select-with-multi.js.map +1 -1
- package/dist/components/ic-select2.js +1 -1
- package/dist/components/ic-side-navigation.js +1 -1
- package/dist/components/ic-step.js +1 -1
- package/dist/components/ic-stepper.js +1 -1
- package/dist/components/ic-switch.js +1 -1
- package/dist/components/ic-tab-panel.js +1 -1
- package/dist/components/ic-text-field2.js +1 -1
- package/dist/components/ic-theme.js +1 -1
- package/dist/components/ic-toast.js +1 -1
- package/dist/components/ic-tooltip2.js +12 -5
- package/dist/components/ic-tooltip2.js.map +1 -1
- package/dist/components/ic-top-navigation.js +1 -1
- package/dist/components/ic-tree-item.d.ts +11 -0
- package/dist/components/ic-tree-item.js +286 -0
- package/dist/components/ic-tree-item.js.map +1 -0
- package/dist/components/ic-tree-view.d.ts +11 -0
- package/dist/components/ic-tree-view.js +237 -0
- package/dist/components/ic-tree-view.js.map +1 -0
- package/dist/components/ic-typography2.js +53 -15
- package/dist/components/ic-typography2.js.map +1 -1
- package/dist/core/core.esm.js +1 -1
- package/dist/core/core.esm.js.map +1 -1
- package/dist/core/{p-0cdd4c93.entry.js → p-0180e00a.entry.js} +2 -2
- package/dist/core/{p-0970c8a1.entry.js → p-046f4de6.entry.js} +2 -2
- package/dist/core/{p-2536b95b.entry.js → p-06732eaf.entry.js} +2 -2
- package/dist/core/p-0ec04c16.entry.js +2 -0
- package/dist/core/p-0ec04c16.entry.js.map +1 -0
- package/dist/core/{p-4c57eef0.entry.js → p-13993bf3.entry.js} +2 -2
- package/dist/core/p-16a48a63.entry.js +2 -0
- package/dist/core/p-16a48a63.entry.js.map +1 -0
- package/dist/core/{p-12120521.entry.js → p-216fbd5e.entry.js} +2 -2
- package/dist/core/{p-14b363d0.entry.js → p-2d063032.entry.js} +2 -2
- package/dist/core/{p-e2387530.entry.js → p-2ee5d3fb.entry.js} +2 -2
- package/dist/core/p-355c8532.entry.js +2 -0
- package/dist/core/p-355c8532.entry.js.map +1 -0
- package/dist/core/p-3a59391f.entry.js +2 -0
- package/dist/core/{p-2b9b9f6e.entry.js.map → p-3a59391f.entry.js.map} +1 -1
- package/dist/core/{p-edf3411a.entry.js → p-3f2723aa.entry.js} +2 -2
- package/dist/core/p-401d0c66.entry.js +2 -0
- package/dist/core/p-401d0c66.entry.js.map +1 -0
- package/dist/core/p-413e68be.entry.js +2 -0
- package/dist/core/{p-60ca1000.entry.js.map → p-413e68be.entry.js.map} +1 -1
- package/dist/core/{p-a484c41c.entry.js → p-418a84d4.entry.js} +2 -2
- package/dist/core/{p-a1369740.entry.js → p-41916ef7.entry.js} +2 -2
- package/dist/core/p-4309460f.entry.js +2 -0
- package/dist/core/p-4309460f.entry.js.map +1 -0
- package/dist/core/{p-7168b71a.entry.js → p-486a6957.entry.js} +2 -2
- package/dist/core/{p-87868dd2.entry.js → p-5348af01.entry.js} +2 -2
- package/dist/core/p-57043b1e.entry.js +2 -0
- package/dist/core/p-57043b1e.entry.js.map +1 -0
- package/dist/core/p-59993f36.entry.js +2 -0
- package/dist/core/p-59993f36.entry.js.map +1 -0
- package/dist/core/{p-c2b5e7b1.entry.js → p-5fea8f1c.entry.js} +2 -2
- package/dist/core/{p-c2b5e7b1.entry.js.map → p-5fea8f1c.entry.js.map} +1 -1
- package/dist/core/{p-eeae7272.entry.js → p-6398a726.entry.js} +2 -2
- package/dist/core/{p-0629691b.entry.js → p-648fb902.entry.js} +2 -2
- package/dist/core/{p-7e850bad.entry.js → p-673a4a62.entry.js} +2 -2
- package/dist/core/{p-0ecde7a8.entry.js → p-67ae9d37.entry.js} +2 -2
- package/dist/core/{p-d3e186a3.entry.js → p-6b01e096.entry.js} +2 -2
- package/dist/core/{p-92a858f7.entry.js → p-6b1fcf87.entry.js} +2 -2
- package/dist/core/{p-94ce6f29.entry.js → p-6fb3d61e.entry.js} +2 -2
- package/dist/core/{p-47c91e08.entry.js → p-789ae7f5.entry.js} +2 -2
- package/dist/core/{p-1440cdd1.js → p-8128572e.js} +2 -2
- package/dist/core/p-8128572e.js.map +1 -0
- package/dist/core/p-84eaa486.entry.js +2 -0
- package/dist/core/p-84eaa486.entry.js.map +1 -0
- package/dist/core/{p-24f9f6d4.entry.js → p-89c7ea3e.entry.js} +2 -2
- package/dist/core/{p-992b6161.entry.js → p-8d276e8f.entry.js} +2 -2
- package/dist/core/{p-db5c4969.entry.js → p-91cf89c8.entry.js} +2 -2
- package/dist/core/p-91cf89c8.entry.js.map +1 -0
- package/dist/core/p-969cadfa.entry.js +2 -0
- package/dist/core/p-969cadfa.entry.js.map +1 -0
- package/dist/core/p-97f141a6.entry.js +2 -0
- package/dist/core/p-97f141a6.entry.js.map +1 -0
- package/dist/core/{p-cb7793b0.entry.js → p-99185fd5.entry.js} +2 -2
- package/dist/core/{p-4883e147.entry.js → p-99f96c33.entry.js} +2 -2
- package/dist/core/p-a052bb95.entry.js +2 -0
- package/dist/core/p-a052bb95.entry.js.map +1 -0
- package/dist/core/{p-8100f45c.entry.js → p-a72af8db.entry.js} +2 -2
- package/dist/core/{p-6eafa62e.entry.js → p-a787bba7.entry.js} +2 -2
- package/dist/core/{p-6c5c6aaf.entry.js → p-aa72f551.entry.js} +2 -2
- package/dist/core/{p-781e8391.entry.js → p-aaaa9261.entry.js} +2 -2
- package/dist/core/p-adbe0d89.js +2 -0
- package/dist/core/p-adbe0d89.js.map +1 -0
- package/dist/core/{p-646b886c.entry.js → p-b29e96b5.entry.js} +2 -2
- package/dist/core/p-b97eba08.entry.js +2 -0
- package/dist/core/p-b97eba08.entry.js.map +1 -0
- package/dist/core/{p-3245554e.entry.js → p-bfc5f3f4.entry.js} +2 -2
- package/dist/core/{p-e1e04f34.entry.js → p-cb3afdbf.entry.js} +2 -2
- package/dist/core/{p-6cf5343b.entry.js → p-ccf72538.entry.js} +2 -2
- package/dist/core/{p-3eb33ef4.entry.js → p-ce0999f1.entry.js} +2 -2
- package/dist/core/{p-0a99994a.entry.js → p-d02a4d1b.entry.js} +2 -2
- package/dist/core/{p-b7161816.entry.js → p-d8322108.entry.js} +2 -2
- package/dist/core/{p-d67a5c90.entry.js → p-d86cdbc8.entry.js} +2 -2
- package/dist/core/{p-a5bb7bb0.entry.js → p-da8255b8.entry.js} +2 -2
- package/dist/core/{p-6a7a5ed5.entry.js → p-e9f5ebb3.entry.js} +2 -2
- package/dist/core/p-e9f5ebb3.entry.js.map +1 -0
- package/dist/core/p-ede631c5.entry.js +2 -0
- package/dist/core/p-ede631c5.entry.js.map +1 -0
- package/dist/core/{p-66c26240.entry.js → p-f09b2041.entry.js} +2 -2
- package/dist/core/{p-b8d3f121.entry.js → p-f1044e4d.entry.js} +2 -2
- package/dist/core/{p-af21360a.entry.js → p-f10f7f37.entry.js} +2 -2
- package/dist/core/{p-34cc7b3d.entry.js → p-fa77211d.entry.js} +2 -2
- package/dist/esm/core.js +1 -1
- package/dist/esm/{helpers-4e2e4787.js → helpers-886489d5.js} +6 -3
- package/dist/esm/helpers-886489d5.js.map +1 -0
- package/dist/esm/{helpers-1cd71f8a.js → helpers-f543bc77.js} +89 -2
- package/dist/{cjs/helpers-fc9441f8.js.map → esm/helpers-f543bc77.js.map} +1 -1
- package/dist/esm/ic-accordion-group.entry.js +1 -1
- package/dist/esm/ic-accordion.entry.js +1 -1
- package/dist/esm/ic-alert.entry.js +18 -2
- package/dist/esm/ic-alert.entry.js.map +1 -1
- package/dist/esm/ic-back-to-top.entry.js +1 -1
- package/dist/esm/ic-badge.entry.js +1 -1
- package/dist/esm/ic-breadcrumb-group.entry.js +1 -1
- package/dist/esm/ic-breadcrumb.entry.js +1 -1
- package/dist/esm/ic-button_3.entry.js +11 -6
- package/dist/esm/ic-button_3.entry.js.map +1 -1
- package/dist/esm/ic-card-horizontal.entry.js +127 -0
- package/dist/esm/ic-card-horizontal.entry.js.map +1 -0
- package/dist/esm/ic-card.entry.js +26 -2
- package/dist/esm/ic-card.entry.js.map +1 -1
- package/dist/esm/ic-checkbox-group.entry.js +1 -1
- package/dist/esm/ic-checkbox.entry.js +1 -1
- package/dist/esm/ic-chip.entry.js +9 -3
- package/dist/esm/ic-chip.entry.js.map +1 -1
- package/dist/esm/ic-classification-banner.entry.js +12 -3
- package/dist/esm/ic-classification-banner.entry.js.map +1 -1
- package/dist/esm/ic-data-row.entry.js +1 -1
- package/dist/esm/ic-data-table-title-bar.entry.js +1 -1
- package/dist/esm/ic-data-table.entry.js +526 -71
- package/dist/esm/ic-data-table.entry.js.map +1 -1
- package/dist/esm/ic-date-input.entry.js +4 -3
- package/dist/esm/ic-date-input.entry.js.map +1 -1
- package/dist/esm/ic-date-picker.entry.js +15 -4
- package/dist/esm/ic-date-picker.entry.js.map +1 -1
- package/dist/esm/ic-dialog.entry.js +1 -1
- package/dist/esm/ic-divider.entry.js +1 -1
- package/dist/esm/ic-empty-state_2.entry.js +22 -3
- package/dist/esm/ic-empty-state_2.entry.js.map +1 -1
- package/dist/esm/ic-footer-link-group.entry.js +1 -1
- package/dist/esm/ic-footer-link.entry.js +1 -1
- package/dist/esm/ic-footer.entry.js +1 -1
- package/dist/esm/ic-hero.entry.js +18 -2
- package/dist/esm/ic-hero.entry.js.map +1 -1
- package/dist/esm/ic-horizontal-scroll.entry.js +1 -1
- package/dist/esm/ic-input-component-container_4.entry.js +1 -1
- package/dist/esm/ic-link.entry.js +1 -1
- package/dist/esm/ic-menu-group.entry.js +1 -1
- package/dist/esm/ic-menu-item.entry.js +1 -1
- package/dist/esm/ic-menu-with-multi.entry.js +1 -1
- package/dist/esm/ic-menu.entry.js +1 -1
- package/dist/esm/ic-navigation-button.entry.js +1 -1
- package/dist/esm/ic-navigation-group.entry.js +1 -1
- package/dist/esm/ic-navigation-item.entry.js +1 -1
- package/dist/esm/ic-navigation-menu.entry.js +1 -1
- package/dist/esm/ic-page-header.entry.js +1 -1
- package/dist/esm/ic-pagination_4.entry.js +1 -1
- package/dist/esm/ic-popover-menu.entry.js +1 -1
- package/dist/esm/ic-radio-group.entry.js +41 -22
- package/dist/esm/ic-radio-group.entry.js.map +1 -1
- package/dist/esm/ic-radio-option.entry.js +1 -1
- package/dist/esm/ic-search-bar.entry.js +1 -1
- package/dist/esm/ic-select-with-multi.entry.js +1 -29
- package/dist/esm/ic-select-with-multi.entry.js.map +1 -1
- package/dist/esm/ic-side-navigation.entry.js +1 -1
- package/dist/esm/ic-status-tag.entry.js +1 -1
- package/dist/esm/ic-step.entry.js +1 -1
- package/dist/esm/ic-stepper.entry.js +1 -1
- package/dist/esm/ic-switch.entry.js +1 -1
- package/dist/esm/ic-tab-group.entry.js +1 -1
- package/dist/esm/ic-tab-panel.entry.js +1 -1
- package/dist/esm/ic-tab.entry.js +1 -1
- package/dist/esm/ic-theme.entry.js +1 -1
- package/dist/esm/ic-toast.entry.js +1 -1
- package/dist/esm/ic-toggle-button.entry.js +1 -1
- package/dist/esm/ic-top-navigation.entry.js +1 -1
- package/dist/esm/ic-tree-item.entry.js +237 -0
- package/dist/esm/ic-tree-item.entry.js.map +1 -0
- package/dist/esm/ic-tree-view.entry.js +199 -0
- package/dist/esm/ic-tree-view.entry.js.map +1 -0
- package/dist/esm/ic-typography.entry.js +48 -13
- package/dist/esm/ic-typography.entry.js.map +1 -1
- package/dist/esm/index-93509377.js +12 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.d.ts +71 -0
- package/dist/types/components/ic-card-horizontal/ic-card-horizontal.types.d.ts +1 -0
- package/dist/types/components/ic-data-table/ic-data-table.d.ts +68 -7
- package/dist/types/components/ic-data-table/ic-data-table.types.d.ts +9 -0
- package/dist/types/components/ic-data-table/story-data.d.ts +112 -0
- package/dist/types/components/ic-date-input/ic-date-input.d.ts +4 -0
- package/dist/types/components/ic-date-picker/ic-date-picker.d.ts +5 -0
- package/dist/types/components/ic-tree-item/ic-tree-item.d.ts +95 -0
- package/dist/types/components/ic-tree-view/ic-tree-view.d.ts +40 -0
- package/dist/types/components.d.ts +272 -6
- package/dist/types/utils/helpers.d.ts +1 -0
- package/hydrate/index.js +2198 -899
- package/package.json +3 -3
- package/dist/cjs/helpers-73d277d1.js.map +0 -1
- package/dist/core/p-06e0b5b6.entry.js +0 -2
- package/dist/core/p-06e0b5b6.entry.js.map +0 -1
- package/dist/core/p-0b14be10.entry.js +0 -2
- package/dist/core/p-0b14be10.entry.js.map +0 -1
- package/dist/core/p-1440cdd1.js.map +0 -1
- package/dist/core/p-20d4ded5.js +0 -2
- package/dist/core/p-20d4ded5.js.map +0 -1
- package/dist/core/p-2b9b9f6e.entry.js +0 -2
- package/dist/core/p-34e72f79.entry.js +0 -2
- package/dist/core/p-34e72f79.entry.js.map +0 -1
- package/dist/core/p-352b9c17.entry.js +0 -2
- package/dist/core/p-352b9c17.entry.js.map +0 -1
- package/dist/core/p-3fa986f8.entry.js +0 -2
- package/dist/core/p-3fa986f8.entry.js.map +0 -1
- package/dist/core/p-4ec1ce96.entry.js +0 -2
- package/dist/core/p-4ec1ce96.entry.js.map +0 -1
- package/dist/core/p-60ca1000.entry.js +0 -2
- package/dist/core/p-6a7a5ed5.entry.js.map +0 -1
- package/dist/core/p-9769c195.entry.js +0 -2
- package/dist/core/p-9769c195.entry.js.map +0 -1
- package/dist/core/p-cb15d0b6.entry.js +0 -2
- package/dist/core/p-cb15d0b6.entry.js.map +0 -1
- package/dist/core/p-db5c4969.entry.js.map +0 -1
- package/dist/core/p-e32cce28.entry.js +0 -2
- package/dist/core/p-e32cce28.entry.js.map +0 -1
- package/dist/core/p-ef996e40.entry.js +0 -2
- package/dist/core/p-ef996e40.entry.js.map +0 -1
- package/dist/esm/helpers-1cd71f8a.js.map +0 -1
- package/dist/esm/helpers-4e2e4787.js.map +0 -1
- /package/dist/core/{p-0cdd4c93.entry.js.map → p-0180e00a.entry.js.map} +0 -0
- /package/dist/core/{p-0970c8a1.entry.js.map → p-046f4de6.entry.js.map} +0 -0
- /package/dist/core/{p-2536b95b.entry.js.map → p-06732eaf.entry.js.map} +0 -0
- /package/dist/core/{p-4c57eef0.entry.js.map → p-13993bf3.entry.js.map} +0 -0
- /package/dist/core/{p-12120521.entry.js.map → p-216fbd5e.entry.js.map} +0 -0
- /package/dist/core/{p-14b363d0.entry.js.map → p-2d063032.entry.js.map} +0 -0
- /package/dist/core/{p-e2387530.entry.js.map → p-2ee5d3fb.entry.js.map} +0 -0
- /package/dist/core/{p-edf3411a.entry.js.map → p-3f2723aa.entry.js.map} +0 -0
- /package/dist/core/{p-a484c41c.entry.js.map → p-418a84d4.entry.js.map} +0 -0
- /package/dist/core/{p-a1369740.entry.js.map → p-41916ef7.entry.js.map} +0 -0
- /package/dist/core/{p-7168b71a.entry.js.map → p-486a6957.entry.js.map} +0 -0
- /package/dist/core/{p-87868dd2.entry.js.map → p-5348af01.entry.js.map} +0 -0
- /package/dist/core/{p-eeae7272.entry.js.map → p-6398a726.entry.js.map} +0 -0
- /package/dist/core/{p-0629691b.entry.js.map → p-648fb902.entry.js.map} +0 -0
- /package/dist/core/{p-7e850bad.entry.js.map → p-673a4a62.entry.js.map} +0 -0
- /package/dist/core/{p-0ecde7a8.entry.js.map → p-67ae9d37.entry.js.map} +0 -0
- /package/dist/core/{p-d3e186a3.entry.js.map → p-6b01e096.entry.js.map} +0 -0
- /package/dist/core/{p-92a858f7.entry.js.map → p-6b1fcf87.entry.js.map} +0 -0
- /package/dist/core/{p-94ce6f29.entry.js.map → p-6fb3d61e.entry.js.map} +0 -0
- /package/dist/core/{p-47c91e08.entry.js.map → p-789ae7f5.entry.js.map} +0 -0
- /package/dist/core/{p-24f9f6d4.entry.js.map → p-89c7ea3e.entry.js.map} +0 -0
- /package/dist/core/{p-992b6161.entry.js.map → p-8d276e8f.entry.js.map} +0 -0
- /package/dist/core/{p-cb7793b0.entry.js.map → p-99185fd5.entry.js.map} +0 -0
- /package/dist/core/{p-4883e147.entry.js.map → p-99f96c33.entry.js.map} +0 -0
- /package/dist/core/{p-8100f45c.entry.js.map → p-a72af8db.entry.js.map} +0 -0
- /package/dist/core/{p-6eafa62e.entry.js.map → p-a787bba7.entry.js.map} +0 -0
- /package/dist/core/{p-6c5c6aaf.entry.js.map → p-aa72f551.entry.js.map} +0 -0
- /package/dist/core/{p-781e8391.entry.js.map → p-aaaa9261.entry.js.map} +0 -0
- /package/dist/core/{p-646b886c.entry.js.map → p-b29e96b5.entry.js.map} +0 -0
- /package/dist/core/{p-3245554e.entry.js.map → p-bfc5f3f4.entry.js.map} +0 -0
- /package/dist/core/{p-e1e04f34.entry.js.map → p-cb3afdbf.entry.js.map} +0 -0
- /package/dist/core/{p-6cf5343b.entry.js.map → p-ccf72538.entry.js.map} +0 -0
- /package/dist/core/{p-3eb33ef4.entry.js.map → p-ce0999f1.entry.js.map} +0 -0
- /package/dist/core/{p-0a99994a.entry.js.map → p-d02a4d1b.entry.js.map} +0 -0
- /package/dist/core/{p-b7161816.entry.js.map → p-d8322108.entry.js.map} +0 -0
- /package/dist/core/{p-d67a5c90.entry.js.map → p-d86cdbc8.entry.js.map} +0 -0
- /package/dist/core/{p-a5bb7bb0.entry.js.map → p-da8255b8.entry.js.map} +0 -0
- /package/dist/core/{p-66c26240.entry.js.map → p-f09b2041.entry.js.map} +0 -0
- /package/dist/core/{p-b8d3f121.entry.js.map → p-f1044e4d.entry.js.map} +0 -0
- /package/dist/core/{p-af21360a.entry.js.map → p-f10f7f37.entry.js.map} +0 -0
- /package/dist/core/{p-34cc7b3d.entry.js.map → p-fa77211d.entry.js.map} +0 -0
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-4cf27b16.js');
|
6
6
|
const types = require('./types-17dba796.js');
|
7
|
-
const helpers = require('./helpers-
|
7
|
+
const helpers = require('./helpers-093368be.js');
|
8
8
|
|
9
9
|
const icTopNavigationCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;color:var(--ic-theme-text);width:100%;position:relative}:host .top-navigation{background-color:var(--ic-theme-primary);height:-moz-max-content;height:max-content}:host(.fullwidth-searchbar) slot[name=\"search\"]::slotted(form){width:100%}:host .title-link{display:inline-flex;align-items:center;text-decoration:none;padding:var(--ic-space-xxs);transition:var(--ic-easing-transition-fast)}:host .title-link,:host .title-link:visited,:host .title-link:active,:host .title-link ::slotted(a),:host .title-link:visited ::slotted(a),:host .title-link:active ::slotted(a){color:var(--ic-theme-text);text-decoration:none;outline:none}:host .title-link:hover:not(:focus){background-color:var(--ic-theme-hover)}:host .title-link:active:not(:focus){background-color:var(--ic-theme-active)}:host .title-link:hover{border-radius:var(--ic-border-radius)}:host .title-link:focus,:host .title-link:focus-within{border-radius:var(--ic-border-radius);box-shadow:var(--ic-border-focus);outline:var(--ic-hc-focus-outline)}:host .title-link ic-typography{font-weight:600}:host .nav-panel-container{border-top:var(--ic-keyline-lighten);padding:0 var(--ic-space-lg);margin-left:calc(-1 * var(--section-container-margin));margin-right:calc(-1 * var(--section-container-margin));display:flex}:host(.dark) .nav-panel-container{border-top:var(--ic-keyline-darken)}.top-panel-container{display:flex;padding-top:0.5rem;padding-bottom:0.5rem}.navigation-tabs{margin-top:calc(-1 * var(--ic-space-1px))}.app-details-container{display:flex;align-items:center;flex:1 1 auto;margin-right:var(--ic-space-md)}.app-icon-container{display:flex;padding-right:var(--ic-space-xs)}.icon-buttons-container{display:flex;margin-left:var(--ic-space-md)}.icon-buttons-container ::slotted(nav){display:flex}.title-wrap{overflow-wrap:break-word;word-wrap:break-word;-ms-word-break:break-all;word-break:break-word;-webkit-hyphens:auto;hyphens:auto}:host .app-status{border-radius:var(--ic-space-md);background-color:var(--ic-architectural-white);color:var(--ic-color-primary-text);padding:var(--ic-space-xxs) var(--ic-space-lg);margin-left:var(--ic-space-md);flex:1 1 0;max-width:-moz-fit-content;max-width:fit-content}:host(.dark) .app-status{background-color:var(--ic-theme-text);color:var(--ic-color-white-text)}:host .app-version{border-radius:var(--ic-space-md);background-color:var(--ic-theme-active);padding:var(--ic-space-xxs) var(--ic-space-sm);margin-left:var(--ic-space-xs);flex:1 1 0;max-width:-moz-fit-content;max-width:fit-content}slot[name=\"app-icon\"]::slotted(*){fill:var(--ic-theme-text);width:2em;height:2em}slot[name=\"toggle-icon\"] svg{fill:var(--ic-theme-text)}.search-menu-container{justify-content:right;display:flex;align-items:center}.menu-button-container{margin-left:var(--ic-space-md)}.menu-button-container .navigation-landmark-button-text{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.search-actions-container{display:flex}.menu-buttons-slot{display:flex;flex-direction:column}.navigation-landmark-text{position:absolute;width:var(--ic-space-1px);height:var(--ic-space-1px);padding:0;margin:calc(-1 * var(--ic-space-1px));overflow:hidden}.navigation-item-list{display:flex;list-style:none;height:2.75rem}.navigation-item-list::-webkit-scrollbar{display:none}:host ic-section-container{padding-bottom:0 !important;padding-top:0 !important}@media screen and (min-width: 993px){.app-details-container{margin-right:var(--ic-space-lg)}}@media screen and (max-width: 1200px){:host .nav-panel-container{padding:0 var(--ic-space-md)}}:host(.mobile-mode) .app-status,:host(.mobile-mode) .app-version{display:none}:host(.mobile-mode) .title-link{margin-right:var(--ic-space-xs)}:host(.mobile-mode) .search-menu-container{max-width:10rem}:host(.mobile-mode) .search-bar-container{display:flex;justify-content:center;align-items:center;border-top:var(--ic-keyline-darken);height:4rem;padding-left:var(--ic-space-md);padding-right:var(--ic-space-md);margin-left:calc(-1 * var(--section-container-margin));margin-right:calc(-1 * var(--section-container-margin))}@media screen and (max-width: 576px){:host .title-link{margin-right:var(--ic-space-xxxs);word-break:break-word;-webkit-hyphens:none;hyphens:none}.top-panel-container{min-height:2.5rem}.search-bar-container{margin-top:0;height:3.5rem;padding-left:var(--ic-space-xs);padding-right:var(--ic-space-xs)}.menu-button-container{margin-left:var(--ic-space-sm)}slot[name=\"app-icon\"]::slotted(*){width:1.5em;height:1.5em}slot[name=\"toggle-icon\"] svg{width:1.5em;height:1.5em}}@media (forced-colors: active){:host .top-navigation{border-bottom:var(--ic-hc-border)}.app-status,.app-version{border:var(--ic-hc-border)}slot[name=\"app-icon\"]::slotted(*){fill:currentcolor}}";
|
10
10
|
|
@@ -0,0 +1,241 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-4cf27b16.js');
|
6
|
+
const helpers = require('./helpers-85c5ca15.js');
|
7
|
+
|
8
|
+
const arrowDropdown = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
9
|
+
<path d="M7 9.5L12 14.5L17 9.5H7Z" fill="currentColor"/>
|
10
|
+
</svg>`;
|
11
|
+
|
12
|
+
const icTreeItemCss = ":host{display:block;border:none;position:relative}:host .tree-item-content{display:flex;align-items:center;height:calc(var(--ic-space-xl) + var(--ic-space-xs));padding:0 var(--ic-space-xs);text-decoration:none;color:var(--ic-primary-text)}::slotted([slot=\"router-item\"]){display:flex;align-items:center;height:calc(var(--ic-space-xl) + var(--ic-space-xs));text-decoration:none;font-family:var(--ic-font-body-family);color:var(--ic-primary-text);padding:0 var(--ic-space-xs) !important}::slotted([slot=\"router-item\"].ic-tree-item-single){padding-left:calc(var(--ic-space-xl) + var(--ic-space-xs)) !important}:host .tree-item-content:focus,::slotted([slot=\"router-item\"]:focus){box-shadow:var(--ic-border-focus);border-radius:var(--ic-border-radius);transition:var(--ic-transition-duration-fast);outline:none}:host .tree-item-content:hover,::slotted([slot=\"router-item\"]:hover){background-color:var(--ic-action-dark-bg-hover) !important;cursor:pointer}:host .tree-item-content:active,::slotted([slot=\"router-item\"]:active){background-color:var(--ic-action-dark-bg-active) !important}:host(.ic-tree-item-selected) .tree-item-content,:host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]){background-color:var(--ic-action-default-bg-hover) !important}:host(.ic-tree-item-small) .tree-item-content,:host(.ic-tree-item-small) ::slotted([slot=\"router-item\"]){height:var(--ic-space-xl)}:host(.ic-tree-item-large) .tree-item-content,:host(.ic-tree-item-large) ::slotted([slot=\"router-item\"]){height:var(--ic-space-xxl)}:host(.ic-tree-item-disabled){pointer-events:none}:host(.ic-tree-item-disabled) .tree-item-content,:host(.ic-tree-item-disabled) .arrow-dropdown,:host(.ic-tree-item-disabled) ::slotted([slot=\"icon\"]),:host(.ic-tree-item-disabled) ::slotted([slot=\"router-item\"]){color:var(--ic-architectural-200) !important;fill:var(--ic-architectural-200);pointer-events:none}:host(.ic-tree-item-light) .tree-item-content,:host(.ic-tree-item-light) .arrow-dropdown,:host(.ic-tree-item-light) ::slotted([slot=\"icon\"]),:host(.ic-tree-item-light) ::slotted([slot=\"router-item\"]){color:var(--ic-architectural-white);fill:var(--ic-architectural-white)}:host .arrow-dropdown{color:var(--ic-action-default);margin-right:var(--ic-space-xs)}:host(.ic-tree-item-small) .arrow-dropdown{margin-right:var(--ic-space-xxs)}:host .tree-item-expanded{transform:rotate(180deg);margin-top:calc(-1 * var(--ic-space-xxs))}:host .ic-tree-item-single{padding-left:calc(var(--ic-space-xl) + var(--ic-space-xs))}:host(.ic-tree-item-small) .ic-tree-item-single{padding-left:calc(var(--ic-space-xl) + var(--ic-space-xxs))}.icon-container{width:var(--ic-space-lg);height:var(--ic-space-lg);margin:0 var(--ic-space-xs) 0 0}:host(.ic-tree-item-small) .icon-container{margin:0 var(--ic-space-xxs) 0 0}.ic-text-overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ic-tooltip-overflow{overflow:hidden}@media (forced-colors: active){::slotted([slot=\"icon\"]){fill:currentcolor}:host(.ic-tree-item-disabled) .tree-item-content,:host(.ic-tree-item-disabled) .arrow-dropdown,:host(.ic-tree-item-disabled) ::slotted([slot=\"icon\"]),:host(.ic-tree-item-disabled) ::slotted([slot=\"router-item\"]){color:GrayText !important;fill:GrayText !important}:host .tree-item-content:focus,::slotted([slot=\"router-item\"]:focus){border:var(--ic-hc-border) !important}:host(.ic-tree-item-selected) .tree-item-content,:host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]){color:Highlight !important}}";
|
13
|
+
|
14
|
+
let treeItemIds = 0;
|
15
|
+
const TreeItem = class {
|
16
|
+
constructor(hostRef) {
|
17
|
+
index.registerInstance(this, hostRef);
|
18
|
+
this.icTreeItemSelected = index.createEvent(this, "icTreeItemSelected", 7);
|
19
|
+
this.treeItemId = `ic-tree-item-${treeItemIds++}`;
|
20
|
+
this.treeItemTag = "IC-TREE-ITEM";
|
21
|
+
this.hostMutationObserver = null;
|
22
|
+
this.TOOLTIP = "ic-tooltip";
|
23
|
+
this.handleTreeItemClicked = () => {
|
24
|
+
if (this.isParent) {
|
25
|
+
this.expanded = !this.expanded;
|
26
|
+
this.hasParentExpanded = true;
|
27
|
+
}
|
28
|
+
this.updateAriaLabel();
|
29
|
+
this.selected = true;
|
30
|
+
this.watchSelectedHandler();
|
31
|
+
};
|
32
|
+
this.setTreeItemPadding = () => {
|
33
|
+
let level = 1;
|
34
|
+
let parentElement = this.el.parentElement;
|
35
|
+
const treeItemContent = this.el.shadowRoot.querySelector(".tree-item-content");
|
36
|
+
const isSiblingOfParent = Array.from(parentElement.children)
|
37
|
+
.map((sibling) => {
|
38
|
+
if (sibling !== this.el &&
|
39
|
+
!sibling.querySelector('[slot="router-item"]') &&
|
40
|
+
!sibling.querySelector('[slot="label"]')) {
|
41
|
+
return sibling.children.length > 0;
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
return false;
|
45
|
+
}
|
46
|
+
})
|
47
|
+
.includes(true);
|
48
|
+
const isChild = parentElement.tagName === this.treeItemTag;
|
49
|
+
const isRouterItem = this.hasRouterSlot();
|
50
|
+
if ((isSiblingOfParent && !this.el.isParent) ||
|
51
|
+
(isChild && !this.el.isParent)) {
|
52
|
+
if (isRouterItem) {
|
53
|
+
this.routerSlot.classList.add("ic-tree-item-single");
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
treeItemContent.classList.add("ic-tree-item-single");
|
57
|
+
}
|
58
|
+
}
|
59
|
+
while (parentElement) {
|
60
|
+
if (parentElement.tagName === this.treeItemTag) {
|
61
|
+
level++;
|
62
|
+
if (!this.el.isParent && isSiblingOfParent) {
|
63
|
+
treeItemContent.style.paddingLeft = `calc(var(--ic-space-xl) + ${level * 16}px)`;
|
64
|
+
}
|
65
|
+
else if (!this.el.isParent) {
|
66
|
+
treeItemContent.style.paddingLeft = `calc(var(--ic-space-xs) + ${level * 24}px`;
|
67
|
+
}
|
68
|
+
else {
|
69
|
+
treeItemContent.style.paddingLeft = `${level * 16}px`;
|
70
|
+
}
|
71
|
+
}
|
72
|
+
parentElement = parentElement.parentElement;
|
73
|
+
}
|
74
|
+
};
|
75
|
+
this.truncateTreeItemLabel = (treeItem) => {
|
76
|
+
const typographyEl = treeItem.shadowRoot.querySelector(".tree-item-label");
|
77
|
+
const tooltip = typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.closest(this.TOOLTIP);
|
78
|
+
const treeContent = treeItem.shadowRoot.querySelector(".tree-item-content");
|
79
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (treeContent === null || treeContent === void 0 ? void 0 : treeContent.clientHeight)) {
|
80
|
+
typographyEl.classList.add("ic-text-overflow");
|
81
|
+
if (!tooltip) {
|
82
|
+
const tooltipEl = document.createElement("ic-tooltip");
|
83
|
+
tooltipEl.setAttribute("target", this.el.id);
|
84
|
+
tooltipEl.setAttribute("label", typographyEl.textContent);
|
85
|
+
tooltipEl.classList.add("ic-tooltip-overflow");
|
86
|
+
tooltipEl.setAttribute("placement", "right");
|
87
|
+
treeContent.appendChild(tooltipEl);
|
88
|
+
tooltipEl.appendChild(typographyEl);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
};
|
92
|
+
this.hostMutationCallback = (mutationList) => {
|
93
|
+
if (mutationList.some(({ type, addedNodes, removedNodes }) => type === "childList"
|
94
|
+
? helpers.checkSlotInChildMutations(addedNodes, removedNodes, "icon")
|
95
|
+
: false)) {
|
96
|
+
index.forceUpdate(this);
|
97
|
+
}
|
98
|
+
};
|
99
|
+
this.handleDisplayTooltip = (display) => {
|
100
|
+
const typographyEl = this.el.shadowRoot.querySelector(".tree-item-label");
|
101
|
+
const tooltip = typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.closest(this.TOOLTIP);
|
102
|
+
tooltip === null || tooltip === void 0 ? void 0 : tooltip.displayTooltip(display);
|
103
|
+
};
|
104
|
+
this.childTreeItems = undefined;
|
105
|
+
this.appearance = "dark";
|
106
|
+
this.disabled = false;
|
107
|
+
this.expanded = false;
|
108
|
+
this.hasParentExpanded = false;
|
109
|
+
this.href = undefined;
|
110
|
+
this.hreflang = "";
|
111
|
+
this.isParent = false;
|
112
|
+
this.label = "";
|
113
|
+
this.referrerpolicy = undefined;
|
114
|
+
this.rel = undefined;
|
115
|
+
this.selected = false;
|
116
|
+
this.size = "default";
|
117
|
+
this.target = undefined;
|
118
|
+
}
|
119
|
+
watchSelectedHandler() {
|
120
|
+
if (this.selected) {
|
121
|
+
this.icTreeItemSelected.emit({ id: this.el.id });
|
122
|
+
}
|
123
|
+
this.updateAriaLabel();
|
124
|
+
}
|
125
|
+
disconnectedCallback() {
|
126
|
+
var _a;
|
127
|
+
(_a = this.hostMutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
128
|
+
}
|
129
|
+
componentDidLoad() {
|
130
|
+
this.childTreeItems = Array.from(this.el.children).filter((child) => child.tagName === this.treeItemTag);
|
131
|
+
if (this.childTreeItems.length > 0) {
|
132
|
+
this.isParent = true;
|
133
|
+
}
|
134
|
+
this.setTreeItemPadding();
|
135
|
+
this.updateAriaLabel();
|
136
|
+
this.truncateTreeItemLabel(this.el);
|
137
|
+
!helpers.isSlotUsed(this.el, "label") &&
|
138
|
+
helpers.onComponentRequiredPropUndefined([{ prop: this.label, propName: "label" }], "Tree item");
|
139
|
+
this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
|
140
|
+
this.hostMutationObserver.observe(this.el, {
|
141
|
+
childList: true,
|
142
|
+
});
|
143
|
+
}
|
144
|
+
componentDidUpdate() {
|
145
|
+
if (this.hasParentExpanded) {
|
146
|
+
this.childTreeItems.forEach((child) => {
|
147
|
+
this.truncateTreeItemLabel(child);
|
148
|
+
});
|
149
|
+
this.hasParentExpanded = false;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
handleKeyDown(ev) {
|
153
|
+
if (ev.key === "Enter" || ev.key === " ") {
|
154
|
+
ev.stopImmediatePropagation();
|
155
|
+
this.handleTreeItemClicked();
|
156
|
+
}
|
157
|
+
}
|
158
|
+
/**
|
159
|
+
* Sets focus on the native `input`.
|
160
|
+
*/
|
161
|
+
async setFocus() {
|
162
|
+
var _a, _b;
|
163
|
+
if (this.hasRouterSlot()) {
|
164
|
+
(_a = this.routerSlot) === null || _a === void 0 ? void 0 : _a.focus();
|
165
|
+
}
|
166
|
+
else {
|
167
|
+
(_b = this.treeItemElement) === null || _b === void 0 ? void 0 : _b.focus();
|
168
|
+
}
|
169
|
+
}
|
170
|
+
/**
|
171
|
+
* @internal Updates the aria-label of the tree item.
|
172
|
+
*/
|
173
|
+
async updateAriaLabel() {
|
174
|
+
let ariaLabel;
|
175
|
+
if (this.hasRouterSlot()) {
|
176
|
+
ariaLabel = this.routerSlot.textContent;
|
177
|
+
}
|
178
|
+
else if (helpers.isSlotUsed(this.el, "label")) {
|
179
|
+
ariaLabel = this.el.querySelector('[slot="label"]').textContent;
|
180
|
+
}
|
181
|
+
else {
|
182
|
+
ariaLabel = this.label;
|
183
|
+
}
|
184
|
+
if (this.isParent) {
|
185
|
+
ariaLabel = `${ariaLabel}, triggers submenu, ${this.expanded ? "expanded" : "collapsed"}`;
|
186
|
+
}
|
187
|
+
if (this.el.parentElement) {
|
188
|
+
const treeItems = Array.from(this.el.parentElement.children).filter((child) => child.tagName === this.treeItemTag);
|
189
|
+
const index = treeItems.indexOf(this.el) + 1;
|
190
|
+
const parentChildren = treeItems.length;
|
191
|
+
ariaLabel = `${ariaLabel}, ${index} of ${parentChildren}`;
|
192
|
+
}
|
193
|
+
if (this.selected) {
|
194
|
+
ariaLabel = `${ariaLabel}, active`;
|
195
|
+
}
|
196
|
+
if (this.disabled) {
|
197
|
+
ariaLabel = `${ariaLabel}, dimmed`;
|
198
|
+
}
|
199
|
+
if (this.hasRouterSlot()) {
|
200
|
+
this.routerSlot.ariaLabel = ariaLabel;
|
201
|
+
}
|
202
|
+
else {
|
203
|
+
this.treeItemElement.ariaLabel = ariaLabel;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
hasRouterSlot() {
|
207
|
+
this.routerSlot = this.el.querySelector('[slot="router-item"]');
|
208
|
+
return !!this.routerSlot;
|
209
|
+
}
|
210
|
+
render() {
|
211
|
+
const { appearance, disabled, label, selected, size, expanded } = this;
|
212
|
+
const Component = this.href && !this.disabled ? "a" : "div";
|
213
|
+
const attrs = Component == "a" && {
|
214
|
+
href: this.href,
|
215
|
+
hrefLang: this.hreflang,
|
216
|
+
referrerPolicy: this.referrerpolicy,
|
217
|
+
rel: this.rel,
|
218
|
+
target: this.target,
|
219
|
+
};
|
220
|
+
return (index.h(index.Host, { class: {
|
221
|
+
[`ic-tree-item-${appearance}`]: true,
|
222
|
+
"ic-tree-item-disabled": disabled,
|
223
|
+
"ic-tree-item-selected": !disabled && selected,
|
224
|
+
[`ic-tree-item-${size}`]: size !== "default",
|
225
|
+
}, id: this.treeItemId }, this.hasRouterSlot() ? (index.h("slot", { name: "router-item" })) : (index.h(Component, Object.assign({ class: {
|
226
|
+
"tree-item-content": true,
|
227
|
+
}, tabIndex: disabled ? -1 : 0, onClick: this.handleTreeItemClicked, ref: (el) => (this.treeItemElement = el), "aria-disabled": disabled ? "true" : "false", "aria-live": "polite" }, attrs, { onFocus: () => this.handleDisplayTooltip(true), onBlur: () => this.handleDisplayTooltip(false) }), this.isParent && (index.h("span", { class: {
|
228
|
+
["arrow-dropdown"]: true,
|
229
|
+
["tree-item-expanded"]: expanded,
|
230
|
+
}, "aria-hidden": "true", innerHTML: arrowDropdown })), helpers.isSlotUsed(this.el, "icon") && (index.h("div", { class: "icon-container" }, index.h("slot", { name: "icon" }))), index.h("ic-typography", { class: "tree-item-label" }, helpers.isSlotUsed(this.el, "label") ? index.h("slot", { name: "label" }) : label))), expanded && (index.h("div", { "aria-hidden": `${!expanded}` }, index.h("slot", null)))));
|
231
|
+
}
|
232
|
+
get el() { return index.getElement(this); }
|
233
|
+
static get watchers() { return {
|
234
|
+
"selected": ["watchSelectedHandler"]
|
235
|
+
}; }
|
236
|
+
};
|
237
|
+
TreeItem.style = icTreeItemCss;
|
238
|
+
|
239
|
+
exports.ic_tree_item = TreeItem;
|
240
|
+
|
241
|
+
//# sourceMappingURL=ic-tree-item.cjs.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"file":"ic-tree-item.entry.cjs.js","mappings":";;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,+6GAA+6G;;ACsBr8G,IAAI,WAAW,GAAG,CAAC,CAAC;MAYP,QAAQ;;;;QACX,eAAU,GAAG,gBAAgB,WAAW,EAAE,EAAE,CAAC;QAE7C,gBAAW,GAAG,cAAc,CAAC;QAE7B,yBAAoB,GAAqB,IAAI,CAAC;QAC9C,YAAO,GAAG,YAAY,CAAC;QA+IvB,0BAAqB,GAAG;YAC9B,IAAI,IAAI,CAAC,QA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CACJ,CACP,CACI,EACP;KACH;;;;;;;;;;","names":["checkSlotInChildMutations","forceUpdate","isSlotUsed","onComponentRequiredPropUndefined","h","Host"],"sources":["src/components/ic-tree-item/ic-tree-item.css?tag=ic-tree-item&encapsulation=shadow","src/components/ic-tree-item/ic-tree-item.tsx"],"sourcesContent":[":host {\n display: block;\n border: none;\n position: relative;\n}\n\n:host .tree-item-content {\n display: flex;\n align-items: center;\n height: calc(var(--ic-space-xl) + var(--ic-space-xs));\n padding: 0 var(--ic-space-xs);\n text-decoration: none;\n color: var(--ic-primary-text);\n}\n\n::slotted([slot=\"router-item\"]) {\n display: flex;\n align-items: center;\n height: calc(var(--ic-space-xl) + var(--ic-space-xs));\n text-decoration: none;\n font-family: var(--ic-font-body-family);\n color: var(--ic-primary-text);\n padding: 0 var(--ic-space-xs) !important;\n}\n\n::slotted([slot=\"router-item\"].ic-tree-item-single) {\n padding-left: calc(var(--ic-space-xl) + var(--ic-space-xs)) !important;\n}\n\n:host .tree-item-content:focus,\n::slotted([slot=\"router-item\"]:focus) {\n box-shadow: var(--ic-border-focus);\n border-radius: var(--ic-border-radius);\n transition: var(--ic-transition-duration-fast);\n outline: none;\n}\n\n:host .tree-item-content:hover,\n::slotted([slot=\"router-item\"]:hover) {\n background-color: var(--ic-action-dark-bg-hover) !important;\n cursor: pointer;\n}\n\n:host .tree-item-content:active,\n::slotted([slot=\"router-item\"]:active) {\n background-color: var(--ic-action-dark-bg-active) !important;\n}\n\n:host(.ic-tree-item-selected) .tree-item-content,\n:host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]) {\n background-color: var(--ic-action-default-bg-hover) !important;\n}\n\n:host(.ic-tree-item-small) .tree-item-content,\n:host(.ic-tree-item-small) ::slotted([slot=\"router-item\"]) {\n height: var(--ic-space-xl);\n}\n\n:host(.ic-tree-item-large) .tree-item-content,\n:host(.ic-tree-item-large) ::slotted([slot=\"router-item\"]) {\n height: var(--ic-space-xxl);\n}\n\n:host(.ic-tree-item-disabled) {\n pointer-events: none;\n}\n\n:host(.ic-tree-item-disabled) .tree-item-content,\n:host(.ic-tree-item-disabled) .arrow-dropdown,\n:host(.ic-tree-item-disabled) ::slotted([slot=\"icon\"]),\n:host(.ic-tree-item-disabled) ::slotted([slot=\"router-item\"]) {\n color: var(--ic-architectural-200) !important;\n fill: var(--ic-architectural-200);\n pointer-events: none;\n}\n\n:host(.ic-tree-item-light) .tree-item-content,\n:host(.ic-tree-item-light) .arrow-dropdown,\n:host(.ic-tree-item-light) ::slotted([slot=\"icon\"]),\n:host(.ic-tree-item-light) ::slotted([slot=\"router-item\"]) {\n color: var(--ic-architectural-white);\n fill: var(--ic-architectural-white);\n}\n\n:host .arrow-dropdown {\n color: var(--ic-action-default);\n margin-right: var(--ic-space-xs);\n}\n\n:host(.ic-tree-item-small) .arrow-dropdown {\n margin-right: var(--ic-space-xxs);\n}\n\n:host .tree-item-expanded {\n transform: rotate(180deg);\n margin-top: calc(-1 * var(--ic-space-xxs));\n}\n\n:host .ic-tree-item-single {\n padding-left: calc(var(--ic-space-xl) + var(--ic-space-xs));\n}\n\n:host(.ic-tree-item-small) .ic-tree-item-single {\n padding-left: calc(var(--ic-space-xl) + var(--ic-space-xxs));\n}\n\n.icon-container {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n margin: 0 var(--ic-space-xs) 0 0;\n}\n\n:host(.ic-tree-item-small) .icon-container {\n margin: 0 var(--ic-space-xxs) 0 0;\n}\n\n.ic-text-overflow {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ic-tooltip-overflow {\n overflow: hidden;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n ::slotted([slot=\"icon\"]) {\n fill: currentcolor;\n }\n\n :host(.ic-tree-item-disabled) .tree-item-content,\n :host(.ic-tree-item-disabled) .arrow-dropdown,\n :host(.ic-tree-item-disabled) ::slotted([slot=\"icon\"]),\n :host(.ic-tree-item-disabled) ::slotted([slot=\"router-item\"]) {\n color: GrayText !important;\n fill: GrayText !important;\n }\n\n :host .tree-item-content:focus,\n ::slotted([slot=\"router-item\"]:focus) {\n border: var(--ic-hc-border) !important;\n }\n\n :host(.ic-tree-item-selected) .tree-item-content,\n :host(.ic-tree-item-selected) ::slotted([slot=\"router-item\"]) {\n color: Highlight !important;\n }\n}\n","import {\n Component,\n h,\n Prop,\n Element,\n Event,\n EventEmitter,\n Host,\n Watch,\n State,\n Listen,\n forceUpdate,\n Method,\n} from \"@stencil/core\";\nimport { IcSizes, IcThemeForegroundNoDefault } from \"../../utils/types\";\nimport {\n isSlotUsed,\n onComponentRequiredPropUndefined,\n checkSlotInChildMutations,\n} from \"../../utils/helpers\";\nimport arrowDropdown from \"../../assets/arrow-dropdown.svg\";\n\nlet treeItemIds = 0;\n\n/**\n * @slot label - Content is set as the tree item label.\n * @slot icon - Content is placed to the left of the label.\n * @slot router-item - Handle routing by nesting your routes in this slot.\n */\n@Component({\n tag: \"ic-tree-item\",\n styleUrl: \"ic-tree-item.css\",\n shadow: true,\n})\nexport class TreeItem {\n private treeItemId = `ic-tree-item-${treeItemIds++}`;\n private treeItemElement: HTMLElement;\n private treeItemTag = \"IC-TREE-ITEM\";\n private routerSlot: HTMLElement;\n private hostMutationObserver: MutationObserver = null;\n private TOOLTIP = \"ic-tooltip\";\n\n @Element() el: HTMLIcTreeItemElement;\n\n @State() childTreeItems: HTMLIcTreeItemElement[];\n\n /**\n * @internal Determines whether the light or dark variant of the tree item should be displayed.\n */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n\n /**\n * If `true`, the tree item appears in the disabled state.\n */\n @Prop() disabled?: boolean = false;\n\n /**\n * @internal If `true`, the tree item appears in the expanded state.\n */\n @Prop({ mutable: true }) expanded: boolean = false;\n\n /**\n * @internal Determines if the parent tree item has been expanded.\n */\n @Prop({ mutable: true }) hasParentExpanded: boolean = false;\n\n /**\n * The URL that the tree item link points to. If set, the tree item will render as an \"a\" tag, otherwise it will render as a div.\n */\n @Prop() href?: string | undefined;\n\n /**\n * The human language of the linked URL.\n */\n @Prop() hreflang?: string = \"\";\n\n /**\n * @internal If `true`, the tree item is a parent of other tree items.\n */\n @Prop({ mutable: true }) isParent: boolean = false;\n\n /**\n * The label of the tree item.\n */\n @Prop() label: string = \"\";\n\n /**\n * How much of the referrer to send when following the link.\n */\n @Prop() referrerpolicy?: ReferrerPolicy;\n\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n @Prop() rel?: string;\n\n /**\n * If `true`, the tree item appears in the selected state.\n */\n @Prop({ mutable: true }) selected: boolean = false;\n @Watch(\"selected\")\n watchSelectedHandler() {\n if (this.selected) {\n this.icTreeItemSelected.emit({ id: this.el.id });\n }\n this.updateAriaLabel();\n }\n\n /**\n * @internal Determines the size of the tree item.\n */\n @Prop() size?: IcSizes = \"default\";\n\n /**\n * The place to display the linked URL, as the name for a browsing context (a tab, window, or iframe).\n */\n @Prop() target?: string;\n\n /**\n * Emitted when tree item is selected.\n */\n @Event() icTreeItemSelected: EventEmitter<{ id: string }>;\n\n disconnectedCallback(): void {\n this.hostMutationObserver?.disconnect();\n }\n\n componentDidLoad(): void {\n this.childTreeItems = Array.from((this.el as HTMLElement).children).filter(\n (child) => child.tagName === this.treeItemTag\n ) as HTMLIcTreeItemElement[];\n\n if (this.childTreeItems.length > 0) {\n this.isParent = true;\n }\n\n this.setTreeItemPadding();\n\n this.updateAriaLabel();\n\n this.truncateTreeItemLabel(this.el);\n\n !isSlotUsed(this.el, \"label\") &&\n onComponentRequiredPropUndefined(\n [{ prop: this.label, propName: \"label\" }],\n \"Tree item\"\n );\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n componentDidUpdate(): void {\n if (this.hasParentExpanded) {\n this.childTreeItems.forEach((child) => {\n this.truncateTreeItemLabel(child);\n });\n this.hasParentExpanded = false;\n }\n }\n\n @Listen(\"keydown\", {})\n handleKeyDown(ev: KeyboardEvent): void {\n if (ev.key === \"Enter\" || ev.key === \" \") {\n ev.stopImmediatePropagation();\n this.handleTreeItemClicked();\n }\n }\n\n /**\n * Sets focus on the native `input`.\n */\n @Method()\n async setFocus(): Promise<void> {\n if (this.hasRouterSlot()) {\n this.routerSlot?.focus();\n } else {\n this.treeItemElement?.focus();\n }\n }\n\n private handleTreeItemClicked = (): void => {\n if (this.isParent) {\n this.expanded = !this.expanded;\n this.hasParentExpanded = true;\n }\n\n this.updateAriaLabel();\n this.selected = true;\n this.watchSelectedHandler();\n };\n\n /**\n * @internal Updates the aria-label of the tree item.\n */\n @Method()\n async updateAriaLabel(): Promise<void> {\n let ariaLabel;\n\n if (this.hasRouterSlot()) {\n ariaLabel = this.routerSlot.textContent;\n } else if (isSlotUsed(this.el, \"label\")) {\n ariaLabel = this.el.querySelector('[slot=\"label\"]').textContent;\n } else {\n ariaLabel = this.label;\n }\n\n if (this.isParent) {\n ariaLabel = `${ariaLabel}, triggers submenu, ${\n this.expanded ? \"expanded\" : \"collapsed\"\n }`;\n }\n\n if (this.el.parentElement) {\n const treeItems = Array.from(\n (this.el.parentElement as HTMLElement).children\n ).filter(\n (child) => child.tagName === this.treeItemTag\n ) as HTMLIcTreeItemElement[];\n\n const index = treeItems.indexOf(this.el) + 1;\n const parentChildren = treeItems.length;\n\n ariaLabel = `${ariaLabel}, ${index} of ${parentChildren}`;\n }\n\n if (this.selected) {\n ariaLabel = `${ariaLabel}, active`;\n }\n\n if (this.disabled) {\n ariaLabel = `${ariaLabel}, dimmed`;\n }\n\n if (this.hasRouterSlot()) {\n this.routerSlot.ariaLabel = ariaLabel;\n } else {\n this.treeItemElement.ariaLabel = ariaLabel;\n }\n }\n\n private setTreeItemPadding = () => {\n let level = 1;\n let parentElement = this.el.parentElement;\n const treeItemContent = this.el.shadowRoot.querySelector(\n \".tree-item-content\"\n ) as HTMLElement;\n\n const isSiblingOfParent = Array.from(parentElement.children)\n .map((sibling) => {\n if (\n sibling !== this.el &&\n !sibling.querySelector('[slot=\"router-item\"]') &&\n !sibling.querySelector('[slot=\"label\"]')\n ) {\n return sibling.children.length > 0;\n } else {\n return false;\n }\n })\n .includes(true);\n\n const isChild = parentElement.tagName === this.treeItemTag;\n\n const isRouterItem = this.hasRouterSlot();\n\n if (\n (isSiblingOfParent && !this.el.isParent) ||\n (isChild && !this.el.isParent)\n ) {\n if (isRouterItem) {\n this.routerSlot.classList.add(\"ic-tree-item-single\");\n } else {\n treeItemContent.classList.add(\"ic-tree-item-single\");\n }\n }\n\n while (parentElement) {\n if (parentElement.tagName === this.treeItemTag) {\n level++;\n if (!this.el.isParent && isSiblingOfParent) {\n treeItemContent.style.paddingLeft = `calc(var(--ic-space-xl) + ${\n level * 16\n }px)`;\n } else if (!this.el.isParent) {\n treeItemContent.style.paddingLeft = `calc(var(--ic-space-xs) + ${\n level * 24\n }px`;\n } else {\n treeItemContent.style.paddingLeft = `${level * 16}px`;\n }\n }\n parentElement = parentElement.parentElement;\n }\n };\n\n private truncateTreeItemLabel = (treeItem: HTMLIcTreeItemElement) => {\n const typographyEl: HTMLIcTypographyElement =\n treeItem.shadowRoot.querySelector(\".tree-item-label\");\n const tooltip = typographyEl?.closest(this.TOOLTIP);\n const treeContent: HTMLElement =\n treeItem.shadowRoot.querySelector(\".tree-item-content\");\n\n if (typographyEl?.scrollHeight > treeContent?.clientHeight) {\n typographyEl.classList.add(\"ic-text-overflow\");\n\n if (!tooltip) {\n const tooltipEl = document.createElement(\"ic-tooltip\");\n tooltipEl.setAttribute(\"target\", this.el.id);\n tooltipEl.setAttribute(\"label\", typographyEl.textContent);\n tooltipEl.classList.add(\"ic-tooltip-overflow\");\n tooltipEl.setAttribute(\"placement\", \"right\");\n treeContent.appendChild(tooltipEl);\n tooltipEl.appendChild(typographyEl);\n }\n }\n };\n\n private hasRouterSlot(): boolean {\n this.routerSlot = this.el.querySelector('[slot=\"router-item\"]');\n return !!this.routerSlot;\n }\n\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n if (\n mutationList.some(({ type, addedNodes, removedNodes }) =>\n type === \"childList\"\n ? checkSlotInChildMutations(addedNodes, removedNodes, \"icon\")\n : false\n )\n ) {\n forceUpdate(this);\n }\n };\n\n private handleDisplayTooltip = (display: boolean) => {\n const typographyEl: HTMLIcTypographyElement =\n this.el.shadowRoot.querySelector(\".tree-item-label\");\n const tooltip: HTMLIcTooltipElement = typographyEl?.closest(this.TOOLTIP);\n\n tooltip?.displayTooltip(display);\n };\n\n render() {\n const { appearance, disabled, label, selected, size, expanded } = this;\n\n const Component = this.href && !this.disabled ? \"a\" : \"div\";\n\n const attrs = Component == \"a\" && {\n href: this.href,\n hrefLang: this.hreflang,\n referrerPolicy: this.referrerpolicy,\n rel: this.rel,\n target: this.target,\n };\n\n return (\n <Host\n class={{\n [`ic-tree-item-${appearance}`]: true,\n \"ic-tree-item-disabled\": disabled,\n \"ic-tree-item-selected\": !disabled && selected,\n [`ic-tree-item-${size}`]: size !== \"default\",\n }}\n id={this.treeItemId}\n >\n {this.hasRouterSlot() ? (\n <slot name=\"router-item\" />\n ) : (\n <Component\n class={{\n \"tree-item-content\": true,\n }}\n tabIndex={disabled ? -1 : 0}\n onClick={this.handleTreeItemClicked}\n ref={(el) => (this.treeItemElement = el)}\n aria-disabled={disabled ? \"true\" : \"false\"}\n aria-live=\"polite\"\n {...attrs}\n onFocus={() => this.handleDisplayTooltip(true)}\n onBlur={() => this.handleDisplayTooltip(false)}\n >\n {this.isParent && (\n <span\n class={{\n [\"arrow-dropdown\"]: true,\n [\"tree-item-expanded\"]: expanded,\n }}\n aria-hidden=\"true\"\n innerHTML={arrowDropdown}\n />\n )}\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography class=\"tree-item-label\">\n {isSlotUsed(this.el, \"label\") ? <slot name=\"label\" /> : label}\n </ic-typography>\n </Component>\n )}\n {expanded && (\n <div aria-hidden={`${!expanded}`}>\n <slot />\n </div>\n )}\n </Host>\n );\n }\n}\n"],"version":3}
|
@@ -0,0 +1,203 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-4cf27b16.js');
|
6
|
+
const helpers = require('./helpers-85c5ca15.js');
|
7
|
+
|
8
|
+
const icTreeViewCss = ":host{display:block;width:var(--tree-view-width, 100%)}:host .heading-area-container{border-bottom:var(--ic-border-default);display:flex;align-items:center;height:calc(var(--ic-space-xl) + var(--ic-space-xs) - var(--ic-space-1px));padding:0 var(--ic-space-xs)}:host(.ic-tree-view-small) .heading-area-container{height:calc(var(--ic-space-xl) - var(--ic-space-1px))}:host(.ic-tree-view-large) .heading-area-container{height:calc(var(--ic-space-xxl) - var(--ic-space-1px))}:host(.ic-tree-view-light) .heading-area-container{color:var(--ic-architectural-white);fill:var(--ic-architectural-white)}.icon-container{width:var(--ic-space-lg);height:var(--ic-space-lg);margin:0 var(--ic-space-xs) 0 0}:host(.ic-tree-view-small) .icon-container{margin:0 var(--ic-space-xxs) 0 0}.ic-text-overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.ic-tooltip-overflow{overflow:hidden}@media (forced-colors: active){::slotted([slot=\"icon\"]){fill:currentcolor}}";
|
9
|
+
|
10
|
+
let treeViewIds = 0;
|
11
|
+
const TreeView = class {
|
12
|
+
constructor(hostRef) {
|
13
|
+
index.registerInstance(this, hostRef);
|
14
|
+
this.treeViewId = `ic-tree-view-${treeViewIds++}`;
|
15
|
+
this.treeItemTag = "IC-TREE-ITEM";
|
16
|
+
this.hostMutationObserver = null;
|
17
|
+
this.handleKeyDown = (event) => {
|
18
|
+
var _a;
|
19
|
+
const focussedChild = this.treeItems.indexOf(this.treeItems.filter((el) => el === document.activeElement)[0]);
|
20
|
+
const expanded = (_a = this.treeItems[focussedChild]) === null || _a === void 0 ? void 0 : _a.expanded;
|
21
|
+
switch (event.key) {
|
22
|
+
case "ArrowDown":
|
23
|
+
this.treeItems[this.getNextItemToSelect(focussedChild, true)].setFocus();
|
24
|
+
if (focussedChild !== this.treeItems.length - 1) {
|
25
|
+
event.preventDefault();
|
26
|
+
}
|
27
|
+
break;
|
28
|
+
case "ArrowUp":
|
29
|
+
this.treeItems[this.getNextItemToSelect(focussedChild, false)].setFocus();
|
30
|
+
if (focussedChild !== 0) {
|
31
|
+
event.preventDefault();
|
32
|
+
}
|
33
|
+
break;
|
34
|
+
case "ArrowRight":
|
35
|
+
if (this.treeItems[focussedChild].isParent && !expanded) {
|
36
|
+
this.treeItems[focussedChild].expanded = true;
|
37
|
+
this.treeItems[focussedChild].hasParentExpanded = true;
|
38
|
+
this.treeItems[focussedChild].updateAriaLabel();
|
39
|
+
}
|
40
|
+
else if (this.treeItems[focussedChild].isParent && expanded) {
|
41
|
+
this.treeItems[focussedChild].children[0].setFocus();
|
42
|
+
}
|
43
|
+
event.preventDefault();
|
44
|
+
break;
|
45
|
+
case "ArrowLeft":
|
46
|
+
if (this.treeItems[focussedChild].isParent && expanded) {
|
47
|
+
this.treeItems[focussedChild].expanded = false;
|
48
|
+
this.treeItems[focussedChild].hasParentExpanded = false;
|
49
|
+
this.treeItems[focussedChild].updateAriaLabel();
|
50
|
+
}
|
51
|
+
else if (this.treeItems[focussedChild].parentElement.tagName ===
|
52
|
+
this.treeItemTag) {
|
53
|
+
this.treeItems[focussedChild].parentElement.setFocus();
|
54
|
+
}
|
55
|
+
event.preventDefault();
|
56
|
+
break;
|
57
|
+
}
|
58
|
+
};
|
59
|
+
this.getNextItemToSelect = (currentItem, movingDown) => {
|
60
|
+
const numItems = this.treeItems.length - 1;
|
61
|
+
if (currentItem < 1) {
|
62
|
+
currentItem = 0;
|
63
|
+
}
|
64
|
+
let nextItem = movingDown ? currentItem + 1 : currentItem - 1;
|
65
|
+
if (nextItem < 0) {
|
66
|
+
nextItem = 0;
|
67
|
+
}
|
68
|
+
else if (nextItem > numItems) {
|
69
|
+
nextItem = numItems;
|
70
|
+
}
|
71
|
+
const maxAttempts = numItems + 1;
|
72
|
+
let attempts = 0;
|
73
|
+
while (attempts < maxAttempts) {
|
74
|
+
if (nextItem < 0 || nextItem > numItems) {
|
75
|
+
return currentItem;
|
76
|
+
}
|
77
|
+
if (!this.treeItems[nextItem].disabled &&
|
78
|
+
(this.treeItems[nextItem].parentElement.tagName !== this.treeItemTag ||
|
79
|
+
this.treeItems[nextItem].parentElement
|
80
|
+
.expanded)) {
|
81
|
+
return nextItem;
|
82
|
+
}
|
83
|
+
if (nextItem === numItems && this.treeItems[nextItem].disabled) {
|
84
|
+
return currentItem;
|
85
|
+
}
|
86
|
+
nextItem = movingDown ? nextItem + 1 : nextItem - 1;
|
87
|
+
attempts++;
|
88
|
+
}
|
89
|
+
return currentItem;
|
90
|
+
};
|
91
|
+
this.linkTreeItems = () => {
|
92
|
+
this.treeItems.forEach((treeItem) => {
|
93
|
+
treeItem.setAttribute("context-id", this.treeViewId);
|
94
|
+
});
|
95
|
+
};
|
96
|
+
this.setTreeItems = () => {
|
97
|
+
this.treeItems = this.getAllTreeItems(this.el);
|
98
|
+
this.linkTreeItems();
|
99
|
+
};
|
100
|
+
this.addSlotChangeListener = () => {
|
101
|
+
this.el.addEventListener("slotchange", this.setTreeItems);
|
102
|
+
};
|
103
|
+
this.truncateTreeViewHeading = () => {
|
104
|
+
const typographyEl = this.el.shadowRoot.querySelector(".tree-view-header");
|
105
|
+
const tooltip = typographyEl.closest("ic-tooltip");
|
106
|
+
const headingContainer = this.el.shadowRoot.querySelector(".heading-area-container");
|
107
|
+
if ((typographyEl === null || typographyEl === void 0 ? void 0 : typographyEl.scrollHeight) > (headingContainer === null || headingContainer === void 0 ? void 0 : headingContainer.clientHeight)) {
|
108
|
+
typographyEl.classList.add("ic-text-overflow");
|
109
|
+
if (!tooltip) {
|
110
|
+
const tooltipEl = document.createElement("ic-tooltip");
|
111
|
+
tooltipEl.setAttribute("target", this.el.id);
|
112
|
+
tooltipEl.setAttribute("label", typographyEl.textContent);
|
113
|
+
tooltipEl.classList.add("ic-tooltip-overflow");
|
114
|
+
tooltipEl.setAttribute("placement", "right");
|
115
|
+
headingContainer.appendChild(tooltipEl);
|
116
|
+
tooltipEl.appendChild(typographyEl);
|
117
|
+
}
|
118
|
+
}
|
119
|
+
};
|
120
|
+
this.hostMutationCallback = (mutationList) => {
|
121
|
+
if (mutationList.some(({ type, addedNodes, removedNodes }) => type === "childList"
|
122
|
+
? helpers.checkSlotInChildMutations(addedNodes, removedNodes, "icon")
|
123
|
+
: false)) {
|
124
|
+
index.forceUpdate(this);
|
125
|
+
}
|
126
|
+
};
|
127
|
+
this.isHeadingDefined = () => helpers.isPropDefined(this.heading) && this.heading !== null;
|
128
|
+
this.hasHeadingAreaContent = () => {
|
129
|
+
return (helpers.isSlotUsed(this.el, "heading") ||
|
130
|
+
this.isHeadingDefined() ||
|
131
|
+
helpers.isSlotUsed(this.el, "icon"));
|
132
|
+
};
|
133
|
+
this.treeItems = undefined;
|
134
|
+
this.appearance = "dark";
|
135
|
+
this.heading = "";
|
136
|
+
this.size = "default";
|
137
|
+
}
|
138
|
+
watchAppearanceHandler() {
|
139
|
+
this.treeItems.forEach((treeItem) => {
|
140
|
+
treeItem.appearance = this.appearance;
|
141
|
+
});
|
142
|
+
}
|
143
|
+
watchSizeHandler() {
|
144
|
+
this.treeItems.forEach((treeItem) => {
|
145
|
+
treeItem.size = this.size;
|
146
|
+
});
|
147
|
+
}
|
148
|
+
disconnectedCallback() {
|
149
|
+
var _a, _b;
|
150
|
+
(_a = this.el) === null || _a === void 0 ? void 0 : _a.removeEventListener("slotchange", this.setTreeItems);
|
151
|
+
(_b = this.hostMutationObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
|
152
|
+
}
|
153
|
+
componentDidLoad() {
|
154
|
+
this.setTreeItems();
|
155
|
+
this.watchAppearanceHandler();
|
156
|
+
this.watchSizeHandler();
|
157
|
+
setTimeout(() => {
|
158
|
+
this.truncateTreeViewHeading();
|
159
|
+
}, 100);
|
160
|
+
this.addSlotChangeListener();
|
161
|
+
this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);
|
162
|
+
this.hostMutationObserver.observe(this.el, {
|
163
|
+
childList: true,
|
164
|
+
});
|
165
|
+
}
|
166
|
+
handleTreeItemSelected(event) {
|
167
|
+
this.treeItems.forEach((treeItem) => {
|
168
|
+
if (treeItem.selected && treeItem.id !== event.detail.id) {
|
169
|
+
treeItem.selected = false;
|
170
|
+
}
|
171
|
+
});
|
172
|
+
}
|
173
|
+
getAllTreeItems(element) {
|
174
|
+
const treeItems = [];
|
175
|
+
const collectTreeItems = (el) => {
|
176
|
+
Array.from(el.children).forEach((child) => {
|
177
|
+
if (child.tagName === this.treeItemTag) {
|
178
|
+
treeItems.push(child);
|
179
|
+
}
|
180
|
+
collectTreeItems(child);
|
181
|
+
});
|
182
|
+
};
|
183
|
+
collectTreeItems(element);
|
184
|
+
return treeItems;
|
185
|
+
}
|
186
|
+
render() {
|
187
|
+
const { appearance, heading, size } = this;
|
188
|
+
return (index.h(index.Host, { "context-id": this.treeViewId, class: {
|
189
|
+
[`ic-tree-view-${appearance}`]: true,
|
190
|
+
[`ic-tree-view-${size}`]: size !== "default",
|
191
|
+
}, onKeyDown: this.handleKeyDown, "aria-label": this.isHeadingDefined() ? heading : null }, this.hasHeadingAreaContent() && (index.h("div", { class: "heading-area-container" }, helpers.isSlotUsed(this.el, "icon") && (index.h("div", { class: "icon-container" }, index.h("slot", { name: "icon" }))), index.h("ic-typography", { variant: "subtitle-large", class: "tree-view-header" }, helpers.isSlotUsed(this.el, "heading") ? (index.h("slot", { name: "heading" })) : (heading)))), index.h("slot", null)));
|
192
|
+
}
|
193
|
+
get el() { return index.getElement(this); }
|
194
|
+
static get watchers() { return {
|
195
|
+
"appearance": ["watchAppearanceHandler"],
|
196
|
+
"size": ["watchSizeHandler"]
|
197
|
+
}; }
|
198
|
+
};
|
199
|
+
TreeView.style = icTreeViewCss;
|
200
|
+
|
201
|
+
exports.ic_tree_view = TreeView;
|
202
|
+
|
203
|
+
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gB,UAAU,EAAE,GAAG,IAAI;gBACpC,CAAC,gBAAgB,IAAI,EAAE,GAAG,IAAI,KAAK,SAAS;aAC7C,EACD,SAAS,EAAE,IAAI,CAAC,aAAa,gBACjB,IAAI,CAAC,gBAAgB,EAAE,GAAG,OAAO,GAAG,IAAI,IAEnD,IAAI,CAAC,qBAAqB,EAAE,KAC3BD,iBAAK,KAAK,EAAC,wBAAwB,IAChCD,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,KAC1BC,iBAAK,KAAK,EAAC,gBAAgB,IACzBA,kBAAM,IAAI,EAAC,MAAM,GAAG,CAChB,CACP,EACDA,2BAAe,OAAO,EAAC,gBAAgB,EAAC,KAAK,EAAC,kBAAkB,IAC7DD,kBAAU,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,IAC7BC,kBAAM,IAAI,EAAC,SAAS,GAAG,KAEvB,OAAO,CACR,CACa,CACZ,CACP,EACDA,qBAAa,CACR,EACP;KACH;;;;;;;;;;;","names":["checkSlotInChildMutations","forceUpdate","isPropDefined","isSlotUsed","h","Host"],"sources":["src/components/ic-tree-view/ic-tree-view.css?tag=ic-tree-view&encapsulation=shadow","src/components/ic-tree-view/ic-tree-view.tsx"],"sourcesContent":["/**\n* @prop --tree-view-width: Width of the tree view\n*/\n\n:host {\n display: block;\n width: var(--tree-view-width, 100%);\n}\n\n:host .heading-area-container {\n border-bottom: var(--ic-border-default);\n display: flex;\n align-items: center;\n height: calc(var(--ic-space-xl) + var(--ic-space-xs) - var(--ic-space-1px));\n padding: 0 var(--ic-space-xs);\n}\n\n:host(.ic-tree-view-small) .heading-area-container {\n height: calc(var(--ic-space-xl) - var(--ic-space-1px));\n}\n\n:host(.ic-tree-view-large) .heading-area-container {\n height: calc(var(--ic-space-xxl) - var(--ic-space-1px));\n}\n\n:host(.ic-tree-view-light) .heading-area-container {\n color: var(--ic-architectural-white);\n fill: var(--ic-architectural-white);\n}\n\n.icon-container {\n width: var(--ic-space-lg);\n height: var(--ic-space-lg);\n margin: 0 var(--ic-space-xs) 0 0;\n}\n\n:host(.ic-tree-view-small) .icon-container {\n margin: 0 var(--ic-space-xxs) 0 0;\n}\n\n.ic-text-overflow {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ic-tooltip-overflow {\n overflow: hidden;\n}\n\n/** High Contrast **/\n@media (forced-colors: active) {\n ::slotted([slot=\"icon\"]) {\n fill: currentcolor;\n }\n}\n","import {\n Component,\n h,\n Prop,\n Element,\n Host,\n Watch,\n State,\n Listen,\n forceUpdate,\n} from \"@stencil/core\";\nimport { IcSizes, IcThemeForegroundNoDefault } from \"../../utils/types\";\nimport {\n isPropDefined,\n isSlotUsed,\n checkSlotInChildMutations,\n} from \"../../utils/helpers\";\n\nlet treeViewIds = 0;\n\n/**\n * @slot heading - Content is set as the tree view heading.\n * @slot icon - Content is placed to the left of the heading.\n */\n\n@Component({\n tag: \"ic-tree-view\",\n styleUrl: \"ic-tree-view.css\",\n shadow: true,\n})\nexport class TreeView {\n private treeViewId = `ic-tree-view-${treeViewIds++}`;\n private treeItemTag = \"IC-TREE-ITEM\";\n private hostMutationObserver: MutationObserver = null;\n\n @Element() el: HTMLIcTreeViewElement;\n\n @State() treeItems: HTMLIcTreeItemElement[];\n\n /**\n * The appearance of the tree view, e.g. dark, or light.\n */\n @Prop() appearance?: IcThemeForegroundNoDefault = \"dark\";\n @Watch(\"appearance\")\n watchAppearanceHandler() {\n this.treeItems.forEach((treeItem) => {\n treeItem.appearance = this.appearance;\n });\n }\n\n /**\n * The heading of the tree view.\n */\n @Prop() heading?: string = \"\";\n\n /**\n * The size of the tree view.\n */\n @Prop() size?: IcSizes = \"default\";\n @Watch(\"size\")\n watchSizeHandler() {\n this.treeItems.forEach((treeItem) => {\n treeItem.size = this.size;\n });\n }\n\n disconnectedCallback(): void {\n this.el?.removeEventListener(\"slotchange\", this.setTreeItems);\n\n this.hostMutationObserver?.disconnect();\n }\n\n componentDidLoad(): void {\n this.setTreeItems();\n\n this.watchAppearanceHandler();\n this.watchSizeHandler();\n setTimeout(() => {\n this.truncateTreeViewHeading();\n }, 100);\n\n this.addSlotChangeListener();\n\n this.hostMutationObserver = new MutationObserver(this.hostMutationCallback);\n this.hostMutationObserver.observe(this.el, {\n childList: true,\n });\n }\n\n @Listen(\"icTreeItemSelected\")\n handleTreeItemSelected(event: CustomEvent): void {\n this.treeItems.forEach((treeItem) => {\n if (treeItem.selected && treeItem.id !== event.detail.id) {\n treeItem.selected = false;\n }\n });\n }\n\n private handleKeyDown = (event: KeyboardEvent): void => {\n const focussedChild = this.treeItems.indexOf(\n this.treeItems.filter((el) => el === document.activeElement)[0]\n );\n const expanded = this.treeItems[focussedChild]?.expanded;\n switch (event.key) {\n case \"ArrowDown\":\n this.treeItems[\n this.getNextItemToSelect(focussedChild, true)\n ].setFocus();\n if (focussedChild !== this.treeItems.length - 1) {\n event.preventDefault();\n }\n break;\n case \"ArrowUp\":\n this.treeItems[\n this.getNextItemToSelect(focussedChild, false)\n ].setFocus();\n if (focussedChild !== 0) {\n event.preventDefault();\n }\n break;\n case \"ArrowRight\":\n if (this.treeItems[focussedChild].isParent && !expanded) {\n this.treeItems[focussedChild].expanded = true;\n this.treeItems[focussedChild].hasParentExpanded = true;\n this.treeItems[focussedChild].updateAriaLabel();\n } else if (this.treeItems[focussedChild].isParent && expanded) {\n (\n this.treeItems[focussedChild].children[0] as HTMLIcTreeItemElement\n ).setFocus();\n }\n event.preventDefault();\n break;\n case \"ArrowLeft\":\n if (this.treeItems[focussedChild].isParent && expanded) {\n this.treeItems[focussedChild].expanded = false;\n this.treeItems[focussedChild].hasParentExpanded = false;\n this.treeItems[focussedChild].updateAriaLabel();\n } else if (\n this.treeItems[focussedChild].parentElement.tagName ===\n this.treeItemTag\n ) {\n (\n this.treeItems[focussedChild].parentElement as HTMLIcTreeItemElement\n ).setFocus();\n }\n event.preventDefault();\n break;\n }\n };\n\n private getNextItemToSelect = (\n currentItem: number,\n movingDown: boolean\n ): number => {\n const numItems = this.treeItems.length - 1;\n\n if (currentItem < 1) {\n currentItem = 0;\n }\n\n let nextItem = movingDown ? currentItem + 1 : currentItem - 1;\n if (nextItem < 0) {\n nextItem = 0;\n } else if (nextItem > numItems) {\n nextItem = numItems;\n }\n\n const maxAttempts = numItems + 1;\n let attempts = 0;\n\n while (attempts < maxAttempts) {\n if (nextItem < 0 || nextItem > numItems) {\n return currentItem;\n }\n\n if (\n !this.treeItems[nextItem].disabled &&\n (this.treeItems[nextItem].parentElement.tagName !== this.treeItemTag ||\n (this.treeItems[nextItem].parentElement as HTMLIcTreeItemElement)\n .expanded)\n ) {\n return nextItem;\n }\n\n if (nextItem === numItems && this.treeItems[nextItem].disabled) {\n return currentItem;\n }\n\n nextItem = movingDown ? nextItem + 1 : nextItem - 1;\n attempts++;\n }\n\n return currentItem;\n };\n\n private linkTreeItems = () => {\n this.treeItems.forEach((treeItem) => {\n treeItem.setAttribute(\"context-id\", this.treeViewId);\n });\n };\n\n private setTreeItems = () => {\n this.treeItems = this.getAllTreeItems(this.el as HTMLElement);\n\n this.linkTreeItems();\n };\n\n private getAllTreeItems(element: HTMLElement): HTMLIcTreeItemElement[] {\n const treeItems: HTMLIcTreeItemElement[] = [];\n\n const collectTreeItems = (el: HTMLElement) => {\n Array.from(el.children).forEach((child) => {\n if (child.tagName === this.treeItemTag) {\n treeItems.push(child as HTMLIcTreeItemElement);\n }\n\n collectTreeItems(child as HTMLElement);\n });\n };\n\n collectTreeItems(element);\n return treeItems;\n }\n\n private addSlotChangeListener = () => {\n this.el.addEventListener(\"slotchange\", this.setTreeItems);\n };\n\n private truncateTreeViewHeading = () => {\n const typographyEl: HTMLIcTypographyElement =\n this.el.shadowRoot.querySelector(\".tree-view-header\");\n const tooltip = typographyEl.closest(\"ic-tooltip\");\n const headingContainer: HTMLElement = this.el.shadowRoot.querySelector(\n \".heading-area-container\"\n );\n\n if (typographyEl?.scrollHeight > headingContainer?.clientHeight) {\n typographyEl.classList.add(\"ic-text-overflow\");\n\n if (!tooltip) {\n const tooltipEl = document.createElement(\"ic-tooltip\");\n tooltipEl.setAttribute(\"target\", this.el.id);\n tooltipEl.setAttribute(\"label\", typographyEl.textContent);\n tooltipEl.classList.add(\"ic-tooltip-overflow\");\n tooltipEl.setAttribute(\"placement\", \"right\");\n headingContainer.appendChild(tooltipEl);\n tooltipEl.appendChild(typographyEl);\n }\n }\n };\n\n private hostMutationCallback = (mutationList: MutationRecord[]): void => {\n if (\n mutationList.some(({ type, addedNodes, removedNodes }) =>\n type === \"childList\"\n ? checkSlotInChildMutations(addedNodes, removedNodes, \"icon\")\n : false\n )\n ) {\n forceUpdate(this);\n }\n };\n\n private isHeadingDefined = () =>\n isPropDefined(this.heading) && this.heading !== null;\n\n private hasHeadingAreaContent = (): boolean => {\n return (\n isSlotUsed(this.el, \"heading\") ||\n this.isHeadingDefined() ||\n isSlotUsed(this.el, \"icon\")\n );\n };\n\n render() {\n const { appearance, heading, size } = this;\n\n return (\n <Host\n context-id={this.treeViewId}\n class={{\n [`ic-tree-view-${appearance}`]: true,\n [`ic-tree-view-${size}`]: size !== \"default\",\n }}\n onKeyDown={this.handleKeyDown}\n aria-label={this.isHeadingDefined() ? heading : null}\n >\n {this.hasHeadingAreaContent() && (\n <div class=\"heading-area-container\">\n {isSlotUsed(this.el, \"icon\") && (\n <div class=\"icon-container\">\n <slot name=\"icon\" />\n </div>\n )}\n <ic-typography variant=\"subtitle-large\" class=\"tree-view-header\">\n {isSlotUsed(this.el, \"heading\") ? (\n <slot name=\"heading\" />\n ) : (\n heading\n )}\n </ic-typography>\n </div>\n )}\n <slot></slot>\n </Host>\n );\n }\n}\n"],"version":3}
|