@siemens/ix 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/button.js +7 -2
- package/components/button.js.map +1 -1
- package/components/dropdown-item.js +1 -1
- package/components/dropdown-item.js.map +1 -1
- package/components/field-label.js +1 -1
- package/components/field-label.js.map +1 -1
- package/components/field-wrapper.js +2 -2
- package/components/field-wrapper.js.map +1 -1
- package/components/index3.js +2 -1
- package/components/index3.js.map +1 -1
- package/components/input.util.js +4 -8
- package/components/input.util.js.map +1 -1
- package/components/ix-date-input.js +6 -6
- package/components/ix-date-input.js.map +1 -1
- package/components/ix-input.js +3 -3
- package/components/ix-input.js.map +1 -1
- package/components/ix-number-input.js +5 -5
- package/components/ix-number-input.js.map +1 -1
- package/components/ix-textarea.js +2 -2
- package/components/ix-textarea.js.map +1 -1
- package/components/ix-toggle-button.js +2 -2
- package/components/ix-toggle.js +25 -5
- package/components/ix-toggle.js.map +1 -1
- package/components/ix-tree.js +330 -496
- package/components/ix-tree.js.map +1 -1
- package/components/ix-upload.js +3 -3
- package/components/ix-validation-tooltip.js +2 -2
- package/components/ix-workflow-step.js +3 -3
- package/components/ix-workflow-steps.js +1 -1
- package/components/modal.js +6 -0
- package/components/modal.js.map +1 -1
- package/components/select.js +68 -52
- package/components/select.js.map +1 -1
- package/components/tooltip.js +2 -2
- package/components/tree-item.js +6 -5
- package/components/tree-item.js.map +1 -1
- package/dist/cjs/{app-globals-3c9c6a50.js → app-globals-4d8f1524.js} +2 -2
- package/dist/cjs/{app-globals-3c9c6a50.js.map → app-globals-4d8f1524.js.map} +1 -1
- package/dist/cjs/core-js-b22adfab.js +26 -0
- package/dist/cjs/core-js-b22adfab.js.map +1 -0
- package/dist/cjs/{helper-text-util-3192e78f.js → helper-text-util-635a1877.js} +2 -2
- package/dist/cjs/{helper-text-util-3192e78f.js.map → helper-text-util-635a1877.js.map} +1 -1
- package/dist/cjs/{index-74904d8b.js → index-492e6488.js} +2 -2
- package/dist/cjs/{index-74904d8b.js.map → index-492e6488.js.map} +1 -1
- package/dist/cjs/{index-d2117dc0.js → index-b44a6617.js} +3 -1
- package/dist/cjs/index-b44a6617.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{index.es2017-0c2b80b6.js → index.es2017-805b5876.js} +3 -3
- package/dist/cjs/{index.es2017-0c2b80b6.js.map → index.es2017-805b5876.js.map} +1 -1
- package/dist/cjs/{input.util-1c2fa43d.js → input.util-54d161e6.js} +5 -9
- package/dist/cjs/input.util-54d161e6.js.map +1 -0
- package/dist/cjs/ix-application-header.cjs.entry.js +2 -2
- package/dist/cjs/ix-application-switch-modal.cjs.entry.js +1 -1
- package/dist/cjs/ix-button.cjs.entry.js +7 -2
- package/dist/cjs/ix-button.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-col_4.cjs.entry.js +1 -1
- package/dist/cjs/ix-date-input.cjs.entry.js +6 -6
- package/dist/cjs/ix-date-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/ix-dropdown-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-field-label_3.cjs.entry.js +7 -7
- package/dist/cjs/ix-field-label_3.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-helper-text.cjs.entry.js +2 -2
- package/dist/cjs/{ix-icon.entry-e95ddded.js → ix-icon.entry-e33446e2.js} +2 -2
- package/dist/cjs/{ix-icon.entry-e95ddded.js.map → ix-icon.entry-e33446e2.js.map} +1 -1
- package/dist/cjs/ix-input.cjs.entry.js +5 -5
- package/dist/cjs/ix-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-menu.cjs.entry.js +2 -2
- package/dist/cjs/ix-number-input.cjs.entry.js +7 -7
- package/dist/cjs/ix-number-input.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-select.cjs.entry.js +68 -52
- package/dist/cjs/ix-select.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-textarea.cjs.entry.js +3 -3
- package/dist/cjs/ix-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/ix-toggle-button.cjs.entry.js +2 -2
- package/dist/cjs/ix-toggle.cjs.entry.js +17 -3
- package/dist/cjs/ix-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-tree-item.cjs.entry.js +6 -5
- package/dist/cjs/ix-tree-item.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-tree.cjs.entry.js +330 -489
- package/dist/cjs/ix-tree.cjs.entry.js.map +1 -1
- package/dist/cjs/ix-upload.cjs.entry.js +3 -3
- package/dist/cjs/ix-validation-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/ix-workflow-step.cjs.entry.js +3 -3
- package/dist/cjs/ix-workflow-steps.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{modal-a49409aa.js → modal-923c83a6.js} +7 -1
- package/dist/cjs/modal-923c83a6.js.map +1 -0
- package/dist/cjs/{setup-86b7d543.js → setup-cc07fbfc.js} +2 -2
- package/dist/cjs/{setup-86b7d543.js.map → setup-cc07fbfc.js.map} +1 -1
- package/dist/cjs/siemens-ix.cjs.js +3 -3
- package/dist/collection/components/button/button.js +7 -2
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/date-input/date-input.js +8 -6
- package/dist/collection/components/date-input/date-input.js.map +1 -1
- package/dist/collection/components/dropdown-item/dropdown-item.css +0 -3
- package/dist/collection/components/field-label/field-label.js +13 -5
- package/dist/collection/components/field-label/field-label.js.map +1 -1
- package/dist/collection/components/field-wrapper/field-wrapper.js +12 -4
- package/dist/collection/components/field-wrapper/field-wrapper.js.map +1 -1
- package/dist/collection/components/input/input.fc.js +4 -8
- package/dist/collection/components/input/input.fc.js.map +1 -1
- package/dist/collection/components/input/input.js +5 -3
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/number-input.js +7 -5
- package/dist/collection/components/input/number-input.js.map +1 -1
- package/dist/collection/components/input/textarea.js +2 -2
- package/dist/collection/components/input/textarea.js.map +1 -1
- package/dist/collection/components/modal/test/modal.ct.js +57 -65
- package/dist/collection/components/modal/test/modal.ct.js.map +1 -1
- package/dist/collection/components/select/select.js +68 -52
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/select/test/select.ct.js +72 -100
- package/dist/collection/components/select/test/select.ct.js.map +1 -1
- package/dist/collection/components/toggle/toggle.css +376 -161
- package/dist/collection/components/toggle/toggle.js +17 -3
- package/dist/collection/components/toggle/toggle.js.map +1 -1
- package/dist/collection/components/toggle-button/toggle-button.js +2 -2
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/collection/components/tree/tree.js +6 -3
- package/dist/collection/components/tree/tree.js.map +1 -1
- package/dist/collection/components/tree-item/tree-item.js +6 -5
- package/dist/collection/components/tree-item/tree-item.js.map +1 -1
- package/dist/collection/components/upload/upload.js +3 -3
- package/dist/collection/components/utils/lazy-list/index.js +2 -0
- package/dist/collection/components/utils/lazy-list/index.js.map +1 -0
- package/dist/collection/components/utils/lazy-list/lazy.js +343 -0
- package/dist/collection/components/utils/lazy-list/lazy.js.map +1 -0
- package/dist/collection/components/utils/modal/modal.js +6 -0
- package/dist/collection/components/utils/modal/modal.js.map +1 -1
- package/dist/collection/components/validation-tooltip/validation-tooltip.js +2 -2
- package/dist/collection/components/workflow-step/workflow-step.js +3 -3
- package/dist/collection/components/workflow-steps/workflow-steps.js +1 -1
- package/dist/collection/tests/html-tags/html-tags.e2e.js +17 -0
- package/dist/collection/tests/html-tags/html-tags.e2e.js.map +1 -0
- package/dist/esm/app-globals-40082a83.js +7 -0
- package/dist/esm/{app-globals-ae0ca705.js.map → app-globals-40082a83.js.map} +1 -1
- package/dist/esm/{core-js-78b486a8.js → core-js-4a847feb.js} +2 -2
- package/dist/esm/{core-js-78b486a8.js.map → core-js-4a847feb.js.map} +1 -1
- package/dist/esm/{helper-text-util-10896253.js → helper-text-util-e47b864d.js} +2 -2
- package/dist/esm/{helper-text-util-10896253.js.map → helper-text-util-e47b864d.js.map} +1 -1
- package/dist/esm/{index-ad2af369.js → index-2b76ea55.js} +3 -2
- package/dist/esm/index-2b76ea55.js.map +1 -0
- package/dist/esm/{index-60d17930.js → index-7421df0c.js} +2 -2
- package/dist/esm/{index-60d17930.js.map → index-7421df0c.js.map} +1 -1
- package/dist/esm/{index.es2017-93ac816c.js → index.es2017-4e6fdf77.js} +3 -3
- package/dist/esm/{index.es2017-93ac816c.js.map → index.es2017-4e6fdf77.js.map} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{input.util-715860e3.js → input.util-c855b2ed.js} +5 -9
- package/dist/esm/input.util-c855b2ed.js.map +1 -0
- package/dist/esm/ix-application-header.entry.js +2 -2
- package/dist/esm/ix-application-switch-modal.entry.js +1 -1
- package/dist/esm/ix-button.entry.js +7 -2
- package/dist/esm/ix-button.entry.js.map +1 -1
- package/dist/esm/ix-col_4.entry.js +1 -1
- package/dist/esm/ix-date-input.entry.js +6 -6
- package/dist/esm/ix-date-input.entry.js.map +1 -1
- package/dist/esm/ix-dropdown-item.entry.js +1 -1
- package/dist/esm/ix-dropdown-item.entry.js.map +1 -1
- package/dist/esm/ix-field-label_3.entry.js +7 -7
- package/dist/esm/ix-field-label_3.entry.js.map +1 -1
- package/dist/esm/ix-helper-text.entry.js +2 -2
- package/dist/esm/{ix-icon.entry-621b700a.js → ix-icon.entry-f5f7c268.js} +2 -2
- package/dist/esm/{ix-icon.entry-621b700a.js.map → ix-icon.entry-f5f7c268.js.map} +1 -1
- package/dist/esm/ix-input.entry.js +5 -5
- package/dist/esm/ix-input.entry.js.map +1 -1
- package/dist/esm/ix-menu.entry.js +2 -2
- package/dist/esm/ix-number-input.entry.js +7 -7
- package/dist/esm/ix-number-input.entry.js.map +1 -1
- package/dist/esm/ix-select.entry.js +68 -52
- package/dist/esm/ix-select.entry.js.map +1 -1
- package/dist/esm/ix-textarea.entry.js +3 -3
- package/dist/esm/ix-textarea.entry.js.map +1 -1
- package/dist/esm/ix-time-picker.entry.js +1 -1
- package/dist/esm/ix-toggle-button.entry.js +2 -2
- package/dist/esm/ix-toggle.entry.js +18 -4
- package/dist/esm/ix-toggle.entry.js.map +1 -1
- package/dist/esm/ix-tree-item.entry.js +6 -5
- package/dist/esm/ix-tree-item.entry.js.map +1 -1
- package/dist/esm/ix-tree.entry.js +330 -489
- package/dist/esm/ix-tree.entry.js.map +1 -1
- package/dist/esm/ix-upload.entry.js +3 -3
- package/dist/esm/ix-validation-tooltip.entry.js +2 -2
- package/dist/esm/ix-workflow-step.entry.js +3 -3
- package/dist/esm/ix-workflow-steps.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{modal-101eef04.js → modal-4b3f8800.js} +7 -1
- package/dist/{cjs/modal-a49409aa.js.map → esm/modal-4b3f8800.js.map} +1 -1
- package/dist/esm/{setup-d88021f8.js → setup-9c5fe321.js} +2 -2
- package/dist/esm/{setup-d88021f8.js.map → setup-9c5fe321.js.map} +1 -1
- package/dist/esm/siemens-ix.js +3 -3
- package/dist/siemens-ix/index.esm.js +1 -1
- package/dist/siemens-ix/{p-0dbc970e.entry.js → p-0b2f0536.entry.js} +2 -2
- package/dist/siemens-ix/{p-2b226409.entry.js → p-0b5c9f33.entry.js} +2 -2
- package/dist/siemens-ix/p-0b5c9f33.entry.js.map +1 -0
- package/dist/siemens-ix/{p-044c2a7b.entry.js → p-18542846.entry.js} +2 -2
- package/dist/siemens-ix/p-20938f73.entry.js +2 -0
- package/dist/siemens-ix/p-20938f73.entry.js.map +1 -0
- package/dist/siemens-ix/p-22cba43a.entry.js +2 -0
- package/dist/siemens-ix/p-22cba43a.entry.js.map +1 -0
- package/dist/siemens-ix/{p-9fe2759f.entry.js → p-243e8b32.entry.js} +2 -2
- package/dist/siemens-ix/p-243e8b32.entry.js.map +1 -0
- package/dist/siemens-ix/p-38d9d569.js +2 -0
- package/dist/siemens-ix/p-38d9d569.js.map +1 -0
- package/dist/siemens-ix/{p-d7aa00d6.js → p-3aaecbd9.js} +2 -2
- package/dist/siemens-ix/{p-175599e4.entry.js → p-42320fb3.entry.js} +2 -2
- package/dist/siemens-ix/p-44fa005c.js +4 -0
- package/dist/siemens-ix/{p-a2200306.js.map → p-44fa005c.js.map} +1 -1
- package/dist/siemens-ix/p-451551d1.js +2 -0
- package/dist/siemens-ix/p-451551d1.js.map +1 -0
- package/dist/siemens-ix/p-53fd545a.entry.js +2 -0
- package/dist/siemens-ix/p-53fd545a.entry.js.map +1 -0
- package/dist/siemens-ix/p-5fbdff13.entry.js +2 -0
- package/dist/siemens-ix/p-5fbdff13.entry.js.map +1 -0
- package/dist/siemens-ix/{p-1f6df0c6.js → p-738c2d1f.js} +2 -2
- package/dist/siemens-ix/{p-424e8092.entry.js → p-897c8e5b.entry.js} +2 -2
- package/dist/siemens-ix/p-897c8e5b.entry.js.map +1 -0
- package/dist/siemens-ix/{p-f35386ec.js → p-93d4d3c9.js} +2 -2
- package/dist/siemens-ix/{p-9948574f.entry.js → p-97d4b3bd.entry.js} +2 -2
- package/dist/siemens-ix/{p-6a4a2064.entry.js → p-9f960c0b.entry.js} +2 -2
- package/dist/siemens-ix/{p-0c89cbcc.entry.js → p-a4dc6824.entry.js} +2 -2
- package/dist/siemens-ix/{p-fe87443e.js → p-a6af13b0.js} +2 -2
- package/dist/siemens-ix/p-af7c4b16.entry.js +2 -0
- package/dist/siemens-ix/p-af7c4b16.entry.js.map +1 -0
- package/dist/siemens-ix/{p-a3364116.entry.js → p-afb4565c.entry.js} +2 -2
- package/dist/siemens-ix/{p-4c9b7548.entry.js → p-bc272f75.entry.js} +2 -2
- package/dist/siemens-ix/{p-3205726a.entry.js → p-bfe469e4.entry.js} +2 -2
- package/dist/siemens-ix/{p-792e1c52.entry.js → p-c07557b0.entry.js} +2 -2
- package/dist/siemens-ix/p-c07557b0.entry.js.map +1 -0
- package/dist/siemens-ix/p-c3ca17fc.js +2 -0
- package/dist/siemens-ix/p-c530de51.entry.js +2 -0
- package/dist/siemens-ix/p-c530de51.entry.js.map +1 -0
- package/dist/siemens-ix/p-d2f21544.js +2 -0
- package/dist/siemens-ix/{p-68bb2a09.entry.js → p-d9b654af.entry.js} +2 -2
- package/dist/siemens-ix/p-d9b654af.entry.js.map +1 -0
- package/dist/siemens-ix/{p-e9a37b3f.entry.js → p-ee0645f8.entry.js} +2 -2
- package/dist/siemens-ix/p-fe158b99.js +2 -0
- package/dist/siemens-ix/p-fe158b99.js.map +1 -0
- package/dist/siemens-ix/{p-f39048a2.entry.js → p-fe396297.entry.js} +2 -2
- package/dist/siemens-ix/siemens-ix.esm.js +1 -1
- package/dist/types/components/button/button.d.ts +1 -0
- package/dist/types/components/date-input/date-input.d.ts +2 -0
- package/dist/types/components/field-label/field-label.d.ts +1 -1
- package/dist/types/components/field-wrapper/field-wrapper.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +2 -0
- package/dist/types/components/input/number-input.d.ts +2 -0
- package/dist/types/components/modal/test/modal.ct.d.ts +2 -1
- package/dist/types/components/select/select.d.ts +9 -8
- package/dist/types/components/utils/lazy-list/index.d.ts +2 -0
- package/dist/types/components/utils/lazy-list/lazy.d.ts +51 -0
- package/dist/types/components.d.ts +9 -3
- package/hydrate/index.js +499 -621
- package/package.json +1 -2
- package/dist/cjs/_commonjsHelpers-0192c5b3.js +0 -17
- package/dist/cjs/_commonjsHelpers-0192c5b3.js.map +0 -1
- package/dist/cjs/core-js-2fc351ee.js +0 -26
- package/dist/cjs/core-js-2fc351ee.js.map +0 -1
- package/dist/cjs/index-d2117dc0.js.map +0 -1
- package/dist/cjs/input.util-1c2fa43d.js.map +0 -1
- package/dist/esm/_commonjsHelpers-e557d4a5.js +0 -13
- package/dist/esm/_commonjsHelpers-e557d4a5.js.map +0 -1
- package/dist/esm/app-globals-ae0ca705.js +0 -7
- package/dist/esm/index-ad2af369.js.map +0 -1
- package/dist/esm/input.util-715860e3.js.map +0 -1
- package/dist/esm/modal-101eef04.js.map +0 -1
- package/dist/siemens-ix/p-0f0e7e14.entry.js +0 -2
- package/dist/siemens-ix/p-0f0e7e14.entry.js.map +0 -1
- package/dist/siemens-ix/p-23a4b81f.js +0 -2
- package/dist/siemens-ix/p-23a4b81f.js.map +0 -1
- package/dist/siemens-ix/p-2b226409.entry.js.map +0 -1
- package/dist/siemens-ix/p-424e8092.entry.js.map +0 -1
- package/dist/siemens-ix/p-45840cb9.js +0 -2
- package/dist/siemens-ix/p-45840cb9.js.map +0 -1
- package/dist/siemens-ix/p-4624a772.entry.js +0 -2
- package/dist/siemens-ix/p-4624a772.entry.js.map +0 -1
- package/dist/siemens-ix/p-50096707.js +0 -2
- package/dist/siemens-ix/p-5682e985.js +0 -2
- package/dist/siemens-ix/p-5db5a0b5.entry.js +0 -2
- package/dist/siemens-ix/p-5db5a0b5.entry.js.map +0 -1
- package/dist/siemens-ix/p-68bb2a09.entry.js.map +0 -1
- package/dist/siemens-ix/p-792e1c52.entry.js.map +0 -1
- package/dist/siemens-ix/p-79bb0d39.js +0 -2
- package/dist/siemens-ix/p-79bb0d39.js.map +0 -1
- package/dist/siemens-ix/p-857f99c8.entry.js +0 -2
- package/dist/siemens-ix/p-857f99c8.entry.js.map +0 -1
- package/dist/siemens-ix/p-9fe2759f.entry.js.map +0 -1
- package/dist/siemens-ix/p-a2200306.js +0 -4
- package/dist/siemens-ix/p-a427e6a2.js +0 -2
- package/dist/siemens-ix/p-a427e6a2.js.map +0 -1
- package/dist/siemens-ix/p-bded112a.entry.js +0 -2
- package/dist/siemens-ix/p-bded112a.entry.js.map +0 -1
- package/dist/siemens-ix/p-f7618d1d.entry.js +0 -2
- package/dist/siemens-ix/p-f7618d1d.entry.js.map +0 -1
- /package/dist/siemens-ix/{p-0dbc970e.entry.js.map → p-0b2f0536.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-044c2a7b.entry.js.map → p-18542846.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-d7aa00d6.js.map → p-3aaecbd9.js.map} +0 -0
- /package/dist/siemens-ix/{p-175599e4.entry.js.map → p-42320fb3.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-1f6df0c6.js.map → p-738c2d1f.js.map} +0 -0
- /package/dist/siemens-ix/{p-f35386ec.js.map → p-93d4d3c9.js.map} +0 -0
- /package/dist/siemens-ix/{p-9948574f.entry.js.map → p-97d4b3bd.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-6a4a2064.entry.js.map → p-9f960c0b.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-0c89cbcc.entry.js.map → p-a4dc6824.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-fe87443e.js.map → p-a6af13b0.js.map} +0 -0
- /package/dist/siemens-ix/{p-a3364116.entry.js.map → p-afb4565c.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-4c9b7548.entry.js.map → p-bc272f75.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-3205726a.entry.js.map → p-bfe469e4.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-5682e985.js.map → p-c3ca17fc.js.map} +0 -0
- /package/dist/siemens-ix/{p-50096707.js.map → p-d2f21544.js.map} +0 -0
- /package/dist/siemens-ix/{p-e9a37b3f.entry.js.map → p-ee0645f8.entry.js.map} +0 -0
- /package/dist/siemens-ix/{p-f39048a2.entry.js.map → p-fe396297.entry.js.map} +0 -0
|
@@ -1,511 +1,349 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-97874de0.js';
|
|
2
|
-
import { c as commonjsRequire, g as getDefaultExportFromCjs } from './_commonjsHelpers-e557d4a5.js';
|
|
3
2
|
import { r as renderDefaultItem } from './default-tree-item-25091766.js';
|
|
4
3
|
import { d as dropdownController } from './dropdown-controller-cb6d3789.js';
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
18
|
-
|
|
19
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
-
|
|
21
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22
|
-
|
|
23
|
-
var defaultConfig = {
|
|
24
|
-
width: '100%',
|
|
25
|
-
height: '100%'
|
|
26
|
-
|
|
27
|
-
// Check for valid number.
|
|
28
|
-
};var isNumber = function isNumber(input) {
|
|
29
|
-
return Number(input) === Number(input);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Add a class to an element.
|
|
33
|
-
var addClass = 'classList' in document.documentElement ? function (element, className) {
|
|
34
|
-
element.classList.add(className);
|
|
35
|
-
} : function (element, className) {
|
|
36
|
-
var oldClass = element.getAttribute('class') || '';
|
|
37
|
-
element.setAttribute('class', oldClass + ' ' + className);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Creates a HyperList instance that virtually scrolls very large amounts of
|
|
42
|
-
* data effortlessly.
|
|
5
|
+
/*
|
|
6
|
+
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
12
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
13
|
+
// Manually forked from https://github.com/tbranyen/hyperlist to remove
|
|
14
|
+
// features a direct document calls
|
|
15
|
+
//
|
|
16
|
+
// Hyperlist is licensed MIT. https://github.com/tbranyen/hyperlist
|
|
17
|
+
const isNumber = (input) => !Number.isNaN(Number(input));
|
|
18
|
+
const addClass = (element, className) => {
|
|
19
|
+
element.classList.add(className);
|
|
20
|
+
};
|
|
21
|
+
class VirtualList {
|
|
22
|
+
static create(element, userProvidedConfig = VirtualList.defaultConfig) {
|
|
23
|
+
return new VirtualList(element, userProvidedConfig);
|
|
50
24
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, {
|
|
59
|
-
key: 'mergeStyle',
|
|
60
|
-
value: function mergeStyle(element, style) {
|
|
61
|
-
for (var i in style) {
|
|
62
|
-
if (element.style[i] !== style[i]) {
|
|
63
|
-
element.style[i] = style[i];
|
|
64
|
-
}
|
|
65
|
-
}
|
|
25
|
+
static mergeStyle(element, style) {
|
|
26
|
+
for (let i in style) {
|
|
27
|
+
if (element.style[i] !== style[i]) {
|
|
28
|
+
element.style[i] = style[i];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
66
31
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// Remove the element immediately after reading the value.
|
|
92
|
-
document.body.removeChild(wrapper);
|
|
93
|
-
|
|
94
|
-
return maxElementHeight;
|
|
32
|
+
static getMaxBrowserHeight() {
|
|
33
|
+
// Create two elements, the wrapper is `1px` tall and is transparent and
|
|
34
|
+
// positioned at the top of the page. Inside that is an element that gets
|
|
35
|
+
// set to 1 billion pixels. Then reads the max height the browser can
|
|
36
|
+
// calculate.
|
|
37
|
+
const wrapper = document.createElement('div');
|
|
38
|
+
const fixture = document.createElement('div');
|
|
39
|
+
// As said above, these values get set to put the fixture elements into the
|
|
40
|
+
// right visual state.
|
|
41
|
+
VirtualList.mergeStyle(wrapper, {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
height: '1px',
|
|
44
|
+
opacity: 0,
|
|
45
|
+
});
|
|
46
|
+
VirtualList.mergeStyle(fixture, { height: '1e7px' });
|
|
47
|
+
// Add the fixture into the wrapper element.
|
|
48
|
+
wrapper.appendChild(fixture);
|
|
49
|
+
// Apply to the page, the values won't kick in unless this is attached.
|
|
50
|
+
document.body.appendChild(wrapper);
|
|
51
|
+
// Get the maximum element height in pixels.
|
|
52
|
+
const maxElementHeight = fixture.offsetHeight;
|
|
53
|
+
// Remove the element immediately after reading the value.
|
|
54
|
+
document.body.removeChild(wrapper);
|
|
55
|
+
return maxElementHeight;
|
|
95
56
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var diff = lastRepaint ? scrollTop - lastRepaint : 0;
|
|
123
|
-
if (!lastRepaint || diff < 0 || diff > _this._averageHeight) {
|
|
124
|
-
var rendered = _this._renderChunk();
|
|
125
|
-
|
|
126
|
-
_this._lastRepaint = scrollTop;
|
|
127
|
-
|
|
128
|
-
if (rendered !== false && typeof config.afterRender === 'function') {
|
|
129
|
-
config.afterRender();
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
render();
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
_createClass(HyperList, [{
|
|
138
|
-
key: 'destroy',
|
|
139
|
-
value: function destroy() {
|
|
140
|
-
window.cancelAnimationFrame(this._renderAnimationFrame);
|
|
57
|
+
constructor(element, userProvidedConfig) {
|
|
58
|
+
this._lastRepaint = null;
|
|
59
|
+
this._maxElementHeight = VirtualList.getMaxBrowserHeight();
|
|
60
|
+
this.refresh(element, userProvidedConfig);
|
|
61
|
+
const config = this._config;
|
|
62
|
+
// Create internal render loop.
|
|
63
|
+
const render = () => {
|
|
64
|
+
const scrollTop = this._getScrollPosition();
|
|
65
|
+
const lastRepaint = this._lastRepaint;
|
|
66
|
+
this._renderAnimationFrame = window.requestAnimationFrame(render);
|
|
67
|
+
if (scrollTop === lastRepaint) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const diff = lastRepaint ? scrollTop - lastRepaint : 0;
|
|
71
|
+
if (!lastRepaint || diff < 0 || diff > this._averageHeight) {
|
|
72
|
+
let rendered = this._renderChunk();
|
|
73
|
+
this._lastRepaint = scrollTop;
|
|
74
|
+
if (rendered !== false && typeof config.afterRender === 'function') {
|
|
75
|
+
config.afterRender();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
render();
|
|
141
80
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (!element || element.nodeType !== 1) {
|
|
150
|
-
throw new Error('HyperList requires a valid DOM Node container');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
this._element = element;
|
|
154
|
-
|
|
155
|
-
var config = this._config;
|
|
156
|
-
|
|
157
|
-
var scroller = this._scroller || config.scroller || document.createElement(config.scrollerTagName || 'tr');
|
|
158
|
-
|
|
159
|
-
// Default configuration option `useFragment` to `true`.
|
|
160
|
-
if (typeof config.useFragment !== 'boolean') {
|
|
161
|
-
this._config.useFragment = true;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (!config.generate) {
|
|
165
|
-
throw new Error('Missing required `generate` function');
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (!isNumber(config.total)) {
|
|
169
|
-
throw new Error('Invalid required `total` value, expected number');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (!Array.isArray(config.itemHeight) && !isNumber(config.itemHeight)) {
|
|
173
|
-
throw new Error('\n Invalid required `itemHeight` value, expected number or array\n '.trim());
|
|
174
|
-
} else if (isNumber(config.itemHeight)) {
|
|
175
|
-
this._itemHeights = Array(config.total).fill(config.itemHeight);
|
|
176
|
-
} else {
|
|
177
|
-
this._itemHeights = config.itemHeight;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Width and height should be coerced to string representations. Either in
|
|
181
|
-
// `%` or `px`.
|
|
182
|
-
Object.keys(defaultConfig).filter(function (prop) {
|
|
183
|
-
return prop in config;
|
|
184
|
-
}).forEach(function (prop) {
|
|
185
|
-
var value = config[prop];
|
|
186
|
-
var isValueNumber = isNumber(value);
|
|
187
|
-
|
|
188
|
-
if (value && typeof value !== 'string' && typeof value !== 'number') {
|
|
189
|
-
var msg = 'Invalid optional `' + prop + '`, expected string or number';
|
|
190
|
-
throw new Error(msg);
|
|
191
|
-
} else if (isValueNumber) {
|
|
192
|
-
config[prop] = value + 'px';
|
|
81
|
+
destroy() {
|
|
82
|
+
window.cancelAnimationFrame(this._renderAnimationFrame);
|
|
83
|
+
}
|
|
84
|
+
refresh(element, userProvidedConfig = VirtualList.defaultConfig) {
|
|
85
|
+
this._config = userProvidedConfig;
|
|
86
|
+
if (!element || element.nodeType !== 1) {
|
|
87
|
+
throw new Error('HyperList requires a valid DOM Node container');
|
|
193
88
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
if (
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
|
|
89
|
+
this._element = element;
|
|
90
|
+
const config = this._config;
|
|
91
|
+
const scroller = this._scroller ||
|
|
92
|
+
config.scroller ||
|
|
93
|
+
document.createElement(config.scrollerTagName || 'tr');
|
|
94
|
+
// Default configuration option `useFragment` to `true`.
|
|
95
|
+
if (typeof config.useFragment !== 'boolean') {
|
|
96
|
+
this._config.useFragment = true;
|
|
97
|
+
}
|
|
98
|
+
if (!config.generate) {
|
|
99
|
+
throw new Error('Missing required `generate` function');
|
|
100
|
+
}
|
|
101
|
+
if (!isNumber(config.total)) {
|
|
102
|
+
throw new Error('Invalid required `total` value, expected number');
|
|
103
|
+
}
|
|
104
|
+
if (!Array.isArray(config.itemHeight) && !isNumber(config.itemHeight)) {
|
|
105
|
+
throw new Error(`
|
|
106
|
+
Invalid required \`itemHeight\` value, expected number or array
|
|
107
|
+
`.trim());
|
|
108
|
+
}
|
|
109
|
+
else if (isNumber(config.itemHeight)) {
|
|
110
|
+
this._itemHeights = Array(config.total).fill(config.itemHeight);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
this._itemHeights = [config.itemHeight];
|
|
114
|
+
}
|
|
115
|
+
// Width and height should be coerced to string representations. Either in
|
|
116
|
+
// `%` or `px`.
|
|
117
|
+
Object.keys(VirtualList.defaultConfig)
|
|
118
|
+
.filter((prop) => prop in config)
|
|
119
|
+
.forEach((prop) => {
|
|
120
|
+
const value = config[prop];
|
|
121
|
+
const isValueNumber = isNumber(value);
|
|
122
|
+
if (value && typeof value !== 'string' && typeof value !== 'number') {
|
|
123
|
+
let msg = `Invalid optional \`${prop}\`, expected string or number`;
|
|
124
|
+
throw new Error(msg);
|
|
125
|
+
}
|
|
126
|
+
else if (isValueNumber) {
|
|
127
|
+
config[prop] = `${value}px`;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
const isHorizontal = Boolean(config.horizontal);
|
|
131
|
+
const value = config[isHorizontal ? 'width' : 'height'];
|
|
132
|
+
if (value) {
|
|
133
|
+
const isValueNumber = isNumber(value);
|
|
134
|
+
const isValuePercent = isValueNumber ? false : value.slice(-1) === '%';
|
|
135
|
+
// Compute the containerHeight as number
|
|
136
|
+
const numberValue = isValueNumber
|
|
137
|
+
? parseInt(value, 10)
|
|
138
|
+
: parseInt(value.replace(/px|%/, ''), 10);
|
|
139
|
+
const innerSize = window[isHorizontal ? 'innerWidth' : 'innerHeight'];
|
|
140
|
+
if (isValuePercent) {
|
|
141
|
+
this._containerSize = (innerSize * numberValue) / 100;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
this._containerSize = isNumber(value) ? value : numberValue;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const scrollContainer = config.scrollContainer;
|
|
148
|
+
const scrollerHeight = config.itemHeight * config.total;
|
|
149
|
+
const maxElementHeight = this._maxElementHeight;
|
|
150
|
+
if (scrollerHeight > maxElementHeight) {
|
|
151
|
+
console.warn([
|
|
152
|
+
'HyperList: The maximum element height',
|
|
153
|
+
maxElementHeight + 'px has',
|
|
154
|
+
'been exceeded; please reduce your item height.',
|
|
155
|
+
].join(' '));
|
|
156
|
+
}
|
|
157
|
+
// Decorate the container element with styles that will match
|
|
158
|
+
// the user supplied configuration.
|
|
159
|
+
const elementStyle = {
|
|
160
|
+
width: `${config.width}`,
|
|
161
|
+
height: scrollContainer ? `${scrollerHeight}px` : `${config.height}`,
|
|
162
|
+
overflow: scrollContainer ? 'none' : 'auto',
|
|
163
|
+
position: 'relative',
|
|
164
|
+
};
|
|
165
|
+
VirtualList.mergeStyle(element, elementStyle);
|
|
166
|
+
if (scrollContainer) {
|
|
167
|
+
VirtualList.mergeStyle(config.scrollContainer, { overflow: 'auto' });
|
|
168
|
+
}
|
|
169
|
+
const scrollerStyle = {
|
|
170
|
+
opacity: '0',
|
|
171
|
+
position: 'absolute',
|
|
172
|
+
[isHorizontal ? 'height' : 'width']: '1px',
|
|
173
|
+
[isHorizontal ? 'width' : 'height']: `${scrollerHeight}px`,
|
|
174
|
+
};
|
|
175
|
+
VirtualList.mergeStyle(scroller, scrollerStyle);
|
|
176
|
+
// Only append the scroller element once.
|
|
177
|
+
if (!this._scroller) {
|
|
178
|
+
element.appendChild(scroller);
|
|
179
|
+
}
|
|
180
|
+
const padding = this._computeScrollPadding();
|
|
181
|
+
this._scrollPaddingBottom = padding.bottom;
|
|
182
|
+
this._scrollPaddingTop = padding.top;
|
|
183
|
+
// Set the scroller instance.
|
|
184
|
+
this._scroller = scroller;
|
|
185
|
+
this._scrollHeight = this._computeScrollHeight();
|
|
186
|
+
// Reuse the item positions if refreshed, otherwise set to empty array.
|
|
187
|
+
this._itemPositions = this._itemPositions || Array(config.total).fill(0);
|
|
188
|
+
// Each index in the array should represent the position in the DOM.
|
|
189
|
+
this._computePositions(0);
|
|
190
|
+
// Render after refreshing. Force render if we're calling refresh manually.
|
|
191
|
+
this._renderChunk(this._lastRepaint !== null);
|
|
192
|
+
if (typeof config.afterRender === 'function') {
|
|
193
|
+
config.afterRender();
|
|
210
194
|
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var scrollContainer = config.scrollContainer;
|
|
214
|
-
var scrollerHeight = config.itemHeight * config.total;
|
|
215
|
-
var maxElementHeight = this._maxElementHeight;
|
|
216
|
-
|
|
217
|
-
if (scrollerHeight > maxElementHeight) {
|
|
218
|
-
console.warn(['HyperList: The maximum element height', maxElementHeight + 'px has', 'been exceeded; please reduce your item height.'].join(' '));
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// Decorate the container element with styles that will match
|
|
222
|
-
// the user supplied configuration.
|
|
223
|
-
var elementStyle = {
|
|
224
|
-
width: '' + config.width,
|
|
225
|
-
height: scrollContainer ? scrollerHeight + 'px' : '' + config.height,
|
|
226
|
-
overflow: scrollContainer ? 'none' : 'auto',
|
|
227
|
-
position: 'relative'
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
HyperList.mergeStyle(element, elementStyle);
|
|
231
|
-
|
|
232
|
-
if (scrollContainer) {
|
|
233
|
-
HyperList.mergeStyle(config.scrollContainer, { overflow: 'auto' });
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
var scrollerStyle = (_scrollerStyle = {
|
|
237
|
-
opacity: '0',
|
|
238
|
-
position: 'absolute'
|
|
239
|
-
}, _defineProperty(_scrollerStyle, isHoriz ? 'height' : 'width', '1px'), _defineProperty(_scrollerStyle, isHoriz ? 'width' : 'height', scrollerHeight + 'px'), _scrollerStyle);
|
|
240
|
-
|
|
241
|
-
HyperList.mergeStyle(scroller, scrollerStyle);
|
|
242
|
-
|
|
243
|
-
// Only append the scroller element once.
|
|
244
|
-
if (!this._scroller) {
|
|
245
|
-
element.appendChild(scroller);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
var padding = this._computeScrollPadding();
|
|
249
|
-
this._scrollPaddingBottom = padding.bottom;
|
|
250
|
-
this._scrollPaddingTop = padding.top;
|
|
251
|
-
|
|
252
|
-
// Set the scroller instance.
|
|
253
|
-
this._scroller = scroller;
|
|
254
|
-
this._scrollHeight = this._computeScrollHeight();
|
|
255
|
-
|
|
256
|
-
// Reuse the item positions if refreshed, otherwise set to empty array.
|
|
257
|
-
this._itemPositions = this._itemPositions || Array(config.total).fill(0);
|
|
258
|
-
|
|
259
|
-
// Each index in the array should represent the position in the DOM.
|
|
260
|
-
this._computePositions(0);
|
|
261
|
-
|
|
262
|
-
// Render after refreshing. Force render if we're calling refresh manually.
|
|
263
|
-
this._renderChunk(this._lastRepaint !== null);
|
|
264
|
-
|
|
265
|
-
if (typeof config.afterRender === 'function') {
|
|
266
|
-
config.afterRender();
|
|
267
|
-
}
|
|
268
195
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
var top = this._itemPositions[i] + this._scrollPaddingTop;
|
|
296
|
-
|
|
297
|
-
HyperList.mergeStyle(item, _defineProperty({
|
|
298
|
-
position: 'absolute'
|
|
299
|
-
}, config.horizontal ? 'left' : 'top', top + 'px'));
|
|
300
|
-
|
|
301
|
-
return item;
|
|
196
|
+
_getRow(i) {
|
|
197
|
+
const config = this._config;
|
|
198
|
+
let item = config.generate(i);
|
|
199
|
+
let height = item.height;
|
|
200
|
+
if (height !== undefined && isNumber(height)) {
|
|
201
|
+
item = item.element;
|
|
202
|
+
// The height isn't the same as predicted, compute positions again
|
|
203
|
+
if (height !== this._itemHeights[i]) {
|
|
204
|
+
this._itemHeights[i] = height;
|
|
205
|
+
this._computePositions(i);
|
|
206
|
+
this._scrollHeight = this._computeScrollHeight();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
height = this._itemHeights[i];
|
|
211
|
+
}
|
|
212
|
+
if (!item || item.nodeType !== 1) {
|
|
213
|
+
throw new Error(`Generator did not return a DOM Node for index: ${i}`);
|
|
214
|
+
}
|
|
215
|
+
addClass(item, config.rowClassName || 'vrow');
|
|
216
|
+
const top = this._itemPositions[i] + this._scrollPaddingTop;
|
|
217
|
+
VirtualList.mergeStyle(item, {
|
|
218
|
+
position: 'absolute',
|
|
219
|
+
[config.horizontal ? 'left' : 'top']: `${top}px`,
|
|
220
|
+
});
|
|
221
|
+
return item;
|
|
302
222
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
return config.overrideScrollPosition();
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return this._element[config.horizontal ? 'scrollLeft' : 'scrollTop'];
|
|
223
|
+
_getScrollPosition() {
|
|
224
|
+
const config = this._config;
|
|
225
|
+
if (typeof config.overrideScrollPosition === 'function') {
|
|
226
|
+
return config.overrideScrollPosition();
|
|
227
|
+
}
|
|
228
|
+
return this._element[config.horizontal ? 'scrollLeft' : 'scrollTop'];
|
|
313
229
|
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
for (var i = from; i < to; i++) {
|
|
354
|
-
var row = this._getRow(i);
|
|
355
|
-
|
|
356
|
-
fragment[config.useFragment ? 'appendChild' : 'push'](row);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
if (config.applyPatch) {
|
|
360
|
-
return config.applyPatch(element, fragment);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
element.innerHTML = '';
|
|
364
|
-
element.appendChild(fragment);
|
|
230
|
+
_renderChunk(force = false) {
|
|
231
|
+
const config = this._config;
|
|
232
|
+
const element = this._element;
|
|
233
|
+
const scrollTop = this._getScrollPosition();
|
|
234
|
+
const total = config.total;
|
|
235
|
+
let from = this._getFrom(scrollTop) - 1;
|
|
236
|
+
if (from < 0 || from - this._screenItemsLen < 0) {
|
|
237
|
+
from = 0;
|
|
238
|
+
}
|
|
239
|
+
if (!force && this._lastFrom === from) {
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
this._lastFrom = from;
|
|
243
|
+
let to = from + this._cachedItemsLen;
|
|
244
|
+
if (to > total || to + this._cachedItemsLen > total) {
|
|
245
|
+
to = total;
|
|
246
|
+
}
|
|
247
|
+
// Append all the new rows in a document fragment that we will later append
|
|
248
|
+
// to the parent node
|
|
249
|
+
const fragment = config.useFragment
|
|
250
|
+
? document.createDocumentFragment()
|
|
251
|
+
: [
|
|
252
|
+
// Sometimes you'll pass fake elements to this tool and Fragments require
|
|
253
|
+
// real elements.
|
|
254
|
+
];
|
|
255
|
+
// The element that forces the container to scroll.
|
|
256
|
+
const scroller = this._scroller;
|
|
257
|
+
// Keep the scroller in the list of children.
|
|
258
|
+
fragment[config.useFragment ? 'appendChild' : 'push'](scroller);
|
|
259
|
+
for (let i = from; i < to; i++) {
|
|
260
|
+
let row = this._getRow(i);
|
|
261
|
+
fragment[config.useFragment ? 'appendChild' : 'push'](row);
|
|
262
|
+
}
|
|
263
|
+
if (config.applyPatch) {
|
|
264
|
+
return config.applyPatch(element, fragment);
|
|
265
|
+
}
|
|
266
|
+
element.innerHTML = '';
|
|
267
|
+
element.appendChild(fragment);
|
|
365
268
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
from = 1;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
for (var i = from; i < total; i++) {
|
|
380
|
-
if (reverse) {
|
|
381
|
-
if (i === 0) {
|
|
382
|
-
this._itemPositions[0] = this._scrollHeight - this._itemHeights[0];
|
|
383
|
-
} else {
|
|
384
|
-
this._itemPositions[i] = this._itemPositions[i - 1] - this._itemHeights[i];
|
|
385
|
-
}
|
|
386
|
-
} else {
|
|
387
|
-
this._itemPositions[i] = this._itemHeights[i - 1] + this._itemPositions[i - 1];
|
|
388
|
-
}
|
|
389
|
-
}
|
|
269
|
+
_computePositions(from = 1) {
|
|
270
|
+
const config = this._config;
|
|
271
|
+
const total = config.total;
|
|
272
|
+
if (from < 1) {
|
|
273
|
+
from = 1;
|
|
274
|
+
}
|
|
275
|
+
for (let i = from; i < total; i++) {
|
|
276
|
+
this._itemPositions[i] =
|
|
277
|
+
this._itemHeights[i - 1] + this._itemPositions[i - 1];
|
|
278
|
+
}
|
|
390
279
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
HyperList.mergeStyle(this._scroller, (_HyperList$mergeStyle2 = {
|
|
405
|
-
opacity: 0,
|
|
406
|
-
position: 'absolute',
|
|
407
|
-
top: '0px'
|
|
408
|
-
}, _defineProperty(_HyperList$mergeStyle2, isHoriz ? 'height' : 'width', '1px'), _defineProperty(_HyperList$mergeStyle2, isHoriz ? 'width' : 'height', scrollHeight + 'px'), _HyperList$mergeStyle2));
|
|
409
|
-
|
|
410
|
-
// Calculate the height median
|
|
411
|
-
var sortedItemHeights = this._itemHeights.slice(0).sort(function (a, b) {
|
|
412
|
-
return a - b;
|
|
413
|
-
});
|
|
414
|
-
var middle = Math.floor(total / 2);
|
|
415
|
-
var averageHeight = total % 2 === 0 ? (sortedItemHeights[middle] + sortedItemHeights[middle - 1]) / 2 : sortedItemHeights[middle];
|
|
416
|
-
|
|
417
|
-
var clientProp = isHoriz ? 'clientWidth' : 'clientHeight';
|
|
418
|
-
var element = config.scrollContainer ? config.scrollContainer : this._element;
|
|
419
|
-
var containerHeight = element[clientProp] ? element[clientProp] : this._containerSize;
|
|
420
|
-
this._screenItemsLen = Math.ceil(containerHeight / averageHeight);
|
|
421
|
-
this._containerSize = containerHeight;
|
|
422
|
-
|
|
423
|
-
// Cache 3 times the number of items that fit in the container viewport.
|
|
424
|
-
this._cachedItemsLen = Math.max(this._cachedItemsLen || 0, this._screenItemsLen * 3);
|
|
425
|
-
this._averageHeight = averageHeight;
|
|
426
|
-
|
|
427
|
-
if (config.reverse) {
|
|
428
|
-
window.requestAnimationFrame(function () {
|
|
429
|
-
if (isHoriz) {
|
|
430
|
-
_this2._element.scrollLeft = scrollHeight;
|
|
431
|
-
} else {
|
|
432
|
-
_this2._element.scrollTop = scrollHeight;
|
|
433
|
-
}
|
|
280
|
+
_computeScrollHeight() {
|
|
281
|
+
const config = this._config;
|
|
282
|
+
const isHorizontal = Boolean(config.horizontal);
|
|
283
|
+
const total = config.total;
|
|
284
|
+
const scrollHeight = this._itemHeights.reduce((a, b) => a + b, 0) +
|
|
285
|
+
this._scrollPaddingBottom +
|
|
286
|
+
this._scrollPaddingTop;
|
|
287
|
+
VirtualList.mergeStyle(this._scroller, {
|
|
288
|
+
opacity: 0,
|
|
289
|
+
position: 'absolute',
|
|
290
|
+
top: '0px',
|
|
291
|
+
[isHorizontal ? 'height' : 'width']: '1px',
|
|
292
|
+
[isHorizontal ? 'width' : 'height']: `${scrollHeight}px`,
|
|
434
293
|
});
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
294
|
+
// Calculate the height median
|
|
295
|
+
const sortedItemHeights = this._itemHeights.slice(0).sort((a, b) => a - b);
|
|
296
|
+
const middle = Math.floor(total / 2);
|
|
297
|
+
const averageHeight = total % 2 === 0
|
|
298
|
+
? (sortedItemHeights[middle] + sortedItemHeights[middle - 1]) / 2
|
|
299
|
+
: sortedItemHeights[middle];
|
|
300
|
+
const clientProp = isHorizontal ? 'clientWidth' : 'clientHeight';
|
|
301
|
+
const element = config.scrollContainer
|
|
302
|
+
? config.scrollContainer
|
|
303
|
+
: this._element;
|
|
304
|
+
const containerHeight = element[clientProp]
|
|
305
|
+
? element[clientProp]
|
|
306
|
+
: this._containerSize;
|
|
307
|
+
this._screenItemsLen = Math.ceil(containerHeight / averageHeight);
|
|
308
|
+
this._containerSize = containerHeight;
|
|
309
|
+
// Cache 3 times the number of items that fit in the container viewport.
|
|
310
|
+
this._cachedItemsLen = Math.max(this._cachedItemsLen || 0, this._screenItemsLen * 3);
|
|
311
|
+
this._averageHeight = averageHeight;
|
|
312
|
+
return scrollHeight;
|
|
438
313
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
var padding = function padding(location) {
|
|
448
|
-
var cssValue = styles.getPropertyValue('padding-' + location);
|
|
449
|
-
return parseInt(cssValue, 10) || 0;
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
if (isHoriz && isReverse) {
|
|
453
|
-
return {
|
|
454
|
-
bottom: padding('left'),
|
|
455
|
-
top: padding('right')
|
|
456
|
-
};
|
|
457
|
-
} else if (isHoriz) {
|
|
458
|
-
return {
|
|
459
|
-
bottom: padding('right'),
|
|
460
|
-
top: padding('left')
|
|
461
|
-
};
|
|
462
|
-
} else if (isReverse) {
|
|
463
|
-
return {
|
|
464
|
-
bottom: padding('top'),
|
|
465
|
-
top: padding('bottom')
|
|
314
|
+
_computeScrollPadding() {
|
|
315
|
+
const config = this._config;
|
|
316
|
+
const isHoriz = Boolean(config.horizontal);
|
|
317
|
+
const styles = window.getComputedStyle(this._element);
|
|
318
|
+
const padding = (location) => {
|
|
319
|
+
const cssValue = styles.getPropertyValue(`padding-${location}`);
|
|
320
|
+
return parseInt(cssValue, 10) || 0;
|
|
466
321
|
};
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
while (this._itemPositions[i] < scrollTop) {
|
|
480
|
-
i++;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
return i;
|
|
322
|
+
if (isHoriz) {
|
|
323
|
+
return {
|
|
324
|
+
bottom: padding('right'),
|
|
325
|
+
top: padding('left'),
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
return {
|
|
330
|
+
bottom: padding('bottom'),
|
|
331
|
+
top: padding('top'),
|
|
332
|
+
};
|
|
333
|
+
}
|
|
484
334
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
i--;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
return i;
|
|
335
|
+
_getFrom(scrollTop) {
|
|
336
|
+
let i = 0;
|
|
337
|
+
while (this._itemPositions[i] < scrollTop) {
|
|
338
|
+
i++;
|
|
339
|
+
}
|
|
340
|
+
return i;
|
|
495
341
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
exports.default = HyperList;
|
|
502
|
-
module.exports = exports['default'];
|
|
503
|
-
|
|
504
|
-
},{}]},{},[1])(1)
|
|
505
|
-
});
|
|
506
|
-
}(hyperlist));
|
|
507
|
-
|
|
508
|
-
const Hyperlist = /*@__PURE__*/getDefaultExportFromCjs(hyperlist.exports);
|
|
342
|
+
}
|
|
343
|
+
VirtualList.defaultConfig = {
|
|
344
|
+
width: '100%',
|
|
345
|
+
height: '100%',
|
|
346
|
+
};
|
|
509
347
|
|
|
510
348
|
const treeCss = ":host{display:block}";
|
|
511
349
|
const IxTreeStyle0 = treeCss;
|
|
@@ -546,6 +384,8 @@ const Tree = class {
|
|
|
546
384
|
}
|
|
547
385
|
};
|
|
548
386
|
return {
|
|
387
|
+
width: '100%',
|
|
388
|
+
height: '100%',
|
|
549
389
|
itemHeight: 32,
|
|
550
390
|
total: list.length,
|
|
551
391
|
generate: (index) => {
|
|
@@ -682,6 +522,7 @@ const Tree = class {
|
|
|
682
522
|
}
|
|
683
523
|
isListInitialized() {
|
|
684
524
|
var _a;
|
|
525
|
+
//@ts-ignore
|
|
685
526
|
const itemPositions = (_a = this.hyperlist) === null || _a === void 0 ? void 0 : _a._itemPositions;
|
|
686
527
|
return (itemPositions !== undefined &&
|
|
687
528
|
itemPositions.length &&
|
|
@@ -699,10 +540,10 @@ const Tree = class {
|
|
|
699
540
|
}
|
|
700
541
|
(_a = this.hyperlist) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
701
542
|
const config = this.getVirtualizerOptions();
|
|
702
|
-
this.hyperlist = new
|
|
543
|
+
this.hyperlist = new VirtualList(this.hostElement, config);
|
|
703
544
|
}
|
|
704
545
|
render() {
|
|
705
|
-
return (h(Host, { key: '
|
|
546
|
+
return (h(Host, { key: '23855bc97fd2eceb9af149d6b39e32ccb930b1d9' }, h("slot", { key: '1fe905f3ded4b94af84d2e827f6056914c14fc45' })));
|
|
706
547
|
}
|
|
707
548
|
get hostElement() { return getElement(this); }
|
|
708
549
|
static get watchers() { return {
|