@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
|
@@ -3,513 +3,351 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-757233c7.js');
|
|
6
|
-
const _commonjsHelpers = require('./_commonjsHelpers-0192c5b3.js');
|
|
7
6
|
const defaultTreeItem = require('./default-tree-item-309a50cd.js');
|
|
8
7
|
const dropdownController = require('./dropdown-controller-aef51729.js');
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Object.defineProperty(exports, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
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; }; }();
|
|
22
|
-
|
|
23
|
-
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; }
|
|
24
|
-
|
|
25
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
26
|
-
|
|
27
|
-
var defaultConfig = {
|
|
28
|
-
width: '100%',
|
|
29
|
-
height: '100%'
|
|
30
|
-
|
|
31
|
-
// Check for valid number.
|
|
32
|
-
};var isNumber = function isNumber(input) {
|
|
33
|
-
return Number(input) === Number(input);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
// Add a class to an element.
|
|
37
|
-
var addClass = 'classList' in document.documentElement ? function (element, className) {
|
|
38
|
-
element.classList.add(className);
|
|
39
|
-
} : function (element, className) {
|
|
40
|
-
var oldClass = element.getAttribute('class') || '';
|
|
41
|
-
element.setAttribute('class', oldClass + ' ' + className);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Creates a HyperList instance that virtually scrolls very large amounts of
|
|
46
|
-
* data effortlessly.
|
|
9
|
+
/*
|
|
10
|
+
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
11
|
+
*
|
|
12
|
+
* SPDX-License-Identifier: MIT
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
47
16
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
17
|
+
// Manually forked from https://github.com/tbranyen/hyperlist to remove
|
|
18
|
+
// features a direct document calls
|
|
19
|
+
//
|
|
20
|
+
// Hyperlist is licensed MIT. https://github.com/tbranyen/hyperlist
|
|
21
|
+
const isNumber = (input) => !Number.isNaN(Number(input));
|
|
22
|
+
const addClass = (element, className) => {
|
|
23
|
+
element.classList.add(className);
|
|
24
|
+
};
|
|
25
|
+
class VirtualList {
|
|
26
|
+
static create(element, userProvidedConfig = VirtualList.defaultConfig) {
|
|
27
|
+
return new VirtualList(element, userProvidedConfig);
|
|
54
28
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}, {
|
|
63
|
-
key: 'mergeStyle',
|
|
64
|
-
value: function mergeStyle(element, style) {
|
|
65
|
-
for (var i in style) {
|
|
66
|
-
if (element.style[i] !== style[i]) {
|
|
67
|
-
element.style[i] = style[i];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
29
|
+
static mergeStyle(element, style) {
|
|
30
|
+
for (let i in style) {
|
|
31
|
+
if (element.style[i] !== style[i]) {
|
|
32
|
+
element.style[i] = style[i];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
70
35
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// Remove the element immediately after reading the value.
|
|
96
|
-
document.body.removeChild(wrapper);
|
|
97
|
-
|
|
98
|
-
return maxElementHeight;
|
|
36
|
+
static getMaxBrowserHeight() {
|
|
37
|
+
// Create two elements, the wrapper is `1px` tall and is transparent and
|
|
38
|
+
// positioned at the top of the page. Inside that is an element that gets
|
|
39
|
+
// set to 1 billion pixels. Then reads the max height the browser can
|
|
40
|
+
// calculate.
|
|
41
|
+
const wrapper = document.createElement('div');
|
|
42
|
+
const fixture = document.createElement('div');
|
|
43
|
+
// As said above, these values get set to put the fixture elements into the
|
|
44
|
+
// right visual state.
|
|
45
|
+
VirtualList.mergeStyle(wrapper, {
|
|
46
|
+
position: 'absolute',
|
|
47
|
+
height: '1px',
|
|
48
|
+
opacity: 0,
|
|
49
|
+
});
|
|
50
|
+
VirtualList.mergeStyle(fixture, { height: '1e7px' });
|
|
51
|
+
// Add the fixture into the wrapper element.
|
|
52
|
+
wrapper.appendChild(fixture);
|
|
53
|
+
// Apply to the page, the values won't kick in unless this is attached.
|
|
54
|
+
document.body.appendChild(wrapper);
|
|
55
|
+
// Get the maximum element height in pixels.
|
|
56
|
+
const maxElementHeight = fixture.offsetHeight;
|
|
57
|
+
// Remove the element immediately after reading the value.
|
|
58
|
+
document.body.removeChild(wrapper);
|
|
59
|
+
return maxElementHeight;
|
|
99
60
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
var diff = lastRepaint ? scrollTop - lastRepaint : 0;
|
|
127
|
-
if (!lastRepaint || diff < 0 || diff > _this._averageHeight) {
|
|
128
|
-
var rendered = _this._renderChunk();
|
|
129
|
-
|
|
130
|
-
_this._lastRepaint = scrollTop;
|
|
131
|
-
|
|
132
|
-
if (rendered !== false && typeof config.afterRender === 'function') {
|
|
133
|
-
config.afterRender();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
render();
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
_createClass(HyperList, [{
|
|
142
|
-
key: 'destroy',
|
|
143
|
-
value: function destroy() {
|
|
144
|
-
window.cancelAnimationFrame(this._renderAnimationFrame);
|
|
61
|
+
constructor(element, userProvidedConfig) {
|
|
62
|
+
this._lastRepaint = null;
|
|
63
|
+
this._maxElementHeight = VirtualList.getMaxBrowserHeight();
|
|
64
|
+
this.refresh(element, userProvidedConfig);
|
|
65
|
+
const config = this._config;
|
|
66
|
+
// Create internal render loop.
|
|
67
|
+
const render = () => {
|
|
68
|
+
const scrollTop = this._getScrollPosition();
|
|
69
|
+
const lastRepaint = this._lastRepaint;
|
|
70
|
+
this._renderAnimationFrame = window.requestAnimationFrame(render);
|
|
71
|
+
if (scrollTop === lastRepaint) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const diff = lastRepaint ? scrollTop - lastRepaint : 0;
|
|
75
|
+
if (!lastRepaint || diff < 0 || diff > this._averageHeight) {
|
|
76
|
+
let rendered = this._renderChunk();
|
|
77
|
+
this._lastRepaint = scrollTop;
|
|
78
|
+
if (rendered !== false && typeof config.afterRender === 'function') {
|
|
79
|
+
config.afterRender();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
render();
|
|
145
84
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (!element || element.nodeType !== 1) {
|
|
154
|
-
throw new Error('HyperList requires a valid DOM Node container');
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
this._element = element;
|
|
158
|
-
|
|
159
|
-
var config = this._config;
|
|
160
|
-
|
|
161
|
-
var scroller = this._scroller || config.scroller || document.createElement(config.scrollerTagName || 'tr');
|
|
162
|
-
|
|
163
|
-
// Default configuration option `useFragment` to `true`.
|
|
164
|
-
if (typeof config.useFragment !== 'boolean') {
|
|
165
|
-
this._config.useFragment = true;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
if (!config.generate) {
|
|
169
|
-
throw new Error('Missing required `generate` function');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
if (!isNumber(config.total)) {
|
|
173
|
-
throw new Error('Invalid required `total` value, expected number');
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
if (!Array.isArray(config.itemHeight) && !isNumber(config.itemHeight)) {
|
|
177
|
-
throw new Error('\n Invalid required `itemHeight` value, expected number or array\n '.trim());
|
|
178
|
-
} else if (isNumber(config.itemHeight)) {
|
|
179
|
-
this._itemHeights = Array(config.total).fill(config.itemHeight);
|
|
180
|
-
} else {
|
|
181
|
-
this._itemHeights = config.itemHeight;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Width and height should be coerced to string representations. Either in
|
|
185
|
-
// `%` or `px`.
|
|
186
|
-
Object.keys(defaultConfig).filter(function (prop) {
|
|
187
|
-
return prop in config;
|
|
188
|
-
}).forEach(function (prop) {
|
|
189
|
-
var value = config[prop];
|
|
190
|
-
var isValueNumber = isNumber(value);
|
|
191
|
-
|
|
192
|
-
if (value && typeof value !== 'string' && typeof value !== 'number') {
|
|
193
|
-
var msg = 'Invalid optional `' + prop + '`, expected string or number';
|
|
194
|
-
throw new Error(msg);
|
|
195
|
-
} else if (isValueNumber) {
|
|
196
|
-
config[prop] = value + 'px';
|
|
85
|
+
destroy() {
|
|
86
|
+
window.cancelAnimationFrame(this._renderAnimationFrame);
|
|
87
|
+
}
|
|
88
|
+
refresh(element, userProvidedConfig = VirtualList.defaultConfig) {
|
|
89
|
+
this._config = userProvidedConfig;
|
|
90
|
+
if (!element || element.nodeType !== 1) {
|
|
91
|
+
throw new Error('HyperList requires a valid DOM Node container');
|
|
197
92
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
|
|
93
|
+
this._element = element;
|
|
94
|
+
const config = this._config;
|
|
95
|
+
const scroller = this._scroller ||
|
|
96
|
+
config.scroller ||
|
|
97
|
+
document.createElement(config.scrollerTagName || 'tr');
|
|
98
|
+
// Default configuration option `useFragment` to `true`.
|
|
99
|
+
if (typeof config.useFragment !== 'boolean') {
|
|
100
|
+
this._config.useFragment = true;
|
|
101
|
+
}
|
|
102
|
+
if (!config.generate) {
|
|
103
|
+
throw new Error('Missing required `generate` function');
|
|
104
|
+
}
|
|
105
|
+
if (!isNumber(config.total)) {
|
|
106
|
+
throw new Error('Invalid required `total` value, expected number');
|
|
107
|
+
}
|
|
108
|
+
if (!Array.isArray(config.itemHeight) && !isNumber(config.itemHeight)) {
|
|
109
|
+
throw new Error(`
|
|
110
|
+
Invalid required \`itemHeight\` value, expected number or array
|
|
111
|
+
`.trim());
|
|
112
|
+
}
|
|
113
|
+
else if (isNumber(config.itemHeight)) {
|
|
114
|
+
this._itemHeights = Array(config.total).fill(config.itemHeight);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
this._itemHeights = [config.itemHeight];
|
|
118
|
+
}
|
|
119
|
+
// Width and height should be coerced to string representations. Either in
|
|
120
|
+
// `%` or `px`.
|
|
121
|
+
Object.keys(VirtualList.defaultConfig)
|
|
122
|
+
.filter((prop) => prop in config)
|
|
123
|
+
.forEach((prop) => {
|
|
124
|
+
const value = config[prop];
|
|
125
|
+
const isValueNumber = isNumber(value);
|
|
126
|
+
if (value && typeof value !== 'string' && typeof value !== 'number') {
|
|
127
|
+
let msg = `Invalid optional \`${prop}\`, expected string or number`;
|
|
128
|
+
throw new Error(msg);
|
|
129
|
+
}
|
|
130
|
+
else if (isValueNumber) {
|
|
131
|
+
config[prop] = `${value}px`;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
const isHorizontal = Boolean(config.horizontal);
|
|
135
|
+
const value = config[isHorizontal ? 'width' : 'height'];
|
|
136
|
+
if (value) {
|
|
137
|
+
const isValueNumber = isNumber(value);
|
|
138
|
+
const isValuePercent = isValueNumber ? false : value.slice(-1) === '%';
|
|
139
|
+
// Compute the containerHeight as number
|
|
140
|
+
const numberValue = isValueNumber
|
|
141
|
+
? parseInt(value, 10)
|
|
142
|
+
: parseInt(value.replace(/px|%/, ''), 10);
|
|
143
|
+
const innerSize = window[isHorizontal ? 'innerWidth' : 'innerHeight'];
|
|
144
|
+
if (isValuePercent) {
|
|
145
|
+
this._containerSize = (innerSize * numberValue) / 100;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this._containerSize = isNumber(value) ? value : numberValue;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
const scrollContainer = config.scrollContainer;
|
|
152
|
+
const scrollerHeight = config.itemHeight * config.total;
|
|
153
|
+
const maxElementHeight = this._maxElementHeight;
|
|
154
|
+
if (scrollerHeight > maxElementHeight) {
|
|
155
|
+
console.warn([
|
|
156
|
+
'HyperList: The maximum element height',
|
|
157
|
+
maxElementHeight + 'px has',
|
|
158
|
+
'been exceeded; please reduce your item height.',
|
|
159
|
+
].join(' '));
|
|
160
|
+
}
|
|
161
|
+
// Decorate the container element with styles that will match
|
|
162
|
+
// the user supplied configuration.
|
|
163
|
+
const elementStyle = {
|
|
164
|
+
width: `${config.width}`,
|
|
165
|
+
height: scrollContainer ? `${scrollerHeight}px` : `${config.height}`,
|
|
166
|
+
overflow: scrollContainer ? 'none' : 'auto',
|
|
167
|
+
position: 'relative',
|
|
168
|
+
};
|
|
169
|
+
VirtualList.mergeStyle(element, elementStyle);
|
|
170
|
+
if (scrollContainer) {
|
|
171
|
+
VirtualList.mergeStyle(config.scrollContainer, { overflow: 'auto' });
|
|
172
|
+
}
|
|
173
|
+
const scrollerStyle = {
|
|
174
|
+
opacity: '0',
|
|
175
|
+
position: 'absolute',
|
|
176
|
+
[isHorizontal ? 'height' : 'width']: '1px',
|
|
177
|
+
[isHorizontal ? 'width' : 'height']: `${scrollerHeight}px`,
|
|
178
|
+
};
|
|
179
|
+
VirtualList.mergeStyle(scroller, scrollerStyle);
|
|
180
|
+
// Only append the scroller element once.
|
|
181
|
+
if (!this._scroller) {
|
|
182
|
+
element.appendChild(scroller);
|
|
183
|
+
}
|
|
184
|
+
const padding = this._computeScrollPadding();
|
|
185
|
+
this._scrollPaddingBottom = padding.bottom;
|
|
186
|
+
this._scrollPaddingTop = padding.top;
|
|
187
|
+
// Set the scroller instance.
|
|
188
|
+
this._scroller = scroller;
|
|
189
|
+
this._scrollHeight = this._computeScrollHeight();
|
|
190
|
+
// Reuse the item positions if refreshed, otherwise set to empty array.
|
|
191
|
+
this._itemPositions = this._itemPositions || Array(config.total).fill(0);
|
|
192
|
+
// Each index in the array should represent the position in the DOM.
|
|
193
|
+
this._computePositions(0);
|
|
194
|
+
// Render after refreshing. Force render if we're calling refresh manually.
|
|
195
|
+
this._renderChunk(this._lastRepaint !== null);
|
|
196
|
+
if (typeof config.afterRender === 'function') {
|
|
197
|
+
config.afterRender();
|
|
214
198
|
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
var scrollContainer = config.scrollContainer;
|
|
218
|
-
var scrollerHeight = config.itemHeight * config.total;
|
|
219
|
-
var maxElementHeight = this._maxElementHeight;
|
|
220
|
-
|
|
221
|
-
if (scrollerHeight > maxElementHeight) {
|
|
222
|
-
console.warn(['HyperList: The maximum element height', maxElementHeight + 'px has', 'been exceeded; please reduce your item height.'].join(' '));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
// Decorate the container element with styles that will match
|
|
226
|
-
// the user supplied configuration.
|
|
227
|
-
var elementStyle = {
|
|
228
|
-
width: '' + config.width,
|
|
229
|
-
height: scrollContainer ? scrollerHeight + 'px' : '' + config.height,
|
|
230
|
-
overflow: scrollContainer ? 'none' : 'auto',
|
|
231
|
-
position: 'relative'
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
HyperList.mergeStyle(element, elementStyle);
|
|
235
|
-
|
|
236
|
-
if (scrollContainer) {
|
|
237
|
-
HyperList.mergeStyle(config.scrollContainer, { overflow: 'auto' });
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
var scrollerStyle = (_scrollerStyle = {
|
|
241
|
-
opacity: '0',
|
|
242
|
-
position: 'absolute'
|
|
243
|
-
}, _defineProperty(_scrollerStyle, isHoriz ? 'height' : 'width', '1px'), _defineProperty(_scrollerStyle, isHoriz ? 'width' : 'height', scrollerHeight + 'px'), _scrollerStyle);
|
|
244
|
-
|
|
245
|
-
HyperList.mergeStyle(scroller, scrollerStyle);
|
|
246
|
-
|
|
247
|
-
// Only append the scroller element once.
|
|
248
|
-
if (!this._scroller) {
|
|
249
|
-
element.appendChild(scroller);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
var padding = this._computeScrollPadding();
|
|
253
|
-
this._scrollPaddingBottom = padding.bottom;
|
|
254
|
-
this._scrollPaddingTop = padding.top;
|
|
255
|
-
|
|
256
|
-
// Set the scroller instance.
|
|
257
|
-
this._scroller = scroller;
|
|
258
|
-
this._scrollHeight = this._computeScrollHeight();
|
|
259
|
-
|
|
260
|
-
// Reuse the item positions if refreshed, otherwise set to empty array.
|
|
261
|
-
this._itemPositions = this._itemPositions || Array(config.total).fill(0);
|
|
262
|
-
|
|
263
|
-
// Each index in the array should represent the position in the DOM.
|
|
264
|
-
this._computePositions(0);
|
|
265
|
-
|
|
266
|
-
// Render after refreshing. Force render if we're calling refresh manually.
|
|
267
|
-
this._renderChunk(this._lastRepaint !== null);
|
|
268
|
-
|
|
269
|
-
if (typeof config.afterRender === 'function') {
|
|
270
|
-
config.afterRender();
|
|
271
|
-
}
|
|
272
199
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var top = this._itemPositions[i] + this._scrollPaddingTop;
|
|
300
|
-
|
|
301
|
-
HyperList.mergeStyle(item, _defineProperty({
|
|
302
|
-
position: 'absolute'
|
|
303
|
-
}, config.horizontal ? 'left' : 'top', top + 'px'));
|
|
304
|
-
|
|
305
|
-
return item;
|
|
200
|
+
_getRow(i) {
|
|
201
|
+
const config = this._config;
|
|
202
|
+
let item = config.generate(i);
|
|
203
|
+
let height = item.height;
|
|
204
|
+
if (height !== undefined && isNumber(height)) {
|
|
205
|
+
item = item.element;
|
|
206
|
+
// The height isn't the same as predicted, compute positions again
|
|
207
|
+
if (height !== this._itemHeights[i]) {
|
|
208
|
+
this._itemHeights[i] = height;
|
|
209
|
+
this._computePositions(i);
|
|
210
|
+
this._scrollHeight = this._computeScrollHeight();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
height = this._itemHeights[i];
|
|
215
|
+
}
|
|
216
|
+
if (!item || item.nodeType !== 1) {
|
|
217
|
+
throw new Error(`Generator did not return a DOM Node for index: ${i}`);
|
|
218
|
+
}
|
|
219
|
+
addClass(item, config.rowClassName || 'vrow');
|
|
220
|
+
const top = this._itemPositions[i] + this._scrollPaddingTop;
|
|
221
|
+
VirtualList.mergeStyle(item, {
|
|
222
|
+
position: 'absolute',
|
|
223
|
+
[config.horizontal ? 'left' : 'top']: `${top}px`,
|
|
224
|
+
});
|
|
225
|
+
return item;
|
|
306
226
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return config.overrideScrollPosition();
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
return this._element[config.horizontal ? 'scrollLeft' : 'scrollTop'];
|
|
227
|
+
_getScrollPosition() {
|
|
228
|
+
const config = this._config;
|
|
229
|
+
if (typeof config.overrideScrollPosition === 'function') {
|
|
230
|
+
return config.overrideScrollPosition();
|
|
231
|
+
}
|
|
232
|
+
return this._element[config.horizontal ? 'scrollLeft' : 'scrollTop'];
|
|
317
233
|
}
|
|
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
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
for (var i = from; i < to; i++) {
|
|
358
|
-
var row = this._getRow(i);
|
|
359
|
-
|
|
360
|
-
fragment[config.useFragment ? 'appendChild' : 'push'](row);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (config.applyPatch) {
|
|
364
|
-
return config.applyPatch(element, fragment);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
element.innerHTML = '';
|
|
368
|
-
element.appendChild(fragment);
|
|
234
|
+
_renderChunk(force = false) {
|
|
235
|
+
const config = this._config;
|
|
236
|
+
const element = this._element;
|
|
237
|
+
const scrollTop = this._getScrollPosition();
|
|
238
|
+
const total = config.total;
|
|
239
|
+
let from = this._getFrom(scrollTop) - 1;
|
|
240
|
+
if (from < 0 || from - this._screenItemsLen < 0) {
|
|
241
|
+
from = 0;
|
|
242
|
+
}
|
|
243
|
+
if (!force && this._lastFrom === from) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
this._lastFrom = from;
|
|
247
|
+
let to = from + this._cachedItemsLen;
|
|
248
|
+
if (to > total || to + this._cachedItemsLen > total) {
|
|
249
|
+
to = total;
|
|
250
|
+
}
|
|
251
|
+
// Append all the new rows in a document fragment that we will later append
|
|
252
|
+
// to the parent node
|
|
253
|
+
const fragment = config.useFragment
|
|
254
|
+
? document.createDocumentFragment()
|
|
255
|
+
: [
|
|
256
|
+
// Sometimes you'll pass fake elements to this tool and Fragments require
|
|
257
|
+
// real elements.
|
|
258
|
+
];
|
|
259
|
+
// The element that forces the container to scroll.
|
|
260
|
+
const scroller = this._scroller;
|
|
261
|
+
// Keep the scroller in the list of children.
|
|
262
|
+
fragment[config.useFragment ? 'appendChild' : 'push'](scroller);
|
|
263
|
+
for (let i = from; i < to; i++) {
|
|
264
|
+
let row = this._getRow(i);
|
|
265
|
+
fragment[config.useFragment ? 'appendChild' : 'push'](row);
|
|
266
|
+
}
|
|
267
|
+
if (config.applyPatch) {
|
|
268
|
+
return config.applyPatch(element, fragment);
|
|
269
|
+
}
|
|
270
|
+
element.innerHTML = '';
|
|
271
|
+
element.appendChild(fragment);
|
|
369
272
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
from = 1;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
for (var i = from; i < total; i++) {
|
|
384
|
-
if (reverse) {
|
|
385
|
-
if (i === 0) {
|
|
386
|
-
this._itemPositions[0] = this._scrollHeight - this._itemHeights[0];
|
|
387
|
-
} else {
|
|
388
|
-
this._itemPositions[i] = this._itemPositions[i - 1] - this._itemHeights[i];
|
|
389
|
-
}
|
|
390
|
-
} else {
|
|
391
|
-
this._itemPositions[i] = this._itemHeights[i - 1] + this._itemPositions[i - 1];
|
|
392
|
-
}
|
|
393
|
-
}
|
|
273
|
+
_computePositions(from = 1) {
|
|
274
|
+
const config = this._config;
|
|
275
|
+
const total = config.total;
|
|
276
|
+
if (from < 1) {
|
|
277
|
+
from = 1;
|
|
278
|
+
}
|
|
279
|
+
for (let i = from; i < total; i++) {
|
|
280
|
+
this._itemPositions[i] =
|
|
281
|
+
this._itemHeights[i - 1] + this._itemPositions[i - 1];
|
|
282
|
+
}
|
|
394
283
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
HyperList.mergeStyle(this._scroller, (_HyperList$mergeStyle2 = {
|
|
409
|
-
opacity: 0,
|
|
410
|
-
position: 'absolute',
|
|
411
|
-
top: '0px'
|
|
412
|
-
}, _defineProperty(_HyperList$mergeStyle2, isHoriz ? 'height' : 'width', '1px'), _defineProperty(_HyperList$mergeStyle2, isHoriz ? 'width' : 'height', scrollHeight + 'px'), _HyperList$mergeStyle2));
|
|
413
|
-
|
|
414
|
-
// Calculate the height median
|
|
415
|
-
var sortedItemHeights = this._itemHeights.slice(0).sort(function (a, b) {
|
|
416
|
-
return a - b;
|
|
417
|
-
});
|
|
418
|
-
var middle = Math.floor(total / 2);
|
|
419
|
-
var averageHeight = total % 2 === 0 ? (sortedItemHeights[middle] + sortedItemHeights[middle - 1]) / 2 : sortedItemHeights[middle];
|
|
420
|
-
|
|
421
|
-
var clientProp = isHoriz ? 'clientWidth' : 'clientHeight';
|
|
422
|
-
var element = config.scrollContainer ? config.scrollContainer : this._element;
|
|
423
|
-
var containerHeight = element[clientProp] ? element[clientProp] : this._containerSize;
|
|
424
|
-
this._screenItemsLen = Math.ceil(containerHeight / averageHeight);
|
|
425
|
-
this._containerSize = containerHeight;
|
|
426
|
-
|
|
427
|
-
// Cache 3 times the number of items that fit in the container viewport.
|
|
428
|
-
this._cachedItemsLen = Math.max(this._cachedItemsLen || 0, this._screenItemsLen * 3);
|
|
429
|
-
this._averageHeight = averageHeight;
|
|
430
|
-
|
|
431
|
-
if (config.reverse) {
|
|
432
|
-
window.requestAnimationFrame(function () {
|
|
433
|
-
if (isHoriz) {
|
|
434
|
-
_this2._element.scrollLeft = scrollHeight;
|
|
435
|
-
} else {
|
|
436
|
-
_this2._element.scrollTop = scrollHeight;
|
|
437
|
-
}
|
|
284
|
+
_computeScrollHeight() {
|
|
285
|
+
const config = this._config;
|
|
286
|
+
const isHorizontal = Boolean(config.horizontal);
|
|
287
|
+
const total = config.total;
|
|
288
|
+
const scrollHeight = this._itemHeights.reduce((a, b) => a + b, 0) +
|
|
289
|
+
this._scrollPaddingBottom +
|
|
290
|
+
this._scrollPaddingTop;
|
|
291
|
+
VirtualList.mergeStyle(this._scroller, {
|
|
292
|
+
opacity: 0,
|
|
293
|
+
position: 'absolute',
|
|
294
|
+
top: '0px',
|
|
295
|
+
[isHorizontal ? 'height' : 'width']: '1px',
|
|
296
|
+
[isHorizontal ? 'width' : 'height']: `${scrollHeight}px`,
|
|
438
297
|
});
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
298
|
+
// Calculate the height median
|
|
299
|
+
const sortedItemHeights = this._itemHeights.slice(0).sort((a, b) => a - b);
|
|
300
|
+
const middle = Math.floor(total / 2);
|
|
301
|
+
const averageHeight = total % 2 === 0
|
|
302
|
+
? (sortedItemHeights[middle] + sortedItemHeights[middle - 1]) / 2
|
|
303
|
+
: sortedItemHeights[middle];
|
|
304
|
+
const clientProp = isHorizontal ? 'clientWidth' : 'clientHeight';
|
|
305
|
+
const element = config.scrollContainer
|
|
306
|
+
? config.scrollContainer
|
|
307
|
+
: this._element;
|
|
308
|
+
const containerHeight = element[clientProp]
|
|
309
|
+
? element[clientProp]
|
|
310
|
+
: this._containerSize;
|
|
311
|
+
this._screenItemsLen = Math.ceil(containerHeight / averageHeight);
|
|
312
|
+
this._containerSize = containerHeight;
|
|
313
|
+
// Cache 3 times the number of items that fit in the container viewport.
|
|
314
|
+
this._cachedItemsLen = Math.max(this._cachedItemsLen || 0, this._screenItemsLen * 3);
|
|
315
|
+
this._averageHeight = averageHeight;
|
|
316
|
+
return scrollHeight;
|
|
442
317
|
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
var padding = function padding(location) {
|
|
452
|
-
var cssValue = styles.getPropertyValue('padding-' + location);
|
|
453
|
-
return parseInt(cssValue, 10) || 0;
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
if (isHoriz && isReverse) {
|
|
457
|
-
return {
|
|
458
|
-
bottom: padding('left'),
|
|
459
|
-
top: padding('right')
|
|
460
|
-
};
|
|
461
|
-
} else if (isHoriz) {
|
|
462
|
-
return {
|
|
463
|
-
bottom: padding('right'),
|
|
464
|
-
top: padding('left')
|
|
465
|
-
};
|
|
466
|
-
} else if (isReverse) {
|
|
467
|
-
return {
|
|
468
|
-
bottom: padding('top'),
|
|
469
|
-
top: padding('bottom')
|
|
318
|
+
_computeScrollPadding() {
|
|
319
|
+
const config = this._config;
|
|
320
|
+
const isHoriz = Boolean(config.horizontal);
|
|
321
|
+
const styles = window.getComputedStyle(this._element);
|
|
322
|
+
const padding = (location) => {
|
|
323
|
+
const cssValue = styles.getPropertyValue(`padding-${location}`);
|
|
324
|
+
return parseInt(cssValue, 10) || 0;
|
|
470
325
|
};
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
while (this._itemPositions[i] < scrollTop) {
|
|
484
|
-
i++;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
return i;
|
|
326
|
+
if (isHoriz) {
|
|
327
|
+
return {
|
|
328
|
+
bottom: padding('right'),
|
|
329
|
+
top: padding('left'),
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
return {
|
|
334
|
+
bottom: padding('bottom'),
|
|
335
|
+
top: padding('top'),
|
|
336
|
+
};
|
|
337
|
+
}
|
|
488
338
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
i--;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
return i;
|
|
339
|
+
_getFrom(scrollTop) {
|
|
340
|
+
let i = 0;
|
|
341
|
+
while (this._itemPositions[i] < scrollTop) {
|
|
342
|
+
i++;
|
|
343
|
+
}
|
|
344
|
+
return i;
|
|
499
345
|
}
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
exports.default = HyperList;
|
|
506
|
-
module.exports = exports['default'];
|
|
507
|
-
|
|
508
|
-
},{}]},{},[1])(1)
|
|
509
|
-
});
|
|
510
|
-
}(hyperlist));
|
|
511
|
-
|
|
512
|
-
const Hyperlist = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(hyperlist.exports);
|
|
346
|
+
}
|
|
347
|
+
VirtualList.defaultConfig = {
|
|
348
|
+
width: '100%',
|
|
349
|
+
height: '100%',
|
|
350
|
+
};
|
|
513
351
|
|
|
514
352
|
const treeCss = ":host{display:block}";
|
|
515
353
|
const IxTreeStyle0 = treeCss;
|
|
@@ -550,6 +388,8 @@ const Tree = class {
|
|
|
550
388
|
}
|
|
551
389
|
};
|
|
552
390
|
return {
|
|
391
|
+
width: '100%',
|
|
392
|
+
height: '100%',
|
|
553
393
|
itemHeight: 32,
|
|
554
394
|
total: list.length,
|
|
555
395
|
generate: (index) => {
|
|
@@ -686,6 +526,7 @@ const Tree = class {
|
|
|
686
526
|
}
|
|
687
527
|
isListInitialized() {
|
|
688
528
|
var _a;
|
|
529
|
+
//@ts-ignore
|
|
689
530
|
const itemPositions = (_a = this.hyperlist) === null || _a === void 0 ? void 0 : _a._itemPositions;
|
|
690
531
|
return (itemPositions !== undefined &&
|
|
691
532
|
itemPositions.length &&
|
|
@@ -703,10 +544,10 @@ const Tree = class {
|
|
|
703
544
|
}
|
|
704
545
|
(_a = this.hyperlist) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
705
546
|
const config = this.getVirtualizerOptions();
|
|
706
|
-
this.hyperlist = new
|
|
547
|
+
this.hyperlist = new VirtualList(this.hostElement, config);
|
|
707
548
|
}
|
|
708
549
|
render() {
|
|
709
|
-
return (index.h(index.Host, { key: '
|
|
550
|
+
return (index.h(index.Host, { key: '23855bc97fd2eceb9af149d6b39e32ccb930b1d9' }, index.h("slot", { key: '1fe905f3ded4b94af84d2e827f6056914c14fc45' })));
|
|
710
551
|
}
|
|
711
552
|
get hostElement() { return index.getElement(this); }
|
|
712
553
|
static get watchers() { return {
|