@paperless/core 1.3.0 → 1.3.2
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/CHANGELOG.md +19 -0
- package/dist/{paperless/p-b2bc1d2a.entry.js → build/p-178a9622.entry.js} +2 -2
- package/dist/build/p-178a9622.entry.js.map +1 -0
- package/dist/build/{p-a1c1d95b.entry.js → p-231959ae.entry.js} +2 -2
- package/dist/build/p-231959ae.entry.js.map +1 -0
- package/dist/build/{p-36967a97.entry.js → p-23f19585.entry.js} +2 -2
- package/dist/build/p-23f19585.entry.js.map +1 -0
- package/dist/{paperless/p-6124f388.entry.js → build/p-2db30595.entry.js} +2 -2
- package/dist/build/{p-6124f388.entry.js.map → p-2db30595.entry.js.map} +1 -1
- package/dist/build/{p-ec850aca.entry.js → p-32e40e8a.entry.js} +2 -2
- package/dist/build/p-32e40e8a.entry.js.map +1 -0
- package/dist/{paperless/p-1630e39b.entry.js → build/p-36705eff.entry.js} +2 -2
- package/dist/{paperless/p-b92dd098.entry.js → build/p-3774ce4c.entry.js} +2 -2
- package/dist/build/p-3774ce4c.entry.js.map +1 -0
- package/dist/{paperless/p-6d5aa646.entry.js → build/p-6a30c500.entry.js} +2 -2
- package/dist/build/{p-6d5aa646.entry.js.map → p-6a30c500.entry.js.map} +1 -1
- package/dist/build/{p-12171df4.entry.js → p-6cb21186.entry.js} +2 -2
- package/dist/build/p-6cb21186.entry.js.map +1 -0
- package/dist/{paperless/p-b9f742e0.entry.js → build/p-7caa2463.entry.js} +2 -2
- package/dist/build/{p-b9f742e0.entry.js.map → p-7caa2463.entry.js.map} +1 -1
- package/dist/{paperless/p-26da620b.entry.js → build/p-89dd1b98.entry.js} +2 -2
- package/dist/build/p-89dd1b98.entry.js.map +1 -0
- package/dist/{paperless/p-350d452b.entry.js → build/p-bd08b944.entry.js} +2 -2
- package/dist/build/{p-350d452b.entry.js.map → p-bd08b944.entry.js.map} +1 -1
- package/dist/build/p-c6be1eab.entry.js +2 -0
- package/dist/build/p-c6be1eab.entry.js.map +1 -0
- package/dist/{paperless/p-18c0dd17.entry.js → build/p-dbadeb2a.entry.js} +2 -2
- package/dist/build/{p-946286e2.entry.js → p-e28c262e.entry.js} +2 -2
- package/dist/build/{p-946286e2.entry.js.map → p-e28c262e.entry.js.map} +1 -1
- package/dist/build/{p-da6e5abd.entry.js → p-e3143372.entry.js} +2 -2
- package/dist/build/p-e3143372.entry.js.map +1 -0
- package/dist/{paperless/p-2a668e75.entry.js → build/p-e5023a73.entry.js} +2 -2
- package/dist/build/p-e5023a73.entry.js.map +1 -0
- package/dist/build/{p-1f55126f.entry.js → p-e508900b.entry.js} +2 -2
- package/dist/build/{p-1f55126f.entry.js.map → p-e508900b.entry.js.map} +1 -1
- package/dist/build/{p-b0398d3b.entry.js → p-e6b0dbdc.entry.js} +2 -2
- package/dist/build/p-e6b0dbdc.entry.js.map +1 -0
- package/dist/{paperless/p-3d8b2178.entry.js → build/p-f8aa1cac.entry.js} +2 -2
- package/dist/build/p-f8aa1cac.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/p-accordion.cjs.entry.js +1 -1
- package/dist/cjs/p-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/p-attachment.cjs.entry.js +2 -2
- package/dist/cjs/p-attachment.cjs.entry.js.map +1 -1
- package/dist/cjs/p-backdrop.cjs.entry.js +1 -1
- package/dist/cjs/p-backdrop.cjs.entry.js.map +1 -1
- package/dist/cjs/p-button_3.cjs.entry.js +3 -3
- package/dist/cjs/p-button_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-calendar.cjs.entry.js +1 -1
- package/dist/cjs/p-calendar.cjs.entry.js.map +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js +1 -1
- package/dist/cjs/p-datepicker.cjs.entry.js.map +1 -1
- package/dist/cjs/p-drawer-body_3.cjs.entry.js +1 -1
- package/dist/cjs/p-drawer-body_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-drawer.cjs.entry.js +2 -2
- package/dist/cjs/p-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +1 -1
- package/dist/cjs/p-dropdown_2.cjs.entry.js +3 -3
- package/dist/cjs/p-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-helper_3.cjs.entry.js +2 -2
- package/dist/cjs/p-illustration_6.cjs.entry.js +44 -8
- package/dist/cjs/p-illustration_6.cjs.entry.js.map +1 -1
- package/dist/cjs/p-layout.cjs.entry.js +1 -1
- package/dist/cjs/p-layout.cjs.entry.js.map +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js +1 -1
- package/dist/cjs/p-modal-body_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-modal.cjs.entry.js +2 -2
- package/dist/cjs/p-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/p-page-size-select_3.cjs.entry.js +2 -2
- package/dist/cjs/p-page-size-select_3.cjs.entry.js.map +1 -1
- package/dist/cjs/p-select.cjs.entry.js +3 -3
- package/dist/cjs/p-select.cjs.entry.js.map +1 -1
- package/dist/cjs/p-table.cjs.entry.js +13 -13
- package/dist/cjs/p-table.cjs.entry.js.map +1 -1
- package/dist/cjs/p-toast.cjs.entry.js +1 -1
- package/dist/cjs/p-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/p-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/p-tooltip.cjs.entry.js.map +1 -1
- package/dist/collection/components/atoms/backdrop/backdrop.component.js +2 -2
- package/dist/collection/components/atoms/backdrop/backdrop.component.js.map +1 -1
- package/dist/collection/components/atoms/button/button.component.js +2 -2
- package/dist/collection/components/atoms/button/button.component.js.map +1 -1
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.js +1 -1
- package/dist/collection/components/atoms/drawer-header/drawer-header.component.js.map +1 -1
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -1
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -1
- package/dist/collection/components/atoms/helper/helper.component.css +1 -1
- package/dist/collection/components/atoms/icon/icon.component.css +1 -1
- package/dist/collection/components/atoms/layout/layout.component.css +1 -1
- package/dist/collection/components/atoms/layout/layout.component.js +2 -2
- package/dist/collection/components/atoms/layout/layout.component.js.map +1 -1
- package/dist/collection/components/atoms/loader/loader.component.css +1 -1
- package/dist/collection/components/atoms/modal-header/modal-header.component.js +1 -1
- package/dist/collection/components/atoms/modal-header/modal-header.component.js.map +1 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +3 -3
- package/dist/collection/components/atoms/tooltip/tooltip.component.js.map +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.js +1 -1
- package/dist/collection/components/molecules/accordion/accordion.component.js.map +1 -1
- package/dist/collection/components/molecules/attachment/attachment.component.js +2 -2
- package/dist/collection/components/molecules/attachment/attachment.component.js.map +1 -1
- package/dist/collection/components/molecules/calendar/calendar.component.js +3 -3
- package/dist/collection/components/molecules/calendar/calendar.component.js.map +1 -1
- package/dist/collection/components/molecules/datepicker/datepicker.component.js +3 -3
- package/dist/collection/components/molecules/datepicker/datepicker.component.js.map +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +3 -3
- package/dist/collection/components/molecules/dropdown/dropdown.component.js.map +1 -1
- package/dist/collection/components/molecules/input-group/input-group.component.css +1 -1
- package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +3 -3
- package/dist/collection/components/molecules/page-size-select/page-size-select.component.js.map +1 -1
- package/dist/collection/components/molecules/pagination/pagination.component.js +2 -2
- package/dist/collection/components/molecules/pagination/pagination.component.js.map +1 -1
- package/dist/collection/components/molecules/select/select.component.js +4 -4
- package/dist/collection/components/molecules/select/select.component.js.map +1 -1
- package/dist/collection/components/molecules/table-footer/table-footer.component.js +5 -5
- package/dist/collection/components/molecules/table-footer/table-footer.component.js.map +1 -1
- package/dist/collection/components/molecules/table-header/table-header.component.js +8 -8
- package/dist/collection/components/molecules/table-header/table-header.component.js.map +1 -1
- package/dist/collection/components/molecules/toast/toast.component.js +1 -1
- package/dist/collection/components/molecules/toast/toast.component.js.map +1 -1
- package/dist/collection/components/organisms/drawer/drawer.component.js +3 -3
- package/dist/collection/components/organisms/drawer/drawer.component.js.map +1 -1
- package/dist/collection/components/organisms/modal/modal.component.js +2 -2
- package/dist/collection/components/organisms/modal/modal.component.js.map +1 -1
- package/dist/collection/components/organisms/table/table.component.js +15 -15
- package/dist/collection/components/organisms/table/table.component.js.map +1 -1
- package/dist/collection/tailwind/width.js +1 -2
- package/dist/components/backdrop.component.js +1 -1
- package/dist/components/backdrop.component.js.map +1 -1
- package/dist/components/button.component.js +1 -1
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/calendar.component.js +1 -1
- package/dist/components/calendar.component.js.map +1 -1
- package/dist/components/drawer-header.component.js +1 -1
- package/dist/components/drawer-header.component.js.map +1 -1
- package/dist/components/dropdown-menu-container.component.js +1 -1
- package/dist/components/dropdown-menu-item.component.js +1 -1
- package/dist/components/dropdown.component.js +2 -2
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/helper.component.js +1 -1
- package/dist/components/icon.component.js +1 -1
- package/dist/components/input-group.component.js +1 -1
- package/dist/components/loader.component.js +1 -1
- package/dist/components/modal-header.component.js +1 -1
- package/dist/components/modal-header.component.js.map +1 -1
- package/dist/components/p-accordion.js +1 -1
- package/dist/components/p-accordion.js.map +1 -1
- package/dist/components/p-attachment.js +2 -2
- package/dist/components/p-attachment.js.map +1 -1
- package/dist/components/p-datepicker.js +1 -1
- package/dist/components/p-datepicker.js.map +1 -1
- package/dist/components/p-drawer.js +2 -2
- package/dist/components/p-drawer.js.map +1 -1
- package/dist/components/p-layout.js +1 -1
- package/dist/components/p-layout.js.map +1 -1
- package/dist/components/p-modal.js +2 -2
- package/dist/components/p-modal.js.map +1 -1
- package/dist/components/p-select.js +3 -3
- package/dist/components/p-select.js.map +1 -1
- package/dist/components/p-table.js +13 -13
- package/dist/components/p-table.js.map +1 -1
- package/dist/components/p-toast.js +1 -1
- package/dist/components/p-toast.js.map +1 -1
- package/dist/components/page-size-select.component.js +1 -1
- package/dist/components/page-size-select.component.js.map +1 -1
- package/dist/components/pagination.component.js +1 -1
- package/dist/components/pagination.component.js.map +1 -1
- package/dist/components/table-footer.component.js +3 -3
- package/dist/components/table-footer.component.js.map +1 -1
- package/dist/components/table-header.component.js +41 -5
- package/dist/components/table-header.component.js.map +1 -1
- package/dist/components/tooltip.component.js +2 -2
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/esm/p-accordion.entry.js +1 -1
- package/dist/esm/p-accordion.entry.js.map +1 -1
- package/dist/esm/p-attachment.entry.js +2 -2
- package/dist/esm/p-attachment.entry.js.map +1 -1
- package/dist/esm/p-backdrop.entry.js +1 -1
- package/dist/esm/p-backdrop.entry.js.map +1 -1
- package/dist/esm/p-button_3.entry.js +3 -3
- package/dist/esm/p-button_3.entry.js.map +1 -1
- package/dist/esm/p-calendar.entry.js +1 -1
- package/dist/esm/p-calendar.entry.js.map +1 -1
- package/dist/esm/p-datepicker.entry.js +1 -1
- package/dist/esm/p-datepicker.entry.js.map +1 -1
- package/dist/esm/p-drawer-body_3.entry.js +1 -1
- package/dist/esm/p-drawer-body_3.entry.js.map +1 -1
- package/dist/esm/p-drawer.entry.js +2 -2
- package/dist/esm/p-drawer.entry.js.map +1 -1
- package/dist/esm/p-dropdown-menu-container.entry.js +1 -1
- package/dist/esm/p-dropdown_2.entry.js +3 -3
- package/dist/esm/p-dropdown_2.entry.js.map +1 -1
- package/dist/esm/p-helper_3.entry.js +2 -2
- package/dist/esm/p-illustration_6.entry.js +44 -8
- package/dist/esm/p-illustration_6.entry.js.map +1 -1
- package/dist/esm/p-layout.entry.js +1 -1
- package/dist/esm/p-layout.entry.js.map +1 -1
- package/dist/esm/p-modal-body_4.entry.js +1 -1
- package/dist/esm/p-modal-body_4.entry.js.map +1 -1
- package/dist/esm/p-modal.entry.js +2 -2
- package/dist/esm/p-modal.entry.js.map +1 -1
- package/dist/esm/p-page-size-select_3.entry.js +2 -2
- package/dist/esm/p-page-size-select_3.entry.js.map +1 -1
- package/dist/esm/p-select.entry.js +3 -3
- package/dist/esm/p-select.entry.js.map +1 -1
- package/dist/esm/p-table.entry.js +13 -13
- package/dist/esm/p-table.entry.js.map +1 -1
- package/dist/esm/p-toast.entry.js +1 -1
- package/dist/esm/p-toast.entry.js.map +1 -1
- package/dist/esm/p-tooltip.entry.js +2 -2
- package/dist/esm/p-tooltip.entry.js.map +1 -1
- package/dist/index.html +1 -1
- package/dist/{build/p-b2bc1d2a.entry.js → paperless/p-178a9622.entry.js} +2 -2
- package/dist/paperless/p-178a9622.entry.js.map +1 -0
- package/dist/paperless/{p-a1c1d95b.entry.js → p-231959ae.entry.js} +2 -2
- package/dist/paperless/p-231959ae.entry.js.map +1 -0
- package/dist/paperless/{p-36967a97.entry.js → p-23f19585.entry.js} +2 -2
- package/dist/paperless/p-23f19585.entry.js.map +1 -0
- package/dist/{build/p-6124f388.entry.js → paperless/p-2db30595.entry.js} +2 -2
- package/dist/paperless/{p-6124f388.entry.js.map → p-2db30595.entry.js.map} +1 -1
- package/dist/paperless/{p-ec850aca.entry.js → p-32e40e8a.entry.js} +2 -2
- package/dist/paperless/p-32e40e8a.entry.js.map +1 -0
- package/dist/{build/p-1630e39b.entry.js → paperless/p-36705eff.entry.js} +2 -2
- package/dist/{build/p-b92dd098.entry.js → paperless/p-3774ce4c.entry.js} +2 -2
- package/dist/paperless/p-3774ce4c.entry.js.map +1 -0
- package/dist/{build/p-6d5aa646.entry.js → paperless/p-6a30c500.entry.js} +2 -2
- package/dist/paperless/{p-6d5aa646.entry.js.map → p-6a30c500.entry.js.map} +1 -1
- package/dist/paperless/{p-12171df4.entry.js → p-6cb21186.entry.js} +2 -2
- package/dist/paperless/p-6cb21186.entry.js.map +1 -0
- package/dist/{build/p-b9f742e0.entry.js → paperless/p-7caa2463.entry.js} +2 -2
- package/dist/paperless/{p-b9f742e0.entry.js.map → p-7caa2463.entry.js.map} +1 -1
- package/dist/{build/p-26da620b.entry.js → paperless/p-89dd1b98.entry.js} +2 -2
- package/dist/paperless/p-89dd1b98.entry.js.map +1 -0
- package/dist/{build/p-350d452b.entry.js → paperless/p-bd08b944.entry.js} +2 -2
- package/dist/paperless/{p-350d452b.entry.js.map → p-bd08b944.entry.js.map} +1 -1
- package/dist/paperless/p-c6be1eab.entry.js +2 -0
- package/dist/paperless/p-c6be1eab.entry.js.map +1 -0
- package/dist/{build/p-18c0dd17.entry.js → paperless/p-dbadeb2a.entry.js} +2 -2
- package/dist/paperless/{p-946286e2.entry.js → p-e28c262e.entry.js} +2 -2
- package/dist/paperless/{p-946286e2.entry.js.map → p-e28c262e.entry.js.map} +1 -1
- package/dist/paperless/{p-da6e5abd.entry.js → p-e3143372.entry.js} +2 -2
- package/dist/paperless/p-e3143372.entry.js.map +1 -0
- package/dist/{build/p-2a668e75.entry.js → paperless/p-e5023a73.entry.js} +2 -2
- package/dist/paperless/p-e5023a73.entry.js.map +1 -0
- package/dist/paperless/{p-1f55126f.entry.js → p-e508900b.entry.js} +2 -2
- package/dist/paperless/{p-1f55126f.entry.js.map → p-e508900b.entry.js.map} +1 -1
- package/dist/paperless/{p-b0398d3b.entry.js → p-e6b0dbdc.entry.js} +2 -2
- package/dist/paperless/p-e6b0dbdc.entry.js.map +1 -0
- package/dist/{build/p-3d8b2178.entry.js → paperless/p-f8aa1cac.entry.js} +2 -2
- package/dist/paperless/p-f8aa1cac.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/tailwind/width.js +1 -2
- package/dist/types/components/atoms/layout/layout.component.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/hydrate/index.js +87 -51
- package/package.json +1 -1
- package/dist/build/p-12171df4.entry.js.map +0 -1
- package/dist/build/p-26da620b.entry.js.map +0 -1
- package/dist/build/p-2a668e75.entry.js.map +0 -1
- package/dist/build/p-36967a97.entry.js.map +0 -1
- package/dist/build/p-3d8b2178.entry.js.map +0 -1
- package/dist/build/p-a1c1d95b.entry.js.map +0 -1
- package/dist/build/p-b0398d3b.entry.js.map +0 -1
- package/dist/build/p-b2bc1d2a.entry.js.map +0 -1
- package/dist/build/p-b92dd098.entry.js.map +0 -1
- package/dist/build/p-da6e5abd.entry.js.map +0 -1
- package/dist/build/p-ec850aca.entry.js.map +0 -1
- package/dist/build/p-f47247a6.entry.js +0 -2
- package/dist/build/p-f47247a6.entry.js.map +0 -1
- package/dist/paperless/p-12171df4.entry.js.map +0 -1
- package/dist/paperless/p-26da620b.entry.js.map +0 -1
- package/dist/paperless/p-2a668e75.entry.js.map +0 -1
- package/dist/paperless/p-36967a97.entry.js.map +0 -1
- package/dist/paperless/p-3d8b2178.entry.js.map +0 -1
- package/dist/paperless/p-a1c1d95b.entry.js.map +0 -1
- package/dist/paperless/p-b0398d3b.entry.js.map +0 -1
- package/dist/paperless/p-b2bc1d2a.entry.js.map +0 -1
- package/dist/paperless/p-b92dd098.entry.js.map +0 -1
- package/dist/paperless/p-da6e5abd.entry.js.map +0 -1
- package/dist/paperless/p-ec850aca.entry.js.map +0 -1
- package/dist/paperless/p-f47247a6.entry.js +0 -2
- package/dist/paperless/p-f47247a6.entry.js.map +0 -1
- /package/dist/build/{p-1630e39b.entry.js.map → p-36705eff.entry.js.map} +0 -0
- /package/dist/build/{p-18c0dd17.entry.js.map → p-dbadeb2a.entry.js.map} +0 -0
- /package/dist/paperless/{p-1630e39b.entry.js.map → p-36705eff.entry.js.map} +0 -0
- /package/dist/paperless/{p-18c0dd17.entry.js.map → p-dbadeb2a.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/select.component.tsx"],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Watch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-select',\n styleUrl: 'select.component.scss',\n shadow: false,\n})\nexport class Select {\n /**\n * The items to show in the dropdown\n */\n @Prop() items: string | any[];\n\n /**\n * Icon of the select box\n */\n @Prop() icon: IconVariant;\n\n /**\n * The current query\n */\n @Prop() query: string;\n\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The placeholder of the input when auto completing\n */\n @Prop() autocompletePlaceholder: string;\n\n /**\n * The current value\n */\n @Prop() value: any;\n\n /**\n * The key of the object to display\n */\n @Prop() displayKey: string = 'text';\n\n /**\n * The key of the object to return\n */\n @Prop() valueKey: string;\n\n /**\n * The key to identify an object\n */\n @Prop() identifierKey: string;\n\n /**\n * The key of the object to display\n */\n @Prop() queryKey?: string;\n\n /**\n * Wether to automatically select the first item\n */\n @Prop() autoSelectFirst: boolean = true;\n\n /**\n * Wether to show the chevron or not\n */\n @Prop() showChevron: boolean = true;\n\n /**\n * The maximum amount of items to display\n */\n @Prop() maxDisplayedItems: number = 10;\n\n /**\n * Wether to enable autocomplete\n */\n @Prop() enableAutocomplete: boolean = true;\n\n /**\n * Wether to keep the query or not\n */\n @Prop() keepQuery: boolean = true;\n\n /**\n * Wether the input uses async filtering\n */\n @Prop() asyncFilter: boolean = false;\n\n /**\n * Wether to show loading items\n */\n @Prop() loading: boolean = false;\n\n /**\n * Event when the query of the autocomplete changes\n */\n @Event() queryChange: EventEmitter<string>;\n\n /**\n * Event when the value changes\n */\n @Event() valueChange: EventEmitter<any>;\n\n /**\n * Event when the dropdown shows\n */\n @Event() dropdownShown: EventEmitter<any>;\n\n /**\n * The size of the input group used by the select\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the select\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the select\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop() helper: string;\n\n /**\n * Wether the field is required\n */\n @Prop({ reflect: true }) required: boolean;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the select\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _showDropdown: any = false;\n @State() private _selectedItem: any = null;\n\n @State() private _isAutoCompleting: boolean = false;\n\n get _items() {\n if (!this.items || this.loading) {\n return [];\n }\n\n let items =\n typeof this.items === 'string'\n ? JSON.parse(this.items)\n : this.items;\n\n if (typeof items?.[0] === 'string') {\n this.displayKey = 'text';\n this.valueKey = 'value';\n\n items = items.map((str) => ({\n value: str,\n text: str,\n }));\n }\n\n if (\n this._isAutoCompleting &&\n this.query?.length &&\n this.query !== this._selectedItem?.[this.displayKey] &&\n !this.asyncFilter\n ) {\n items = items.filter((item) => {\n if (this.queryKey) {\n return this._checkvalue(this.queryKey, item);\n }\n\n return (\n this._checkvalue(this._identifierKey, item) ||\n this._checkvalue(this.displayKey, item)\n );\n });\n }\n\n return items?.slice(0, this.maxDisplayedItems);\n }\n\n get _displayValue() {\n if (this._isAutoCompleting) {\n return this.query;\n }\n\n return this._selectedItem?.[this.displayKey];\n }\n\n get _placeholder() {\n return this._isAutoCompleting && this.autocompletePlaceholder?.length\n ? this.autocompletePlaceholder\n : this.placeholder;\n }\n\n get _identifierKey() {\n return this.identifierKey ?? this.valueKey ?? 'value';\n }\n\n componentDidLoad() {\n if (!this.valueKey && !this.identifierKey) {\n throw new Error('You must provide a valueKey or identifierKey');\n }\n\n if (this.value) {\n this._valueChange();\n return;\n }\n\n this.itemChanges();\n }\n\n render() {\n return (\n <Host class=\"p-select\">\n {this._showDropdown && (!!this._items.length || this.loading)}\n {this._isAutoCompleting}\n <p-dropdown\n disableTriggerClick={true}\n calculateWidth={true}\n insideClick={true}\n show={\n this._showDropdown &&\n (!!this._items.length || this.loading)\n }\n >\n <p-input-group\n slot=\"trigger\"\n icon={this.icon}\n size={this.size}\n prefix={this.prefix}\n label={this.label}\n helper={this.helper}\n required={this.required}\n error={this.error}\n disabled={this.disabled}\n focused={this._showDropdown}\n focusMethod={\n this.enableAutocomplete ? 'focus' : 'click'\n }\n >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this._placeholder}\n value={this._displayValue}\n class={`p-input cursor-pointer ${\n !this._isAutoCompleting && 'read-only'\n }`}\n onFocus={(ev) => this._onFocus(ev)}\n onMouseDown={(ev) => this._onMouseDown(ev)}\n onClick={() => this._onClick()}\n onInput={(ev) => this._onChange(ev)}\n />\n\n {this.showChevron && (\n <p-icon variant=\"chevron\" slot=\"suffix\" />\n )}\n </p-input-group>\n <div slot=\"items\">\n {this.loading\n ? this._getLoadingItems()\n : this._getItems()}\n </div>\n </p-dropdown>\n </Host>\n );\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (!this._showDropdown || childOf(target, this._el)) {\n return;\n }\n\n this._showDropdown = false;\n this._isAutoCompleting = false;\n }\n\n @Watch('value')\n private _valueChange() {\n this._preselectItem();\n }\n\n @Watch('items')\n public itemChanges() {\n this._preselectItem();\n }\n\n @Watch('_showDropdown')\n public _showDropdownChanges() {\n this.dropdownShown.emit({\n value: this._showDropdown,\n query: this.query,\n });\n }\n\n private _preselectItem() {\n if (this._isAutoCompleting && this.query?.length) {\n return;\n }\n\n let value = this.value;\n\n if (!this._selectedItem && !value && this.autoSelectFirst) {\n value = this._items[0];\n }\n\n // if (!value) {\n // this._selectValue(null);\n // return;\n // }\n\n const identifier =\n typeof value === 'object' && value !== null\n ? value[this._identifierKey]\n : value;\n const parsedValue =\n typeof identifier === 'string' || typeof identifier === 'number'\n ? identifier\n : JSON.stringify(identifier);\n\n const currentValue = this._selectedItem\n ? this._selectedItem?.[this._identifierKey]\n : null;\n const currentParsedValue =\n typeof currentValue === 'string' || typeof currentValue === 'number'\n ? currentValue\n : JSON.stringify(currentValue);\n\n if (this._selectedItem && currentParsedValue === parsedValue) {\n return;\n }\n\n if (!this._items?.length && value) {\n this._selectValue(value);\n return;\n }\n\n const item = this._items.find((i) => {\n const itemIdentifier = i?.[this._identifierKey];\n const parsedItemIdentifier =\n typeof itemIdentifier === 'string' ||\n typeof itemIdentifier === 'number'\n ? itemIdentifier\n : JSON.stringify(itemIdentifier);\n\n return parsedItemIdentifier === parsedValue;\n });\n\n this._selectValue(!!item ? item : value);\n }\n\n private _selectValue(item) {\n this._selectedItem = item;\n const value =\n !!this.valueKey && this.valueKey !== 'false' && item !== null\n ? item?.[this.valueKey]\n : item;\n\n this.query = this.keepQuery ? item?.[this.displayKey] : null;\n this.value = value;\n this.valueChange.emit(value);\n\n this._onBlur(true);\n }\n\n private _onFocus(ev) {\n if (!this.enableAutocomplete) {\n ev.preventDefault();\n ev.stopPropogation();\n\n if (!this._showDropdown) {\n this._showDropdown = true;\n }\n return;\n }\n\n this._showDropdown = true;\n this._isAutoCompleting = true;\n }\n\n private _onMouseDown(ev) {\n if (this.enableAutocomplete) {\n return;\n }\n\n ev.preventDefault();\n }\n\n private _onClick() {\n if (this.enableAutocomplete) {\n return;\n }\n\n this._showDropdown = !this._showDropdown;\n }\n\n private _onBlur(force = false) {\n if (!this.enableAutocomplete && !force) {\n return;\n }\n\n this._isAutoCompleting = false;\n this._showDropdown = false;\n }\n\n private _onChange(ev) {\n if (!this.enableAutocomplete) {\n return;\n }\n\n if (!this._isAutoCompleting) {\n this._isAutoCompleting = true;\n this._showDropdown = true;\n }\n\n this.query = ev.target.value;\n this.queryChange.emit(ev.target.value);\n }\n\n private _checkvalue(key, item) {\n return (\n item?.[key]\n ?.toString()\n ?.toLowerCase()\n .indexOf(this.query?.toLowerCase()) >= 0\n );\n }\n\n private _getItems() {\n return this._items.map((item) => (\n <p-dropdown-menu-item\n onClick={() => this._selectValue(item)}\n active={\n item[this._identifierKey] ===\n this._selectedItem?.[this._identifierKey]\n }\n >\n {item[this.displayKey]}\n </p-dropdown-menu-item>\n ));\n }\n\n private _getLoadingItems() {\n return [0, 0, 0].map(() => (\n <p-dropdown-menu-item enableHover={false}>\n <p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n </p-dropdown-menu-item>\n ));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"select.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/select/select.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAQzC,MAAM,OAAO,MAAM;;;;;;;;sBAkCc,MAAM;;;;2BAoBA,IAAI;uBAKR,IAAI;6BAKC,EAAE;8BAKA,IAAI;qBAKb,IAAI;uBAKF,KAAK;mBAKT,KAAK;gBA0BG,QAAQ;;;;;;oBA8BE,KAAK;yBAOZ,KAAK;yBACL,IAAI;6BAEI,KAAK;;EAEnD,IAAI,MAAM;;IACN,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;MAC7B,OAAO,EAAE,CAAC;KACb;IAED,IAAI,KAAK,GACL,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ;MAC1B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;MACxB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IAErB,IAAI,OAAO,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,CAAC,CAAC,CAAA,KAAK,QAAQ,EAAE;MAChC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;MACzB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;MAExB,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACxB,KAAK,EAAE,GAAG;QACV,IAAI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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-select',\n styleUrl: 'select.component.scss',\n shadow: false,\n})\nexport class Select {\n /**\n * The items to show in the dropdown\n */\n @Prop() items: string | any[];\n\n /**\n * Icon of the select box\n */\n @Prop() icon: IconVariant;\n\n /**\n * The current query\n */\n @Prop() query: string;\n\n /**\n * The placeholder of the input\n */\n @Prop() placeholder: string;\n\n /**\n * The placeholder of the input when auto completing\n */\n @Prop() autocompletePlaceholder: string;\n\n /**\n * The current value\n */\n @Prop() value: any;\n\n /**\n * The key of the object to display\n */\n @Prop() displayKey: string = 'text';\n\n /**\n * The key of the object to return\n */\n @Prop() valueKey: string;\n\n /**\n * The key to identify an object\n */\n @Prop() identifierKey: string;\n\n /**\n * The key of the object to display\n */\n @Prop() queryKey?: string;\n\n /**\n * Wether to automatically select the first item\n */\n @Prop() autoSelectFirst: boolean = true;\n\n /**\n * Wether to show the chevron or not\n */\n @Prop() showChevron: boolean = true;\n\n /**\n * The maximum amount of items to display\n */\n @Prop() maxDisplayedItems: number = 10;\n\n /**\n * Wether to enable autocomplete\n */\n @Prop() enableAutocomplete: boolean = true;\n\n /**\n * Wether to keep the query or not\n */\n @Prop() keepQuery: boolean = true;\n\n /**\n * Wether the input uses async filtering\n */\n @Prop() asyncFilter: boolean = false;\n\n /**\n * Wether to show loading items\n */\n @Prop() loading: boolean = false;\n\n /**\n * Event when the query of the autocomplete changes\n */\n @Event({\n bubbles: false\n }) queryChange: EventEmitter<string>;\n\n /**\n * Event when the value changes\n */\n @Event({\n bubbles: false\n }) valueChange: EventEmitter<any>;\n\n /**\n * Event when the dropdown shows\n */\n @Event({\n bubbles: false\n }) dropdownShown: EventEmitter<any>;\n\n /**\n * The size of the input group used by the select\n */\n @Prop() size: 'small' | 'medium' = 'medium';\n\n /**\n * The prefix of the input group used by the select\n */\n @Prop() prefix: string;\n\n /**\n * The label of the input group used by the select\n */\n @Prop() label: string;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop() helper: string;\n\n /**\n * Wether the field is required\n */\n @Prop({ reflect: true }) required: boolean;\n\n /**\n * The helper of the input group used by the select\n */\n @Prop({ reflect: true }) error: string;\n\n /**\n * Wether the input group is disabled used by the select\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n @State() private _showDropdown: any = false;\n @State() private _selectedItem: any = null;\n\n @State() private _isAutoCompleting: boolean = false;\n\n get _items() {\n if (!this.items || this.loading) {\n return [];\n }\n\n let items =\n typeof this.items === 'string'\n ? JSON.parse(this.items)\n : this.items;\n\n if (typeof items?.[0] === 'string') {\n this.displayKey = 'text';\n this.valueKey = 'value';\n\n items = items.map((str) => ({\n value: str,\n text: str,\n }));\n }\n\n if (\n this._isAutoCompleting &&\n this.query?.length &&\n this.query !== this._selectedItem?.[this.displayKey] &&\n !this.asyncFilter\n ) {\n items = items.filter((item) => {\n if (this.queryKey) {\n return this._checkvalue(this.queryKey, item);\n }\n\n return (\n this._checkvalue(this._identifierKey, item) ||\n this._checkvalue(this.displayKey, item)\n );\n });\n }\n\n return items?.slice(0, this.maxDisplayedItems);\n }\n\n get _displayValue() {\n if (this._isAutoCompleting) {\n return this.query;\n }\n\n return this._selectedItem?.[this.displayKey];\n }\n\n get _placeholder() {\n return this._isAutoCompleting && this.autocompletePlaceholder?.length\n ? this.autocompletePlaceholder\n : this.placeholder;\n }\n\n get _identifierKey() {\n return this.identifierKey ?? this.valueKey ?? 'value';\n }\n\n componentDidLoad() {\n if (!this.valueKey && !this.identifierKey) {\n throw new Error('You must provide a valueKey or identifierKey');\n }\n\n if (this.value) {\n this._valueChange();\n return;\n }\n\n this.itemChanges();\n }\n\n render() {\n return (\n <Host class=\"p-select\">\n {this._showDropdown && (!!this._items.length || this.loading)}\n {this._isAutoCompleting}\n <p-dropdown\n disableTriggerClick={true}\n calculateWidth={true}\n insideClick={true}\n show={\n this._showDropdown &&\n (!!this._items.length || this.loading)\n }\n >\n <p-input-group\n slot=\"trigger\"\n icon={this.icon}\n size={this.size}\n prefix={this.prefix}\n label={this.label}\n helper={this.helper}\n required={this.required}\n error={this.error}\n disabled={this.disabled}\n focused={this._showDropdown}\n focusMethod={\n this.enableAutocomplete ? 'focus' : 'click'\n }\n >\n <input\n slot=\"input\"\n type=\"text\"\n placeholder={this._placeholder}\n value={this._displayValue}\n class={`p-input cursor-pointer ${\n !this._isAutoCompleting && 'read-only'\n }`}\n onFocus={(ev) => this._onFocus(ev)}\n onMouseDown={(ev) => this._onMouseDown(ev)}\n onClick={() => this._onClick()}\n onInput={(ev) => this._onChange(ev)}\n />\n\n {this.showChevron && (\n <p-icon variant=\"chevron\" slot=\"suffix\" />\n )}\n </p-input-group>\n <div slot=\"items\">\n {this.loading\n ? this._getLoadingItems()\n : this._getItems()}\n </div>\n </p-dropdown>\n </Host>\n );\n }\n\n @Listen('click', { target: 'document', capture: true })\n protected documentClickHandler({ target }) {\n if (!this._showDropdown || childOf(target, this._el)) {\n return;\n }\n\n this._showDropdown = false;\n this._isAutoCompleting = false;\n }\n\n @Watch('value')\n private _valueChange() {\n this._preselectItem();\n }\n\n @Watch('items')\n public itemChanges() {\n this._preselectItem();\n }\n\n @Watch('_showDropdown')\n public _showDropdownChanges() {\n this.dropdownShown.emit({\n value: this._showDropdown,\n query: this.query,\n });\n }\n\n private _preselectItem() {\n if (this._isAutoCompleting && this.query?.length) {\n return;\n }\n\n let value = this.value;\n\n if (!this._selectedItem && !value && this.autoSelectFirst) {\n value = this._items[0];\n }\n\n // if (!value) {\n // this._selectValue(null);\n // return;\n // }\n\n const identifier =\n typeof value === 'object' && value !== null\n ? value[this._identifierKey]\n : value;\n const parsedValue =\n typeof identifier === 'string' || typeof identifier === 'number'\n ? identifier\n : JSON.stringify(identifier);\n\n const currentValue = this._selectedItem\n ? this._selectedItem?.[this._identifierKey]\n : null;\n const currentParsedValue =\n typeof currentValue === 'string' || typeof currentValue === 'number'\n ? currentValue\n : JSON.stringify(currentValue);\n\n if (this._selectedItem && currentParsedValue === parsedValue) {\n return;\n }\n\n if (!this._items?.length && value) {\n this._selectValue(value);\n return;\n }\n\n const item = this._items.find((i) => {\n const itemIdentifier = i?.[this._identifierKey];\n const parsedItemIdentifier =\n typeof itemIdentifier === 'string' ||\n typeof itemIdentifier === 'number'\n ? itemIdentifier\n : JSON.stringify(itemIdentifier);\n\n return parsedItemIdentifier === parsedValue;\n });\n\n this._selectValue(!!item ? item : value);\n }\n\n private _selectValue(item) {\n this._selectedItem = item;\n const value =\n !!this.valueKey && this.valueKey !== 'false' && item !== null\n ? item?.[this.valueKey]\n : item;\n\n this.query = this.keepQuery ? item?.[this.displayKey] : null;\n this.value = value;\n this.valueChange.emit(value);\n\n this._onBlur(true);\n }\n\n private _onFocus(ev) {\n if (!this.enableAutocomplete) {\n ev.preventDefault();\n ev.stopPropogation();\n\n if (!this._showDropdown) {\n this._showDropdown = true;\n }\n return;\n }\n\n this._showDropdown = true;\n this._isAutoCompleting = true;\n }\n\n private _onMouseDown(ev) {\n if (this.enableAutocomplete) {\n return;\n }\n\n ev.preventDefault();\n }\n\n private _onClick() {\n if (this.enableAutocomplete) {\n return;\n }\n\n this._showDropdown = !this._showDropdown;\n }\n\n private _onBlur(force = false) {\n if (!this.enableAutocomplete && !force) {\n return;\n }\n\n this._isAutoCompleting = false;\n this._showDropdown = false;\n }\n\n private _onChange(ev) {\n if (!this.enableAutocomplete) {\n return;\n }\n\n if (!this._isAutoCompleting) {\n this._isAutoCompleting = true;\n this._showDropdown = true;\n }\n\n this.query = ev.target.value;\n this.queryChange.emit(ev.target.value);\n }\n\n private _checkvalue(key, item) {\n return (\n item?.[key]\n ?.toString()\n ?.toLowerCase()\n .indexOf(this.query?.toLowerCase()) >= 0\n );\n }\n\n private _getItems() {\n return this._items.map((item) => (\n <p-dropdown-menu-item\n onClick={() => this._selectValue(item)}\n active={\n item[this._identifierKey] ===\n this._selectedItem?.[this._identifierKey]\n }\n >\n {item[this.displayKey]}\n </p-dropdown-menu-item>\n ));\n }\n\n private _getLoadingItems() {\n return [0, 0, 0].map(() => (\n <p-dropdown-menu-item enableHover={false}>\n <p-loader variant=\"ghost\" class=\"h-6 w-full rounded\" />\n </p-dropdown-menu-item>\n ));\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h, Host
|
|
2
|
-
import { formatTranslation, getLocaleComponentStrings
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
import { formatTranslation, getLocaleComponentStrings } from '../../../utils/localization';
|
|
3
3
|
import { defaultSize, defaultSizeOptions } from '../page-size-select/constants';
|
|
4
4
|
export class TableFooter {
|
|
5
5
|
constructor() {
|
|
@@ -218,7 +218,7 @@ export class TableFooter {
|
|
|
218
218
|
return [{
|
|
219
219
|
"method": "pageChange",
|
|
220
220
|
"name": "pageChange",
|
|
221
|
-
"bubbles":
|
|
221
|
+
"bubbles": false,
|
|
222
222
|
"cancelable": true,
|
|
223
223
|
"composed": true,
|
|
224
224
|
"docs": {
|
|
@@ -233,7 +233,7 @@ export class TableFooter {
|
|
|
233
233
|
}, {
|
|
234
234
|
"method": "pageSizeChange",
|
|
235
235
|
"name": "pageSizeChange",
|
|
236
|
-
"bubbles":
|
|
236
|
+
"bubbles": false,
|
|
237
237
|
"cancelable": true,
|
|
238
238
|
"composed": true,
|
|
239
239
|
"docs": {
|
|
@@ -248,7 +248,7 @@ export class TableFooter {
|
|
|
248
248
|
}, {
|
|
249
249
|
"method": "export",
|
|
250
250
|
"name": "export",
|
|
251
|
-
"bubbles":
|
|
251
|
+
"bubbles": false,
|
|
252
252
|
"cancelable": true,
|
|
253
253
|
"composed": true,
|
|
254
254
|
"docs": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-footer.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/table-footer/table-footer.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,
|
|
1
|
+
{"version":3,"file":"table-footer.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/table-footer/table-footer.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,iBAAiB,EACjB,yBAAyB,EAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAOhF,MAAM,OAAO,WAAW;;0BAIc,IAAI;4BAKF,IAAI;wBAKR,IAAI;mBAKT,KAAK;gBAKuB,CAAC;;oBAiB7B,WAAW;2BAKF,kBAAkB;4BAmBlB,IAAI;oBAUP,EAAE;;EAEnC,iBAAiB;IACb,IAAI,CAAC,WAAW,EAAE,CAAC;EACvB,CAAC;EAED,MAAM;;IACF,MAAM,kBAAkB,GACpB,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,IAAG,MAAA,IAAI,CAAC,eAAe,0CAAG,CAAC,CAAC,CAAA,CAAC;IACpE,OAAO,CACH,EAAC,IAAI,IACD,KAAK,EAAE,kBACH,CAAC,IAAI,CAAC,cAAc,IAAI,oBAC5B,IAAI,CAAC,IAAI,CAAC,gBAAgB,IAAI,qBAAqB,IAC/C,CAAC,IAAI,CAAC,YAAY,IAAI,iBAC1B,EAAE;MAED,CAAC,IAAI,CAAC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;IAC9B,IAAI,CAAC,CAAC,EAAE;MACJ,OAAO;KACV;IAED,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IAClB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;EAC5C,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State\n} from '@stencil/core';\nimport {\n formatTranslation,\n getLocaleComponentStrings\n} from '../../../utils/localization';\nimport { defaultSize, defaultSizeOptions } from '../page-size-select/constants';\n\n@Component({\n tag: 'p-table-footer',\n styleUrl: 'table-footer.component.scss',\n shadow: true,\n})\nexport class TableFooter {\n /**\n * Wether to enable page size select\n */\n @Prop() enablePageSize: boolean = true;\n\n /**\n * Wether to enable pagination\n */\n @Prop() enablePagination: boolean = true;\n\n /**\n * Wether to enable export\n */\n @Prop() enableExport: boolean = true;\n\n /**\n * Wether we want to show loading state\n */\n @Prop() loading: boolean = false;\n\n /**\n * The current page\n */\n @Prop({ mutable: true, reflect: true }) page: number = 1;\n\n /**\n * The total amount of items\n */\n @Prop() total!: number;\n\n /**\n * Event whenever the page changes\n */\n @Event({\n bubbles: false\n }) pageChange: EventEmitter<number>;\n\n /**\n * The amount of items per page\n */\n @Prop() pageSize: number = defaultSize;\n\n /**\n * The options for the page size\n */\n @Prop() pageSizeOptions: number[] = defaultSizeOptions;\n\n /**\n * Event whenever the page changes\n */\n @Event({\n bubbles: false\n }) pageSizeChange: EventEmitter<number>;\n\n /**\n * Event whenever the page changes\n */\n @Event({\n bubbles: false\n }) export: EventEmitter<number>;\n\n /**\n * Wether to hide when there is only 1 page available\n */\n @Prop() hideOnSinglePage: boolean = true;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n /**\n * Locales used for this component\n */\n @State() private _locales: any = {};\n\n componentWillLoad() {\n this._setLocales();\n }\n\n render() {\n const hidePageSizeSelect =\n this.hideOnSinglePage && this.total < this.pageSizeOptions?.[0];\n return (\n <Host\n class={`p-table-footer ${\n !this.enablePageSize && 'page-size-disabled'\n } ${!this.enablePagination && 'pagination-disabled'} ${\n !this.enableExport && 'export-disabled'\n }`}\n >\n {!this.loading &&\n this.enablePagination &&\n this.enablePageSize && (\n <p-page-size-select\n class={\n !hidePageSizeSelect && 'hidden desktop-xs:flex'\n }\n hidden={hidePageSizeSelect}\n size={this.pageSize}\n sizeOptions={this.pageSizeOptions}\n onSizeChange={({ detail }) =>\n this._changePageSize(detail)\n }\n />\n )}\n\n {this.loading && (\n <p-loader\n variant=\"ghost\"\n class=\"rounded w-full h-8\"\n ></p-loader>\n )}\n\n {!this.loading && this.enablePagination && (\n <p-pagination\n pageSize={this.pageSize}\n total={this.total}\n page={this.page}\n hideOnSinglePage={this.hideOnSinglePage}\n onPageChange={({ detail }) =>\n this.pageChange.emit(detail)\n }\n />\n )}\n {!this.loading && this.enableExport && (\n <p-button\n class=\"hidden desktop-xs:flex\"\n variant=\"secondary\"\n size=\"small\"\n icon=\"download\"\n onClick={() => this.export.emit()}\n >\n {formatTranslation(this._locales.export)}\n </p-button>\n )}\n </Host>\n );\n }\n\n @Listen('localeChanged', { target: 'body' })\n private async _setLocales(): Promise<void> {\n this._locales = await getLocaleComponentStrings(this._el);\n }\n\n private _changePageSize(s?: number) {\n if (!s) {\n return;\n }\n\n this.pageSize = s;\n this.pageSizeChange.emit(this.pageSize);\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h, Host
|
|
2
|
-
import { debounceTime, distinctUntilChanged, Subject } from 'rxjs';
|
|
3
|
-
import { formatTranslation, getLocaleComponentStrings
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
|
+
import { debounceTime, distinctUntilChanged, Subject, tap } from 'rxjs';
|
|
3
|
+
import { formatTranslation, getLocaleComponentStrings } from '../../../utils/localization';
|
|
4
4
|
export class TableHeader {
|
|
5
5
|
constructor() {
|
|
6
6
|
this._defaultFilterButtonTemplate = () => formatTranslation(this._locales.filter);
|
|
@@ -36,7 +36,7 @@ export class TableHeader {
|
|
|
36
36
|
}
|
|
37
37
|
componentDidLoad() {
|
|
38
38
|
this._queryObserver
|
|
39
|
-
.pipe(debounceTime(300), distinctUntilChanged())
|
|
39
|
+
.pipe(debounceTime(300), distinctUntilChanged(), tap(() => console.log("Search updated from header")))
|
|
40
40
|
.subscribe((value) => this.queryChange.emit(value));
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
@@ -374,7 +374,7 @@ export class TableHeader {
|
|
|
374
374
|
return [{
|
|
375
375
|
"method": "quickFilter",
|
|
376
376
|
"name": "quickFilter",
|
|
377
|
-
"bubbles":
|
|
377
|
+
"bubbles": false,
|
|
378
378
|
"cancelable": true,
|
|
379
379
|
"composed": true,
|
|
380
380
|
"docs": {
|
|
@@ -394,7 +394,7 @@ export class TableHeader {
|
|
|
394
394
|
}, {
|
|
395
395
|
"method": "queryChange",
|
|
396
396
|
"name": "queryChange",
|
|
397
|
-
"bubbles":
|
|
397
|
+
"bubbles": false,
|
|
398
398
|
"cancelable": true,
|
|
399
399
|
"composed": true,
|
|
400
400
|
"docs": {
|
|
@@ -409,7 +409,7 @@ export class TableHeader {
|
|
|
409
409
|
}, {
|
|
410
410
|
"method": "filter",
|
|
411
411
|
"name": "filter",
|
|
412
|
-
"bubbles":
|
|
412
|
+
"bubbles": false,
|
|
413
413
|
"cancelable": true,
|
|
414
414
|
"composed": true,
|
|
415
415
|
"docs": {
|
|
@@ -424,7 +424,7 @@ export class TableHeader {
|
|
|
424
424
|
}, {
|
|
425
425
|
"method": "edit",
|
|
426
426
|
"name": "edit",
|
|
427
|
-
"bubbles":
|
|
427
|
+
"bubbles": false,
|
|
428
428
|
"cancelable": true,
|
|
429
429
|
"composed": true,
|
|
430
430
|
"docs": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-header.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/table-header/table-header.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAGnE,OAAO,EACH,iBAAiB,EACjB,yBAAyB,GAC5B,MAAM,6BAA6B,CAAC;AAUrC,MAAM,OAAO,WAAW;;IACZ,iCAA4B,GAAiB,GAAG,EAAE,CACtD,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpC,+BAA0B,GAAuB,CAAC,MAAc,EAAE,EAAE,CACxE,IAAI,CAAC,QAAQ;MACT,CAAC,CAAC,IAAI,CAAC,QAAQ;MACf,CAAC,CAAC,iBAAiB,CACb,MAAM,KAAK,CAAC;QACR,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;QACpB,CAAC,CAAC,MAAM,KAAK,CAAC;UACd,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW;UAC3B,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAC/B,EAAE,MAAM,EAAE,CACb,CAAC;IA6GJ,mBAAc,GAAG,IAAI,OAAO,EAAU,CAAC;IACvC,yBAAoB,GAAG,KAAK,CAAC;wBAzGC,EAAE;;mBAUb,KAAK;wBAKA,IAAI;+BAKE,CAAC;;wBAUP,IAAI;;gCAWhC,IAAI,CAAC,4BAA4B;sBAKP,IAAI;uB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,CACd,CAAC;EACN,CAAC;EAEO,SAAS,CAAC,MAAM,EAAE,UAAgC,SAAS;IAC/D,OAAO,CACH,eACI,IAAI,EAAC,OAAO,EACZ,OAAO,EAAC,UAAU,EAClB,QAAQ,EAAC,MAAM,EACf,KAAK,EAAE,QACH,OAAO,KAAK,SAAS;QACjB,CAAC,CAAC,wBAAwB;QAC1B,CAAC,CAAC,wBACV,EAAE,IAED,MAAM,CACD,CACb,CAAC;EACN,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State,\n} from '@stencil/core';\nimport { debounceTime, distinctUntilChanged, Subject } from 'rxjs';\nimport { IconVariant } from '../../../components';\nimport { QuickFilter } from '../../../types/table';\nimport {\n formatTranslation,\n getLocaleComponentStrings,\n} from '../../../utils/localization';\n\nexport type templateFunc = () => string;\nexport type buttonTemplateFunc = (amount: number) => string;\n\n@Component({\n tag: 'p-table-header',\n styleUrl: 'table-header.component.scss',\n shadow: true,\n})\nexport class TableHeader {\n private _defaultFilterButtonTemplate: templateFunc = () =>\n formatTranslation(this._locales.filter);\n private _defaultEditButtonTemplate: buttonTemplateFunc = (amount: number) =>\n this.editText\n ? this.editText\n : formatTranslation(\n amount === 0\n ? this._locales.edit\n : amount === 1\n ? this._locales.edit_single\n : this._locales.edit_plural,\n { amount }\n );\n\n /**\n * Quick filters to show\n */\n @Prop() quickFilters: QuickFilter[] = [];\n\n /**\n * Active quick filter identifier\n */\n @Prop() activeQuickFilterIdentifier: string;\n\n /**\n * Wether we want to show loading state\n */\n @Prop() loading: boolean = false;\n\n /**\n * Wether to show the search input\n */\n @Prop() enableSearch: boolean = true;\n\n /**\n * The amount of items that are selected\n */\n @Prop() itemsSelectedAmount: number = 0;\n\n /**\n * The query to show in the search bar\n */\n @Prop({ mutable: true }) query: string;\n\n /**\n * Wether to show the filter button\n */\n @Prop() enableFilter: boolean = true;\n\n /**\n * The amount of filters being selected\n */\n @Prop() selectedFiltersAmount: number;\n\n /**\n * The template for the filter button text\n */\n @Prop() filterButtonTemplate: templateFunc =\n this._defaultFilterButtonTemplate;\n\n /**\n * Wether to show the edit button\n */\n @Prop() enableEdit: boolean = true;\n\n /**\n * Wether the edit button is loading\n */\n @Prop() editLoading: boolean = false;\n\n /**\n * The edit button icon\n */\n @Prop() editIcon: IconVariant = 'pencil';\n\n /**\n * The edit button text if changed\n */\n @Prop() editText: string;\n\n /**\n * Wether to enable the edit button\n */\n @Prop({ mutable: true }) canEdit: boolean = false;\n\n /**\n * The template for the edit button text\n */\n @Prop() editButtonTemplate: buttonTemplateFunc =\n this._defaultEditButtonTemplate;\n\n /**\n * Event when one of the quick filters is clicked\n */\n @Event() quickFilter: EventEmitter<QuickFilter>;\n\n /**\n * Event when the query changes\n */\n @Event() queryChange: EventEmitter<string>;\n\n /**\n * Event when the filter button is clicked\n */\n @Event() filter: EventEmitter<null>;\n\n /**\n * Event when the edit button is clicked\n */\n @Event() edit: EventEmitter<null>;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n /**\n * Locales used for this component\n */\n @State() private _locales: any = {};\n\n private _queryObserver = new Subject<string>();\n private _hasCustomFilterSlot = false;\n\n componentWillLoad() {\n this._hasCustomFilterSlot = !!this._el.querySelector(\n ':scope > [slot=\"custom-filter\"]'\n );\n\n this._setLocales();\n }\n\n componentDidLoad() {\n this._queryObserver\n .pipe(debounceTime(300), distinctUntilChanged())\n .subscribe((value) => this.queryChange.emit(value));\n }\n\n render() {\n const activeQuickFilter = this.quickFilters.find(\n (f) => f.identifier === this.activeQuickFilterIdentifier\n );\n const mobileTotal =\n (this.selectedFiltersAmount || 0) +\n (activeQuickFilter?.default ? 0 : 1);\n\n return (\n <Host class=\"p-table-header\">\n {this.loading && (\n <p-loader\n variant=\"ghost\"\n class=\"hidden h-8 w-3/4 rounded desktop-xs:flex\"\n ></p-loader>\n )}\n\n {!this.loading &&\n (this._hasCustomFilterSlot ||\n this.quickFilters.length > 0) && (\n <div class=\"left-side flex flex-col justify-start gap-4 desktop-xs:flex-row\">\n {this._hasCustomFilterSlot && (\n <slot name=\"custom-filter\" />\n )}\n\n {this.quickFilters.length > 0 && (\n <p-segment-container class=\"hidden desktop-xs:flex\">\n {this.quickFilters.map((item) => (\n <p-segment-item\n active={\n item.identifier ===\n this.activeQuickFilterIdentifier\n }\n onClick={() =>\n this.quickFilter.emit(item)\n }\n >\n {typeof item.text === 'string'\n ? item.text\n : item.text()}{' '}\n {item?.count >= 0\n ? `(${item.count})`\n : ''}\n </p-segment-item>\n ))}\n </p-segment-container>\n )}\n </div>\n )}\n\n <div class=\"right-side flex flex-col justify-end gap-4 desktop-xs:flex-row\">\n {this.enableSearch && (\n <p-input-group\n icon=\"search\"\n size=\"small\"\n class=\"desktop-xs:w-48\"\n >\n <input\n type=\"text\"\n slot=\"input\"\n placeholder=\"Zoeken...\"\n value={this.query}\n onInput={(ev) =>\n this._queryObserver.next(\n (ev.target as HTMLInputElement).value\n )\n }\n />\n </p-input-group>\n )}\n\n {this.enableFilter && (\n <p-button\n icon=\"filter\"\n variant=\"secondary\"\n size=\"small\"\n class=\"w-full desktop-xs:w-auto\"\n onClick={() => this.filter.emit()}\n >\n {this.filterButtonTemplate\n ? this.filterButtonTemplate()\n : this._defaultFilterButtonTemplate()}\n {this.selectedFiltersAmount &&\n this._getLabel(this.selectedFiltersAmount)}\n {mobileTotal > 0 &&\n this._getLabel(mobileTotal, 'mobile')}\n </p-button>\n )}\n\n {this.enableEdit && this._buttonTemplate()}\n </div>\n\n {this.enableEdit && this.canEdit && (\n <div class=\"fixed bottom-0 left-0 block w-full border border-solid border-transparent border-t-mystic-dark bg-white p-4 desktop-xs:hidden\">\n {this._buttonTemplate(true)}\n </div>\n )}\n </Host>\n );\n }\n\n @Listen('localeChanged', { target: 'body' })\n private async _setLocales(): Promise<void> {\n this._locales = await getLocaleComponentStrings(this._el);\n }\n\n private _buttonTemplate(mobile = false) {\n return (\n <p-button\n class={mobile ? 'w-full' : 'hidden desktop-xs:flex'}\n icon={this.editIcon}\n size=\"small\"\n disabled={!this.canEdit}\n onClick={() => this.edit.emit()}\n loading={this.editLoading}\n >\n {this.editButtonTemplate\n ? this.editButtonTemplate(\n mobile ? this.itemsSelectedAmount : 0\n )\n : this._defaultEditButtonTemplate(\n mobile ? this.itemsSelectedAmount : 0\n )}\n </p-button>\n );\n }\n\n private _getLabel(amount, variant: 'mobile' | 'default' = 'default') {\n return (\n <p-label\n size=\"small\"\n variant=\"negative\"\n behavior=\"text\"\n class={`ml-1 ${\n variant === 'default'\n ? 'hidden desktop-xs:flex'\n : 'flex desktop-xs:hidden'\n }`}\n >\n {amount}\n </p-label>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"table-header.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/table-header/table-header.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAGxE,OAAO,EACH,iBAAiB,EACjB,yBAAyB,EAC5B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Prop,\n State\n} from '@stencil/core';\nimport { debounceTime, distinctUntilChanged, Subject, tap } from 'rxjs';\nimport { IconVariant } from '../../../components';\nimport { QuickFilter } from '../../../types/table';\nimport {\n formatTranslation,\n getLocaleComponentStrings\n} from '../../../utils/localization';\n\nexport type templateFunc = () => string;\nexport type buttonTemplateFunc = (amount: number) => string;\n\n@Component({\n tag: 'p-table-header',\n styleUrl: 'table-header.component.scss',\n shadow: true,\n})\nexport class TableHeader {\n private _defaultFilterButtonTemplate: templateFunc = () =>\n formatTranslation(this._locales.filter);\n private _defaultEditButtonTemplate: buttonTemplateFunc = (amount: number) =>\n this.editText\n ? this.editText\n : formatTranslation(\n amount === 0\n ? this._locales.edit\n : amount === 1\n ? this._locales.edit_single\n : this._locales.edit_plural,\n { amount }\n );\n\n /**\n * Quick filters to show\n */\n @Prop() quickFilters: QuickFilter[] = [];\n\n /**\n * Active quick filter identifier\n */\n @Prop() activeQuickFilterIdentifier: string;\n\n /**\n * Wether we want to show loading state\n */\n @Prop() loading: boolean = false;\n\n /**\n * Wether to show the search input\n */\n @Prop() enableSearch: boolean = true;\n\n /**\n * The amount of items that are selected\n */\n @Prop() itemsSelectedAmount: number = 0;\n\n /**\n * The query to show in the search bar\n */\n @Prop({ mutable: true }) query: string;\n\n /**\n * Wether to show the filter button\n */\n @Prop() enableFilter: boolean = true;\n\n /**\n * The amount of filters being selected\n */\n @Prop() selectedFiltersAmount: number;\n\n /**\n * The template for the filter button text\n */\n @Prop() filterButtonTemplate: templateFunc =\n this._defaultFilterButtonTemplate;\n\n /**\n * Wether to show the edit button\n */\n @Prop() enableEdit: boolean = true;\n\n /**\n * Wether the edit button is loading\n */\n @Prop() editLoading: boolean = false;\n\n /**\n * The edit button icon\n */\n @Prop() editIcon: IconVariant = 'pencil';\n\n /**\n * The edit button text if changed\n */\n @Prop() editText: string;\n\n /**\n * Wether to enable the edit button\n */\n @Prop({ mutable: true }) canEdit: boolean = false;\n\n /**\n * The template for the edit button text\n */\n @Prop() editButtonTemplate: buttonTemplateFunc =\n this._defaultEditButtonTemplate;\n\n /**\n * Event when one of the quick filters is clicked\n */\n @Event({\n bubbles: false\n }) quickFilter: EventEmitter<QuickFilter>;\n\n /**\n * Event when the query changes\n */\n @Event({\n bubbles: false\n }) queryChange: EventEmitter<string>;\n\n /**\n * Event when the filter button is clicked\n */\n @Event({\n bubbles: false\n }) filter: EventEmitter<null>;\n\n /**\n * Event when the edit button is clicked\n */\n @Event({\n bubbles: false\n }) edit: EventEmitter<null>;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n /**\n * Locales used for this component\n */\n @State() private _locales: any = {};\n\n private _queryObserver = new Subject<string>();\n private _hasCustomFilterSlot = false;\n\n componentWillLoad() {\n this._hasCustomFilterSlot = !!this._el.querySelector(\n ':scope > [slot=\"custom-filter\"]'\n );\n\n this._setLocales();\n }\n\n componentDidLoad() {\n this._queryObserver\n .pipe(debounceTime(300), distinctUntilChanged(), tap(() => console.log(\"Search updated from header\")))\n .subscribe((value) => this.queryChange.emit(value));\n }\n\n render() {\n const activeQuickFilter = this.quickFilters.find(\n (f) => f.identifier === this.activeQuickFilterIdentifier\n );\n const mobileTotal =\n (this.selectedFiltersAmount || 0) +\n (activeQuickFilter?.default ? 0 : 1);\n\n return (\n <Host class=\"p-table-header\">\n {this.loading && (\n <p-loader\n variant=\"ghost\"\n class=\"hidden h-8 w-3/4 rounded desktop-xs:flex\"\n ></p-loader>\n )}\n\n {!this.loading &&\n (this._hasCustomFilterSlot ||\n this.quickFilters.length > 0) && (\n <div class=\"left-side flex flex-col justify-start gap-4 desktop-xs:flex-row\">\n {this._hasCustomFilterSlot && (\n <slot name=\"custom-filter\" />\n )}\n\n {this.quickFilters.length > 0 && (\n <p-segment-container class=\"hidden desktop-xs:flex\">\n {this.quickFilters.map((item) => (\n <p-segment-item\n active={\n item.identifier ===\n this.activeQuickFilterIdentifier\n }\n onClick={() =>\n this.quickFilter.emit(item)\n }\n >\n {typeof item.text === 'string'\n ? item.text\n : item.text()}{' '}\n {item?.count >= 0\n ? `(${item.count})`\n : ''}\n </p-segment-item>\n ))}\n </p-segment-container>\n )}\n </div>\n )}\n\n <div class=\"right-side flex flex-col justify-end gap-4 desktop-xs:flex-row\">\n {this.enableSearch && (\n <p-input-group\n icon=\"search\"\n size=\"small\"\n class=\"desktop-xs:w-48\"\n >\n <input\n type=\"text\"\n slot=\"input\"\n placeholder=\"Zoeken...\"\n value={this.query}\n onInput={(ev) =>\n this._queryObserver.next(\n (ev.target as HTMLInputElement).value\n )\n }\n />\n </p-input-group>\n )}\n\n {this.enableFilter && (\n <p-button\n icon=\"filter\"\n variant=\"secondary\"\n size=\"small\"\n class=\"w-full desktop-xs:w-auto\"\n onClick={() => this.filter.emit()}\n >\n {this.filterButtonTemplate\n ? this.filterButtonTemplate()\n : this._defaultFilterButtonTemplate()}\n {this.selectedFiltersAmount &&\n this._getLabel(this.selectedFiltersAmount)}\n {mobileTotal > 0 &&\n this._getLabel(mobileTotal, 'mobile')}\n </p-button>\n )}\n\n {this.enableEdit && this._buttonTemplate()}\n </div>\n\n {this.enableEdit && this.canEdit && (\n <div class=\"fixed bottom-0 left-0 block w-full border border-solid border-transparent border-t-mystic-dark bg-white p-4 desktop-xs:hidden\">\n {this._buttonTemplate(true)}\n </div>\n )}\n </Host>\n );\n }\n\n @Listen('localeChanged', { target: 'body' })\n private async _setLocales(): Promise<void> {\n this._locales = await getLocaleComponentStrings(this._el);\n }\n\n private _buttonTemplate(mobile = false) {\n return (\n <p-button\n class={mobile ? 'w-full' : 'hidden desktop-xs:flex'}\n icon={this.editIcon}\n size=\"small\"\n disabled={!this.canEdit}\n onClick={() => this.edit.emit()}\n loading={this.editLoading}\n >\n {this.editButtonTemplate\n ? this.editButtonTemplate(\n mobile ? this.itemsSelectedAmount : 0\n )\n : this._defaultEditButtonTemplate(\n mobile ? this.itemsSelectedAmount : 0\n )}\n </p-button>\n );\n }\n\n private _getLabel(amount, variant: 'mobile' | 'default' = 'default') {\n return (\n <p-label\n size=\"small\"\n variant=\"negative\"\n behavior=\"text\"\n class={`ml-1 ${\n variant === 'default'\n ? 'hidden desktop-xs:flex'\n : 'flex desktop-xs:hidden'\n }`}\n >\n {amount}\n </p-label>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toast.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/toast/toast.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAS9E,MAAM,OAAO,KAAK;;mBAI0C,UAAU;;;wBAelC,IAAI;sBAKF,UAAU;;;;
|
|
1
|
+
{"version":3,"file":"toast.component.js","sourceRoot":"","sources":["../../../../src/components/molecules/toast/toast.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAS9E,MAAM,OAAO,KAAK;;mBAI0C,UAAU;;;wBAelC,IAAI;sBAKF,UAAU;;;;EAmB5C,MAAM;;IACF,OAAO,CACH,EAAC,IAAI,IACD,KAAK,EAAE,mBAAmB,IAAI,CAAC,OAAO,EAAE,EACxC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;MAE9B,WAAK,KAAK,EAAC,8BAA8B;QACrC,SAAG,KAAK,EAAC,0BAA0B,IAC9B,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,MAAM,EAAC,CAAC,CAAC,CACnB,IAAI,CAAC,MAAM,CACd,CAAC,CAAC,CAAC,CACA,YAAM,IAAI,EAAC,QAAQ,GAAG,CACzB,CACD;QACJ,SAAG,KAAK,EAAC,kCAAkC,IACtC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,MAAM,EAAC,CAAC,CAAC,CACpB,IAAI,CAAC,OAAO,CACf,CAAC,CAAC,CAAC,CACA,YAAM,IAAI,EAAC,SAAS,GAAG,CAC1B,CACD,CACF;MAEL,IAAI,CAAC,YAAY,IAAI,CAClB,gBACI,OAAO,EAAC,WAAW,EACnB,QAAQ,QACR,IAAI,EAAC,OAAO,EACZ,IAAI,EAAE,IAAI,CAAC,UAAU,EACrB,QAAQ,EAAE,IAAI,CAAC,cAAc,EAC7B,UAAU,EAAE,IAAI,CAAC,gBAAgB,EACjC,KAAK,EAAC,eAAe,GACvB,CACL,CACE,CACV,CAAC;EACN,CAAC;EAEO,QAAQ;IACZ,IAAI,IAAI,CAAC,YAAY,EAAE;MACnB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;KACtB;EACL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import { Component, Event, EventEmitter, h, Host, Prop } from '@stencil/core';\nimport { RotateOptions } from '../../../types';\nimport { IconFlipOptions, IconVariant } from '../../atoms/icon/icon.component';\n\n@Component({\n tag: 'p-toast',\n styleUrl: 'toast.component.scss',\n shadow: true,\n})\nexport class Toast {\n /**\n * The variant of the toast\n */\n @Prop() variant: 'positive' | 'unbiased' | 'negative' = 'positive';\n\n /**\n * The header of the toast\n */\n @Prop() header?: string;\n\n /**\n * The content of the toast\n */\n @Prop() content?: string;\n\n /**\n * Wether to enable the close button\n */\n @Prop() enableAction: boolean = true;\n\n /**\n * Icon to show on the button\n */\n @Prop() actionIcon: IconVariant = 'negative';\n\n /**\n * Icon flip\n */\n @Prop() actionIconFlip: IconFlipOptions;\n\n /**\n * Icon rotate\n */\n @Prop() actionIconRotate: RotateOptions;\n\n /**\n * Button click event\n */\n @Event({\n bubbles: false\n }) action: EventEmitter<MouseEvent>;\n\n render() {\n return (\n <Host\n class={`p-toast variant-${this.variant}`}\n onClick={() => this._onClick()}\n >\n <div class=\"flex flex-col w-full min-w-0\">\n <p class=\"font-semibold text-storm\">\n {this.header?.length ? (\n this.header\n ) : (\n <slot name=\"header\" />\n )}\n </p>\n <p class=\"text-sm text-storm-medium w-full\">\n {this.content?.length ? (\n this.content\n ) : (\n <slot name=\"content\" />\n )}\n </p>\n </div>\n\n {this.enableAction && (\n <p-button\n variant=\"secondary\"\n iconOnly\n size=\"small\"\n icon={this.actionIcon}\n iconFlip={this.actionIconFlip}\n iconRotate={this.actionIconRotate}\n class=\"flex-shrink-0\"\n />\n )}\n </Host>\n );\n }\n\n private _onClick() {\n if (this.enableAction) {\n this.action.emit();\n }\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, Host
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
2
|
export class Drawer {
|
|
3
3
|
constructor() {
|
|
4
4
|
this._hasHeaderSlot = false;
|
|
@@ -196,7 +196,7 @@ export class Drawer {
|
|
|
196
196
|
return [{
|
|
197
197
|
"method": "closeClicked",
|
|
198
198
|
"name": "closeClicked",
|
|
199
|
-
"bubbles":
|
|
199
|
+
"bubbles": false,
|
|
200
200
|
"cancelable": true,
|
|
201
201
|
"composed": true,
|
|
202
202
|
"docs": {
|
|
@@ -215,7 +215,7 @@ export class Drawer {
|
|
|
215
215
|
}, {
|
|
216
216
|
"method": "closed",
|
|
217
217
|
"name": "closed",
|
|
218
|
-
"bubbles":
|
|
218
|
+
"bubbles": false,
|
|
219
219
|
"cancelable": true,
|
|
220
220
|
"composed": true,
|
|
221
221
|
"docs": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/drawer/drawer.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,KAAK,
|
|
1
|
+
{"version":3,"file":"drawer.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/drawer/drawer.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,KAAK,EACR,MAAM,eAAe,CAAC;AAOvB,MAAM,OAAO,MAAM;;IA0DP,mBAAc,GAAG,KAAK,CAAC;;gBAjDP,KAAK;qBAKA,KAAK;qBAKd,IAAI;8BAKK,IAAI;oBAKL,IAAI;sBAKF,IAAI;oBA0BN,KAAK;;EAEjC,iBAAiB;IACb,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAC1C,0BAA0B,CAC7B,CAAC;EACN,CAAC;EAED,MAAM;;IACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;MACZ,OAAO;KACV;IAED,MAAM,aAAa,GAAG,YAAM,IAAI,EAAC,QAAQ,GAAG,CAAC;IAC7C,MAAM,WAAW,GAAG,YAAM,IAAI,EAAC,SAAS,GAAG,CAAC;IAE5C,OAAO,CACH,EAAC,IAAI,IAAC,KAAK,EAAC,UAAU;MAClB,kBACI,OAAO,EAAC,QAAQ,EAChB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,SAAS,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State\n} from '@stencil/core';\n\n@Component({\n tag: 'p-drawer',\n styleUrl: 'drawer.component.scss',\n shadow: true,\n})\nexport class Drawer {\n /**\n * The Header of the drawer\n */\n @Prop() header?: string;\n\n /**\n * Wether to show the drawer or not\n */\n @Prop() show: boolean = false;\n\n /**\n * Wether to apply blur to the backdrop\n */\n @Prop() applyBlur: boolean = false;\n\n /**\n * Wether to show the close on mobile in the header\n */\n @Prop() showClose = true;\n\n /**\n * Wether to hide the drawer when the backdrop is clicked\n */\n @Prop() backdropClickClose = true;\n\n /**\n * Wether the drawer can be closed\n */\n @Prop() canClose: boolean = true;\n\n /**\n * Wether we should scroll lock the body\n */\n @Prop() scrollLock: boolean = true;\n\n /**\n * Close click event\n */\n @Event({\n bubbles: false\n }) closeClicked: EventEmitter<{\n event: MouseEvent;\n canClose: boolean;\n }>;\n\n /**\n * Closed event\n */\n @Event({\n bubbles: false\n }) closed: EventEmitter<null>;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n private _hasHeaderSlot = false;\n\n @State() private _closing = false;\n\n componentWillLoad() {\n this._hasHeaderSlot = !!this._el.querySelector(\n ':scope > [slot=\"header\"]'\n );\n }\n\n render() {\n if (!this.show) {\n return;\n }\n\n const headerContent = <slot name=\"header\" />;\n const bodyContent = <slot name=\"content\" />;\n\n return (\n <Host class=\"p-drawer\">\n <p-backdrop\n variant=\"drawer\"\n applyBlur={this.applyBlur}\n onClicked={(ev) => this._backdropClick(ev.detail)}\n closing={this._closing}\n scrollLock={this.scrollLock}\n >\n <p-drawer-container closing={this._closing}>\n {(this.header?.length || this._hasHeaderSlot) && (\n <p-drawer-header\n show-close={this.showClose}\n onClose={(ev) => this.close(ev.detail)}\n >\n {this._hasHeaderSlot\n ? headerContent\n : this.header}\n </p-drawer-header>\n )}\n <p-drawer-body>{bodyContent}</p-drawer-body>\n </p-drawer-container>\n </p-backdrop>\n </Host>\n );\n }\n\n private _backdropClick(ev) {\n if (!this.backdropClickClose) {\n return;\n }\n\n this.close(ev);\n }\n\n public close(ev: MouseEvent) {\n this.closeClicked.emit({\n event: ev,\n canClose: this.canClose,\n });\n\n if (!this.canClose) {\n return;\n }\n\n this._closing = true;\n\n setTimeout(() => {\n this.show = false;\n this._closing = false;\n this.closed.emit();\n }, 250);\n }\n}\n"]}
|
|
@@ -221,7 +221,7 @@ export class Modal {
|
|
|
221
221
|
return [{
|
|
222
222
|
"method": "closeClicked",
|
|
223
223
|
"name": "closeClicked",
|
|
224
|
-
"bubbles":
|
|
224
|
+
"bubbles": false,
|
|
225
225
|
"cancelable": true,
|
|
226
226
|
"composed": true,
|
|
227
227
|
"docs": {
|
|
@@ -240,7 +240,7 @@ export class Modal {
|
|
|
240
240
|
}, {
|
|
241
241
|
"method": "closed",
|
|
242
242
|
"name": "closed",
|
|
243
|
-
"bubbles":
|
|
243
|
+
"bubbles": false,
|
|
244
244
|
"cancelable": true,
|
|
245
245
|
"composed": true,
|
|
246
246
|
"docs": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/modal/modal.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,KAAK,EACR,MAAM,eAAe,CAAC;AAMvB,MAAM,OAAO,KAAK;;
|
|
1
|
+
{"version":3,"file":"modal.component.js","sourceRoot":"","sources":["../../../../src/components/organisms/modal/modal.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,OAAO,EACP,KAAK,EAEL,CAAC,EACD,IAAI,EACJ,IAAI,EACJ,KAAK,EACR,MA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AAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,IAErC,IAAI,CAAC,cAAc;YAChB,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,IAAI,CAAC,MAAM,CACJ,CACpB;UACD,oBACI,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,OAAO,EAAE,CAAC,IAAI,CAAC,cAAc,IAE5B,WAAW,CACD;UACd,IAAI,CAAC,cAAc,IAAI,CACpB,0BAAiB,aAAa,CAAkB,CACnD,CACe,CACX,CACV,CACV,CAAC;EACN,CAAC;EAEO,cAAc,CAAC,EAAc;IACjC,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE;MAC1B,OAAO;KACV;IAED,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;EACnB,CAAC;EAEM,KAAK,CAAC,EAAc;IACvB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAE3B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IAErB,UAAU,CAAC,GAAG,EAAE;MACZ,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC;MAClB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;MAEtB,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC,EAAE,GAAG,CAAC,CAAC;EACZ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACJ","sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State\n} from '@stencil/core';\n\n@Component({\n tag: 'p-modal',\n shadow: true,\n})\nexport class Modal {\n /**\n * The size of the modal container\n */\n @Prop() size: 'sm' | 'md' | 'lg' | 'xl' = 'md';\n\n /**\n * The variant of the modal body\n */\n @Prop() variant: 'default' | 'table' = 'default';\n\n /**\n * The Header of the modal\n */\n @Prop() header?: string;\n\n /**\n * Wether to show the modal or not\n */\n @Prop() show: boolean = false;\n\n /**\n * Wether to apply blur to the backdrop\n */\n @Prop() applyBlur: boolean = false;\n\n /**\n * Wether to show the close button in the header\n */\n @Prop() showClose = true;\n\n /**\n * Wether to show the footer on mobile\n */\n @Prop() showMobileFooter = false;\n\n /**\n * Wether to hide the modal when the backdrop is clicked\n */\n @Prop() backdropClickClose = true;\n\n /**\n * Wether we should scroll lock the body\n */\n @Prop() scrollLock: boolean = true;\n\n /**\n * Close click event\n */\n @Event({\n bubbles: false\n }) closeClicked: EventEmitter<MouseEvent>;\n\n /**\n * Closed event\n */\n @Event({\n bubbles: false\n }) closed: EventEmitter<null>;\n\n /**\n * The host element\n */\n @Element() private _el: HTMLElement;\n\n private _hasFooterSlot = false;\n private _hasHeaderSlot = false;\n\n @State() private _closing = false;\n\n componentWillLoad() {\n this._hasFooterSlot = !!this._el.querySelector(\n ':scope > [slot=\"footer\"]'\n );\n this._hasHeaderSlot = !!this._el.querySelector(\n ':scope > [slot=\"header\"]'\n );\n }\n\n render() {\n if (!this.show) {\n return;\n }\n\n const headerContent = <slot name=\"header\" />;\n const bodyContent = <slot name=\"content\" />;\n const footerContent = <slot name=\"footer\" />;\n\n return (\n <Host class=\"p-modal\">\n <p-backdrop\n applyBlur={this.applyBlur}\n onClicked={(ev) => this._backdropClick(ev.detail)}\n closing={this._closing}\n scrollLock={this.scrollLock}\n >\n <p-modal-container size={this.size} closing={this._closing}>\n {(this.header?.length || this._hasHeaderSlot) && (\n <p-modal-header\n showClose={this.showClose}\n onClose={(ev) => this.close(ev.detail)}\n >\n {this._hasHeaderSlot\n ? headerContent\n : this.header}\n </p-modal-header>\n )}\n <p-modal-body\n variant={this.variant}\n rounded={!this._hasFooterSlot}\n >\n {bodyContent}\n </p-modal-body>\n {this._hasFooterSlot && (\n <p-modal-footer>{footerContent}</p-modal-footer>\n )}\n </p-modal-container>\n </p-backdrop>\n </Host>\n );\n }\n\n private _backdropClick(ev: MouseEvent) {\n if (!this.backdropClickClose) {\n return;\n }\n\n this.close(ev);\n }\n\n public close(ev: MouseEvent) {\n this.closeClicked.emit(ev);\n\n this._closing = true;\n\n setTimeout(() => {\n this.show = false;\n this._closing = false;\n\n this.closed.emit();\n }, 550);\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h, Host
|
|
1
|
+
import { h, Host } from '@stencil/core';
|
|
2
2
|
import { formatTranslation, getLocaleComponentStrings } from '../../../utils';
|
|
3
|
-
import { defaultSize, defaultSizeOptions
|
|
3
|
+
import { defaultSize, defaultSizeOptions } from '../../molecules/page-size-select/constants';
|
|
4
4
|
export class Table {
|
|
5
5
|
constructor() {
|
|
6
6
|
this._ctrlDown = false;
|
|
@@ -1052,7 +1052,7 @@ export class Table {
|
|
|
1052
1052
|
return [{
|
|
1053
1053
|
"method": "selectedRowsChange",
|
|
1054
1054
|
"name": "selectedRowsChange",
|
|
1055
|
-
"bubbles":
|
|
1055
|
+
"bubbles": false,
|
|
1056
1056
|
"cancelable": true,
|
|
1057
1057
|
"composed": true,
|
|
1058
1058
|
"docs": {
|
|
@@ -1067,7 +1067,7 @@ export class Table {
|
|
|
1067
1067
|
}, {
|
|
1068
1068
|
"method": "rowClick",
|
|
1069
1069
|
"name": "rowClick",
|
|
1070
|
-
"bubbles":
|
|
1070
|
+
"bubbles": false,
|
|
1071
1071
|
"cancelable": true,
|
|
1072
1072
|
"composed": true,
|
|
1073
1073
|
"docs": {
|
|
@@ -1087,7 +1087,7 @@ export class Table {
|
|
|
1087
1087
|
}, {
|
|
1088
1088
|
"method": "rowSelected",
|
|
1089
1089
|
"name": "rowSelected",
|
|
1090
|
-
"bubbles":
|
|
1090
|
+
"bubbles": false,
|
|
1091
1091
|
"cancelable": true,
|
|
1092
1092
|
"composed": true,
|
|
1093
1093
|
"docs": {
|
|
@@ -1102,7 +1102,7 @@ export class Table {
|
|
|
1102
1102
|
}, {
|
|
1103
1103
|
"method": "rowDeselected",
|
|
1104
1104
|
"name": "rowDeselected",
|
|
1105
|
-
"bubbles":
|
|
1105
|
+
"bubbles": false,
|
|
1106
1106
|
"cancelable": true,
|
|
1107
1107
|
"composed": true,
|
|
1108
1108
|
"docs": {
|
|
@@ -1117,7 +1117,7 @@ export class Table {
|
|
|
1117
1117
|
}, {
|
|
1118
1118
|
"method": "hasRendered",
|
|
1119
1119
|
"name": "hasRendered",
|
|
1120
|
-
"bubbles":
|
|
1120
|
+
"bubbles": false,
|
|
1121
1121
|
"cancelable": true,
|
|
1122
1122
|
"composed": true,
|
|
1123
1123
|
"docs": {
|
|
@@ -1132,7 +1132,7 @@ export class Table {
|
|
|
1132
1132
|
}, {
|
|
1133
1133
|
"method": "quickFilter",
|
|
1134
1134
|
"name": "quickFilter",
|
|
1135
|
-
"bubbles":
|
|
1135
|
+
"bubbles": false,
|
|
1136
1136
|
"cancelable": true,
|
|
1137
1137
|
"composed": true,
|
|
1138
1138
|
"docs": {
|
|
@@ -1152,7 +1152,7 @@ export class Table {
|
|
|
1152
1152
|
}, {
|
|
1153
1153
|
"method": "queryChange",
|
|
1154
1154
|
"name": "queryChange",
|
|
1155
|
-
"bubbles":
|
|
1155
|
+
"bubbles": false,
|
|
1156
1156
|
"cancelable": true,
|
|
1157
1157
|
"composed": true,
|
|
1158
1158
|
"docs": {
|
|
@@ -1167,7 +1167,7 @@ export class Table {
|
|
|
1167
1167
|
}, {
|
|
1168
1168
|
"method": "filter",
|
|
1169
1169
|
"name": "filter",
|
|
1170
|
-
"bubbles":
|
|
1170
|
+
"bubbles": false,
|
|
1171
1171
|
"cancelable": true,
|
|
1172
1172
|
"composed": true,
|
|
1173
1173
|
"docs": {
|
|
@@ -1182,7 +1182,7 @@ export class Table {
|
|
|
1182
1182
|
}, {
|
|
1183
1183
|
"method": "edit",
|
|
1184
1184
|
"name": "edit",
|
|
1185
|
-
"bubbles":
|
|
1185
|
+
"bubbles": false,
|
|
1186
1186
|
"cancelable": true,
|
|
1187
1187
|
"composed": true,
|
|
1188
1188
|
"docs": {
|
|
@@ -1197,7 +1197,7 @@ export class Table {
|
|
|
1197
1197
|
}, {
|
|
1198
1198
|
"method": "pageChange",
|
|
1199
1199
|
"name": "pageChange",
|
|
1200
|
-
"bubbles":
|
|
1200
|
+
"bubbles": false,
|
|
1201
1201
|
"cancelable": true,
|
|
1202
1202
|
"composed": true,
|
|
1203
1203
|
"docs": {
|
|
@@ -1212,7 +1212,7 @@ export class Table {
|
|
|
1212
1212
|
}, {
|
|
1213
1213
|
"method": "pageSizeChange",
|
|
1214
1214
|
"name": "pageSizeChange",
|
|
1215
|
-
"bubbles":
|
|
1215
|
+
"bubbles": false,
|
|
1216
1216
|
"cancelable": true,
|
|
1217
1217
|
"composed": true,
|
|
1218
1218
|
"docs": {
|
|
@@ -1227,7 +1227,7 @@ export class Table {
|
|
|
1227
1227
|
}, {
|
|
1228
1228
|
"method": "export",
|
|
1229
1229
|
"name": "export",
|
|
1230
|
-
"bubbles":
|
|
1230
|
+
"bubbles": false,
|
|
1231
1231
|
"cancelable": true,
|
|
1232
1232
|
"composed": true,
|
|
1233
1233
|
"docs": {
|
|
@@ -1242,7 +1242,7 @@ export class Table {
|
|
|
1242
1242
|
}, {
|
|
1243
1243
|
"method": "emptyStateActionClick",
|
|
1244
1244
|
"name": "emptyStateActionClick",
|
|
1245
|
-
"bubbles":
|
|
1245
|
+
"bubbles": false,
|
|
1246
1246
|
"cancelable": true,
|
|
1247
1247
|
"composed": true,
|
|
1248
1248
|
"docs": {
|