bromcom-ui 2.12.3 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-7c5763cc.entry.js → p-03337609.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4ca7e0e7.entry.js → p-10687c62.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c49b6287.entry.js → p-19ed830b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-32c55505.entry.js → p-1a7e1a74.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d59d9687.entry.js → p-1fbec9e4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e0cc8f86.entry.js → p-2afde14e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-beaec5b8.js → p-2d0ff35e.js} +1 -1
- package/dist/bromcom-ui/{p-21bacc22.js → p-31a60231.js} +1 -1
- package/dist/bromcom-ui/{p-67343ad8.entry.js → p-3b079331.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6bdf0cbc.js → p-3be27626.js} +1 -1
- package/dist/bromcom-ui/{p-6bea284a.js → p-499d8454.js} +1 -1
- package/dist/bromcom-ui/{p-a6aa173f.entry.js → p-4a71c61a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3f34cf2a.entry.js → p-4cc12992.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c77541f4.js → p-4d2bf0e7.js} +2 -2
- package/dist/bromcom-ui/p-556010cb.js +5 -0
- package/dist/bromcom-ui/{p-3aaa60b9.entry.js → p-56b9cdf7.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1b558b0f.entry.js → p-583982a6.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ef5cba72.js → p-59dc2542.js} +1 -1
- package/dist/bromcom-ui/{p-d623e891.entry.js → p-5adcfd9b.entry.js} +1 -1
- package/dist/bromcom-ui/p-5ea9881d.entry.js +5 -0
- package/dist/bromcom-ui/{p-375e9750.entry.js → p-5f47e061.entry.js} +1 -1
- package/dist/bromcom-ui/p-64fad38b.js +11 -0
- package/dist/bromcom-ui/{p-d6b1465a.entry.js → p-6d42e250.entry.js} +1 -1
- package/dist/bromcom-ui/p-6f11eb8e.entry.js +5 -0
- package/dist/bromcom-ui/{p-8c018ae0.js → p-6f2e4c9b.js} +1 -1
- package/dist/bromcom-ui/{p-7e44e6b5.js → p-6f861fed.js} +1 -1
- package/dist/bromcom-ui/{p-d1298c40.js → p-7b21fcb9.js} +1 -1
- package/dist/bromcom-ui/p-815f884d.entry.js +5 -0
- package/dist/bromcom-ui/{p-6657830f.js → p-85eedabc.js} +1 -1
- package/dist/bromcom-ui/{p-8fa7d3c3.entry.js → p-8c009880.entry.js} +1 -1
- package/dist/bromcom-ui/p-8d0d0c5b.entry.js +5 -0
- package/dist/bromcom-ui/{p-9850cbce.js → p-8e5e362a.js} +1 -1
- package/dist/bromcom-ui/{p-0715c523.entry.js → p-8f062608.entry.js} +1 -1
- package/dist/bromcom-ui/p-9cbf3f1d.entry.js +16 -0
- package/dist/bromcom-ui/{p-aeb4be41.js → p-a2df6c19.js} +1 -1
- package/dist/bromcom-ui/p-a2e0a182.entry.js +5 -0
- package/dist/bromcom-ui/{p-2b42d77e.entry.js → p-a6b4a46d.entry.js} +1 -1
- package/dist/bromcom-ui/p-a6b696de.js +5 -0
- package/dist/bromcom-ui/p-a947136c.entry.js +5 -0
- package/dist/bromcom-ui/{p-bb6f4952.entry.js → p-ac720743.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3288f732.entry.js → p-b3af25ef.entry.js} +1 -1
- package/dist/bromcom-ui/{p-77ef609e.entry.js → p-b46e368e.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d53c9b92.entry.js → p-bae91cbf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1141f58d.entry.js → p-c10b25e2.entry.js} +1 -1
- package/dist/bromcom-ui/{p-59f7fa84.entry.js → p-c4bf7f7e.entry.js} +1 -1
- package/dist/bromcom-ui/p-c4d524b5.entry.js +5 -0
- package/dist/bromcom-ui/{p-9b59c689.entry.js → p-c5bb29d0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5d670fd7.entry.js → p-cc70861b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e8eaa3bb.entry.js → p-d0e56f5f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5d266fd0.entry.js → p-d49d3d72.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a0d6d680.js → p-d65bc842.js} +1 -1
- package/dist/bromcom-ui/{p-cb7d5481.entry.js → p-dc2d5b2f.entry.js} +1 -1
- package/dist/bromcom-ui/p-dc73abe2.js +5 -0
- package/dist/bromcom-ui/{p-170cf07d.js → p-e037ee2b.js} +1 -1
- package/dist/bromcom-ui/p-e46fde49.js +5 -0
- package/dist/bromcom-ui/{p-083126ea.entry.js → p-e499306b.entry.js} +1 -1
- package/dist/bromcom-ui/p-ebd9132c.entry.js +5 -0
- package/dist/bromcom-ui/{p-1812bfb7.entry.js → p-f5a8e601.entry.js} +1 -1
- package/dist/bromcom-ui/{p-19b32974.entry.js → p-f66c4afa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a486613b.entry.js → p-fdd4cabe.entry.js} +1 -1
- package/dist/cjs/bcm-accordion_68.cjs.entry.js +47182 -0
- package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +3 -3
- package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +3 -3
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bcm-caption.cjs.entry.js +4 -4
- package/dist/cjs/bcm-card.cjs.entry.js +1 -1
- package/dist/cjs/bcm-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-default.cjs.entry.js +1 -1
- package/dist/cjs/bcm-form-2.cjs.entry.js +1 -1
- package/dist/cjs/bcm-input-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-input-custom.cjs.entry.js +1 -1
- package/dist/cjs/bcm-input-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-number-input.cjs.entry.js +5 -5
- package/dist/cjs/bcm-skeleton.cjs.entry.js +3 -3
- package/dist/cjs/bcm-table.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tag.cjs.entry.js +2 -2
- package/dist/cjs/bcm-time-picker.cjs.entry.js +1 -1
- package/dist/cjs/bcm-toast.cjs.entry.js +17 -17
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/{caption-template-85a18b6d.js → caption-template-f8a78504.js} +9 -9
- package/dist/cjs/{generate-b43c3d3b.js → generate-e3956756.js} +13 -13
- package/dist/cjs/{input.style-b5676e6a.js → input.style-bee84fb0.js} +1 -1
- package/dist/cjs/{label-template-e83447b5.js → label-template-fc301e0c.js} +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{number-helper-a708fa79.js → number-helper-43361f4e.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +2 -2
- package/dist/cjs/old-bcm-popover.cjs.entry.js +1 -1
- package/dist/cjs/{validators-84d8ae28.js → validators-9a6ae72d.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/avatar/avatar.js +1 -1
- package/dist/collection/components/atoms/avatar/avatar.style.js +4 -4
- package/dist/collection/components/atoms/badge/badge.style.js +8 -8
- package/dist/collection/components/atoms/button/button.css +90 -92
- package/dist/collection/components/atoms/button/button.js +45 -46
- package/dist/collection/components/atoms/chip/chip.css +27 -29
- package/dist/collection/components/atoms/chip/chip.js +10 -11
- package/dist/collection/components/atoms/divider/divider.css +4 -4
- package/dist/collection/components/atoms/link/link.css +10 -11
- package/dist/collection/components/molecules/accordion/accordion.css +23 -0
- package/dist/collection/components/molecules/accordion/accordion.js +1 -1
- package/dist/collection/components/molecules/alert/alert.css +28 -24
- package/dist/collection/components/molecules/alert/alert.js +26 -36
- package/dist/collection/components/molecules/button-group/button-group.css +15 -23
- package/dist/collection/components/molecules/checkbox/checkbox.css +15 -15
- package/dist/collection/components/molecules/checkbox/checkbox.js +8 -9
- package/dist/collection/components/molecules/color-input/color-input.js +1 -1
- package/dist/collection/components/molecules/empty/empty.js +1 -1
- package/dist/collection/components/molecules/error-layout/error-layout.css +13 -15
- package/dist/collection/components/molecules/error-layout/error-layout.js +1 -1
- package/dist/collection/components/molecules/expansion-panel/expansion-panel.css +25 -22
- package/dist/collection/components/molecules/expansion-panel/expansion-panel.js +1 -1
- package/dist/collection/components/molecules/input/input.css +21 -13
- package/dist/collection/components/molecules/input/input.style.js +1 -1
- package/dist/collection/components/molecules/menu/menu.css +29 -23
- package/dist/collection/components/molecules/modal/modal.css +21 -27
- package/dist/collection/components/molecules/radio/radio.js +10 -10
- package/dist/collection/components/molecules/range/range.css +5 -8
- package/dist/collection/components/molecules/search/search.css +21 -13
- package/dist/collection/components/molecules/stepper/stepper.css +6 -5
- package/dist/collection/components/molecules/switch/switch.css +22 -21
- package/dist/collection/components/molecules/tab-group/tab-item-header.js +6 -6
- package/dist/collection/components/molecules/textarea/textarea.css +21 -13
- package/dist/collection/components/organism/list/list.css +44 -44
- package/dist/collection/components/other/shortcut/shortcut.js +4 -4
- package/dist/collection/components/other/toast/toast.js +16 -16
- package/dist/collection/components/third-parts/colorful/colorful.css +21 -13
- package/dist/collection/components/third-parts/rc-picker/rc-picker.css +13 -9
- package/dist/collection/global/components/_checkbox.css +15 -15
- package/dist/collection/helper/popover-helper.js +5 -5
- package/dist/collection/helper/tooltip-helper.js +6 -6
- package/dist/collection/templates/caption-template.js +9 -9
- package/dist/collection/templates/input-template.js +1 -1
- package/dist/collection/templates/label-template.js +4 -4
- package/dist/collection/templates/step-template.js +4 -4
- package/dist/components/Overflow.js +141 -83
- package/dist/components/avatar.js +6 -6
- package/dist/components/badge.js +9 -9
- package/dist/components/bcm-accordion.js +2 -2
- package/dist/components/bcm-alert.js +28 -41
- package/dist/components/bcm-attendance-actions-comment.js +1 -1
- package/dist/components/bcm-attendance-actions-dropdown.js +1 -1
- package/dist/components/bcm-attendance-actions.js +1 -1
- package/dist/components/bcm-button-group.js +1 -1
- package/dist/components/bcm-checkbox-group.js +1 -1
- package/dist/components/bcm-color-input.js +1 -1
- package/dist/components/bcm-error-layout.js +2 -2
- package/dist/components/bcm-expansion-panel.js +2 -2
- package/dist/components/bcm-input-2.js +1 -1
- package/dist/components/bcm-input-dropdown.js +1 -1
- package/dist/components/bcm-modal.js +1 -1
- package/dist/components/bcm-popover.js +5 -5
- package/dist/components/bcm-range.js +1 -1
- package/dist/components/bcm-shortcut.js +4 -4
- package/dist/components/bcm-stepper.js +6 -6
- package/dist/components/bcm-switch.js +1 -1
- package/dist/components/bcm-tab-item-header.js +6 -6
- package/dist/components/bcm-toast.js +16 -16
- package/dist/components/button.js +47 -48
- package/dist/components/caption-template.js +9 -9
- package/dist/components/checkbox-lite.js +1 -1
- package/dist/components/checkbox.js +9 -10
- package/dist/components/chip.js +11 -12
- package/dist/components/colorful.js +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/empty.js +1 -1
- package/dist/components/index4.js +2549 -171
- package/dist/components/index5.js +171 -2549
- package/dist/components/input-template.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/input.style.js +2 -2
- package/dist/components/label.js +4 -4
- package/dist/components/link.js +1 -1
- package/dist/components/list.js +2 -2
- package/dist/components/menu.js +1 -1
- package/dist/components/radio.js +10 -10
- package/dist/components/rc-picker.js +2651 -2404
- package/dist/components/search.js +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/step.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/tooltip-helper.js +6 -6
- package/dist/esm/{_commonjsHelpers-82aa9212.js → _commonjsHelpers-7002e5de.js} +1 -1
- package/dist/esm/bcm-accordion_68.entry.js +47111 -0
- package/dist/esm/bcm-attendance-actions-comment.entry.js +10 -10
- package/dist/esm/bcm-attendance-actions-dropdown.entry.js +11 -11
- package/dist/esm/bcm-autocomplete.entry.js +3 -3
- package/dist/esm/bcm-box.entry.js +1 -1
- package/dist/esm/bcm-breadcrumb.entry.js +5 -5
- package/dist/esm/bcm-caption.entry.js +12 -12
- package/dist/esm/bcm-card.entry.js +9 -9
- package/dist/esm/bcm-colorpicker.entry.js +5 -5
- package/dist/esm/bcm-content.entry.js +1 -1
- package/dist/esm/bcm-date-picker.entry.js +7 -7
- package/dist/esm/bcm-datetime-picker.entry.js +11 -11
- package/dist/esm/bcm-default.entry.js +4 -4
- package/dist/esm/bcm-form-2.entry.js +6 -6
- package/dist/esm/bcm-form-group.entry.js +1 -1
- package/dist/esm/bcm-input-2.entry.js +9 -9
- package/dist/esm/bcm-input-custom.entry.js +5 -5
- package/dist/esm/bcm-input-dropdown.entry.js +12 -12
- package/dist/esm/bcm-message.entry.js +3 -3
- package/dist/esm/bcm-modal-2-footer.entry.js +11 -11
- package/dist/esm/bcm-modal-2-header.entry.js +10 -10
- package/dist/esm/bcm-modal-2.entry.js +11 -11
- package/dist/esm/bcm-notification.entry.js +3 -3
- package/dist/esm/bcm-number-input.entry.js +13 -13
- package/dist/esm/bcm-overlay_2.entry.js +4 -4
- package/dist/esm/bcm-react-number.entry.js +3 -3
- package/dist/esm/bcm-result.entry.js +3 -3
- package/dist/esm/bcm-select-group.entry.js +3 -3
- package/dist/esm/bcm-select-option.entry.js +3 -3
- package/dist/esm/bcm-skeleton.entry.js +10 -10
- package/dist/esm/bcm-tab-pane.entry.js +3 -3
- package/dist/esm/bcm-table.entry.js +11 -11
- package/dist/esm/bcm-tabs-content.entry.js +4 -4
- package/dist/esm/bcm-tag.entry.js +7 -7
- package/dist/esm/bcm-time-picker.entry.js +7 -7
- package/dist/esm/bcm-timeline-item.entry.js +3 -3
- package/dist/esm/bcm-timeline.entry.js +3 -3
- package/dist/esm/bcm-toast.entry.js +23 -23
- package/dist/esm/bcm-treeview-group.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +4 -4
- package/dist/esm/{caption-template-d7953d13.js → caption-template-16dd9444.js} +11 -11
- package/dist/esm/{color-helper-74614f24.js → color-helper-ba15b0d8.js} +2 -2
- package/dist/esm/{colors-dd598eea.js → colors-ed4e7579.js} +1 -1
- package/dist/esm/{element-dragger-89bb52fd.js → element-dragger-b75266e6.js} +1 -1
- package/dist/esm/{generate-d009624a.js → generate-d2495751.js} +14 -14
- package/dist/esm/{global-f1d14ca8.js → global-88abdcdc.js} +1 -1
- package/dist/esm/{index-f549811f.js → index-00c8a8f7.js} +1 -1
- package/dist/esm/{index-036974d7.js → index-0d3a56ec.js} +1 -1
- package/dist/esm/{index-0615c2b8.js → index-4614b7f0.js} +1 -1
- package/dist/esm/{input.style-e855c0f3.js → input.style-0ddc0073.js} +1 -1
- package/dist/esm/{is-load-decorator-8277e3b8.js → is-load-decorator-b8ca22f2.js} +1 -1
- package/dist/esm/{label-template-a26f76c0.js → label-template-4c3797f4.js} +6 -6
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{number-helper-b7a7a318.js → number-helper-a1e5c9e5.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +10 -10
- package/dist/esm/old-bcm-popover.entry.js +5 -5
- package/dist/esm/{popover-placement-d12fec40.js → popover-placement-2bf3a181.js} +1 -1
- package/dist/esm/{slot-template-2a19b2db.js → slot-template-e0202c5a.js} +2 -2
- package/dist/esm/{string-helper-3592bdc2.js → string-helper-69203215.js} +1 -1
- package/dist/esm/{utils-57652744.js → utils-7727d09e.js} +1 -1
- package/dist/esm/{validators-5519219e.js → validators-57df25a7.js} +1 -1
- package/dist/types/components/atoms/avatar/avatar.style.d.ts +21 -21
- package/dist/types/components/molecules/alert/alert.d.ts +1 -3
- package/dist/types/components.d.ts +0 -2
- package/package.json +1 -1
- package/dist/bromcom-ui/p-01dde034.entry.js +0 -5
- package/dist/bromcom-ui/p-01ffa0a9.entry.js +0 -5
- package/dist/bromcom-ui/p-096837b5.entry.js +0 -5
- package/dist/bromcom-ui/p-09cb8ce4.entry.js +0 -5
- package/dist/bromcom-ui/p-0a3ce86e.entry.js +0 -5
- package/dist/bromcom-ui/p-1345d51b.entry.js +0 -5
- package/dist/bromcom-ui/p-177e1e89.entry.js +0 -5
- package/dist/bromcom-ui/p-228c74e9.entry.js +0 -5
- package/dist/bromcom-ui/p-270e1b24.entry.js +0 -5
- package/dist/bromcom-ui/p-29bc95a1.entry.js +0 -5
- package/dist/bromcom-ui/p-2b02c9d5.entry.js +0 -5
- package/dist/bromcom-ui/p-2b0c3160.entry.js +0 -5
- package/dist/bromcom-ui/p-2cd6cdee.js +0 -5
- package/dist/bromcom-ui/p-2e96086c.entry.js +0 -5
- package/dist/bromcom-ui/p-349400c6.entry.js +0 -5
- package/dist/bromcom-ui/p-376a20ed.js +0 -5
- package/dist/bromcom-ui/p-41276d76.entry.js +0 -5
- package/dist/bromcom-ui/p-4393b33e.entry.js +0 -5
- package/dist/bromcom-ui/p-45a24494.entry.js +0 -5
- package/dist/bromcom-ui/p-4874c7d0.entry.js +0 -5
- package/dist/bromcom-ui/p-49bc13a0.entry.js +0 -5
- package/dist/bromcom-ui/p-4bd65d2f.entry.js +0 -5
- package/dist/bromcom-ui/p-4e03575c.entry.js +0 -7
- package/dist/bromcom-ui/p-4f0bf943.entry.js +0 -5
- package/dist/bromcom-ui/p-6404c57b.entry.js +0 -5
- package/dist/bromcom-ui/p-68b95b96.entry.js +0 -5
- package/dist/bromcom-ui/p-74e6d2b6.js +0 -5
- package/dist/bromcom-ui/p-790ff40a.entry.js +0 -5
- package/dist/bromcom-ui/p-7c3dcd4e.entry.js +0 -5
- package/dist/bromcom-ui/p-7dbfff1b.entry.js +0 -5
- package/dist/bromcom-ui/p-7fa0942c.js +0 -5
- package/dist/bromcom-ui/p-8256af97.entry.js +0 -5
- package/dist/bromcom-ui/p-85936d14.entry.js +0 -5
- package/dist/bromcom-ui/p-8b6d3a37.js +0 -5
- package/dist/bromcom-ui/p-8bc7d1dc.entry.js +0 -5
- package/dist/bromcom-ui/p-8d17c696.entry.js +0 -5
- package/dist/bromcom-ui/p-8f32198d.js +0 -14
- package/dist/bromcom-ui/p-8f519009.entry.js +0 -5
- package/dist/bromcom-ui/p-904b0c28.entry.js +0 -5
- package/dist/bromcom-ui/p-915fd3f1.entry.js +0 -5
- package/dist/bromcom-ui/p-93c2058f.entry.js +0 -5
- package/dist/bromcom-ui/p-96d7ab4a.entry.js +0 -5
- package/dist/bromcom-ui/p-9c0bc44a.js +0 -5
- package/dist/bromcom-ui/p-a0f44b56.entry.js +0 -5
- package/dist/bromcom-ui/p-a23e04ba.entry.js +0 -5
- package/dist/bromcom-ui/p-a6b1a008.entry.js +0 -5
- package/dist/bromcom-ui/p-ab0ad97f.js +0 -5
- package/dist/bromcom-ui/p-ae57f046.entry.js +0 -5
- package/dist/bromcom-ui/p-c1a992e7.entry.js +0 -5
- package/dist/bromcom-ui/p-c1c51cf2.entry.js +0 -5
- package/dist/bromcom-ui/p-cbb99519.entry.js +0 -5
- package/dist/bromcom-ui/p-cedb9ca3.js +0 -5
- package/dist/bromcom-ui/p-d0cd1d32.entry.js +0 -5
- package/dist/bromcom-ui/p-d231f047.entry.js +0 -5
- package/dist/bromcom-ui/p-d44ec0ea.entry.js +0 -5
- package/dist/bromcom-ui/p-d5f03511.entry.js +0 -5
- package/dist/bromcom-ui/p-e0ab7b38.js +0 -11
- package/dist/bromcom-ui/p-e1b6f98e.entry.js +0 -5
- package/dist/bromcom-ui/p-e25c4375.entry.js +0 -5
- package/dist/bromcom-ui/p-e29aebf7.entry.js +0 -5
- package/dist/bromcom-ui/p-eaa94da0.entry.js +0 -5
- package/dist/bromcom-ui/p-ec957130.entry.js +0 -5
- package/dist/bromcom-ui/p-eca0acda.js +0 -5
- package/dist/bromcom-ui/p-f5074bd8.js +0 -5
- package/dist/bromcom-ui/p-fb081ff7.entry.js +0 -5
- package/dist/bromcom-ui/p-fc787048.entry.js +0 -5
- package/dist/bromcom-ui/p-fdf2e30b.entry.js +0 -5
- package/dist/bromcom-ui/p-feed1c5a.entry.js +0 -5
- package/dist/cjs/Overflow-5a73947b.js +0 -2233
- package/dist/cjs/bcm-accordion.cjs.entry.js +0 -74
- package/dist/cjs/bcm-alert.cjs.entry.js +0 -99
- package/dist/cjs/bcm-attendance-actions.cjs.entry.js +0 -330
- package/dist/cjs/bcm-attendance.cjs.entry.js +0 -35
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +0 -210
- package/dist/cjs/bcm-button-group.cjs.entry.js +0 -92
- package/dist/cjs/bcm-button.cjs.entry.js +0 -372
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +0 -415
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +0 -2529
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +0 -194
- package/dist/cjs/bcm-chip-group.cjs.entry.js +0 -128
- package/dist/cjs/bcm-chip.cjs.entry.js +0 -91
- package/dist/cjs/bcm-collapse-group.cjs.entry.js +0 -43
- package/dist/cjs/bcm-collapse.cjs.entry.js +0 -62
- package/dist/cjs/bcm-color-input.cjs.entry.js +0 -77
- package/dist/cjs/bcm-colorful_2.cjs.entry.js +0 -251
- package/dist/cjs/bcm-date_6.cjs.entry.js +0 -15363
- package/dist/cjs/bcm-drawer.cjs.entry.js +0 -96
- package/dist/cjs/bcm-dropdown.cjs.entry.js +0 -119
- package/dist/cjs/bcm-error-layout.cjs.entry.js +0 -64
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +0 -116
- package/dist/cjs/bcm-input_2.cjs.entry.js +0 -550
- package/dist/cjs/bcm-item.cjs.entry.js +0 -72
- package/dist/cjs/bcm-items.cjs.entry.js +0 -49
- package/dist/cjs/bcm-link.cjs.entry.js +0 -51
- package/dist/cjs/bcm-list_3.cjs.entry.js +0 -1977
- package/dist/cjs/bcm-menu.cjs.entry.js +0 -151
- package/dist/cjs/bcm-modal.cjs.entry.js +0 -157
- package/dist/cjs/bcm-old-input.cjs.entry.js +0 -397
- package/dist/cjs/bcm-old-tag_2.cjs.entry.js +0 -145
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +0 -115
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +0 -101
- package/dist/cjs/bcm-popover.cjs.entry.js +0 -230
- package/dist/cjs/bcm-progress.cjs.entry.js +0 -162
- package/dist/cjs/bcm-radio-group.cjs.entry.js +0 -161
- package/dist/cjs/bcm-radio.cjs.entry.js +0 -65
- package/dist/cjs/bcm-range.cjs.entry.js +0 -183
- package/dist/cjs/bcm-select.cjs.entry.js +0 -1195
- package/dist/cjs/bcm-shortcut.cjs.entry.js +0 -65
- package/dist/cjs/bcm-step.cjs.entry.js +0 -89
- package/dist/cjs/bcm-stepper.cjs.entry.js +0 -240
- package/dist/cjs/bcm-switch.cjs.entry.js +0 -151
- package/dist/cjs/bcm-tab-group.cjs.entry.js +0 -210
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +0 -60
- package/dist/cjs/bcm-tab-item.cjs.entry.js +0 -91
- package/dist/cjs/bcm-tab.cjs.entry.js +0 -72
- package/dist/cjs/bcm-tabs.cjs.entry.js +0 -370
- package/dist/cjs/bcm-text.cjs.entry.js +0 -49
- package/dist/cjs/index-d321de96.js +0 -193
- package/dist/cjs/input-template-ccfbe214.js +0 -92
- package/dist/cjs/json-parse-decarator-f1c0961d.js +0 -40
- package/dist/cjs/lodash-917168d7.js +0 -17199
- package/dist/cjs/stepper-states-e293bcd3.js +0 -85
- package/dist/cjs/tooltip-helper-311d3baa.js +0 -158
- package/dist/esm/Overflow-40c63001.js +0 -2217
- package/dist/esm/bcm-accordion.entry.js +0 -70
- package/dist/esm/bcm-alert.entry.js +0 -95
- package/dist/esm/bcm-attendance-actions.entry.js +0 -326
- package/dist/esm/bcm-attendance.entry.js +0 -31
- package/dist/esm/bcm-avatar_2.entry.js +0 -205
- package/dist/esm/bcm-button-group.entry.js +0 -88
- package/dist/esm/bcm-button.entry.js +0 -368
- package/dist/esm/bcm-checkbox-group.entry.js +0 -411
- package/dist/esm/bcm-checkbox-lite_9.entry.js +0 -2517
- package/dist/esm/bcm-checkbox_2.entry.js +0 -189
- package/dist/esm/bcm-chip-group.entry.js +0 -124
- package/dist/esm/bcm-chip.entry.js +0 -87
- package/dist/esm/bcm-collapse-group.entry.js +0 -39
- package/dist/esm/bcm-collapse.entry.js +0 -58
- package/dist/esm/bcm-color-input.entry.js +0 -73
- package/dist/esm/bcm-colorful_2.entry.js +0 -246
- package/dist/esm/bcm-date_6.entry.js +0 -15354
- package/dist/esm/bcm-drawer.entry.js +0 -92
- package/dist/esm/bcm-dropdown.entry.js +0 -115
- package/dist/esm/bcm-error-layout.entry.js +0 -60
- package/dist/esm/bcm-expansion-panel.entry.js +0 -112
- package/dist/esm/bcm-input_2.entry.js +0 -545
- package/dist/esm/bcm-item.entry.js +0 -68
- package/dist/esm/bcm-items.entry.js +0 -45
- package/dist/esm/bcm-link.entry.js +0 -47
- package/dist/esm/bcm-list_3.entry.js +0 -1971
- package/dist/esm/bcm-menu.entry.js +0 -147
- package/dist/esm/bcm-modal.entry.js +0 -153
- package/dist/esm/bcm-old-input.entry.js +0 -393
- package/dist/esm/bcm-old-tag_2.entry.js +0 -140
- package/dist/esm/bcm-popconfirm-box.entry.js +0 -111
- package/dist/esm/bcm-popconfirm.entry.js +0 -97
- package/dist/esm/bcm-popover.entry.js +0 -226
- package/dist/esm/bcm-progress.entry.js +0 -158
- package/dist/esm/bcm-radio-group.entry.js +0 -157
- package/dist/esm/bcm-radio.entry.js +0 -61
- package/dist/esm/bcm-range.entry.js +0 -179
- package/dist/esm/bcm-select.entry.js +0 -1191
- package/dist/esm/bcm-shortcut.entry.js +0 -61
- package/dist/esm/bcm-step.entry.js +0 -85
- package/dist/esm/bcm-stepper.entry.js +0 -236
- package/dist/esm/bcm-switch.entry.js +0 -147
- package/dist/esm/bcm-tab-group.entry.js +0 -206
- package/dist/esm/bcm-tab-item-header.entry.js +0 -56
- package/dist/esm/bcm-tab-item.entry.js +0 -87
- package/dist/esm/bcm-tab.entry.js +0 -68
- package/dist/esm/bcm-tabs.entry.js +0 -366
- package/dist/esm/bcm-text.entry.js +0 -45
- package/dist/esm/index-7e71bbc8.js +0 -191
- package/dist/esm/input-template-f22c62aa.js +0 -90
- package/dist/esm/json-parse-decarator-56846a0c.js +0 -38
- package/dist/esm/lodash-4197be99.js +0 -17197
- package/dist/esm/stepper-states-ec0b9c40.js +0 -83
- package/dist/esm/tooltip-helper-ddb8b9e3.js +0 -156
|
@@ -1,2529 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Built with Stencil
|
|
3
|
-
* Copyright (c) Bromcom.
|
|
4
|
-
*/
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
-
|
|
9
|
-
const index = require('./index-c591ecec.js');
|
|
10
|
-
const index$1 = require('./index-95ae50d0.js');
|
|
11
|
-
const generate = require('./generate-b43c3d3b.js');
|
|
12
|
-
const bcm = require('./bcm-1d1fcf21.js');
|
|
13
|
-
const utils = require('./utils-fc077139.js');
|
|
14
|
-
require('./_commonjsHelpers-ed84c3ca.js');
|
|
15
|
-
require('./package-033055fc.js');
|
|
16
|
-
require('./colors-250d0982.js');
|
|
17
|
-
|
|
18
|
-
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}*{box-sizing:border-box}.bcm-checkbox{outline:none;border:none;--bcm-checkbox-primary-color-default:var(--bcm-new-ds-color-blue-500);--bcm-checkbox-secondary-color-default:var(--bcm-new-ds-color-white);--bcm-checkbox-primary-color-hover:var(--bcm-new-ds-color-blue-600);--bcm-checkbox-secondary-color-hover:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-focus-visible:var(--bcm-new-ds-color-blue-800);--bcm-checkbox-secondary-color-focus-visible:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-active:var(--bcm-new-ds-color-blue-700);--bcm-checkbox-secondary-color-active:var(--bcm-new-ds-color-slate-50);--bcm-checkbox-primary-color-disabled:var(--bcm-new-ds-color-slate-300);--bcm-checkbox-secondary-color-disabled:var(--bcm-new-ds-color-slate-200);display:inline-flex;width:fit-content;flex-direction:column;margin-bottom:8px}.bcm-checkbox:focus,.bcm-checkbox:hover,.bcm-checkbox:active{outline:none;border:none}.bcm-checkbox *{box-sizing:border-box}.bcm-checkbox input[type=radio],.bcm-checkbox input[type=checkbox]{-webkit-appearance:none;appearance:none;background-color:#fff;margin:0;display:none}.bcm-checkbox__input{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap;padding-top:4px}.bcm-checkbox.hidden{display:none}.bcm-checkbox :hover{cursor:pointer}.bcm-checkbox[disabled] :hover,.bcm-checkbox.disabled :hover{cursor:not-allowed}.bcm-checkbox .slot{font-family:\"Inter\", sans-serif;font-size:14px;line-height:calc(14px + 8px);font-weight:400;font-weight:500;color:var(--bcm-new-ds-color-slate-600)}.bcm-checkbox .slot:not(:empty){margin-left:8px;margin-right:8px}.bcm-checkbox-size-small .slot{font-size:12px;line-height:calc(12px + 8px);margin-top:-2.5px}.bcm-checkbox-size-small .bcm-checkbox__input{min-height:calc(24px - 4px)}.bcm-checkbox-size-small .bcm-checkbox__label-icon{width:14px;height:14px;min-width:14px;font-size:calc(10px - 2px)}.bcm-checkbox-size-medium .slot{font-size:calc(12px + 1px);line-height:calc(12px + 8px);margin-top:-1.5px}.bcm-checkbox-size-medium .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-medium .bcm-checkbox__label-icon{width:16px;height:16px;min-width:16px;font-size:10px}.bcm-checkbox-size-large .slot{font-size:16px;line-height:calc(16px + 8px);margin-top:-1.5px}.bcm-checkbox-size-large .bcm-checkbox__input{min-height:calc(32px - 4px)}.bcm-checkbox-size-large .bcm-checkbox__label-icon{width:18px;height:18px;min-width:18px;font-size:12px}.bcm-checkbox__label{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-start;flex-wrap:nowrap}.bcm-checkbox__label-icon{display:flex;flex-direction:column;align-items:center;justify-content:center;flex-wrap:nowrap;border-width:1px;border-style:solid;border-radius:2px}.bcm-checkbox__label-icon-indeterminate{position:relative}.bcm-checkbox__label-icon-indeterminate:after{content:\"\";display:block;position:absolute;width:70%;height:1.5px;background:var(--bcm-new-ds-color-white)}.bcm-checkbox__label-icon.bcm-radio__icon{width:16px;height:16px;box-sizing:border-box;border-radius:100px}.bcm-checkbox__label-icon.bcm-radio__icon .bcm-radio__icon-inner{width:10px;height:10px;border-radius:100px;background-color:var(--bcm-new-ds-color-white)}.bcm-checkbox .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-default);color:var(--bcm-checkbox-secondary-color-default);border-color:var(--bcm-new-ds-color-slate-300)}.bcm-checkbox .bcm-checkbox__label-icon-checked,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-default);border-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-default);background-color:var(--bcm-checkbox-secondary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-default)}.bcm-checkbox:hover .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-hover);color:var(--bcm-checkbox-secondary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-hover);border-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-hover);background-color:var(--bcm-checkbox-secondary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:hover .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-hover)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-focus-visible);color:var(--bcm-checkbox-secondary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-focus-visible);border-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-focus-visible);background-color:var(--bcm-checkbox-secondary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:focus-visible .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-focus-visible)}.bcm-checkbox:active .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-active);color:var(--bcm-checkbox-secondary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-active);border-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-active);background-color:var(--bcm-checkbox-secondary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox:active .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-active)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon{background:var(--bcm-checkbox-secondary-color-disabled);color:var(--bcm-checkbox-secondary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-new-ds-color-white);background-color:var(--bcm-checkbox-primary-color-disabled);border-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon{border-color:var(--bcm-checkbox-primary-color-disabled);background-color:var(--bcm-checkbox-secondary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-checked.bcm-radio__icon .bcm-radio__icon-inner,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate.bcm-radio__icon .bcm-radio__icon-inner{background-color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[disabled] .bcm-checkbox__label-icon-indeterminate,.bcm-checkbox.disabled .bcm-checkbox__label-icon-indeterminate{color:var(--bcm-checkbox-primary-color-disabled)}.bcm-checkbox[no-margin] .bcm-checkbox__input{margin:0;min-height:0;padding:0}";
|
|
19
|
-
|
|
20
|
-
const BcmCheckboxLite = class {
|
|
21
|
-
constructor(hostRef) {
|
|
22
|
-
index.registerInstance(this, hostRef);
|
|
23
|
-
this._id = generate.Generate.UID();
|
|
24
|
-
this.checked = true;
|
|
25
|
-
this.indeterminate = null;
|
|
26
|
-
this.disabled = false;
|
|
27
|
-
this.hidden = false;
|
|
28
|
-
this.required = false;
|
|
29
|
-
this.readOnly = false;
|
|
30
|
-
this.captionType = bcm.Bcm$1.Status.default;
|
|
31
|
-
}
|
|
32
|
-
render() {
|
|
33
|
-
const { disabled, checked, readOnly, required, indeterminate, hidden, captionType, _id } = this;
|
|
34
|
-
// const hostClasses = cs(
|
|
35
|
-
// 'bcm-checkbox',
|
|
36
|
-
// 'bcm-checkbox__type-default',
|
|
37
|
-
// {
|
|
38
|
-
// 'error': captionType == Bcm.Status.error,
|
|
39
|
-
// hidden,
|
|
40
|
-
// checked,
|
|
41
|
-
// disabled,
|
|
42
|
-
// required,
|
|
43
|
-
// readOnly,
|
|
44
|
-
// }
|
|
45
|
-
// )
|
|
46
|
-
// const bcmCheckboxIconClass = cs(
|
|
47
|
-
// 'bcm-checkbox__icon',
|
|
48
|
-
// 'bcm-checkbox__icon-lite',
|
|
49
|
-
// 'bcm-checkbox__icon-' + indeterminate,
|
|
50
|
-
// {
|
|
51
|
-
// checked
|
|
52
|
-
// }
|
|
53
|
-
// )
|
|
54
|
-
// const bcmCheckboxLabelClass = cs(
|
|
55
|
-
// 'bcm-checkbox__label'
|
|
56
|
-
// )
|
|
57
|
-
const bcmCheckboxClass = index$1.classnames('bcm-checkbox', `bcm-checkbox-size-medium`, {
|
|
58
|
-
'error': captionType == bcm.Bcm$1.Status.error,
|
|
59
|
-
hidden,
|
|
60
|
-
checked,
|
|
61
|
-
disabled,
|
|
62
|
-
required
|
|
63
|
-
});
|
|
64
|
-
const bcmCheckboxIconClass = index$1.classnames('bcm-checkbox__label-icon', 'bcm-checkbox__label-icon-lite', 'bcm-checkbox__label-icon-' + indeterminate, {
|
|
65
|
-
'bcm-checkbox__label-icon-checked': checked,
|
|
66
|
-
});
|
|
67
|
-
const bcmCheckboxLabelClass = index$1.classnames('bcm-checkbox__label');
|
|
68
|
-
const bcmCheckboxInputClass = index$1.classnames('bcm-checkbox__input');
|
|
69
|
-
return (index.h(index.Host, { class: bcmCheckboxClass, style: { 'margin': '0' } }, index.h("div", { class: bcmCheckboxInputClass, style: {
|
|
70
|
-
'padding-top': '5px'
|
|
71
|
-
} }, index.h("input", { id: _id, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly }), index.h("label", { class: bcmCheckboxLabelClass, htmlFor: _id }, index.h("span", { class: bcmCheckboxIconClass }, index.h("div", { style: {
|
|
72
|
-
'height': '12px',
|
|
73
|
-
'min-height': '12px',
|
|
74
|
-
'width': '12px',
|
|
75
|
-
'min-width': '12px'
|
|
76
|
-
} }, index.h("svg", { class: "bcm-icon-lite", width: "100%", height: "100%", viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M1.91308 4.03516H1.91326C1.99256 4.03525 2.07081 4.05331 2.14213 4.08798C2.21341 4.12262 2.27591 4.17295 2.32497 4.2352L1.91308 4.03516ZM1.91308 4.03516H1.09394C0.890308 4.03516 0.776602 4.26975 0.902321 4.4292L0.902371 4.42927L4.11214 8.49567L4.11218 8.49573C4.32247 8.76188 4.72568 8.76114 4.93667 8.49617L4.93708 8.49566L10.6597 1.24398C10.6598 1.24378 10.66 1.24358 10.6602 1.24338C10.7884 1.08295 10.6699 0.85 10.4689 0.85H9.6498C9.48941 0.85 9.33668 0.9235 9.2376 1.05044C9.23751 1.05055 9.23742 1.05066 9.23734 1.05077L4.52403 7.02157M1.91308 4.03516L4.52403 7.02157M4.52403 7.02157L2.32506 4.23531L4.52403 7.02157Z", fill: "#ffffff" }))))))));
|
|
77
|
-
}
|
|
78
|
-
get el() { return index.getElement(this); }
|
|
79
|
-
};
|
|
80
|
-
BcmCheckboxLite.style = checkboxCss;
|
|
81
|
-
|
|
82
|
-
const dividerCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-divider{display:block}.bcm-divider.hidden{display:none}.bcm-divider__direction-horizontal{width:100%;height:1px;margin:4px auto;border-top:1px solid var(--bcm-color-grey-5)}.bcm-divider__direction-vertical{height:auto;width:1px;margin:0 4px;border-left:1px solid var(--bcm-color-grey-5)}";
|
|
83
|
-
|
|
84
|
-
const BcmDivider = class {
|
|
85
|
-
constructor(hostRef) {
|
|
86
|
-
index.registerInstance(this, hostRef);
|
|
87
|
-
this.hidden = false;
|
|
88
|
-
this.direction = bcm.Bcm$1.Direction.horizontal;
|
|
89
|
-
}
|
|
90
|
-
render() {
|
|
91
|
-
const { hidden, direction } = this;
|
|
92
|
-
const hostClasses = index$1.classnames('bcm-divider', 'bcm-divider__direction-' + direction, {
|
|
93
|
-
'hidden': hidden
|
|
94
|
-
});
|
|
95
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("span", { hidden: true }, index.h("slot", null))));
|
|
96
|
-
}
|
|
97
|
-
get el() { return index.getElement(this); }
|
|
98
|
-
};
|
|
99
|
-
BcmDivider.style = dividerCss;
|
|
100
|
-
|
|
101
|
-
const BcmEmpty = class {
|
|
102
|
-
constructor(hostRef) {
|
|
103
|
-
index.registerInstance(this, hostRef);
|
|
104
|
-
this.icon = undefined;
|
|
105
|
-
}
|
|
106
|
-
render() {
|
|
107
|
-
return (index.h(index.Host, { class: "tw-h-full tw-flex tw-flex-col tw-items-center tw-justify-center tw-w-full tw-flex-1 tw-bg-slate-50 tw-text-center tw-rounded tw-gap-3" }, this.icon && index.h("i", { class: `tw-text-8 tw-text-amber-500 ${this.icon}` }), index.h("bcm-typography", { class: "tw-text-slate-700 tw-text-2" }, index.h("slot", null))));
|
|
108
|
-
}
|
|
109
|
-
get el() { return index.getElement(this); }
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const listboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block;width:fit-content;height:fit-content;background-color:#ffffff}:host(.hidden){display:none}:host(.flex){width:100%;height:100%}:host(.flex) .bcm-listbox{max-height:100%;max-width:100%;height:100%;min-width:100%}:host(.full-width){width:100%}:host(.full-width) .bcm-listbox{max-width:100%;min-width:100%}.bcm-listbox{flex:1;background-color:var(--bcm-color-grey-1);width:fit-content;display:flex;flex-direction:column;height:100%;width:100%;min-width:256px;max-width:256px;min-height:auto;max-height:300px;box-sizing:border-box;border:1px solid var(--bcm-color-grey-5)}.bcm-listbox-list{flex:1;display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto;border-bottom:none}.bcm-listbox-list.loading{min-height:150px;position:relative;margin:0 8px 8px 8px}.bcm-listbox-list .loading{display:none;align-items:center;justify-content:center;height:100%;width:100%;position:absolute;background-color:rgba(255, 255, 255, 0.03)}.bcm-listbox-list .loading.show{display:flex}.bcm-listbox-list .list-container.hidden{display:none}.bcm-listbox .search{padding:8px;padding-bottom:0}.bcm-listbox .search.hidden{display:none !important}.bcm-listbox .empty{display:none;align-items:center;justify-content:center;flex:1;height:100%}.bcm-listbox .empty.show{display:flex}.bcm-listbox-footer{text-align:right;padding:4px 8px;background-color:var(--bcm-color-grey-3)}.label{display:block;color:var(--bcm-color-grey-9);margin-bottom:4px}.listbox-item{display:flex;align-items:stretch;justify-content:flex-start;flex-direction:column;color:var(--bcm-color-grey-8);user-select:none;background-color:var(--bcm-color-grey-1)}.listbox-item.hidden{display:none}.listbox-item .divider{padding:0 8px}.listbox-item-container{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;padding-left:8px;width:100%}.listbox-item-container .check-content{display:flex;align-items:center;justify-content:flex-start;width:16px;min-width:16px;margin-right:4px}.listbox-item-container .check-content .indeterminate{width:16px;height:16px;position:relative;display:block;padding-right:8px;cursor:pointer}.listbox-item-container .check-content .indeterminate:after{content:\"\";position:absolute;top:50%;left:9px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}.listbox-item-container .check-content .indeterminate:before{content:\"\";position:absolute;top:-1px;left:0px;width:16px;height:100%;border-radius:2px;background-color:transparent;border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:2}.listbox-item-container .check-content .indeterminate:hover:before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.listbox-item-container-text-content{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;cursor:pointer;width:100%;padding:4px 8px 4px 4px}.listbox-item-container.disabled{color:var(--bcm-color-grey-6)}.listbox-item-container.selected{color:var(--bcm-color-prime-blue-6)}.listbox-item-container.selected:hover:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.listbox-item-container:hover:not(.disabled),.listbox-item-container:active:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.caption-area{margin-bottom:8px;min-height:20px}.input-caption{display:block}.error.label{color:var(--bcm-color-red-6) !important}.error.bcm-listbox{border:1px solid var(--bcm-color-red-6) !important}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.input-large{height:38px}.input-medium{height:30px}.input-small{height:20px}";
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @desc
|
|
116
|
-
* @param str
|
|
117
|
-
*/
|
|
118
|
-
const lowercase$2 = (str) => str.toLowerCase();
|
|
119
|
-
const BcmListbox = class {
|
|
120
|
-
constructor(hostRef) {
|
|
121
|
-
index.registerInstance(this, hostRef);
|
|
122
|
-
this.listboxItemSelected = index.createEvent(this, "bcm-listbox-item-selected", 7);
|
|
123
|
-
this.listboxClearSelected = index.createEvent(this, "bcm-listbox-clear-selecteds", 7);
|
|
124
|
-
this.listboxSendCheck = index.createEvent(this, "bcm-listbox-send-check", 7);
|
|
125
|
-
this.listboxSendUncheck = index.createEvent(this, "bcm-listbox-send-uncheck", 7);
|
|
126
|
-
this.listboxChecklist = index.createEvent(this, "bcm-listbox-checklist", 7);
|
|
127
|
-
this.listboxChange = index.createEvent(this, "bcm-listbox-change", 7);
|
|
128
|
-
this.listboxChecked = index.createEvent(this, "bcm-listbox-checked", 7);
|
|
129
|
-
this.change = index.createEvent(this, "bcm-change", 7);
|
|
130
|
-
this.objectMapping = {
|
|
131
|
-
'id': "id",
|
|
132
|
-
'text': "text",
|
|
133
|
-
'icon': "icon",
|
|
134
|
-
'avatar': "avatar",
|
|
135
|
-
'avatarName': "avatarName",
|
|
136
|
-
'avatarImage': "avatarImage",
|
|
137
|
-
'secondaryText': "secondaryText",
|
|
138
|
-
'tooltipText': "tooltipText",
|
|
139
|
-
'selected': "selected",
|
|
140
|
-
'checked': "checked",
|
|
141
|
-
'disabled': "disabled",
|
|
142
|
-
};
|
|
143
|
-
this.checkedObjectList = [];
|
|
144
|
-
this.cacheCheckedObjectList = [];
|
|
145
|
-
this.allChilds = [];
|
|
146
|
-
this.onlyChilds = [];
|
|
147
|
-
this.firstRun = true;
|
|
148
|
-
this.firstCheck = false;
|
|
149
|
-
this.onFocus = false;
|
|
150
|
-
this.isSetData = false;
|
|
151
|
-
this.isGroupArray = [];
|
|
152
|
-
this.intersection = [];
|
|
153
|
-
/**
|
|
154
|
-
* Component States
|
|
155
|
-
*/
|
|
156
|
-
this.searchResults = [];
|
|
157
|
-
this.totalSearch = 0;
|
|
158
|
-
this.showSearch = true;
|
|
159
|
-
this.empty = false;
|
|
160
|
-
this.runClearAndSelect = false;
|
|
161
|
-
this.innerComponent = false;
|
|
162
|
-
this.checkboxes = false;
|
|
163
|
-
this.label = undefined;
|
|
164
|
-
this.required = false;
|
|
165
|
-
this.value = null;
|
|
166
|
-
this.search = false;
|
|
167
|
-
this.infoFooter = false;
|
|
168
|
-
this.showIcon = false;
|
|
169
|
-
this.size = 'medium';
|
|
170
|
-
this.selectedId = undefined;
|
|
171
|
-
this.checkedList = [];
|
|
172
|
-
this.updateCheckedList = [];
|
|
173
|
-
this._items = [];
|
|
174
|
-
this.fullWidth = false;
|
|
175
|
-
this.searchFields = ['text', 'secondaryText', 'tooltipText'];
|
|
176
|
-
this._flex = undefined;
|
|
177
|
-
this.hidden = false;
|
|
178
|
-
this.returnField = "id";
|
|
179
|
-
this.searchSub = "items";
|
|
180
|
-
this.searchText = "";
|
|
181
|
-
this.treeview = false;
|
|
182
|
-
this.searchPlaceholder = "Search";
|
|
183
|
-
this.numberOfColumns = 1;
|
|
184
|
-
this.height = null;
|
|
185
|
-
this.maxHeight = null;
|
|
186
|
-
this.template = null;
|
|
187
|
-
this.highlight = false;
|
|
188
|
-
this.loading = true;
|
|
189
|
-
this.noCaption = false;
|
|
190
|
-
this.caption = undefined;
|
|
191
|
-
this.captionError = undefined;
|
|
192
|
-
this.captionType = 'default';
|
|
193
|
-
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
194
|
-
this.tooltip = undefined;
|
|
195
|
-
this.total = 0;
|
|
196
|
-
this.items = [];
|
|
197
|
-
this.checklist = [];
|
|
198
|
-
this.sortedChecklist = [];
|
|
199
|
-
this.indeterminateState = 'uncheck';
|
|
200
|
-
this.checked = false;
|
|
201
|
-
this.jsonItem = undefined;
|
|
202
|
-
this.searchData = undefined;
|
|
203
|
-
this.captionCache = undefined;
|
|
204
|
-
this.captionTypeCache = undefined;
|
|
205
|
-
this.checklistSorted = [];
|
|
206
|
-
}
|
|
207
|
-
async setClear() {
|
|
208
|
-
this.listboxChecklist.emit([]);
|
|
209
|
-
this.value = null;
|
|
210
|
-
this.selectedId = null;
|
|
211
|
-
this.listboxClearSelected.emit([]);
|
|
212
|
-
// this.checkedObjectList.forEach(item => {
|
|
213
|
-
// this.listboxUncheckedMethod(String(item[this.objectMapping['id']]), this._internal_id)
|
|
214
|
-
// });
|
|
215
|
-
let isItem = utils.getChilds(this.el, 'bcm-listbox-item');
|
|
216
|
-
let elementStatuses = [];
|
|
217
|
-
if (isItem) {
|
|
218
|
-
isItem.map(element => {
|
|
219
|
-
elementStatuses.push(element.checked = false);
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
// console.log("uncheck")
|
|
223
|
-
await Promise.all(elementStatuses);
|
|
224
|
-
// if ( allStatuses ){
|
|
225
|
-
// console.log("bitti")
|
|
226
|
-
// }
|
|
227
|
-
this.checklist = [];
|
|
228
|
-
this.sortedChecklist = [];
|
|
229
|
-
this.checklistSorted = [];
|
|
230
|
-
this.checkedObjectList = [];
|
|
231
|
-
await utils.delay(10);
|
|
232
|
-
return Promise.resolve();
|
|
233
|
-
}
|
|
234
|
-
async resetCaption() {
|
|
235
|
-
await utils.delay(10);
|
|
236
|
-
this.caption = this.captionCache;
|
|
237
|
-
this.captionType = this.captionTypeCache;
|
|
238
|
-
this.captionError = null;
|
|
239
|
-
await utils.delay(10);
|
|
240
|
-
return Promise.resolve();
|
|
241
|
-
}
|
|
242
|
-
connectedCallback() {
|
|
243
|
-
this.captionCache = this.caption;
|
|
244
|
-
this.captionTypeCache = this.captionType;
|
|
245
|
-
}
|
|
246
|
-
async getValue() {
|
|
247
|
-
if (this.checkboxes) {
|
|
248
|
-
return this.checkedObjectList;
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
return this.value;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
async getChecklist() {
|
|
255
|
-
return this.checkedObjectList;
|
|
256
|
-
}
|
|
257
|
-
async showSearchMethod(val = true) {
|
|
258
|
-
if (this.treeview == false && this.search == true) {
|
|
259
|
-
this.showSearch = val;
|
|
260
|
-
var search = null;
|
|
261
|
-
if (search = this.el.shadowRoot.getElementById("search")) {
|
|
262
|
-
if (val) {
|
|
263
|
-
search.classList.remove('hidden');
|
|
264
|
-
}
|
|
265
|
-
else {
|
|
266
|
-
search.classList.add('hidden');
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
async selected(id) {
|
|
272
|
-
this.selectedId = String(id);
|
|
273
|
-
if (this.treeview === true) {
|
|
274
|
-
setTimeout(async () => {
|
|
275
|
-
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
276
|
-
if (bcmTreeview) {
|
|
277
|
-
await bcmTreeview.selected(this.selectedId);
|
|
278
|
-
}
|
|
279
|
-
}, 100);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
async clearAndSelectSearch(select = true) {
|
|
283
|
-
this.runClearAndSelect = true;
|
|
284
|
-
if (this.search == true) {
|
|
285
|
-
setTimeout(() => {
|
|
286
|
-
var searchInput = null;
|
|
287
|
-
searchInput = this.el.shadowRoot.querySelector("bcm-old-search");
|
|
288
|
-
if (searchInput) {
|
|
289
|
-
searchInput.setClear();
|
|
290
|
-
if (select == true) {
|
|
291
|
-
searchInput.select();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}, 100);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
async addChecked(items) {
|
|
298
|
-
await this.setClear();
|
|
299
|
-
if (items) {
|
|
300
|
-
if (typeof items != 'string') {
|
|
301
|
-
await utils.delay(50);
|
|
302
|
-
if (sessionStorage.getItem(this._internal_id + "-config")) {
|
|
303
|
-
this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
|
|
304
|
-
}
|
|
305
|
-
this.checkedList = items;
|
|
306
|
-
this.checkedList.forEach((item) => {
|
|
307
|
-
this.handleListboxChecked({ detail: String(item) }, this._internal_id);
|
|
308
|
-
});
|
|
309
|
-
this.updateCheckedList = [];
|
|
310
|
-
if (this.treeview === true) {
|
|
311
|
-
setTimeout(async () => {
|
|
312
|
-
await customElements.whenDefined("bcm-treeview");
|
|
313
|
-
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
314
|
-
if (bcmTreeview) {
|
|
315
|
-
await bcmTreeview.addChecked(items);
|
|
316
|
-
}
|
|
317
|
-
}, 50);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
async updateChecked(items) {
|
|
323
|
-
this.setClear();
|
|
324
|
-
this.checkedList = [];
|
|
325
|
-
this.updateCheckedList = items;
|
|
326
|
-
this.updateCheckedList.forEach((item) => {
|
|
327
|
-
this.handleListboxChecked({ detail: item });
|
|
328
|
-
});
|
|
329
|
-
setTimeout(async () => {
|
|
330
|
-
if (this.treeview === true) {
|
|
331
|
-
await customElements.whenDefined("bcm-treeview");
|
|
332
|
-
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
333
|
-
if (bcmTreeview) {
|
|
334
|
-
await bcmTreeview.updateChecked(items);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}, 100);
|
|
338
|
-
}
|
|
339
|
-
async config(_config) {
|
|
340
|
-
if (_config['treeview'] && _config['treeview'] === true) {
|
|
341
|
-
typeof _config['treeview'] == 'boolean'
|
|
342
|
-
? this.treeview = _config['treeview']
|
|
343
|
-
: this.treeview = false;
|
|
344
|
-
}
|
|
345
|
-
setTimeout(async () => {
|
|
346
|
-
if (this.treeview === true) {
|
|
347
|
-
await customElements.whenDefined("bcm-treeview");
|
|
348
|
-
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
349
|
-
if (bcmTreeview) {
|
|
350
|
-
await bcmTreeview.config(_config);
|
|
351
|
-
if (this.selectedId) {
|
|
352
|
-
await bcmTreeview.selected(this.selectedId);
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}, 300);
|
|
357
|
-
if (_config['searchFields']) {
|
|
358
|
-
if (Array.isArray(_config['searchFields'])) {
|
|
359
|
-
this.searchFields = _config['searchFields'];
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
if (_config['searchPlaceholder']) {
|
|
363
|
-
typeof _config['searchPlaceholder'] == 'string'
|
|
364
|
-
? this.searchPlaceholder = _config['searchPlaceholder']
|
|
365
|
-
: this.searchPlaceholder = null;
|
|
366
|
-
}
|
|
367
|
-
if (_config['maxHeight']) {
|
|
368
|
-
typeof _config['maxHeight'] == 'string'
|
|
369
|
-
? this.maxHeight = _config['maxHeight']
|
|
370
|
-
: this.maxHeight = "100%";
|
|
371
|
-
}
|
|
372
|
-
if (_config['height']) {
|
|
373
|
-
typeof _config['height'] == 'string'
|
|
374
|
-
? this.height = _config['height']
|
|
375
|
-
: this.height = "100%";
|
|
376
|
-
}
|
|
377
|
-
if (_config['template']) {
|
|
378
|
-
typeof _config['template'] == 'string'
|
|
379
|
-
? this.template = _config['template']
|
|
380
|
-
: this.template = null;
|
|
381
|
-
}
|
|
382
|
-
if (_config['searchable']) {
|
|
383
|
-
typeof _config['searchable'] == 'boolean'
|
|
384
|
-
? this.search = _config['searchable']
|
|
385
|
-
: this.search = false;
|
|
386
|
-
}
|
|
387
|
-
if (_config['highlight']) {
|
|
388
|
-
typeof _config['highlight'] == 'boolean'
|
|
389
|
-
? this.highlight = _config['highlight']
|
|
390
|
-
: this.highlight = false;
|
|
391
|
-
}
|
|
392
|
-
if (_config['fullWidth']) {
|
|
393
|
-
typeof _config['fullWidth'] == 'boolean'
|
|
394
|
-
? this.fullWidth = _config['fullWidth']
|
|
395
|
-
: this.fullWidth = false;
|
|
396
|
-
}
|
|
397
|
-
if (_config['numberOfColumns']) {
|
|
398
|
-
typeof _config['numberOfColumns'] == 'number'
|
|
399
|
-
? this.numberOfColumns = _config['numberOfColumns']
|
|
400
|
-
: this.numberOfColumns = 1;
|
|
401
|
-
}
|
|
402
|
-
if (_config['infoFooter']) {
|
|
403
|
-
typeof _config['infoFooter'] == 'boolean'
|
|
404
|
-
? this.infoFooter = _config['infoFooter']
|
|
405
|
-
: this.infoFooter = false;
|
|
406
|
-
}
|
|
407
|
-
if (_config['checkable']) {
|
|
408
|
-
typeof _config['checkable'] == 'boolean'
|
|
409
|
-
? this.checkboxes = _config['checkable']
|
|
410
|
-
: this.checkboxes = false;
|
|
411
|
-
}
|
|
412
|
-
if (_config['showIcon']) {
|
|
413
|
-
typeof _config['showIcon'] == 'boolean'
|
|
414
|
-
? this.showIcon = _config['showIcon']
|
|
415
|
-
: this.showIcon = false;
|
|
416
|
-
}
|
|
417
|
-
if (_config['size']) {
|
|
418
|
-
(["small", "medium", "large"].indexOf(_config['size']) >= 0)
|
|
419
|
-
? this.size = _config['size']
|
|
420
|
-
: this.size = 'medium';
|
|
421
|
-
}
|
|
422
|
-
this.searchSub = this.objectMapping['items'];
|
|
423
|
-
if (_config['mapping']) {
|
|
424
|
-
if (_config['mapping']['id']) {
|
|
425
|
-
this.objectMapping['id'] = String(_config['mapping']['id']);
|
|
426
|
-
this.returnField = this.objectMapping['id'];
|
|
427
|
-
}
|
|
428
|
-
if (_config['mapping']['text']) {
|
|
429
|
-
this.objectMapping['text'] = _config['mapping']['text'];
|
|
430
|
-
}
|
|
431
|
-
if (_config['mapping']['icon']) {
|
|
432
|
-
this.objectMapping['icon'] = _config['mapping']['icon'];
|
|
433
|
-
}
|
|
434
|
-
if (_config['mapping']['avatar']) {
|
|
435
|
-
this.objectMapping['avatar'] = _config['mapping']['avatar'];
|
|
436
|
-
}
|
|
437
|
-
if (_config['mapping']['avatarName']) {
|
|
438
|
-
this.objectMapping['avatarName'] = _config['mapping']['avatarName'];
|
|
439
|
-
}
|
|
440
|
-
if (_config['mapping']['avatarImage']) {
|
|
441
|
-
this.objectMapping['avatarImage'] = _config['mapping']['avatarImage'];
|
|
442
|
-
}
|
|
443
|
-
if (_config['mapping']['secondaryText']) {
|
|
444
|
-
this.objectMapping['secondaryText'] = _config['mapping']['secondaryText'];
|
|
445
|
-
}
|
|
446
|
-
if (_config['mapping']['tooltipText']) {
|
|
447
|
-
this.objectMapping['tooltipText'] = _config['mapping']['tooltipText'];
|
|
448
|
-
}
|
|
449
|
-
if (_config['mapping']['disabled']) {
|
|
450
|
-
this.objectMapping['disabled'] = _config['mapping']['disabled'];
|
|
451
|
-
}
|
|
452
|
-
if (_config['mapping']['checked']) {
|
|
453
|
-
this.objectMapping['checked'] = _config['mapping']['checked'];
|
|
454
|
-
}
|
|
455
|
-
if (_config['mapping']['selected']) {
|
|
456
|
-
this.objectMapping['selected'] = _config['mapping']['selected'];
|
|
457
|
-
}
|
|
458
|
-
if (_config['mapping']['items']) {
|
|
459
|
-
this.objectMapping['items'] = _config['mapping']['items'];
|
|
460
|
-
this.searchSub = this.objectMapping['items'];
|
|
461
|
-
}
|
|
462
|
-
// if ( this.treeview ) {
|
|
463
|
-
// }else{
|
|
464
|
-
// this.searchSub = this.objectMapping['items']
|
|
465
|
-
// }
|
|
466
|
-
}
|
|
467
|
-
sessionStorage.setItem(this._internal_id + "-config", JSON.stringify(_config));
|
|
468
|
-
// forceUpdate(this.el)
|
|
469
|
-
return Promise.resolve(true);
|
|
470
|
-
}
|
|
471
|
-
async setData(_data = []) {
|
|
472
|
-
this.clearAndSelectSearch(false);
|
|
473
|
-
this.isLoading(true);
|
|
474
|
-
this._items = _data;
|
|
475
|
-
this.searchData = JSON.parse(_data);
|
|
476
|
-
this.isSetData = true;
|
|
477
|
-
// this.isEmpty(false)
|
|
478
|
-
setTimeout(async () => {
|
|
479
|
-
if (this.treeview === true) {
|
|
480
|
-
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
481
|
-
if (bcmTreeview) {
|
|
482
|
-
await bcmTreeview.setData(_data);
|
|
483
|
-
if (this.searchData.length > 0) {
|
|
484
|
-
this.isEmpty(false);
|
|
485
|
-
this.isLoading(false);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}, 100);
|
|
490
|
-
}
|
|
491
|
-
// componentDidLoad(){
|
|
492
|
-
// console.log("kilitle")
|
|
493
|
-
// setTimeout(() => {
|
|
494
|
-
// if(this.isSetData) {
|
|
495
|
-
// this.isLoading(true)
|
|
496
|
-
// this.isEmpty(false)
|
|
497
|
-
// }else{
|
|
498
|
-
// this.isLoading(false)
|
|
499
|
-
// this.isEmpty(true)
|
|
500
|
-
// }
|
|
501
|
-
// }, 100);
|
|
502
|
-
// }
|
|
503
|
-
componentWillRender() {
|
|
504
|
-
if (this.isSetData) {
|
|
505
|
-
this.onlyChilds = this.getAllGroup(this.el, true);
|
|
506
|
-
this.allChilds = this.getAllGroup();
|
|
507
|
-
if (this.onlyChilds.length != this.total) {
|
|
508
|
-
this.total = this.onlyChilds.length;
|
|
509
|
-
}
|
|
510
|
-
if (this.checkboxes === true) {
|
|
511
|
-
this.setIndeterminateState();
|
|
512
|
-
if (this.checklistSorted.length > 0) {
|
|
513
|
-
this.checkedObjectList = [];
|
|
514
|
-
this.getAllGroup(this.el).forEach(element => {
|
|
515
|
-
element.checked == true && (this.firstCheck = true,
|
|
516
|
-
this.checkedObjectList.indexOf(element.itemObject) == -1 && (this.checkedObjectList.push(element.itemObject)));
|
|
517
|
-
});
|
|
518
|
-
if (JSON.stringify(this.cacheCheckedObjectList) !== JSON.stringify(this.checkedObjectList)) {
|
|
519
|
-
this.listboxChecklist.emit(this.checkedObjectList);
|
|
520
|
-
this.cacheCheckedObjectList = this.checkedObjectList;
|
|
521
|
-
this.value = this.checkedObjectList;
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
else {
|
|
525
|
-
if (this.firstCheck) {
|
|
526
|
-
this.listboxChecklist.emit([]);
|
|
527
|
-
this.cacheCheckedObjectList = [];
|
|
528
|
-
if (this.value != null) {
|
|
529
|
-
this.value = null;
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
componentDidRender() {
|
|
537
|
-
// this.isEmpty(true)
|
|
538
|
-
// this.isLoading(true)
|
|
539
|
-
// if(this.total > 0) {
|
|
540
|
-
// this.isLoading(false)
|
|
541
|
-
// this.isEmpty(false)
|
|
542
|
-
// }
|
|
543
|
-
// this.isEmpty(true)
|
|
544
|
-
if (this.isSetData) {
|
|
545
|
-
if (this.total > 0) {
|
|
546
|
-
this.isEmpty(false);
|
|
547
|
-
this.isLoading(false);
|
|
548
|
-
}
|
|
549
|
-
else {
|
|
550
|
-
this.isEmpty(true);
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* @desc
|
|
556
|
-
* @returns {void}
|
|
557
|
-
*/
|
|
558
|
-
setIndeterminateState() {
|
|
559
|
-
let state = 'uncheck';
|
|
560
|
-
let allChecked = true;
|
|
561
|
-
let allUnchecked = true;
|
|
562
|
-
this.getAllGroup(this.el, true).map((item) => {
|
|
563
|
-
item.checked && (allUnchecked = false);
|
|
564
|
-
!item.checked && (allChecked = false);
|
|
565
|
-
});
|
|
566
|
-
!allChecked && !allUnchecked
|
|
567
|
-
? state = 'indeterminate'
|
|
568
|
-
: allChecked
|
|
569
|
-
? state = 'determinate'
|
|
570
|
-
: state = 'uncheck';
|
|
571
|
-
this.indeterminateState = state;
|
|
572
|
-
this.checked = state == 'determinate' ? true : false;
|
|
573
|
-
// this.listboxChecklist.emit(this.sortedChecklist)
|
|
574
|
-
}
|
|
575
|
-
getAllGroup(element = this.el, onlyItem = false) {
|
|
576
|
-
let returnAllItems = [];
|
|
577
|
-
let isGroup = utils.getChilds(element, 'bcm-listbox-group');
|
|
578
|
-
let isItem = utils.getChilds(element, 'bcm-listbox-item');
|
|
579
|
-
if (isGroup.length > 0) {
|
|
580
|
-
isGroup.forEach(group => {
|
|
581
|
-
if (this.isGroupArray.indexOf(Number(group.id)) === -1) {
|
|
582
|
-
this.isGroupArray.push(Number(group.id));
|
|
583
|
-
}
|
|
584
|
-
if (onlyItem == false) {
|
|
585
|
-
returnAllItems = [...returnAllItems,
|
|
586
|
-
group
|
|
587
|
-
];
|
|
588
|
-
}
|
|
589
|
-
utils.getChilds(group, 'bcm-listbox-item').forEach(items => {
|
|
590
|
-
if (!(returnAllItems.indexOf(items) >= 0)) {
|
|
591
|
-
returnAllItems = [...returnAllItems,
|
|
592
|
-
items
|
|
593
|
-
];
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
if (isItem.length > 0) {
|
|
599
|
-
isItem.forEach(items => {
|
|
600
|
-
if (!(returnAllItems.indexOf(items) >= 0)) {
|
|
601
|
-
returnAllItems = [...returnAllItems,
|
|
602
|
-
items
|
|
603
|
-
];
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
}
|
|
607
|
-
return returnAllItems;
|
|
608
|
-
}
|
|
609
|
-
getAllChilds(element = this.el, type = null) {
|
|
610
|
-
let returnAllItems = [];
|
|
611
|
-
let oldItems = [];
|
|
612
|
-
if (!this._items || type === "slot") {
|
|
613
|
-
utils.getChilds(element, 'bcm-listbox-item').forEach(items => {
|
|
614
|
-
returnAllItems = [...returnAllItems,
|
|
615
|
-
items
|
|
616
|
-
];
|
|
617
|
-
});
|
|
618
|
-
}
|
|
619
|
-
else if (this._items && this._items.length > 0) {
|
|
620
|
-
oldItems = JSON.parse(this._items);
|
|
621
|
-
oldItems.map((item) => (((item.type === 'group') ? (item.items.map((item) => ((returnAllItems = [...returnAllItems, item])))) :
|
|
622
|
-
(returnAllItems = [...returnAllItems, item]))));
|
|
623
|
-
}
|
|
624
|
-
return returnAllItems;
|
|
625
|
-
}
|
|
626
|
-
/**
|
|
627
|
-
* @desc
|
|
628
|
-
*/
|
|
629
|
-
handleCheckList(process = 'add', checkId) {
|
|
630
|
-
checkId = String(checkId);
|
|
631
|
-
if (this.checkboxes) {
|
|
632
|
-
if (this.items && this.items.find(e => e[this.objectMapping['id']] == checkId)) {
|
|
633
|
-
// checkId = Number(checkId)
|
|
634
|
-
switch (process) {
|
|
635
|
-
case 'add':
|
|
636
|
-
if (this.checklist.length > 0) {
|
|
637
|
-
if (!this.checklist.includes(checkId)) {
|
|
638
|
-
this.checklist = [...this.checklist, checkId];
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
this.checklist = [checkId];
|
|
643
|
-
}
|
|
644
|
-
break;
|
|
645
|
-
case 'remove':
|
|
646
|
-
this.checklist = this.checklist.filter(item => item !== checkId);
|
|
647
|
-
break;
|
|
648
|
-
}
|
|
649
|
-
let sorted = this.checklist.sort(function (a, b) { return a - b; });
|
|
650
|
-
this.sortedChecklist = this.checklist;
|
|
651
|
-
this.checklistSorted = sorted;
|
|
652
|
-
// forceUpdate(this.el)
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
handleIndeterminateClick() {
|
|
657
|
-
let state = 'uncheck';
|
|
658
|
-
let allChecked = true;
|
|
659
|
-
let allUnchecked = true;
|
|
660
|
-
let visibleItem = [];
|
|
661
|
-
this.getAllGroup(this.el, true).map((item) => {
|
|
662
|
-
if (item.hidden === false) {
|
|
663
|
-
visibleItem.push(item);
|
|
664
|
-
item.checked && (allUnchecked = false);
|
|
665
|
-
!item.checked && (allChecked = false);
|
|
666
|
-
}
|
|
667
|
-
});
|
|
668
|
-
!allChecked && !allUnchecked
|
|
669
|
-
? state = 'indeterminate'
|
|
670
|
-
: allChecked
|
|
671
|
-
? state = 'determinate'
|
|
672
|
-
: state = 'uncheck';
|
|
673
|
-
visibleItem.map((item) => {
|
|
674
|
-
if (state !== 'uncheck') {
|
|
675
|
-
item.checked = false;
|
|
676
|
-
this.handleCheckList('remove', String(item.id));
|
|
677
|
-
}
|
|
678
|
-
else {
|
|
679
|
-
item.checked = true;
|
|
680
|
-
this.handleCheckList('add', String(item.id));
|
|
681
|
-
}
|
|
682
|
-
});
|
|
683
|
-
this.setIndeterminateState();
|
|
684
|
-
}
|
|
685
|
-
handleCheckboxClick(e) {
|
|
686
|
-
e.preventDefault();
|
|
687
|
-
}
|
|
688
|
-
/**
|
|
689
|
-
* @desc
|
|
690
|
-
* @param item
|
|
691
|
-
*/
|
|
692
|
-
itemRenderer(item) {
|
|
693
|
-
if (item[this.objectMapping['id']] && String(this.selectedId) == String(item[this.objectMapping['id']])) {
|
|
694
|
-
this.listboxItemSelected.emit(item);
|
|
695
|
-
}
|
|
696
|
-
// if(item[this.objectMapping['selected']] && item[this.objectMapping['selected']] === true){
|
|
697
|
-
// this.listboxItemSelected.emit(item)
|
|
698
|
-
// }
|
|
699
|
-
// var checkedListCache = this.checkedList;
|
|
700
|
-
// if(checkedListCache && checkedListCache.find(e => e == item[this.objectMapping['id']])){
|
|
701
|
-
// this.handleListboxChecked({detail: item[this.objectMapping['id']]})
|
|
702
|
-
// }
|
|
703
|
-
// const index = checkedListCache.indexOf(item[this.objectMapping['id']]);
|
|
704
|
-
// if (index > -1) {
|
|
705
|
-
// checkedListCache.splice(index, 1);
|
|
706
|
-
// }
|
|
707
|
-
// if(this.updateCheckedList.length > 0 ){
|
|
708
|
-
// if( this.updateCheckedList.find(e => e == item[this.objectMapping['id']]) ){
|
|
709
|
-
// const index = this.updateCheckedList.indexOf(item[this.objectMapping['id']]);
|
|
710
|
-
// if (index > -1) {
|
|
711
|
-
// this.updateCheckedList.splice(index, 1);
|
|
712
|
-
// }
|
|
713
|
-
// this.listboxChecked.emit(item[this.objectMapping['id']])
|
|
714
|
-
// }
|
|
715
|
-
// }
|
|
716
|
-
return (index.h("bcm-listbox-item", Object.assign({ _internal_id: this._internal_id, id: String(item[this.objectMapping['id']]), text: item[this.objectMapping['text']] }, (item[this.objectMapping['icon']] && { icon: item[this.objectMapping['icon']] }), (item[this.objectMapping['avatar']] && { avatar: item[this.objectMapping['avatar']] }), (item[this.objectMapping['avatarName']] && { avatarName: item[this.objectMapping['avatarName']] }), (item[this.objectMapping['avatarImage']] && { avatarImage: item[this.objectMapping['avatarImage']] }), (item[this.objectMapping['secondaryText']] && { secondaryText: item[this.objectMapping['secondaryText']] }), (item[this.objectMapping['tooltipText']] && { tooltipText: item[this.objectMapping['tooltipText']] }), (Boolean(item[this.objectMapping['checked']]) === Boolean(true) && { checked: Boolean(item[this.objectMapping['checked']]) }), (item[this.objectMapping['disabled']] === true && { disabled: true }), (Boolean(item[this.objectMapping['selected']]) === Boolean(true) && this.checkboxes == false && { selected: Boolean(item[this.objectMapping['selected']]) }), (this.template && { template: this.template }), (this.checkboxes && { checkboxes: true }), (this.size && { size: this.size }), { itemObject: item, objectMapping: this.objectMapping })));
|
|
717
|
-
}
|
|
718
|
-
/**
|
|
719
|
-
* @desc
|
|
720
|
-
* @param group
|
|
721
|
-
*/
|
|
722
|
-
recursiveGroupRenderer(group) {
|
|
723
|
-
return (index.h("bcm-listbox-group", { id: group[this.objectMapping['id']], text: group[this.objectMapping['text']] }, group.items.map((item) => ((item.type === 'group' ? this.recursiveGroupRenderer(item) : this.itemRenderer(item))))));
|
|
724
|
-
}
|
|
725
|
-
async searchResultMethod(items = []) {
|
|
726
|
-
if (this.treeview == true) {
|
|
727
|
-
const bcmtreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
728
|
-
// await bcmListbox.config(this._config)
|
|
729
|
-
if (bcmtreeview) {
|
|
730
|
-
bcmtreeview.searchResultMethod({ detail: (items.length > 0 ? items : true) });
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
else {
|
|
734
|
-
this.listenSearchResult({ detail: (items.length > 0 ? items : true), isEvent: true });
|
|
735
|
-
}
|
|
736
|
-
// return true
|
|
737
|
-
}
|
|
738
|
-
handleListboxSelected(event) {
|
|
739
|
-
this.listboxItemSelected.emit(event.detail);
|
|
740
|
-
}
|
|
741
|
-
/**
|
|
742
|
-
* @desc
|
|
743
|
-
*/
|
|
744
|
-
// @Listen('bcm-treeview-checklist')
|
|
745
|
-
// handleListboxCheckedList(e) {
|
|
746
|
-
// this.listboxChecklist.emit(e.detail)
|
|
747
|
-
// }
|
|
748
|
-
isLoading(val) {
|
|
749
|
-
var listContainer = this.el.shadowRoot.getElementById("bcm-listbox-list");
|
|
750
|
-
var loading = this.el.shadowRoot.getElementById("loading");
|
|
751
|
-
var searchInput = this.el.shadowRoot.querySelector("bcm-old-search");
|
|
752
|
-
// var listcontainer = this.el.shadowRoot.getElementById("list-container")
|
|
753
|
-
if (val) {
|
|
754
|
-
if (searchInput) {
|
|
755
|
-
searchInput.disabled = true;
|
|
756
|
-
}
|
|
757
|
-
listContainer && listContainer.classList.add('loading');
|
|
758
|
-
loading && loading.classList.add('show');
|
|
759
|
-
// listcontainer && listcontainer.classList.add('hidden')
|
|
760
|
-
}
|
|
761
|
-
else {
|
|
762
|
-
if (searchInput) {
|
|
763
|
-
searchInput.disabled = false;
|
|
764
|
-
}
|
|
765
|
-
listContainer && listContainer.classList.remove('loading');
|
|
766
|
-
loading && loading.classList.remove('show');
|
|
767
|
-
// listcontainer && listcontainer.classList.remove('hidden')
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
isEmpty(val) {
|
|
771
|
-
var empty = this.el.shadowRoot.getElementById("empty");
|
|
772
|
-
var listcontainer = this.el.shadowRoot.getElementById("list-container");
|
|
773
|
-
var checkall = this.el.shadowRoot.getElementById("checkall");
|
|
774
|
-
if (val) {
|
|
775
|
-
empty && empty.classList.add('show');
|
|
776
|
-
listcontainer && listcontainer.classList.add('hidden');
|
|
777
|
-
checkall && checkall.classList.add('hidden');
|
|
778
|
-
}
|
|
779
|
-
else {
|
|
780
|
-
empty && empty.classList.remove('show');
|
|
781
|
-
listcontainer && listcontainer.classList.remove('hidden');
|
|
782
|
-
checkall && checkall.classList.remove('hidden');
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
isSearchCount(val = false) {
|
|
786
|
-
if (this.infoFooter) {
|
|
787
|
-
var inSearch = this.el.shadowRoot.getElementById("in-search");
|
|
788
|
-
var inTotal = this.el.shadowRoot.getElementById("in-total");
|
|
789
|
-
if (val !== false && val >= 0 && val != null && inSearch && inTotal) {
|
|
790
|
-
inSearch.innerHTML = val;
|
|
791
|
-
inTotal.style.display = "none";
|
|
792
|
-
}
|
|
793
|
-
else {
|
|
794
|
-
inTotal.style.display = "inline";
|
|
795
|
-
inSearch.innerHTML = "";
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}
|
|
799
|
-
listenSearchResult(event) {
|
|
800
|
-
var path = event.path || (event.composedPath && event.composedPath());
|
|
801
|
-
if (event.isEvent == undefined) {
|
|
802
|
-
if (path && path.filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) {
|
|
803
|
-
var searchValue = '';
|
|
804
|
-
if (this.treeview == false) {
|
|
805
|
-
// var checkall = null
|
|
806
|
-
// this.checkboxes && (checkall = this.el.shadowRoot.getElementById("checkall"))
|
|
807
|
-
var totalSearch = event.detail.length;
|
|
808
|
-
// this.empty = false
|
|
809
|
-
this.isEmpty(false);
|
|
810
|
-
this.intersection = [];
|
|
811
|
-
if (event.detail.length > 0) {
|
|
812
|
-
if (event.detail[0] == -1) {
|
|
813
|
-
totalSearch = 0;
|
|
814
|
-
this.empty = true;
|
|
815
|
-
this.isEmpty(true);
|
|
816
|
-
}
|
|
817
|
-
if (this.allChilds.length > 0) {
|
|
818
|
-
// this.checkboxes && ( checkall && checkall.classList.add('hidden') )
|
|
819
|
-
this.allChilds.map((item) => {
|
|
820
|
-
if (this.highlight) {
|
|
821
|
-
event.target.addEventListener('bcm-on-search-value', async (e) => {
|
|
822
|
-
var inputText = item.shadowRoot.getElementById("text");
|
|
823
|
-
if (inputText) {
|
|
824
|
-
searchValue = await e.detail;
|
|
825
|
-
inputText = (inputText === null || inputText === void 0 ? void 0 : inputText.textContent) || (inputText === null || inputText === void 0 ? void 0 : inputText.innerText) || "";
|
|
826
|
-
if (searchValue) {
|
|
827
|
-
var cacheInputText = lowercase$2(inputText);
|
|
828
|
-
var cacheSearchValue = lowercase$2(searchValue);
|
|
829
|
-
var index = cacheInputText.indexOf(cacheSearchValue);
|
|
830
|
-
if (index >= 0) {
|
|
831
|
-
inputText = inputText.substring(0, index) + "<span class='highlight'>" + inputText.substring(index, index + searchValue.length) + "</span>" + inputText.substring(index + searchValue.length);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
item.shadowRoot.getElementById("text").innerHTML = inputText;
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
item.hidden = true;
|
|
839
|
-
var _ids = String(item.id);
|
|
840
|
-
if (event.detail.indexOf(_ids) >= 0) {
|
|
841
|
-
item.hidden = false;
|
|
842
|
-
}
|
|
843
|
-
else {
|
|
844
|
-
item.hidden = true;
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
this.intersection = event.detail[0] == -1 ? [0] : event.detail.filter(x => this.isGroupArray.includes(x));
|
|
849
|
-
}
|
|
850
|
-
else {
|
|
851
|
-
if (this.allChilds.length > 0) {
|
|
852
|
-
this.allChilds.map((item) => {
|
|
853
|
-
item.hidden = false;
|
|
854
|
-
});
|
|
855
|
-
// this.checkboxes && ( checkall && checkall.classList.remove('hidden') )
|
|
856
|
-
}
|
|
857
|
-
// this.isEmpty(true)
|
|
858
|
-
}
|
|
859
|
-
if (this.search || this.checkboxes) {
|
|
860
|
-
setTimeout(() => {
|
|
861
|
-
if (totalSearch >= 0) {
|
|
862
|
-
var totals = totalSearch;
|
|
863
|
-
this.isSearchCount(totals);
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
this.isSearchCount(0);
|
|
867
|
-
}
|
|
868
|
-
if (event.detail[0] === -1) {
|
|
869
|
-
this.isSearchCount(0);
|
|
870
|
-
}
|
|
871
|
-
if (event.detail === true) {
|
|
872
|
-
this.isSearchCount();
|
|
873
|
-
}
|
|
874
|
-
}, 100);
|
|
875
|
-
}
|
|
876
|
-
if (event.detail === true) {
|
|
877
|
-
this.isEmpty(false);
|
|
878
|
-
}
|
|
879
|
-
if (this.runClearAndSelect) {
|
|
880
|
-
this.runClearAndSelect = false;
|
|
881
|
-
this.isSearchCount(true);
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
/**
|
|
888
|
-
* @desc
|
|
889
|
-
* @param newValue
|
|
890
|
-
* @returns {void}
|
|
891
|
-
*/
|
|
892
|
-
parseItems(newValue) {
|
|
893
|
-
if (newValue) {
|
|
894
|
-
typeof newValue == 'string'
|
|
895
|
-
? this.items = JSON.parse(newValue)
|
|
896
|
-
: this.items = newValue;
|
|
897
|
-
}
|
|
898
|
-
this.handleChildProcess();
|
|
899
|
-
}
|
|
900
|
-
handleChange(newValue) {
|
|
901
|
-
this.change.emit(newValue);
|
|
902
|
-
this.listboxChange.emit(newValue);
|
|
903
|
-
}
|
|
904
|
-
handleChildProcess() {
|
|
905
|
-
setTimeout(() => {
|
|
906
|
-
this.onlyChilds = this.getAllGroup(this.el, true);
|
|
907
|
-
this.total = this.onlyChilds.length;
|
|
908
|
-
// console.log(this.total)
|
|
909
|
-
// this.allChilds = this.getAllChilds()
|
|
910
|
-
// this.total = this.allChilds.filter((v, i, a) => a.indexOf(v) === i).length
|
|
911
|
-
if (this.total > 0) {
|
|
912
|
-
// setTimeout(() => {
|
|
913
|
-
this.isLoading(false);
|
|
914
|
-
// }, 100);
|
|
915
|
-
this.isEmpty(false);
|
|
916
|
-
}
|
|
917
|
-
else {
|
|
918
|
-
// setTimeout(() => {
|
|
919
|
-
this.isLoading(false);
|
|
920
|
-
this.isEmpty(true);
|
|
921
|
-
// }, 100);
|
|
922
|
-
}
|
|
923
|
-
}, 100);
|
|
924
|
-
}
|
|
925
|
-
/**
|
|
926
|
-
* @desc
|
|
927
|
-
*/
|
|
928
|
-
handleListboxClearSelected(event) {
|
|
929
|
-
var path = event.path || (event.composedPath && event.composedPath());
|
|
930
|
-
if (this.checkboxes == false && path && path.filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) {
|
|
931
|
-
this.value = event.detail;
|
|
932
|
-
this.selectedId = String(event.detail[this.objectMapping['id']]);
|
|
933
|
-
this.listboxClearSelected.emit(event.detail);
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
/**
|
|
937
|
-
* @desc
|
|
938
|
-
*/
|
|
939
|
-
handleListboxChecked(event, _internal_id = this._internal_id) {
|
|
940
|
-
var path = event.path || (event.composedPath && event.composedPath());
|
|
941
|
-
if ((path && path.filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) || _internal_id == this._internal_id) {
|
|
942
|
-
this.listboxSendCheck.emit(event.detail);
|
|
943
|
-
this.handleCheckList('add', event.detail);
|
|
944
|
-
this.setIndeterminateState();
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
/**
|
|
948
|
-
* @desc
|
|
949
|
-
*/
|
|
950
|
-
handleListboxUnchecked(event, _internal_id = this._internal_id) {
|
|
951
|
-
var path = event.path || (event.composedPath && event.composedPath());
|
|
952
|
-
if ((path && path.filter((input) => input['_internal_id'] == this._internal_id)[0] != undefined) || _internal_id == this._internal_id) {
|
|
953
|
-
this.listboxSendUncheck.emit(event.detail);
|
|
954
|
-
this.handleCheckList('remove', event.detail);
|
|
955
|
-
this.setIndeterminateState();
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
async listboxUncheckedMethod(item, internal_id = this._internal_id) {
|
|
959
|
-
if (this.treeview) {
|
|
960
|
-
await customElements.whenDefined("bcm-treeview");
|
|
961
|
-
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
962
|
-
if (bcmTreeview) {
|
|
963
|
-
await bcmTreeview.treeviewUncheckedMethod(item);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
else {
|
|
967
|
-
this.handleListboxUnchecked({ "detail": item }, internal_id);
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
handleFocus(focusEvent = false) {
|
|
971
|
-
this.onFocus = focusEvent;
|
|
972
|
-
}
|
|
973
|
-
render() {
|
|
974
|
-
const { innerComponent, label, required, treeview, searchText, checkboxes, search, size, fullWidth, total, indeterminateState, checked, checklist, searchData, searchFields, _flex, returnField, searchSub, infoFooter, showSearch, noCaption, caption, captionError, captionType } = this;
|
|
975
|
-
const bcmListbox = index$1.classnames('bcm-listbox', {
|
|
976
|
-
'error': captionType == 'error' ? true : false,
|
|
977
|
-
'full-width': fullWidth,
|
|
978
|
-
'flex': _flex
|
|
979
|
-
});
|
|
980
|
-
const classes = index$1.classnames('listbox-item', {
|
|
981
|
-
'hidden': this.totalSearch > 0
|
|
982
|
-
});
|
|
983
|
-
const classesContainer = index$1.classnames('listbox-item-container');
|
|
984
|
-
const textContent = index$1.classnames('listbox-item-container-text-content', size, {
|
|
985
|
-
'size-2': size === 'small' || size === 'medium',
|
|
986
|
-
'size-3': size === 'large',
|
|
987
|
-
});
|
|
988
|
-
const listContainer = index$1.classnames('list-container', {
|
|
989
|
-
'column-1': this.numberOfColumns <= 1,
|
|
990
|
-
'column-2': this.numberOfColumns == 2,
|
|
991
|
-
'column-3': this.numberOfColumns >= 3,
|
|
992
|
-
});
|
|
993
|
-
const listContainerStyle = {
|
|
994
|
-
'grid-template-columns': this.numberOfColumns <= 1 ? '1fr' : 'repeat(' + this.numberOfColumns + ', ' + (210 - (this.numberOfColumns * 10)) + 'px)'
|
|
995
|
-
};
|
|
996
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null,
|
|
997
|
-
// this.totalSearch > 0 ? 'hidden' : null,
|
|
998
|
-
{
|
|
999
|
-
'flex': _flex,
|
|
1000
|
-
'full-width': fullWidth
|
|
1001
|
-
});
|
|
1002
|
-
var customStyles = {
|
|
1003
|
-
'max-height': this.maxHeight
|
|
1004
|
-
};
|
|
1005
|
-
const customStylesList = {
|
|
1006
|
-
'min-height': this.height ? "inherit" : this.maxHeight ? "auto" : "200px"
|
|
1007
|
-
};
|
|
1008
|
-
if (this.height) {
|
|
1009
|
-
customStyles = Object.assign(Object.assign({}, customStyles), { 'height': this.height });
|
|
1010
|
-
}
|
|
1011
|
-
const captionClasses = index$1.classnames('size-1', 'input-caption', 'caption-' + captionType);
|
|
1012
|
-
return (index.h(index.Host, { class: hostClasses, style: customStyles, "bcm-internal-id": this._internal_id }, !innerComponent && label && index.h("div", null, index.h("bcm-label", { tooltip: this.tooltip, type: captionType, value: label, required: required })), treeview === true && (index.h("bcm-treeview", { _internal_id: this._internal_id })), treeview == false && (index.h("div", { class: bcmListbox, style: customStyles }, search && (index.h("div", { class: "search", id: "search", style: { 'display': String(showSearch) == 'false' ? 'none' : 'block' } }, index.h("bcm-old-search", { _internal_id: this._internal_id, searchPlaceholder: this.searchPlaceholder, searchValue: searchText, "on-bcm-focus": () => this.handleFocus(true), "on-bcm-blur": () => this.handleFocus(false), data: searchData, returnField: returnField, searchFields: searchFields, searchSub: searchSub, clearable: true }), index.h("bcm-divider", null))), index.h("div", { id: "bcm-listbox-list", class: "bcm-listbox-list loading", style: customStylesList }, checkboxes && (index.h("div", { class: classes, id: "checkall" }, index.h("div", { class: classesContainer, onClick: () => this.handleIndeterminateClick() }, index.h("div", { class: "check-content" }, indeterminateState == 'indeterminate' && (index.h("span", { class: "indeterminate" })) || (index.h("bcm-checkbox-lite", { onClick: (e) => this.handleCheckboxClick(e), checked: checked, "no-caption": true }))), index.h("div", { class: textContent }, "Select All")), index.h("div", { class: "divider" }, index.h("bcm-divider", null)))),
|
|
1013
|
-
// this.empty == false && (
|
|
1014
|
-
index.h("div", { id: "list-container", class: listContainer, style: listContainerStyle }, this.items.length !== 0 && this.items.map((item) => ((item.type === 'group' ? this.recursiveGroupRenderer(item) : this.itemRenderer(item)))))
|
|
1015
|
-
// )
|
|
1016
|
-
,
|
|
1017
|
-
// this.loading && (
|
|
1018
|
-
index.h("div", { id: "loading", class: "loading show" }, index.h("bcm-icon", { class: "prefix", icon: "far fa-spinner-third fa-spin" }))
|
|
1019
|
-
// )
|
|
1020
|
-
,
|
|
1021
|
-
// ( this.empty || total == 0 ) && (
|
|
1022
|
-
index.h("div", { id: "empty", class: "empty" }, index.h("bcm-empty", null, "No Data"))
|
|
1023
|
-
// )
|
|
1024
|
-
), infoFooter == true && (index.h("div", { class: "bcm-listbox-footer" }, index.h("bcm-text", { scale: "size-1", color: "grey-8" }, checklist.length > 0 && (' ( ' + checklist.length + ' selected ) '), "Total ", index.h("span", { id: "in-search" }), " ", index.h("span", { id: "in-total" }, total), " items found."))))), !noCaption && (index.h("div", { class: "caption-area" }, captionType == "error"
|
|
1025
|
-
? index.h("span", { class: captionClasses }, " ", captionError, " ")
|
|
1026
|
-
: caption && index.h("span", { class: captionClasses }, " ", caption, " ")))));
|
|
1027
|
-
}
|
|
1028
|
-
get el() { return index.getElement(this); }
|
|
1029
|
-
static get watchers() { return {
|
|
1030
|
-
"_items": ["parseItems"],
|
|
1031
|
-
"value": ["handleChange"]
|
|
1032
|
-
}; }
|
|
1033
|
-
};
|
|
1034
|
-
BcmListbox.style = listboxCss;
|
|
1035
|
-
|
|
1036
|
-
const listboxGroupCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block}:host(.hidden){display:none}.listbox-group-title{padding:4px 16px;background-color:var(--bcm-color-grey-7);position:sticky;top:0;z-index:1}";
|
|
1037
|
-
|
|
1038
|
-
const uppercase = (str) => str.toUpperCase();
|
|
1039
|
-
const BcmListboxGroup = class {
|
|
1040
|
-
constructor(hostRef) {
|
|
1041
|
-
index.registerInstance(this, hostRef);
|
|
1042
|
-
this.text = undefined;
|
|
1043
|
-
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
1044
|
-
this.hidden = false;
|
|
1045
|
-
}
|
|
1046
|
-
componentWillLoad() {
|
|
1047
|
-
this.text = uppercase(this.text);
|
|
1048
|
-
}
|
|
1049
|
-
render() {
|
|
1050
|
-
const { text } = this;
|
|
1051
|
-
const classes = index$1.classnames('listbox-group');
|
|
1052
|
-
const classesTitle = index$1.classnames('listbox-group-title');
|
|
1053
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
|
|
1054
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("div", { class: classesTitle }, index.h("bcm-text", { "font-size": "3", color: "slate-100" }, " ", text, " ")), index.h("slot", null))));
|
|
1055
|
-
}
|
|
1056
|
-
};
|
|
1057
|
-
BcmListboxGroup.style = listboxGroupCss;
|
|
1058
|
-
|
|
1059
|
-
const listboxItemCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:flex;flex:1}:host(.hidden){display:none}.listbox-item{display:flex;flex:1;align-items:stretch;justify-content:flex-start;color:var(--bcm-color-grey-8);user-select:none;background-color:var(--bcm-color-grey-1);display:none}.listbox-item.display{display:flex}.listbox-item-container{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;padding-left:8px;flex:1}.listbox-item-container .avatar{margin-right:4px}.listbox-item-container .check-content{display:flex;align-items:center;justify-content:flex-start;width:16px;min-width:16px;margin-right:4px}.listbox-item-container .check-content .indeterminate{width:16px;height:16px;position:relative;display:block;padding-right:8px;cursor:pointer}.listbox-item-container .check-content .indeterminate:after{content:\"\";position:absolute;top:50%;left:9px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}.listbox-item-container .check-content .indeterminate:before{content:\"\";position:absolute;top:-1px;left:0px;width:16px;height:100%;border-radius:2px;background-color:transparent;border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:2}.listbox-item-container .check-content .indeterminate:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.listbox-item-container-html-content{display:flex;align-items:center;justify-content:flex-start;flex-direction:row;cursor:pointer;flex:1}.listbox-item-container-html-content #text .highlight{background-color:var(--bcm-color-yellow-5)}.listbox-item-container-html-content.small{padding:0 8px 0 4px;padding:4px 8px 4px 4px}.listbox-item-container-html-content.medium{padding:8px 8px 8px 4px}.listbox-item-container-html-content.large{padding:8px 8px 8px 4px}.listbox-item-container-text-content{display:flex;align-items:center;justify-content:space-between;flex-direction:row;cursor:pointer;width:100%}.listbox-item-container-text-content #text .highlight{background-color:var(--bcm-color-yellow-5)}.listbox-item-container-text-content.small{padding:0 8px 0 4px;padding:4px 8px 4px 4px}.listbox-item-container-text-content.medium{padding:8px 8px 8px 4px}.listbox-item-container-text-content.large{padding:8px 8px 8px 4px}.listbox-item-container-text-content .icon{text-align:center;margin-right:8px}.listbox-item-container-text-content>div{display:flex;align-items:center;flex-direction:row;word-wrap:break-word}.listbox-item-container.disabled{color:var(--bcm-color-grey-6)}.listbox-item-container.selected{color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.listbox-item-container.selected:hover:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.listbox-item-container:hover:not(.disabled),.listbox-item-container:active:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}";
|
|
1060
|
-
|
|
1061
|
-
const BcmListboxItem = class {
|
|
1062
|
-
constructor(hostRef) {
|
|
1063
|
-
index.registerInstance(this, hostRef);
|
|
1064
|
-
this.listboxItemSelected = index.createEvent(this, "bcm-listbox-item-selected", 7);
|
|
1065
|
-
this.listboxUnchecked = index.createEvent(this, "bcm-listbox-unchecked", 7);
|
|
1066
|
-
this.listboxChecked = index.createEvent(this, "bcm-listbox-checked", 7);
|
|
1067
|
-
this.objectMapping = {
|
|
1068
|
-
'id': "id",
|
|
1069
|
-
'text': "text",
|
|
1070
|
-
'icon': "icon",
|
|
1071
|
-
'avatar': "avatar",
|
|
1072
|
-
'avatarName': "avatarName",
|
|
1073
|
-
'avatarImage': "avatarImage",
|
|
1074
|
-
'secondaryText': "secondaryText",
|
|
1075
|
-
'tooltipText': "tooltipText",
|
|
1076
|
-
'selected': "selected",
|
|
1077
|
-
'checked': "checked",
|
|
1078
|
-
'disabled': "disabled",
|
|
1079
|
-
};
|
|
1080
|
-
this.display = true;
|
|
1081
|
-
this.avatar = false;
|
|
1082
|
-
this.avatarImage = undefined;
|
|
1083
|
-
this.avatarName = undefined;
|
|
1084
|
-
this.secondaryText = undefined;
|
|
1085
|
-
this.tooltipText = undefined;
|
|
1086
|
-
this.text = undefined;
|
|
1087
|
-
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
1088
|
-
this.size = 'medium';
|
|
1089
|
-
this.icon = 'bug';
|
|
1090
|
-
this.open = false;
|
|
1091
|
-
this.selected = false;
|
|
1092
|
-
this.checkboxes = false;
|
|
1093
|
-
this.showIcon = false;
|
|
1094
|
-
this.checked = false;
|
|
1095
|
-
this.focused = false;
|
|
1096
|
-
this.hidden = false;
|
|
1097
|
-
this.itemObject = undefined;
|
|
1098
|
-
this.disabled = false;
|
|
1099
|
-
this.highlight = undefined;
|
|
1100
|
-
this._internal_id = "";
|
|
1101
|
-
this.template = null;
|
|
1102
|
-
}
|
|
1103
|
-
componentDidLoad() {
|
|
1104
|
-
if (!this.disabled) {
|
|
1105
|
-
if (this.selected === true) {
|
|
1106
|
-
this.listboxItemSelected.emit(this.itemObject);
|
|
1107
|
-
}
|
|
1108
|
-
this.checkboxes === true && (this.checked === true && (this.listboxChecked.emit(this._id)));
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
* @desc
|
|
1113
|
-
*/
|
|
1114
|
-
handleClick() {
|
|
1115
|
-
if (!this.disabled) {
|
|
1116
|
-
this.checkboxes === true && (this.checked === true && (this.listboxUnchecked.emit(this._id)) || (this.listboxChecked.emit(this._id)));
|
|
1117
|
-
this.checkboxes === false && (this.selected = true,
|
|
1118
|
-
this.listboxItemSelected.emit(this.itemObject));
|
|
1119
|
-
}
|
|
1120
|
-
}
|
|
1121
|
-
handleCheckboxClick(e) {
|
|
1122
|
-
e.preventDefault();
|
|
1123
|
-
}
|
|
1124
|
-
isInternal(event) {
|
|
1125
|
-
var path = event.path || (event.composedPath && event.composedPath());
|
|
1126
|
-
const detect = path
|
|
1127
|
-
&& path[0]
|
|
1128
|
-
&& path[0].attributes
|
|
1129
|
-
&& path[0].attributes['bcm-internal-id']
|
|
1130
|
-
&& path[0].attributes['bcm-internal-id'].value;
|
|
1131
|
-
return detect == this._internal_id;
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* @descc
|
|
1135
|
-
* @param event
|
|
1136
|
-
*/
|
|
1137
|
-
ListenListboxCheck(event) {
|
|
1138
|
-
if (this.isInternal(event)) {
|
|
1139
|
-
if (!this.disabled) {
|
|
1140
|
-
if (event.detail && event.detail === this._id) {
|
|
1141
|
-
this.checked = true;
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
/**
|
|
1147
|
-
* @descc
|
|
1148
|
-
* @param event
|
|
1149
|
-
*/
|
|
1150
|
-
ListenListboxUncheck(event) {
|
|
1151
|
-
if (this.isInternal(event)) {
|
|
1152
|
-
if (!this.disabled) {
|
|
1153
|
-
if (event.detail && event.detail === this._id) {
|
|
1154
|
-
this.checked = false;
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
/**
|
|
1160
|
-
* @descc
|
|
1161
|
-
* @param event
|
|
1162
|
-
*/
|
|
1163
|
-
handleListboxClearSelecteds(event) {
|
|
1164
|
-
if (this.checkboxes == false && this.isInternal(event)) {
|
|
1165
|
-
if (!this.disabled) {
|
|
1166
|
-
if (event.detail) {
|
|
1167
|
-
if (event.detail !== this.itemObject) {
|
|
1168
|
-
this.selected = false;
|
|
1169
|
-
}
|
|
1170
|
-
else {
|
|
1171
|
-
this.selected = true;
|
|
1172
|
-
}
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
templateParser(template) {
|
|
1178
|
-
var rxp = /{{([^}]+)}}/g, str = template, curMatch;
|
|
1179
|
-
while (curMatch = rxp.exec(str)) {
|
|
1180
|
-
template = template.replace("{{" + curMatch[1] + "}}", this.itemObject[curMatch[1]]);
|
|
1181
|
-
}
|
|
1182
|
-
return template;
|
|
1183
|
-
}
|
|
1184
|
-
render() {
|
|
1185
|
-
const { display, focused, selected, size, showIcon, icon, checkboxes, _id, checked, text, avatarName, avatarImage, avatar, secondaryText, tooltipText } = this;
|
|
1186
|
-
const classes = index$1.classnames('listbox-item', {
|
|
1187
|
-
'disabled': this.disabled,
|
|
1188
|
-
'display': display
|
|
1189
|
-
});
|
|
1190
|
-
const classesContainer = index$1.classnames('listbox-item-container', {
|
|
1191
|
-
'disabled': this.disabled,
|
|
1192
|
-
'focus': focused,
|
|
1193
|
-
'selected': selected
|
|
1194
|
-
});
|
|
1195
|
-
const textContent = index$1.classnames('listbox-item-container-text-content', size, {
|
|
1196
|
-
'disabled': this.disabled,
|
|
1197
|
-
'size-2': size === 'small' || size === 'medium',
|
|
1198
|
-
'size-3': size === 'large',
|
|
1199
|
-
});
|
|
1200
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
|
|
1201
|
-
const htmlContent = index$1.classnames('listbox-item-container-html-content', size, {
|
|
1202
|
-
'disabled': this.disabled,
|
|
1203
|
-
'size-2': size === 'small' || size === 'medium',
|
|
1204
|
-
'size-3': size === 'large',
|
|
1205
|
-
});
|
|
1206
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("div", { class: classesContainer, onClick: () => this.handleClick() }, checkboxes && (index.h("div", { class: "check-content" }, index.h("bcm-checkbox-lite", { id: 'check-' + _id, onClick: (e) => this.handleCheckboxClick(e), checked: checked, disabled: this.disabled }))), this.template && (index.h("div", { class: htmlContent, title: tooltipText, innerHTML: this.templateParser(this.template) })), this.template == null && (index.h("div", { class: textContent, title: tooltipText }, index.h("div", null, (avatar || avatarName || avatarImage) && (index.h("div", { class: "avatar" }, index.h("bcm-avatar", Object.assign({ size: "small", name: text }, avatarName && { name: avatarName }, avatarImage && { image: avatarImage })))), showIcon && icon && (index.h("bcm-icon", { class: "icon", icon: icon })), text && (index.h("span", { id: "text" }, text)) || (index.h("slot", null))), index.h("div", null, (secondaryText) && (index.h("div", { class: "secondaryText size-1" }, secondaryText)))))))));
|
|
1207
|
-
}
|
|
1208
|
-
get el() { return index.getElement(this); }
|
|
1209
|
-
};
|
|
1210
|
-
BcmListboxItem.style = listboxItemCss;
|
|
1211
|
-
|
|
1212
|
-
const oldSearchCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:block}:host(.hidden){display:none}";
|
|
1213
|
-
|
|
1214
|
-
const lowercase$1 = (str) => str.toLowerCase();
|
|
1215
|
-
const BcmOldSearch = class {
|
|
1216
|
-
constructor(hostRef) {
|
|
1217
|
-
index.registerInstance(this, hostRef);
|
|
1218
|
-
this.bcmOnSearch = index.createEvent(this, "bcm-on-search", 7);
|
|
1219
|
-
this.bcmOnSearchValue = index.createEvent(this, "bcm-on-search-value", 7);
|
|
1220
|
-
this.data = [];
|
|
1221
|
-
this.searchFields = ['text', 'value' /*, ...*/];
|
|
1222
|
-
this.returnField = 'idx';
|
|
1223
|
-
this.searchSub = null;
|
|
1224
|
-
this.hidden = false;
|
|
1225
|
-
this.onlyChild = false;
|
|
1226
|
-
this.clearable = false;
|
|
1227
|
-
this.searchValue = '';
|
|
1228
|
-
this.searchPlaceholder = 'Search';
|
|
1229
|
-
this.disabled = false;
|
|
1230
|
-
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
1231
|
-
this.results = [];
|
|
1232
|
-
}
|
|
1233
|
-
getInput() {
|
|
1234
|
-
return this.el.shadowRoot.querySelector('bcm-old-input');
|
|
1235
|
-
}
|
|
1236
|
-
componentDidLoad() {
|
|
1237
|
-
this.getInput().clearable = this.clearable;
|
|
1238
|
-
}
|
|
1239
|
-
listenBcmChange(e) {
|
|
1240
|
-
e.stopPropagation();
|
|
1241
|
-
}
|
|
1242
|
-
async setValue(value) {
|
|
1243
|
-
await this.getInput().setValue(value);
|
|
1244
|
-
return value;
|
|
1245
|
-
}
|
|
1246
|
-
async select() {
|
|
1247
|
-
await this.getInput().select();
|
|
1248
|
-
this.bcmOnSearch.emit(true);
|
|
1249
|
-
return true;
|
|
1250
|
-
}
|
|
1251
|
-
async setClear() {
|
|
1252
|
-
await this.getInput().setClear();
|
|
1253
|
-
this.bcmOnSearch.emit(true);
|
|
1254
|
-
return true;
|
|
1255
|
-
}
|
|
1256
|
-
async searchArray(value, idFields = null) {
|
|
1257
|
-
// console.log(this.data)
|
|
1258
|
-
let cacheSearchFields = this.searchFields;
|
|
1259
|
-
let arrayResult = [];
|
|
1260
|
-
if (idFields) {
|
|
1261
|
-
this.searchFields = [idFields];
|
|
1262
|
-
}
|
|
1263
|
-
value.forEach(item => {
|
|
1264
|
-
// item = {[idFields]:item}
|
|
1265
|
-
this.results = [];
|
|
1266
|
-
// console.log(this.data)
|
|
1267
|
-
this.nestedSearch(this.data, item, true);
|
|
1268
|
-
arrayResult.push(...this.results);
|
|
1269
|
-
});
|
|
1270
|
-
this.searchFields = cacheSearchFields;
|
|
1271
|
-
return arrayResult;
|
|
1272
|
-
// await this.getInput().setValue( value )
|
|
1273
|
-
// return value
|
|
1274
|
-
}
|
|
1275
|
-
nestedSearch(items, value, equal = false) {
|
|
1276
|
-
var result;
|
|
1277
|
-
items && (items.map((item) => {
|
|
1278
|
-
this.searchFields.map(searchField => {
|
|
1279
|
-
if (searchField in item) {
|
|
1280
|
-
// debugger;
|
|
1281
|
-
item[searchField] = lowercase$1(String(item[searchField]));
|
|
1282
|
-
if (this.onlyChild) {
|
|
1283
|
-
if (item[this.searchSub]) {
|
|
1284
|
-
var temp = this.nestedSearch(item[this.searchSub], value, equal);
|
|
1285
|
-
if (temp) {
|
|
1286
|
-
this.results.push((result = String(item[this.returnField])));
|
|
1287
|
-
this.results.push(temp);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
else {
|
|
1291
|
-
if (equal) {
|
|
1292
|
-
// console.log(value)
|
|
1293
|
-
if (item[searchField] == lowercase$1(String(value))) {
|
|
1294
|
-
// if (item == lowercase(value)) {
|
|
1295
|
-
this.results.push((result = String(item[this.returnField])));
|
|
1296
|
-
// this.results.push (result = String(item))
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
else {
|
|
1300
|
-
if (item[searchField].indexOf(lowercase$1(value)) !== -1) {
|
|
1301
|
-
this.results.push((result = String(item[this.returnField])));
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
}
|
|
1306
|
-
else {
|
|
1307
|
-
if (item[this.searchSub]) {
|
|
1308
|
-
var temp = this.nestedSearch(item[this.searchSub], value, equal);
|
|
1309
|
-
if (temp) {
|
|
1310
|
-
this.results.push((result = String(item[this.returnField])));
|
|
1311
|
-
this.results.push(temp);
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
if (equal) {
|
|
1315
|
-
// console.log(value)
|
|
1316
|
-
if (item[searchField] == lowercase$1(String(value))) {
|
|
1317
|
-
// if (item == lowercase(value)) {
|
|
1318
|
-
this.results.push((result = String(item[this.returnField])));
|
|
1319
|
-
// this.results.push (result = String(item))
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
else {
|
|
1323
|
-
if (item[searchField].indexOf(lowercase$1(value)) !== -1) {
|
|
1324
|
-
this.results.push((result = String(item[this.returnField])));
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
});
|
|
1330
|
-
}));
|
|
1331
|
-
return result;
|
|
1332
|
-
}
|
|
1333
|
-
/**
|
|
1334
|
-
* @desc
|
|
1335
|
-
* @param value
|
|
1336
|
-
*/
|
|
1337
|
-
inputChange(value) {
|
|
1338
|
-
this.results = [];
|
|
1339
|
-
// data prop'unda arama yapılacak (searchFields prop'u içerisindeki alanlar ile)
|
|
1340
|
-
// arama sonucunda eşleyen itemların 'idx', index
|
|
1341
|
-
// değerleri, array şeklinde root component'e
|
|
1342
|
-
// event ile gönderilecek
|
|
1343
|
-
// Örneğin value == 'to' olduğunda aşağıdaki
|
|
1344
|
-
// sonuçlar filtrelenmeli
|
|
1345
|
-
// -->
|
|
1346
|
-
//{ text: 'Mateusz Eaton', idx: 2 },
|
|
1347
|
-
//{ text: 'Tony Vickers', idx: 3 },
|
|
1348
|
-
// result array'i eşleşen itemların
|
|
1349
|
-
// index numaralarını tutacak
|
|
1350
|
-
// results = [2, 3]
|
|
1351
|
-
// Örnek arama
|
|
1352
|
-
// #
|
|
1353
|
-
this.nestedSearch(this.data, value);
|
|
1354
|
-
this.results = Array.from(new Set(this.results));
|
|
1355
|
-
(value && ((this.results.length > 0 && this.bcmOnSearch.emit(this.results)) || this.bcmOnSearch.emit([-1]))) || this.bcmOnSearch.emit(true);
|
|
1356
|
-
this.bcmOnSearchValue.emit(value);
|
|
1357
|
-
}
|
|
1358
|
-
render() {
|
|
1359
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
|
|
1360
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("bcm-old-input", { placeholder: this.searchPlaceholder, "no-caption": true, "no-margin": true, "full-width": true, disabled: this.disabled, type: "search", "on-bcm-change": e => this.inputChange(e.detail), value: this.searchValue })));
|
|
1361
|
-
}
|
|
1362
|
-
get el() { return index.getElement(this); }
|
|
1363
|
-
static get watchers() { return {
|
|
1364
|
-
"searchValue": ["inputChange"]
|
|
1365
|
-
}; }
|
|
1366
|
-
};
|
|
1367
|
-
BcmOldSearch.style = oldSearchCss;
|
|
1368
|
-
|
|
1369
|
-
const treeviewCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host{display:flex;flex-direction:column;height:100%;max-height:100%;border:1px solid var(--bcm-color-grey-5);box-sizing:border-box;background-color:#ffffff}:host(.empty) .treeview{display:flex;align-items:center;justify-content:center}.search{padding:8px;padding-bottom:0;margin-bottom:4px}.treeview{height:100%;max-height:100%;overflow:auto;background-color:var(--bcm-color-grey-1);padding:0 8px 8px 0}.treeview.loading{min-height:150px;position:relative;margin:0 8px 8px 8px}.treeview .loading{display:none;align-items:center;justify-content:center;height:100%;width:100%;position:absolute;background-color:rgba(255, 255, 255, 0.03)}.treeview .loading.show{display:flex}.treeview .empty{display:none;align-items:center;justify-content:center;height:100%}.treeview .empty bcm-empty{width:fit-content;margin:auto}.treeview .empty.show{display:flex}footer{text-align:right;padding:4px 8px;background-color:var(--bcm-color-grey-3);user-select:none}";
|
|
1370
|
-
|
|
1371
|
-
/**
|
|
1372
|
-
* @desc
|
|
1373
|
-
* @param str
|
|
1374
|
-
*/
|
|
1375
|
-
const lowercase = (str) => str.toLowerCase();
|
|
1376
|
-
const Bcmtreeview = class {
|
|
1377
|
-
constructor(hostRef) {
|
|
1378
|
-
index.registerInstance(this, hostRef);
|
|
1379
|
-
this.treeviewChange = index.createEvent(this, "bcm-treeview-change", 7);
|
|
1380
|
-
this.treeviewSendCheck = index.createEvent(this, "bcm-treeview-send-check", 7);
|
|
1381
|
-
this.treeviewSendUncheck = index.createEvent(this, "bcm-treeview-send-uncheck", 7);
|
|
1382
|
-
this.treeviewChecklist = index.createEvent(this, "bcm-treeview-checklist", 7);
|
|
1383
|
-
this.treeviewItemSelected = index.createEvent(this, "bcm-treeview-item-selected", 7);
|
|
1384
|
-
this.treeviewClearSelecteds = index.createEvent(this, "bcm-treeview-clear-selecteds", 7);
|
|
1385
|
-
this.treeviewShowContext = index.createEvent(this, "bcm-treeview-show-context", 7);
|
|
1386
|
-
this.treeviewUnchecked = index.createEvent(this, "bcm-treeview-unchecked", 7);
|
|
1387
|
-
this.treeviewChecked = index.createEvent(this, "bcm-treeview-checked", 7);
|
|
1388
|
-
this.objectMapping = {
|
|
1389
|
-
'text': 'text',
|
|
1390
|
-
'icon': 'icon',
|
|
1391
|
-
'id': 'id',
|
|
1392
|
-
'items': 'items',
|
|
1393
|
-
'open': 'open',
|
|
1394
|
-
'selected': 'selected',
|
|
1395
|
-
'checked': 'checked',
|
|
1396
|
-
'tooltipText': 'tooltipText',
|
|
1397
|
-
'disabled': "disabled",
|
|
1398
|
-
'favorite': "favorite",
|
|
1399
|
-
};
|
|
1400
|
-
this.checkedObjectList = [];
|
|
1401
|
-
this.allChilds = [];
|
|
1402
|
-
this.onFocus = false;
|
|
1403
|
-
this.minHeight = 200;
|
|
1404
|
-
this.minWidth = 200;
|
|
1405
|
-
this.allOpenCache = false;
|
|
1406
|
-
this.allOpenOnSearch = false;
|
|
1407
|
-
this.parentLength = [{}];
|
|
1408
|
-
this.isSetData = false;
|
|
1409
|
-
this.runClearAndSelect = false;
|
|
1410
|
-
/**
|
|
1411
|
-
* Component States
|
|
1412
|
-
*/
|
|
1413
|
-
this.empty = false;
|
|
1414
|
-
this.checkboxes = false;
|
|
1415
|
-
this.showIcon = false;
|
|
1416
|
-
this.size = 'medium';
|
|
1417
|
-
this.selectedId = undefined;
|
|
1418
|
-
this.checkedList = [];
|
|
1419
|
-
this.updateCheckedList = [];
|
|
1420
|
-
this.hidden = false;
|
|
1421
|
-
this.search = false;
|
|
1422
|
-
this.searchOnlyChild = false;
|
|
1423
|
-
this.keydown = false;
|
|
1424
|
-
this.allOpen = false;
|
|
1425
|
-
this.fullWidth = false;
|
|
1426
|
-
this.infoFooter = false;
|
|
1427
|
-
this.searchFields = ['text', 'secondaryText', 'tooltipText'];
|
|
1428
|
-
this.searchSub = "items";
|
|
1429
|
-
this.returnField = "id";
|
|
1430
|
-
this._items = [];
|
|
1431
|
-
this.searchPlaceholder = "Search";
|
|
1432
|
-
this.maxHeight = null;
|
|
1433
|
-
this.highlight = false;
|
|
1434
|
-
this.loading = true;
|
|
1435
|
-
this.favIcon = false;
|
|
1436
|
-
this.favIconOnlyChilds = false;
|
|
1437
|
-
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
1438
|
-
this.showSearch = true;
|
|
1439
|
-
this.items = [];
|
|
1440
|
-
this.total = 0;
|
|
1441
|
-
this.checkCount = 0;
|
|
1442
|
-
this.focusedElement = undefined;
|
|
1443
|
-
this.keyMapForFocus = { 18: false, 87: false };
|
|
1444
|
-
this.checklist = [];
|
|
1445
|
-
this.favoriteList = [];
|
|
1446
|
-
this.checklistSorted = [];
|
|
1447
|
-
this.searchData = undefined;
|
|
1448
|
-
this.searchResults = [];
|
|
1449
|
-
}
|
|
1450
|
-
async setData(_data = []) {
|
|
1451
|
-
this.clearAndSelectSearch(false);
|
|
1452
|
-
this.isLoading(true);
|
|
1453
|
-
this.isSetData = true;
|
|
1454
|
-
this.checkedObjectList = [];
|
|
1455
|
-
this.selectedId = null;
|
|
1456
|
-
setTimeout(() => {
|
|
1457
|
-
this._items = _data;
|
|
1458
|
-
this.searchData = JSON.parse(_data);
|
|
1459
|
-
this.calculateMinSizes();
|
|
1460
|
-
this.handleChildProcess();
|
|
1461
|
-
}, 100);
|
|
1462
|
-
return Promise.resolve(true);
|
|
1463
|
-
}
|
|
1464
|
-
async getChecklist() {
|
|
1465
|
-
return this.checkedObjectList;
|
|
1466
|
-
}
|
|
1467
|
-
async getFavorites() {
|
|
1468
|
-
this.getChildItem(this.el).forEach(element => {
|
|
1469
|
-
element[this.objectMapping['favorite']] == true && (this.favIconOnlyChilds && element[this.objectMapping['items']].length == 0 && (this.favoriteList.indexOf(element.itemObject) < 0 && (this.favoriteList.push(element.itemObject))),
|
|
1470
|
-
!this.favIconOnlyChilds && (this.favoriteList.indexOf(element.itemObject) < 0 && (this.favoriteList.push(element.itemObject))));
|
|
1471
|
-
});
|
|
1472
|
-
return this.favoriteList;
|
|
1473
|
-
}
|
|
1474
|
-
async selected(id) {
|
|
1475
|
-
this.selectedId = id;
|
|
1476
|
-
}
|
|
1477
|
-
async clearAndSelectSearch(select = true) {
|
|
1478
|
-
this.runClearAndSelect = true;
|
|
1479
|
-
if (this.search === true) {
|
|
1480
|
-
setTimeout(() => {
|
|
1481
|
-
var searchInput = null;
|
|
1482
|
-
searchInput = this.el.shadowRoot.querySelector("bcm-old-search");
|
|
1483
|
-
if (searchInput) {
|
|
1484
|
-
searchInput.setClear();
|
|
1485
|
-
if (select == true) {
|
|
1486
|
-
searchInput.select();
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
}, 100);
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
async addChecked(items = []) {
|
|
1493
|
-
this.checkedList = items;
|
|
1494
|
-
}
|
|
1495
|
-
async updateChecked(items = []) {
|
|
1496
|
-
this.updateCheckedList = items;
|
|
1497
|
-
}
|
|
1498
|
-
async config(_config) {
|
|
1499
|
-
if (_config['maxHeight']) {
|
|
1500
|
-
typeof _config['maxHeight'] == 'string'
|
|
1501
|
-
? this.maxHeight = _config['maxHeight']
|
|
1502
|
-
: this.maxHeight = "100%";
|
|
1503
|
-
}
|
|
1504
|
-
if (_config['searchFields']) {
|
|
1505
|
-
if (Array.isArray(_config['searchFields'])) {
|
|
1506
|
-
this.searchFields = _config['searchFields'];
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
if (_config['searchable']) {
|
|
1510
|
-
typeof _config['searchable'] == 'boolean'
|
|
1511
|
-
? this.search = _config['searchable']
|
|
1512
|
-
: this.search = false;
|
|
1513
|
-
}
|
|
1514
|
-
if (_config['searchOnlyChild']) {
|
|
1515
|
-
typeof _config['searchOnlyChild'] == 'boolean'
|
|
1516
|
-
? this.searchOnlyChild = _config['searchOnlyChild']
|
|
1517
|
-
: this.searchOnlyChild = false;
|
|
1518
|
-
}
|
|
1519
|
-
if (_config['searchPlaceholder']) {
|
|
1520
|
-
typeof _config['searchPlaceholder'] == 'string'
|
|
1521
|
-
? this.searchPlaceholder = _config['searchPlaceholder']
|
|
1522
|
-
: this.searchPlaceholder = null;
|
|
1523
|
-
}
|
|
1524
|
-
if (_config['fullWidth']) {
|
|
1525
|
-
typeof _config['fullWidth'] == 'boolean'
|
|
1526
|
-
? this.fullWidth = _config['fullWidth']
|
|
1527
|
-
: this.fullWidth = false;
|
|
1528
|
-
}
|
|
1529
|
-
if (_config['infoFooter']) {
|
|
1530
|
-
typeof _config['infoFooter'] == 'boolean'
|
|
1531
|
-
? this.infoFooter = _config['infoFooter']
|
|
1532
|
-
: this.infoFooter = false;
|
|
1533
|
-
}
|
|
1534
|
-
if (_config['highlight']) {
|
|
1535
|
-
typeof _config['highlight'] == 'boolean'
|
|
1536
|
-
? this.highlight = _config['highlight']
|
|
1537
|
-
: this.highlight = false;
|
|
1538
|
-
}
|
|
1539
|
-
if (_config['checkable']) {
|
|
1540
|
-
typeof _config['checkable'] == 'boolean'
|
|
1541
|
-
? this.checkboxes = _config['checkable']
|
|
1542
|
-
: this.checkboxes = false;
|
|
1543
|
-
}
|
|
1544
|
-
if (_config['showIcon']) {
|
|
1545
|
-
typeof _config['showIcon'] == 'boolean'
|
|
1546
|
-
? this.showIcon = _config['showIcon']
|
|
1547
|
-
: this.showIcon = false;
|
|
1548
|
-
}
|
|
1549
|
-
if (_config['favIcon']) {
|
|
1550
|
-
typeof _config['favIcon'] == 'boolean'
|
|
1551
|
-
? this.favIcon = _config['favIcon']
|
|
1552
|
-
: this.favIcon = false;
|
|
1553
|
-
}
|
|
1554
|
-
if (_config['favIconOnlyChilds']) {
|
|
1555
|
-
typeof _config['favIconOnlyChilds'] == 'boolean'
|
|
1556
|
-
? this.favIconOnlyChilds = _config['favIconOnlyChilds']
|
|
1557
|
-
: this.favIconOnlyChilds = false;
|
|
1558
|
-
}
|
|
1559
|
-
if (_config['allOpen']) {
|
|
1560
|
-
typeof _config['allOpen'] == 'boolean'
|
|
1561
|
-
? this.allOpen = _config['allOpen']
|
|
1562
|
-
: this.allOpen = false;
|
|
1563
|
-
}
|
|
1564
|
-
this.allOpenCache = this.allOpen;
|
|
1565
|
-
if (_config['size']) {
|
|
1566
|
-
(["small", "medium", "large"].indexOf(_config['size']) >= 0)
|
|
1567
|
-
? this.size = _config['size']
|
|
1568
|
-
: this.size = 'medium';
|
|
1569
|
-
}
|
|
1570
|
-
if (_config['mapping']) {
|
|
1571
|
-
if (_config['mapping']['text']) {
|
|
1572
|
-
this.objectMapping['text'] = _config['mapping']['text'];
|
|
1573
|
-
}
|
|
1574
|
-
if (_config['mapping']['icon']) {
|
|
1575
|
-
this.objectMapping['icon'] = _config['mapping']['icon'];
|
|
1576
|
-
}
|
|
1577
|
-
if (_config['mapping']['id']) {
|
|
1578
|
-
this.objectMapping['id'] = _config['mapping']['id'];
|
|
1579
|
-
this.returnField = this.objectMapping['id'];
|
|
1580
|
-
}
|
|
1581
|
-
if (_config['mapping']['items']) {
|
|
1582
|
-
this.objectMapping['items'] = _config['mapping']['items'];
|
|
1583
|
-
this.searchSub = this.objectMapping['items'];
|
|
1584
|
-
}
|
|
1585
|
-
if (_config['mapping']['open']) {
|
|
1586
|
-
this.objectMapping['open'] = _config['mapping']['open'];
|
|
1587
|
-
}
|
|
1588
|
-
if (_config['mapping']['selected']) {
|
|
1589
|
-
this.objectMapping['selected'] = _config['mapping']['selected'];
|
|
1590
|
-
}
|
|
1591
|
-
if (_config['mapping']['checked']) {
|
|
1592
|
-
this.objectMapping['checked'] = _config['mapping']['checked'];
|
|
1593
|
-
}
|
|
1594
|
-
if (_config['mapping']['tooltipText']) {
|
|
1595
|
-
this.objectMapping['tooltipText'] = _config['mapping']['tooltipText'];
|
|
1596
|
-
}
|
|
1597
|
-
if (_config['mapping']['disabled']) {
|
|
1598
|
-
this.objectMapping['disabled'] = _config['mapping']['disabled'];
|
|
1599
|
-
}
|
|
1600
|
-
if (_config['mapping']['favorite']) {
|
|
1601
|
-
this.objectMapping['favorite'] = _config['mapping']['favorite'];
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
// sessionStorage.setItem(this._internal_id + "-config", JSON.stringify(_config));
|
|
1605
|
-
return Promise.resolve(true);
|
|
1606
|
-
}
|
|
1607
|
-
calculateMinSizes() {
|
|
1608
|
-
if (this.minHeight < this.el.clientHeight) {
|
|
1609
|
-
this.minHeight = this.el.clientHeight;
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
|
-
connectedCallback() { }
|
|
1613
|
-
componentWillLoad() { }
|
|
1614
|
-
componentWillRender() {
|
|
1615
|
-
if (sessionStorage.getItem(this._internal_id + "-config")) {
|
|
1616
|
-
this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
componentDidRender() {
|
|
1620
|
-
// this.isEmpty(true)
|
|
1621
|
-
// if(this.total > 0) {
|
|
1622
|
-
// this.isEmpty(false)
|
|
1623
|
-
// }
|
|
1624
|
-
}
|
|
1625
|
-
// componentDidLoad(){
|
|
1626
|
-
// this.handleChildProcess()
|
|
1627
|
-
// setTimeout(() => {
|
|
1628
|
-
// if(this.isSetData) {
|
|
1629
|
-
// this.isLoading(true)
|
|
1630
|
-
// this.isEmpty(false)
|
|
1631
|
-
// }else{
|
|
1632
|
-
// this.isLoading(false)
|
|
1633
|
-
// this.isEmpty(true)
|
|
1634
|
-
// }
|
|
1635
|
-
// }, 1000);
|
|
1636
|
-
// // this.isEmpty(true)
|
|
1637
|
-
// }
|
|
1638
|
-
componentWillUpdate() { }
|
|
1639
|
-
// componentWillRender(){}
|
|
1640
|
-
// componentDidRender(){}
|
|
1641
|
-
componentDidUpdate() {
|
|
1642
|
-
if (this.checkboxes === true) {
|
|
1643
|
-
this.checkedObjectList = [];
|
|
1644
|
-
if (this.checklistSorted.length > 0) {
|
|
1645
|
-
this.getChildItem(this.el).forEach(element => {
|
|
1646
|
-
element.checked == true && (this.checkedObjectList.indexOf(element.itemObject) < 0 && (this.checkedObjectList.push(element.itemObject)));
|
|
1647
|
-
});
|
|
1648
|
-
this.treeviewChecklist.emit(this.checkedObjectList);
|
|
1649
|
-
}
|
|
1650
|
-
else {
|
|
1651
|
-
this.treeviewChecklist.emit([]);
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
parseItems(newValue) {
|
|
1656
|
-
if (newValue) {
|
|
1657
|
-
typeof newValue == 'string'
|
|
1658
|
-
? this.items = JSON.parse(newValue)
|
|
1659
|
-
: this.items = newValue;
|
|
1660
|
-
}
|
|
1661
|
-
this.handleChildProcess();
|
|
1662
|
-
}
|
|
1663
|
-
handleChildProcess() {
|
|
1664
|
-
setTimeout(() => {
|
|
1665
|
-
this.allChilds = this.getAllChilds();
|
|
1666
|
-
this.total = this.allChilds.filter((v, i, a) => a.indexOf(v) === i).length;
|
|
1667
|
-
if (this.total > 0) {
|
|
1668
|
-
// setTimeout(() => {
|
|
1669
|
-
this.isLoading(false);
|
|
1670
|
-
// }, 100);
|
|
1671
|
-
this.isEmpty(false);
|
|
1672
|
-
}
|
|
1673
|
-
else {
|
|
1674
|
-
// setTimeout(() => {
|
|
1675
|
-
this.isLoading(false);
|
|
1676
|
-
this.isEmpty(true);
|
|
1677
|
-
// }, 100);
|
|
1678
|
-
}
|
|
1679
|
-
}, 100);
|
|
1680
|
-
}
|
|
1681
|
-
/**
|
|
1682
|
-
* @desc
|
|
1683
|
-
* @param group
|
|
1684
|
-
*/
|
|
1685
|
-
recursiveItemRenderer(group, parentGroup) {
|
|
1686
|
-
const sId = String(this.selectedId);
|
|
1687
|
-
const gId = String(group[this.objectMapping['id']]);
|
|
1688
|
-
const isSelected = String(group[this.objectMapping['selected']]) === 'true' ? true : false;
|
|
1689
|
-
if (sId === gId || isSelected) {
|
|
1690
|
-
this.treeviewItemSelected.emit(group);
|
|
1691
|
-
}
|
|
1692
|
-
return (index.h("bcm-treeview-item", Object.assign({ _internal_id: this._internal_id, text: group[this.objectMapping['text']], icon: group[this.objectMapping['icon']], id: group[this.objectMapping['id']], size: this.size, "has-child": !!group[this.objectMapping['items']] }, (parentGroup && { 'parent-id': parentGroup[this.objectMapping['id']] }), (group[this.objectMapping['tooltipText']] && { tooltipText: group[this.objectMapping['tooltipText']] }), (String(group[this.objectMapping['checked']]) === "true" && { checkTrigger: true }), (String(group[this.objectMapping['open']]) === "true" && { open: true }), (String(group[this.objectMapping['selected']]) === "true" && { selected: true }), (String(group[this.objectMapping['disabled']]) === "true" && { disabled: true }), (group[this.objectMapping['items']] && { items: group[this.objectMapping['items']] }), (this.favIcon && !this.favIconOnlyChilds && { favicon: true }), (this.favIcon && this.favIconOnlyChilds && group[this.objectMapping['items']].length == 0 && { favicon: true }), (this.favIcon && group.rightSlot && { favorite: group.rightSlot[this.objectMapping['favorite']] }), (this.showIcon && { showIcon: true }), (String(this.checkboxes) === "true" && { checkboxes: true }), ((this.allOpen || this.allOpenOnSearch) && { open: true }), { itemObject: group }, ((this.checkedList && this.checkedList.find(e => e == group[this.objectMapping['id']]))) && { checkTrigger: true }, (this.updateCheckedList.length > 0 &&
|
|
1693
|
-
((this.updateCheckedList.find(e => e == group[this.objectMapping['id']])) && { checkTrigger: true }))), group[this.objectMapping['items']] && group[this.objectMapping['items']].map((item) => (this.recursiveItemRenderer(item, group)))));
|
|
1694
|
-
}
|
|
1695
|
-
/**
|
|
1696
|
-
* @desc
|
|
1697
|
-
*/
|
|
1698
|
-
handleCheckList(process = 'add', checkId) {
|
|
1699
|
-
// console.log(checkId)
|
|
1700
|
-
if (this.checkboxes === true) {
|
|
1701
|
-
// const { checklist } = this
|
|
1702
|
-
// checkId = Number(checkId)
|
|
1703
|
-
switch (process) {
|
|
1704
|
-
case 'add':
|
|
1705
|
-
if (this.checklist.length > 0) {
|
|
1706
|
-
this.checklist.indexOf(checkId) < 0 && (this.checklist = [...this.checklist, checkId]);
|
|
1707
|
-
}
|
|
1708
|
-
else {
|
|
1709
|
-
this.checklist = [checkId];
|
|
1710
|
-
}
|
|
1711
|
-
break;
|
|
1712
|
-
case 'remove':
|
|
1713
|
-
this.checklist = this.checklist.filter(item => item !== checkId);
|
|
1714
|
-
break;
|
|
1715
|
-
}
|
|
1716
|
-
let sorted = this.checklist.sort(function (a, b) { return a - b; });
|
|
1717
|
-
this.checklistSorted = sorted;
|
|
1718
|
-
// console.log('sorted: ', sorted)
|
|
1719
|
-
this.checkCount = this.checklistSorted.length;
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
async showSearchMethod(val = true) {
|
|
1723
|
-
this.showSearch = val;
|
|
1724
|
-
// return val
|
|
1725
|
-
}
|
|
1726
|
-
async searchResultMethod(items = []) {
|
|
1727
|
-
// this.listenSearchResult({ detail: items })
|
|
1728
|
-
await customElements.whenDefined("bcm-old-search");
|
|
1729
|
-
const search = this.el.shadowRoot.querySelector("bcm-old-search");
|
|
1730
|
-
const detail = await search.searchArray(items, this.objectMapping['id']);
|
|
1731
|
-
await this.listenSearchResult({ detail: detail });
|
|
1732
|
-
// return true
|
|
1733
|
-
}
|
|
1734
|
-
isLoading(val) {
|
|
1735
|
-
var treeview = this.el.shadowRoot.getElementById("treeview");
|
|
1736
|
-
var loading = this.el.shadowRoot.getElementById("loading");
|
|
1737
|
-
var searchInput = this.el.shadowRoot.querySelector("bcm-old-search");
|
|
1738
|
-
// var listcontainer = this.el.shadowRoot.getElementById("list-container")
|
|
1739
|
-
if (val === true) {
|
|
1740
|
-
treeview && treeview.classList.add('loading');
|
|
1741
|
-
loading && loading.classList.add('show');
|
|
1742
|
-
if (searchInput) {
|
|
1743
|
-
searchInput.disabled = true;
|
|
1744
|
-
}
|
|
1745
|
-
// listcontainer && listcontainer.classList.add('hidden')
|
|
1746
|
-
}
|
|
1747
|
-
else {
|
|
1748
|
-
treeview && treeview.classList.remove('loading');
|
|
1749
|
-
loading && loading.classList.remove('show');
|
|
1750
|
-
if (searchInput) {
|
|
1751
|
-
searchInput.disabled = false;
|
|
1752
|
-
}
|
|
1753
|
-
// listcontainer && listcontainer.classList.remove('hidden')
|
|
1754
|
-
}
|
|
1755
|
-
return false;
|
|
1756
|
-
}
|
|
1757
|
-
isEmpty(val) {
|
|
1758
|
-
var empty = this.el.shadowRoot.getElementById("empty");
|
|
1759
|
-
// var listcontainer = this.el.shadowRoot.getElementById("list-container")
|
|
1760
|
-
if (val === true) {
|
|
1761
|
-
empty && empty.classList.add('show');
|
|
1762
|
-
// listcontainer && listcontainer.classList.add('hidden')
|
|
1763
|
-
}
|
|
1764
|
-
else {
|
|
1765
|
-
empty && empty.classList.remove('show');
|
|
1766
|
-
// listcontainer && listcontainer.classList.remove('hidden')
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
isSearchCount(val = null) {
|
|
1770
|
-
if (this.infoFooter === true) {
|
|
1771
|
-
var inSearch = this.el.shadowRoot.getElementById("in-search");
|
|
1772
|
-
var inTotal = this.el.shadowRoot.getElementById("in-total");
|
|
1773
|
-
if (val >= 0 && val != null && inSearch && inTotal) {
|
|
1774
|
-
inSearch.innerHTML = val;
|
|
1775
|
-
inTotal.style.display = "none";
|
|
1776
|
-
}
|
|
1777
|
-
else {
|
|
1778
|
-
inTotal.style.display = "inline";
|
|
1779
|
-
inSearch.innerHTML = "";
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
// if (val > 0){
|
|
1783
|
-
// this.isEmpty(false)
|
|
1784
|
-
// }
|
|
1785
|
-
}
|
|
1786
|
-
listenSearchResult(e) {
|
|
1787
|
-
this.parentLength = [];
|
|
1788
|
-
var searchValue = '';
|
|
1789
|
-
// this.searchResults = e.detail
|
|
1790
|
-
var totalSearch = e.detail.length;
|
|
1791
|
-
this.empty = false;
|
|
1792
|
-
var getAllChilds = this.getAllChilds();
|
|
1793
|
-
this.isEmpty(false);
|
|
1794
|
-
if (e.detail.length > 0) {
|
|
1795
|
-
// this.allOpenOnSearch = true
|
|
1796
|
-
if (e.detail[0] == -1) {
|
|
1797
|
-
totalSearch = 0;
|
|
1798
|
-
this.empty = true;
|
|
1799
|
-
this.isEmpty(true);
|
|
1800
|
-
}
|
|
1801
|
-
if (getAllChilds.length > 0) {
|
|
1802
|
-
getAllChilds.map((item) => {
|
|
1803
|
-
var isParent = false;
|
|
1804
|
-
if (this.searchOnlyChild && item.items && item.items.length > 0) {
|
|
1805
|
-
isParent = true;
|
|
1806
|
-
}
|
|
1807
|
-
e.target.addEventListener('bcm-on-search-value', async (e) => {
|
|
1808
|
-
searchValue = await e.detail;
|
|
1809
|
-
var inputText = item.shadowRoot.getElementById("text");
|
|
1810
|
-
inputText = inputText.textContent || inputText.innerText || "";
|
|
1811
|
-
if (searchValue) {
|
|
1812
|
-
var cacheInputText = lowercase(inputText);
|
|
1813
|
-
var cacheSearchValue = lowercase(searchValue);
|
|
1814
|
-
var index = cacheInputText.indexOf(cacheSearchValue);
|
|
1815
|
-
if (index >= 0) {
|
|
1816
|
-
if (isParent == false) {
|
|
1817
|
-
if (this.parentLength.indexOf(item.id) === -1) {
|
|
1818
|
-
this.parentLength.push(item.id);
|
|
1819
|
-
}
|
|
1820
|
-
if (this.highlight) {
|
|
1821
|
-
inputText = inputText.substring(0, index)
|
|
1822
|
-
+ "<span class='highlight'>"
|
|
1823
|
-
+ inputText.substring(index, index + searchValue.length)
|
|
1824
|
-
+ "</span>"
|
|
1825
|
-
+ inputText.substring(index + searchValue.length);
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
item.shadowRoot.getElementById("text").innerHTML = inputText;
|
|
1831
|
-
});
|
|
1832
|
-
item.hidden = true;
|
|
1833
|
-
var _ids = item.id;
|
|
1834
|
-
if (e.detail.indexOf(_ids) >= 0) {
|
|
1835
|
-
item.hidden = false;
|
|
1836
|
-
item.open = true;
|
|
1837
|
-
setTimeout(() => {
|
|
1838
|
-
if (this.parentLength.indexOf(item.id) !== -1 && item.items && item.items.length > 0 && this.searchOnlyChild == false) {
|
|
1839
|
-
const getChilds = (item) => {
|
|
1840
|
-
this.getAllChilds(item).map(element => {
|
|
1841
|
-
element.hidden = false;
|
|
1842
|
-
element.open = true;
|
|
1843
|
-
getChilds(element);
|
|
1844
|
-
});
|
|
1845
|
-
};
|
|
1846
|
-
getChilds(item);
|
|
1847
|
-
}
|
|
1848
|
-
}, 1);
|
|
1849
|
-
}
|
|
1850
|
-
else {
|
|
1851
|
-
item.hidden = true;
|
|
1852
|
-
}
|
|
1853
|
-
});
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
else {
|
|
1857
|
-
// this.allOpenOnSearch = this.allOpenCache
|
|
1858
|
-
if (getAllChilds.length > 0) {
|
|
1859
|
-
getAllChilds.map((item) => {
|
|
1860
|
-
item.hidden = false;
|
|
1861
|
-
});
|
|
1862
|
-
}
|
|
1863
|
-
// this.isEmpty(true)
|
|
1864
|
-
}
|
|
1865
|
-
// if ( this.searchOnlyChild ) {
|
|
1866
|
-
// this.isSearchCount(highlightLength)
|
|
1867
|
-
// }else{
|
|
1868
|
-
setTimeout(() => {
|
|
1869
|
-
if (totalSearch >= 0) {
|
|
1870
|
-
var totals = totalSearch - Number(totalSearch - this.parentLength.length);
|
|
1871
|
-
this.isSearchCount(totals > 0 ? totals : 0);
|
|
1872
|
-
}
|
|
1873
|
-
else {
|
|
1874
|
-
this.isSearchCount();
|
|
1875
|
-
}
|
|
1876
|
-
if (e.detail[0] === -1) {
|
|
1877
|
-
this.isSearchCount(0);
|
|
1878
|
-
}
|
|
1879
|
-
if (e.detail === true) {
|
|
1880
|
-
this.isSearchCount();
|
|
1881
|
-
}
|
|
1882
|
-
}, 100);
|
|
1883
|
-
// }
|
|
1884
|
-
if (e.detail === true) {
|
|
1885
|
-
this.isEmpty(false);
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
getAllChilds(element = this.el) {
|
|
1889
|
-
let returnAllItems = [];
|
|
1890
|
-
utils.getChilds(element, 'bcm-treeview-item').forEach(items => {
|
|
1891
|
-
this.getAllChilds(items) && (returnAllItems.indexOf(items) < 0 && (returnAllItems.push(items))
|
|
1892
|
-
// returnAllItems = [...returnAllItems, ...this.getAllChilds(items)]
|
|
1893
|
-
);
|
|
1894
|
-
returnAllItems.indexOf(items) < 0 && (returnAllItems.push(items));
|
|
1895
|
-
// returnAllItems = [...returnAllItems,
|
|
1896
|
-
// items
|
|
1897
|
-
// ]
|
|
1898
|
-
});
|
|
1899
|
-
return returnAllItems;
|
|
1900
|
-
}
|
|
1901
|
-
/**
|
|
1902
|
-
* @desc
|
|
1903
|
-
*/
|
|
1904
|
-
handletreeviewItemSelected(event) {
|
|
1905
|
-
this.treeviewClearSelecteds.emit(event.detail);
|
|
1906
|
-
}
|
|
1907
|
-
/**
|
|
1908
|
-
* @desc
|
|
1909
|
-
*/
|
|
1910
|
-
handletreeviewChecked(event) {
|
|
1911
|
-
// this.treeviewSendCheck.emit(event.detail)
|
|
1912
|
-
this.handleCheckList('add', event.detail);
|
|
1913
|
-
// this.treeviewChange.emit(event.detail)
|
|
1914
|
-
}
|
|
1915
|
-
/**
|
|
1916
|
-
* @desc
|
|
1917
|
-
*/
|
|
1918
|
-
// @Listen('bcm-treeview-check-group-check')
|
|
1919
|
-
// bcmTreeviewCheckGroupChecked(event: any) {
|
|
1920
|
-
// console.log(event)
|
|
1921
|
-
// this.treeviewSendCheck.emit(event.detail)
|
|
1922
|
-
// this.handleCheckList('add',event.detail)
|
|
1923
|
-
// this.treeviewChange.emit(event.detail)
|
|
1924
|
-
// }
|
|
1925
|
-
/**
|
|
1926
|
-
* @desc
|
|
1927
|
-
*/
|
|
1928
|
-
handletreeviewUnchecked(event) {
|
|
1929
|
-
// this.treeviewSendUncheck.emit(event.detail)
|
|
1930
|
-
this.handleCheckList('remove', event.detail);
|
|
1931
|
-
// this.treeviewChange.emit(event.detail)
|
|
1932
|
-
}
|
|
1933
|
-
/**
|
|
1934
|
-
* @desc
|
|
1935
|
-
*/
|
|
1936
|
-
handletreeviewIndeterminateChecked(event) {
|
|
1937
|
-
this.handleCheckList('add', event.detail);
|
|
1938
|
-
}
|
|
1939
|
-
/**
|
|
1940
|
-
* @desc
|
|
1941
|
-
*/
|
|
1942
|
-
handletreeviewIndeterminateUnchecked(event) {
|
|
1943
|
-
this.handleCheckList('remove', event.detail);
|
|
1944
|
-
}
|
|
1945
|
-
treeviewUncheckedMethod(item) {
|
|
1946
|
-
this.handletreeviewUnchecked({ "detail": item });
|
|
1947
|
-
this.componentDidUpdate();
|
|
1948
|
-
return Promise.resolve(true);
|
|
1949
|
-
}
|
|
1950
|
-
/**
|
|
1951
|
-
* @desc
|
|
1952
|
-
* Keyboard Navigation
|
|
1953
|
-
*/
|
|
1954
|
-
getIndex(item) {
|
|
1955
|
-
return Array.from(item.parentNode.children).indexOf(item);
|
|
1956
|
-
}
|
|
1957
|
-
/**
|
|
1958
|
-
* @desc
|
|
1959
|
-
* Keyboard Navigation
|
|
1960
|
-
*/
|
|
1961
|
-
getNext(item) {
|
|
1962
|
-
let returnItem = this.getChildItem(item.parentElement)[this.getIndex(item) + 1];
|
|
1963
|
-
if (returnItem)
|
|
1964
|
-
return returnItem;
|
|
1965
|
-
return false;
|
|
1966
|
-
}
|
|
1967
|
-
/**
|
|
1968
|
-
* @desc
|
|
1969
|
-
* Keyboard Navigation
|
|
1970
|
-
*/
|
|
1971
|
-
getPrev(item) {
|
|
1972
|
-
let returnItem = this.getChildItem(item.parentElement)[this.getIndex(item) - 1];
|
|
1973
|
-
if (returnItem)
|
|
1974
|
-
return returnItem;
|
|
1975
|
-
return false;
|
|
1976
|
-
}
|
|
1977
|
-
/**
|
|
1978
|
-
* @desc
|
|
1979
|
-
* Keyboard Navigation
|
|
1980
|
-
*/
|
|
1981
|
-
getParent(item) {
|
|
1982
|
-
if (lowercase(item.parentElement.tagName) == 'bcm-treeview') {
|
|
1983
|
-
return false;
|
|
1984
|
-
}
|
|
1985
|
-
else {
|
|
1986
|
-
return this.getChildItem(item.parentElement.parentElement)[this.getIndex(item.parentElement)];
|
|
1987
|
-
}
|
|
1988
|
-
}
|
|
1989
|
-
/**
|
|
1990
|
-
* @desc
|
|
1991
|
-
* Keyboard Navigation
|
|
1992
|
-
*/
|
|
1993
|
-
getNextParent(item) {
|
|
1994
|
-
let getParent = this.getParent(item);
|
|
1995
|
-
let getNext;
|
|
1996
|
-
if (getParent) {
|
|
1997
|
-
getNext = this.getNext(getParent);
|
|
1998
|
-
if (getNext) {
|
|
1999
|
-
return getNext;
|
|
2000
|
-
}
|
|
2001
|
-
else {
|
|
2002
|
-
return this.getNextParent(getParent);
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
}
|
|
2006
|
-
/**
|
|
2007
|
-
* @desc
|
|
2008
|
-
* Keyboard Navigation
|
|
2009
|
-
*/
|
|
2010
|
-
getFirstItem(el = this.el) {
|
|
2011
|
-
return this.getChildItem(el)[0];
|
|
2012
|
-
}
|
|
2013
|
-
/**
|
|
2014
|
-
* @desc
|
|
2015
|
-
* Keyboard Navigation
|
|
2016
|
-
*/
|
|
2017
|
-
getLastItem(el = this.el) {
|
|
2018
|
-
let childLength = this.getChildItem(el).length;
|
|
2019
|
-
let lastChild = this.getChildItem(el)[childLength - 1];
|
|
2020
|
-
if (this.getChildItem(lastChild).length > 0 && lastChild.open == true) {
|
|
2021
|
-
return this.getLastItem(lastChild);
|
|
2022
|
-
}
|
|
2023
|
-
else {
|
|
2024
|
-
return lastChild;
|
|
2025
|
-
}
|
|
2026
|
-
}
|
|
2027
|
-
/**
|
|
2028
|
-
* @desc
|
|
2029
|
-
* Keyboard Navigation
|
|
2030
|
-
*/
|
|
2031
|
-
getChildItem(element = this.el) {
|
|
2032
|
-
let returnItems = utils.getChilds(element, 'bcm-treeview-item');
|
|
2033
|
-
if (returnItems)
|
|
2034
|
-
return returnItems;
|
|
2035
|
-
return 0;
|
|
2036
|
-
}
|
|
2037
|
-
/**
|
|
2038
|
-
* @desc
|
|
2039
|
-
*/
|
|
2040
|
-
handleRightClick(e) {
|
|
2041
|
-
this.treeviewShowContext.emit([e.target.id, e.clientY, e.clientX]);
|
|
2042
|
-
e.preventDefault();
|
|
2043
|
-
}
|
|
2044
|
-
/**
|
|
2045
|
-
* @desc
|
|
2046
|
-
*/
|
|
2047
|
-
keyboardNavigationUp(e) {
|
|
2048
|
-
let { keyMapForFocus } = this;
|
|
2049
|
-
if (e.keyCode in keyMapForFocus) {
|
|
2050
|
-
keyMapForFocus[e.keyCode] = false;
|
|
2051
|
-
}
|
|
2052
|
-
}
|
|
2053
|
-
/**
|
|
2054
|
-
* @desc
|
|
2055
|
-
*/
|
|
2056
|
-
keyboardNavigation(e) {
|
|
2057
|
-
if (this.keydown) {
|
|
2058
|
-
const { keyMapForFocus, focusedElement, el } = this;
|
|
2059
|
-
this.focusedElement = !focusedElement ? el : focusedElement;
|
|
2060
|
-
const which = e.which || 0;
|
|
2061
|
-
if (this.getChildItem(el).length > 0) {
|
|
2062
|
-
if (e.keyCode in keyMapForFocus) {
|
|
2063
|
-
keyMapForFocus[e.keyCode] = true;
|
|
2064
|
-
if (keyMapForFocus[18] && keyMapForFocus[87]) {
|
|
2065
|
-
e.preventDefault();
|
|
2066
|
-
this.focusedElement = this.getFirstItem(this.focusedElement);
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
if (which == 9 || //tab
|
|
2070
|
-
which == 13 || //enter
|
|
2071
|
-
which == 18 || //alt
|
|
2072
|
-
which == 32 || //space
|
|
2073
|
-
which == 35 || // end
|
|
2074
|
-
which == 36 || // home
|
|
2075
|
-
(which >= 35 && which <= 40) //end, home, left arrow, up arrow, right arrow, down arrow
|
|
2076
|
-
) {
|
|
2077
|
-
e.preventDefault();
|
|
2078
|
-
if (!focusedElement) {
|
|
2079
|
-
this.focusedElement = this.getFirstItem(this.focusedElement);
|
|
2080
|
-
}
|
|
2081
|
-
else {
|
|
2082
|
-
this.focusedElement.focused = false;
|
|
2083
|
-
switch (which) {
|
|
2084
|
-
case 13: // enter
|
|
2085
|
-
this.focusedElement.selected = true;
|
|
2086
|
-
break;
|
|
2087
|
-
case 32: // space
|
|
2088
|
-
this.focusedElement.checked && (this.treeviewUnchecked.emit(this.focusedElement.id)) || (this.treeviewChecked.emit(this.focusedElement.id));
|
|
2089
|
-
break;
|
|
2090
|
-
case 35: // end
|
|
2091
|
-
this.focusedElement = this.getLastItem(this.focusedElement.parentElement);
|
|
2092
|
-
break;
|
|
2093
|
-
case 36: // home
|
|
2094
|
-
this.focusedElement = this.getFirstItem(this.focusedElement.parentElement);
|
|
2095
|
-
break;
|
|
2096
|
-
case 37: // left arrow
|
|
2097
|
-
if (this.getChildItem(this.focusedElement).length > 0 && this.focusedElement.open == true) {
|
|
2098
|
-
this.focusedElement.open = false;
|
|
2099
|
-
}
|
|
2100
|
-
else {
|
|
2101
|
-
if (this.getParent(this.focusedElement)) {
|
|
2102
|
-
this.focusedElement = this.getParent(this.focusedElement);
|
|
2103
|
-
}
|
|
2104
|
-
}
|
|
2105
|
-
break;
|
|
2106
|
-
case 38: // up arrow
|
|
2107
|
-
if (this.getPrev(this.focusedElement)) {
|
|
2108
|
-
this.focusedElement = this.getPrev(this.focusedElement);
|
|
2109
|
-
if (this.getChildItem(this.focusedElement).length > 0 && this.focusedElement.open == true) {
|
|
2110
|
-
this.focusedElement = this.getLastItem(this.focusedElement);
|
|
2111
|
-
}
|
|
2112
|
-
}
|
|
2113
|
-
else if (this.getParent(this.focusedElement)) {
|
|
2114
|
-
this.focusedElement = this.getParent(this.focusedElement);
|
|
2115
|
-
}
|
|
2116
|
-
break;
|
|
2117
|
-
case 39: // right arrow
|
|
2118
|
-
if (this.getChildItem(this.focusedElement).length > 0) {
|
|
2119
|
-
if (this.focusedElement.open == true) {
|
|
2120
|
-
this.focusedElement = this.getFirstItem(this.focusedElement);
|
|
2121
|
-
}
|
|
2122
|
-
else {
|
|
2123
|
-
this.focusedElement.open = true;
|
|
2124
|
-
}
|
|
2125
|
-
}
|
|
2126
|
-
break;
|
|
2127
|
-
case 40: // down arrow
|
|
2128
|
-
if (this.getChildItem(this.focusedElement).length > 0 && this.focusedElement.open == true) {
|
|
2129
|
-
this.focusedElement = this.getFirstItem(this.focusedElement);
|
|
2130
|
-
}
|
|
2131
|
-
else if (this.getNext(this.focusedElement)) {
|
|
2132
|
-
this.focusedElement = this.getNext(this.focusedElement);
|
|
2133
|
-
}
|
|
2134
|
-
else if (this.getNextParent(this.focusedElement)) {
|
|
2135
|
-
this.focusedElement = this.getNextParent(this.focusedElement);
|
|
2136
|
-
}
|
|
2137
|
-
break;
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
if (this.focusedElement)
|
|
2142
|
-
this.focusedElement.focused = true;
|
|
2143
|
-
}
|
|
2144
|
-
}
|
|
2145
|
-
}
|
|
2146
|
-
handleFocus(focusEvent = false) {
|
|
2147
|
-
this.onFocus = focusEvent;
|
|
2148
|
-
}
|
|
2149
|
-
render() {
|
|
2150
|
-
const { searchOnlyChild, searchPlaceholder, search, checkCount, searchData, searchFields, searchSub, returnField, total, fullWidth, infoFooter, showSearch } = this;
|
|
2151
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, {
|
|
2152
|
-
'empty': this.empty,
|
|
2153
|
-
'full-width': fullWidth
|
|
2154
|
-
});
|
|
2155
|
-
const customStyles = {
|
|
2156
|
-
// 'min-height': this.minHeight + 'px',
|
|
2157
|
-
'min-width': this.minWidth + 'px',
|
|
2158
|
-
'max-height': this.maxHeight
|
|
2159
|
-
};
|
|
2160
|
-
return (index.h(index.Host, { class: hostClasses, style: customStyles }, search && (index.h("div", { class: "search", style: { 'display': String(showSearch) == 'false' ? 'none' : 'block' } }, index.h("bcm-old-search", { onlyChild: searchOnlyChild, searchPlaceholder: searchPlaceholder, "on-bcm-focus": () => this.handleFocus(true), "on-bcm-blur": () => this.handleFocus(false), data: searchData, returnField: returnField, searchFields: searchFields, searchSub: searchSub, clearable: true }), index.h("bcm-divider", null))), index.h("div", { id: "treeview", class: "treeview loading" },
|
|
2161
|
-
// this.loading && (
|
|
2162
|
-
index.h("div", { id: "loading", class: "loading show" }, index.h("bcm-icon", { class: "prefix", icon: "far fa-spinner-third fa-spin" }))
|
|
2163
|
-
// )
|
|
2164
|
-
,
|
|
2165
|
-
// this.empty && (
|
|
2166
|
-
index.h("div", { id: "empty", class: "empty" }, index.h("bcm-empty", null, "No Data"))
|
|
2167
|
-
// )
|
|
2168
|
-
, !this.empty && this.items.length !== 0 && this.items.map((item) => (this.recursiveItemRenderer(item, null)))), infoFooter == true && (index.h("footer", null, index.h("bcm-text", { scale: "size-1", color: "grey-8" }, checkCount > 0 && ('( ' + checkCount + ' items selected ) '), "Total ", index.h("span", { id: "in-search" }), " ", index.h("span", { id: "in-total" }, total), " items found.")))));
|
|
2169
|
-
}
|
|
2170
|
-
get el() { return index.getElement(this); }
|
|
2171
|
-
static get watchers() { return {
|
|
2172
|
-
"_items": ["parseItems"]
|
|
2173
|
-
}; }
|
|
2174
|
-
};
|
|
2175
|
-
Bcmtreeview.style = treeviewCss;
|
|
2176
|
-
|
|
2177
|
-
const treeviewItemCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:host(.hidden){display:none}.treeview-item{display:flex;align-items:stretch;justify-content:flex-start;color:var(--bcm-color-grey-8);padding-left:8px;user-select:none;background-color:var(--bcm-color-grey-1)}.treeview-item-context-menu{display:none;position:absolute;height:auto;background-color:#ffffff;align-items:center;justify-content:center;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25)}.treeview-item-context-menu.show{display:flex}.treeview-item-context-menu span{text-align:left;min-width:100px;padding:5px 8px;font-size:14px;line-height:22px;color:var(--bcm-color-grey-8)}.treeview-item-context-menu span:hover{cursor:pointer;color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.treeview-item.focus .treeview-item-container{border:2px solid var(--bcm-color-prime-blue-2)}.treeview-item-container{width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.treeview-item-container.disabled{color:var(--bcm-color-grey-6)}.treeview-item-container.disabled .text-content{cursor:not-allowed}.treeview-item-container.selected:not(.disabled){color:var(--bcm-color-prime-blue-6)}.treeview-item-container.selected:not(.disabled):hover:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.treeview-item-container:hover:not(.disabled),.treeview-item-container:active:not(.disabled){color:var(--bcm-color-prime-blue-6);background-color:var(--bcm-color-prime-blue-1)}.treeview-item-container>section:not(.favicon){display:flex;align-items:stretch;justify-content:flex-start;border:2px solid transparent;flex:1}.treeview-item-container>section.favicon{display:flex;align-items:center;justify-content:center;padding:0 5px;height:100%;cursor:pointer}.treeview-item-container>section.favicon:not(.favorite){display:none}.treeview-item-container:hover:not(.disabled) .favicon{display:flex}.treeview-inner{display:none}.treeview-inner.open{display:block}.collapse-content{display:flex;align-items:center;justify-content:center;width:16px;min-width:16px}.collapse-content.child{cursor:pointer}.check-content{display:flex;align-items:center;justify-content:flex-start;width:24px;min-width:24px;padding-left:8px}.check-content .indeterminate{width:16px;height:16px;position:relative;display:block;padding-right:8px;cursor:pointer}.check-content .indeterminate:after{content:\"\";position:absolute;top:50%;left:9px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}.check-content .indeterminate:before{content:\"\";position:absolute;top:-1px;left:0px;width:16px;height:100%;border-radius:2px;background-color:transparent;border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:2}.check-content .indeterminate:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}.check-content .indeterminate.disabled{cursor:not-allowed;background:linear-gradient(90deg, var(--bcm-color-grey-3) 18px, transparent 0px);border-color:var(--bcm-color-grey-3)}.check-content .indeterminate.disabled:after{background-color:var(--bcm-color-grey-6)}.check-content .indeterminate.disabled bcm-icon{filter:brightness(0);opacity:0.3}.text-content{display:flex;align-items:center;justify-content:space-between;cursor:pointer;width:100%;flex:1}.text-content .favicon{display:flex;flex-direction:row;align-items:center;grid-gap:4px}.text-content #text .highlight{background-color:var(--bcm-color-yellow-5)}.text-content.small{padding:0 8px 0 4px}.text-content.medium{padding:4px 8px 4px 4px}.text-content.large{padding:8px 8px 8px 4px}.text-content .icon{text-align:center;margin-right:8px}";
|
|
2178
|
-
|
|
2179
|
-
const BcmtreeviewItem = class {
|
|
2180
|
-
constructor(hostRef) {
|
|
2181
|
-
index.registerInstance(this, hostRef);
|
|
2182
|
-
this.treeviewItemSelected = index.createEvent(this, "bcm-treeview-item-selected", 7);
|
|
2183
|
-
this.treeviewUnchecked = index.createEvent(this, "bcm-treeview-unchecked", 7);
|
|
2184
|
-
this.treeviewChecked = index.createEvent(this, "bcm-treeview-checked", 7);
|
|
2185
|
-
this.treeviewChange = index.createEvent(this, "bcm-treeview-change", 7);
|
|
2186
|
-
this.treeviewIndeterminateUnchecked = index.createEvent(this, "bcm-treeview-indeterminate-unchecked", 7);
|
|
2187
|
-
this.treeviewIndeterminateChecked = index.createEvent(this, "bcm-treeview-indeterminate-checked", 7);
|
|
2188
|
-
this.itemChecked = index.createEvent(this, "bcm-treeview-check-item-checked", 7);
|
|
2189
|
-
this.itemUnchecked = index.createEvent(this, "bcm-treeview-check-item-unchecked", 7);
|
|
2190
|
-
this.groupCheck = index.createEvent(this, "bcm-treeview-check-group-check", 7);
|
|
2191
|
-
this.favoriteStatus = index.createEvent(this, "bcm-favorite-status", 7);
|
|
2192
|
-
this.firstRun = true;
|
|
2193
|
-
this.items = undefined;
|
|
2194
|
-
this.itemObject = undefined;
|
|
2195
|
-
this.text = undefined;
|
|
2196
|
-
this.tooltipText = undefined;
|
|
2197
|
-
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
2198
|
-
this.parentId = undefined;
|
|
2199
|
-
this.hasChild = false;
|
|
2200
|
-
this.size = 'medium';
|
|
2201
|
-
this.icon = 'bug';
|
|
2202
|
-
this.open = false;
|
|
2203
|
-
this.selected = false;
|
|
2204
|
-
this.checkboxes = false;
|
|
2205
|
-
this.showIcon = false;
|
|
2206
|
-
this.favicon = false;
|
|
2207
|
-
this.favorite = false;
|
|
2208
|
-
this.checked = false;
|
|
2209
|
-
this.checkTrigger = false;
|
|
2210
|
-
this.focused = false;
|
|
2211
|
-
this.disabled = false;
|
|
2212
|
-
this.contextMenuShow = false;
|
|
2213
|
-
this._contextMenu = [];
|
|
2214
|
-
this.indeterminateState = 'uncheck';
|
|
2215
|
-
this._internal_id = "";
|
|
2216
|
-
this.menuPadding = 0;
|
|
2217
|
-
this.childLength = 0;
|
|
2218
|
-
this.indeterminate = false;
|
|
2219
|
-
this.hidden = false;
|
|
2220
|
-
this.contextMenu = [];
|
|
2221
|
-
this.contextOffsetLeft = 0;
|
|
2222
|
-
this.contextOffsetTop = 0;
|
|
2223
|
-
}
|
|
2224
|
-
/**
|
|
2225
|
-
* @ComponentMethod
|
|
2226
|
-
*/
|
|
2227
|
-
componentWillLoad() {
|
|
2228
|
-
this.menuPadding = 24;
|
|
2229
|
-
this.childLength = this.el.children.length;
|
|
2230
|
-
this.parseItems(this._contextMenu);
|
|
2231
|
-
}
|
|
2232
|
-
/**
|
|
2233
|
-
* @ComponentMethod
|
|
2234
|
-
*/
|
|
2235
|
-
componentDidLoad() {
|
|
2236
|
-
// if (!this.disabled){
|
|
2237
|
-
// // if (this.selected) this.treeviewItemSelected.emit(this.itemObject)
|
|
2238
|
-
// if (this.checked){
|
|
2239
|
-
// // this.treeviewChecked.emit(this._id)
|
|
2240
|
-
// this.handleCheckMouseUp()
|
|
2241
|
-
// }
|
|
2242
|
-
// }
|
|
2243
|
-
if (!this.disabled && this.firstRun && this.checkTrigger) {
|
|
2244
|
-
this.firstRun = false;
|
|
2245
|
-
this.handleCheckMouseUp();
|
|
2246
|
-
}
|
|
2247
|
-
}
|
|
2248
|
-
/**
|
|
2249
|
-
* @desc
|
|
2250
|
-
* @returns {void}
|
|
2251
|
-
*/
|
|
2252
|
-
/* setIndeterminateState() {
|
|
2253
|
-
if(this.getAllChilds().length > 0) {
|
|
2254
|
-
|
|
2255
|
-
let state: string = 'uncheck'
|
|
2256
|
-
let allChecked: boolean = true
|
|
2257
|
-
let allUnchecked: boolean = true
|
|
2258
|
-
|
|
2259
|
-
this.getAllChilds().map((item) => {
|
|
2260
|
-
item.checked && (allUnchecked = false)
|
|
2261
|
-
!item.checked && (allChecked = false)
|
|
2262
|
-
});
|
|
2263
|
-
|
|
2264
|
-
!allChecked && !allUnchecked
|
|
2265
|
-
? state = 'indeterminate'
|
|
2266
|
-
: allChecked
|
|
2267
|
-
? state = 'determinate'
|
|
2268
|
-
: state = 'uncheck'
|
|
2269
|
-
|
|
2270
|
-
this.indeterminateState = state as any;
|
|
2271
|
-
|
|
2272
|
-
}
|
|
2273
|
-
} */
|
|
2274
|
-
/* @Watch('indeterminateState')
|
|
2275
|
-
onCheckedChange() {
|
|
2276
|
-
if (this.indeterminateState == 'determinate') {
|
|
2277
|
-
this.treeviewChecked.emit(this._id)
|
|
2278
|
-
}else if (this.indeterminateState == 'uncheck') {
|
|
2279
|
-
this.treeviewIndeterminateUnchecked.emit(this._id)
|
|
2280
|
-
this.checked = false
|
|
2281
|
-
}else{
|
|
2282
|
-
this.treeviewIndeterminateUnchecked.emit(this._id)
|
|
2283
|
-
this.checked = false
|
|
2284
|
-
}
|
|
2285
|
-
} */
|
|
2286
|
-
/**
|
|
2287
|
-
* @descc
|
|
2288
|
-
* @param event
|
|
2289
|
-
*/
|
|
2290
|
-
handletreeviewClearSelecteds(event) {
|
|
2291
|
-
if (!this.disabled) {
|
|
2292
|
-
if (event.detail && event.detail !== this.itemObject)
|
|
2293
|
-
this.selected = false;
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
/**
|
|
2297
|
-
* @descc
|
|
2298
|
-
* @param event
|
|
2299
|
-
*/
|
|
2300
|
-
ListentreeviewChange() {
|
|
2301
|
-
//this.setIndeterminateState();
|
|
2302
|
-
}
|
|
2303
|
-
/**
|
|
2304
|
-
* @descc
|
|
2305
|
-
* @param event
|
|
2306
|
-
*/
|
|
2307
|
-
ListentreeviewShowContext(event) {
|
|
2308
|
-
this.contextOffsetTop = event.detail[1];
|
|
2309
|
-
this.contextOffsetLeft = event.detail[2];
|
|
2310
|
-
if (event.detail[0] && event.detail[0] === this._id) {
|
|
2311
|
-
this.contextMenuShow = true;
|
|
2312
|
-
}
|
|
2313
|
-
else {
|
|
2314
|
-
this.contextMenuShow = false;
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
/**
|
|
2318
|
-
* @desc
|
|
2319
|
-
* @param event
|
|
2320
|
-
*/
|
|
2321
|
-
handleWindowClick(event) {
|
|
2322
|
-
const target = event.target;
|
|
2323
|
-
if (target === this.el)
|
|
2324
|
-
return;
|
|
2325
|
-
this.contextMenuShow = false;
|
|
2326
|
-
}
|
|
2327
|
-
/**
|
|
2328
|
-
* @desc
|
|
2329
|
-
*/
|
|
2330
|
-
handleClick() {
|
|
2331
|
-
if (!this.disabled) {
|
|
2332
|
-
this.selected = true;
|
|
2333
|
-
this.treeviewItemSelected.emit(this.itemObject);
|
|
2334
|
-
}
|
|
2335
|
-
}
|
|
2336
|
-
/**
|
|
2337
|
-
* @desc
|
|
2338
|
-
*/
|
|
2339
|
-
handleFavClick(e) {
|
|
2340
|
-
if (!this.disabled) {
|
|
2341
|
-
this.favorite = !this.favorite;
|
|
2342
|
-
if (!this.itemObject["rightSlot"]) {
|
|
2343
|
-
this.itemObject["rightSlot"] = {};
|
|
2344
|
-
}
|
|
2345
|
-
this.itemObject["rightSlot"]["favorite"] = this.favorite;
|
|
2346
|
-
this.favoriteStatus.emit(this.itemObject);
|
|
2347
|
-
e.stopPropagation();
|
|
2348
|
-
e.preventDefault();
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
/**
|
|
2352
|
-
* @desc
|
|
2353
|
-
*/
|
|
2354
|
-
handleOpen() {
|
|
2355
|
-
this.open = !this.open;
|
|
2356
|
-
}
|
|
2357
|
-
getRootChilds(element = this.el) {
|
|
2358
|
-
return utils.getChilds(element, 'bcm-treeview-item');
|
|
2359
|
-
}
|
|
2360
|
-
getAllChilds(element = this.el) {
|
|
2361
|
-
let returnAllItems = [];
|
|
2362
|
-
utils.getChilds(element, 'bcm-treeview-item').forEach(items => {
|
|
2363
|
-
this.getAllChilds(items) && (returnAllItems = [...returnAllItems, ...this.getAllChilds(items)]);
|
|
2364
|
-
returnAllItems = [...returnAllItems,
|
|
2365
|
-
items
|
|
2366
|
-
];
|
|
2367
|
-
});
|
|
2368
|
-
return returnAllItems;
|
|
2369
|
-
}
|
|
2370
|
-
/**
|
|
2371
|
-
* @desc
|
|
2372
|
-
* -
|
|
2373
|
-
*/
|
|
2374
|
-
checkGroupState() {
|
|
2375
|
-
// debugger;
|
|
2376
|
-
const childsRoot = this.getRootChilds();
|
|
2377
|
-
let [state, allChecked, allUnchecked] = ['uncheck', true, true];
|
|
2378
|
-
if (childsRoot.length > 0) {
|
|
2379
|
-
childsRoot.forEach(checkbox => {
|
|
2380
|
-
(checkbox.checked || checkbox.indeterminateState === 'indeterminate') && (allUnchecked = false);
|
|
2381
|
-
!checkbox.checked && (allChecked = false);
|
|
2382
|
-
});
|
|
2383
|
-
!allChecked && !allUnchecked
|
|
2384
|
-
? state = 'indeterminate'
|
|
2385
|
-
: allChecked
|
|
2386
|
-
? state = 'determinate'
|
|
2387
|
-
: state = 'uncheck';
|
|
2388
|
-
this.indeterminateState = state;
|
|
2389
|
-
if (state === 'determinate') {
|
|
2390
|
-
this.checked = true;
|
|
2391
|
-
// if(this.checked) {
|
|
2392
|
-
this.treeviewChecked.emit(this._id);
|
|
2393
|
-
// }
|
|
2394
|
-
}
|
|
2395
|
-
else {
|
|
2396
|
-
this.checked = false;
|
|
2397
|
-
this.treeviewUnchecked.emit(this._id);
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
|
-
else {
|
|
2401
|
-
if (this.checked) {
|
|
2402
|
-
this.checked = false;
|
|
2403
|
-
this.treeviewUnchecked.emit(this._id);
|
|
2404
|
-
}
|
|
2405
|
-
else {
|
|
2406
|
-
this.checked = true;
|
|
2407
|
-
this.treeviewChecked.emit(this._id);
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
/**
|
|
2412
|
-
* @Event
|
|
2413
|
-
* @desc
|
|
2414
|
-
* -
|
|
2415
|
-
*/
|
|
2416
|
-
handleCheckMouseUp() {
|
|
2417
|
-
const checked = this.checked;
|
|
2418
|
-
const state = this.indeterminateState;
|
|
2419
|
-
if (!this.hasChild) {
|
|
2420
|
-
!checked
|
|
2421
|
-
? this.checked = true
|
|
2422
|
-
: this.checked = false;
|
|
2423
|
-
if (this.checked) {
|
|
2424
|
-
this.treeviewChecked.emit(this._id);
|
|
2425
|
-
}
|
|
2426
|
-
else {
|
|
2427
|
-
this.treeviewUnchecked.emit(this._id);
|
|
2428
|
-
}
|
|
2429
|
-
this.groupCheck.emit(this.parentId);
|
|
2430
|
-
return;
|
|
2431
|
-
}
|
|
2432
|
-
const childs = this.getAllChilds();
|
|
2433
|
-
if (state === 'indeterminate' || state === 'uncheck') {
|
|
2434
|
-
childs.forEach(child => {
|
|
2435
|
-
child.checked = true;
|
|
2436
|
-
// if(this.checked) {
|
|
2437
|
-
this.treeviewChecked.emit(child._id);
|
|
2438
|
-
// }
|
|
2439
|
-
child.indeterminateState = 'determined';
|
|
2440
|
-
});
|
|
2441
|
-
}
|
|
2442
|
-
else {
|
|
2443
|
-
childs.forEach(child => {
|
|
2444
|
-
child.checked = false;
|
|
2445
|
-
this.treeviewUnchecked.emit(child._id);
|
|
2446
|
-
child.indeterminateState = 'uncheck';
|
|
2447
|
-
});
|
|
2448
|
-
}
|
|
2449
|
-
this.checkGroupState();
|
|
2450
|
-
this.groupCheck.emit(this.parentId);
|
|
2451
|
-
}
|
|
2452
|
-
checkGroup(e) {
|
|
2453
|
-
const { detail: groupId } = e;
|
|
2454
|
-
if (!groupId || this._id !== groupId)
|
|
2455
|
-
return;
|
|
2456
|
-
this.checkGroupState();
|
|
2457
|
-
this.groupCheck.emit(this.parentId);
|
|
2458
|
-
}
|
|
2459
|
-
/**
|
|
2460
|
-
* @desc
|
|
2461
|
-
* @param item
|
|
2462
|
-
*/
|
|
2463
|
-
contextItemRenderer(item) {
|
|
2464
|
-
return (index.h("span", null, item.title));
|
|
2465
|
-
}
|
|
2466
|
-
/**
|
|
2467
|
-
* @desc
|
|
2468
|
-
* @param newValue
|
|
2469
|
-
* @returns {void}
|
|
2470
|
-
*/
|
|
2471
|
-
parseItems(newValue) {
|
|
2472
|
-
if (newValue) {
|
|
2473
|
-
typeof newValue == 'string'
|
|
2474
|
-
? this.contextMenu = JSON.parse(newValue)
|
|
2475
|
-
: this.contextMenu = newValue;
|
|
2476
|
-
}
|
|
2477
|
-
}
|
|
2478
|
-
render() {
|
|
2479
|
-
const { _id, text, tooltipText, size, icon, open, childLength, checkboxes, showIcon, checked, indeterminateState, focused, contextMenuShow } = this;
|
|
2480
|
-
const menuPadding = this.menuPadding + 'px';
|
|
2481
|
-
const textContent = index$1.classnames('text-content', size, 'size-2'
|
|
2482
|
-
// {
|
|
2483
|
-
// 'size-2': size === 'small' || size === 'medium',
|
|
2484
|
-
// 'size-3': size === 'large',
|
|
2485
|
-
// }
|
|
2486
|
-
);
|
|
2487
|
-
const classes = index$1.classnames('treeview-item', {
|
|
2488
|
-
'focus': focused,
|
|
2489
|
-
'open': open,
|
|
2490
|
-
'selected': this.selected
|
|
2491
|
-
});
|
|
2492
|
-
const treeviewContextMenu = index$1.classnames('treeview-item-context-menu', {
|
|
2493
|
-
'show': contextMenuShow
|
|
2494
|
-
});
|
|
2495
|
-
const treeviewInner = index$1.classnames('treeview-inner', {
|
|
2496
|
-
'open': open,
|
|
2497
|
-
});
|
|
2498
|
-
const indeterminate = index$1.classnames('indeterminate', {
|
|
2499
|
-
'disabled': this.disabled,
|
|
2500
|
-
});
|
|
2501
|
-
const treeviewItemContainer = index$1.classnames('treeview-item-container', {
|
|
2502
|
-
'selected': this.selected,
|
|
2503
|
-
'disabled': this.disabled
|
|
2504
|
-
});
|
|
2505
|
-
const collapseContent = index$1.classnames('collapse-content', {
|
|
2506
|
-
'child': childLength > 0,
|
|
2507
|
-
});
|
|
2508
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
|
|
2509
|
-
const faviconClass = index$1.classnames("favicon", {
|
|
2510
|
-
"favorite": this.favorite
|
|
2511
|
-
});
|
|
2512
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("div", { class: collapseContent, id: "collapse-button", onClick: () => childLength > 0 && this.handleOpen() }, childLength > 0 && (index.h("bcm-icon", { class: "collapse-icon", icon: `far fa-${open ? 'caret-down' : 'caret-right'}` }))), index.h("div", { class: treeviewItemContainer }, index.h("section", { onMouseUp: () => this.handleCheckMouseUp() }, checkboxes && (index.h("div", { class: "check-content" }, indeterminateState == 'indeterminate' && (index.h("span", { class: indeterminate })) || (index.h("bcm-checkbox", { id: 'check-' + _id, name: 'check-' + _id, checked: checked, disabled: this.disabled, noCaption: true })))), index.h("div", { class: textContent, onClick: () => this.handleClick(), title: tooltipText }, showIcon && icon && (index.h("bcm-icon", { class: "icon", icon: icon })), index.h("span", { id: "text" }, text))), this.favicon && (index.h("section", { class: faviconClass, onClick: (e) => this.handleFavClick(e) }, index.h("bcm-icon", { title: this.favorite ? "Click to remove from favorite list" : "Click to add to your favourites list", icon: "far fa-star" })))), !checkboxes && (index.h("div", { class: treeviewContextMenu, style: { top: this.contextOffsetTop + 'px', left: this.contextOffsetLeft + 'px' } }, this.contextMenu.length !== 0 && this.contextMenu.map((item) => (this.contextItemRenderer(item)))))), index.h("div", { class: treeviewInner, style: { paddingLeft: menuPadding } }, index.h("slot", null))));
|
|
2513
|
-
}
|
|
2514
|
-
get el() { return index.getElement(this); }
|
|
2515
|
-
static get watchers() { return {
|
|
2516
|
-
"_contextMenu": ["parseItems"]
|
|
2517
|
-
}; }
|
|
2518
|
-
};
|
|
2519
|
-
BcmtreeviewItem.style = treeviewItemCss;
|
|
2520
|
-
|
|
2521
|
-
exports.bcm_checkbox_lite = BcmCheckboxLite;
|
|
2522
|
-
exports.bcm_divider = BcmDivider;
|
|
2523
|
-
exports.bcm_empty = BcmEmpty;
|
|
2524
|
-
exports.bcm_listbox = BcmListbox;
|
|
2525
|
-
exports.bcm_listbox_group = BcmListboxGroup;
|
|
2526
|
-
exports.bcm_listbox_item = BcmListboxItem;
|
|
2527
|
-
exports.bcm_old_search = BcmOldSearch;
|
|
2528
|
-
exports.bcm_treeview = Bcmtreeview;
|
|
2529
|
-
exports.bcm_treeview_item = BcmtreeviewItem;
|