@hortonstudio/main 1.2.5 → 1.2.6
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/attributes-master/.changeset/README.md +8 -0
- package/attributes-master/.changeset/config.json +11 -0
- package/attributes-master/.gitattributes +2 -0
- package/attributes-master/.github/ISSUE_TEMPLATE/bug_report.md +42 -0
- package/attributes-master/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
- package/attributes-master/.github/workflows/ci.yml +66 -0
- package/attributes-master/.github/workflows/release.yml +40 -0
- package/attributes-master/.prettierignore +3 -0
- package/attributes-master/.prettierrc +8 -0
- package/attributes-master/.vscode/extensions.json +3 -0
- package/attributes-master/.vscode/settings.json +7 -0
- package/attributes-master/CONTRIBUTING.md +72 -0
- package/attributes-master/LICENSE.md +201 -0
- package/attributes-master/README.md +31 -0
- package/attributes-master/eslint.config.js +3 -0
- package/attributes-master/package.json +34 -0
- package/attributes-master/packages/accordion/CHANGELOG.md +89 -0
- package/attributes-master/packages/accordion/README.md +31 -0
- package/attributes-master/packages/accordion/package.json +25 -0
- package/attributes-master/packages/accordion/src/actions/a11y.ts +39 -0
- package/attributes-master/packages/accordion/src/actions/classes.ts +27 -0
- package/attributes-master/packages/accordion/src/actions/content.ts +42 -0
- package/attributes-master/packages/accordion/src/actions/list.ts +36 -0
- package/attributes-master/packages/accordion/src/actions/query.ts +27 -0
- package/attributes-master/packages/accordion/src/actions/settings.ts +61 -0
- package/attributes-master/packages/accordion/src/factory.ts +145 -0
- package/attributes-master/packages/accordion/src/index.ts +3 -0
- package/attributes-master/packages/accordion/src/init.ts +37 -0
- package/attributes-master/packages/accordion/src/utils/constants.ts +62 -0
- package/attributes-master/packages/accordion/src/utils/helpers.ts +5 -0
- package/attributes-master/packages/accordion/src/utils/selectors.ts +12 -0
- package/attributes-master/packages/accordion/src/utils/types.ts +23 -0
- package/attributes-master/packages/accordion/tsconfig.json +3 -0
- package/attributes-master/packages/attributes/CHANGELOG.md +564 -0
- package/attributes-master/packages/attributes/README.md +66 -0
- package/attributes-master/packages/attributes/bin/build.ts +107 -0
- package/attributes-master/packages/attributes/bin/live-reload.js +1 -0
- package/attributes-master/packages/attributes/package.json +77 -0
- package/attributes-master/packages/attributes/playwright.config.ts +89 -0
- package/attributes-master/packages/attributes/src/attributes.ts +153 -0
- package/attributes-master/packages/attributes/src/load.ts +125 -0
- package/attributes-master/packages/attributes/tests/accordion.spec.ts +137 -0
- package/attributes-master/packages/attributes/tests/codehighlight.spec.ts +23 -0
- package/attributes-master/packages/attributes/tests/combobox.spec.ts +321 -0
- package/attributes-master/packages/attributes/tests/copyclip.spec.ts +19 -0
- package/attributes-master/packages/attributes/tests/displayvalues.spec.ts +48 -0
- package/attributes-master/packages/attributes/tests/favcustom.spec.ts +23 -0
- package/attributes-master/packages/attributes/tests/inject.spec.ts +40 -0
- package/attributes-master/packages/attributes/tests/inputactive.spec.ts +77 -0
- package/attributes-master/packages/attributes/tests/inputcounter.spec.ts +83 -0
- package/attributes-master/packages/attributes/tests/list.spec.ts +800 -0
- package/attributes-master/packages/attributes/tests/mirrorclick.spec.ts +22 -0
- package/attributes-master/packages/attributes/tests/mirrorinput.spec.ts +37 -0
- package/attributes-master/packages/attributes/tests/modal.spec.ts +34 -0
- package/attributes-master/packages/attributes/tests/numbercount.spec.ts +40 -0
- package/attributes-master/packages/attributes/tests/readtime.spec.ts +19 -0
- package/attributes-master/packages/attributes/tests/selectcustom.spec.ts +51 -0
- package/attributes-master/packages/attributes/tests/socialshare.spec.ts +54 -0
- package/attributes-master/packages/attributes/tests/starrating.spec.ts +79 -0
- package/attributes-master/packages/attributes/tests/toc.spec.ts +38 -0
- package/attributes-master/packages/attributes/tests/utils/index.ts +16 -0
- package/attributes-master/packages/attributes/tsconfig.json +6 -0
- package/attributes-master/packages/autovideo/CHANGELOG.md +182 -0
- package/attributes-master/packages/autovideo/README.md +31 -0
- package/attributes-master/packages/autovideo/package.json +22 -0
- package/attributes-master/packages/autovideo/src/index.ts +3 -0
- package/attributes-master/packages/autovideo/src/init.ts +52 -0
- package/attributes-master/packages/autovideo/src/types.ts +5 -0
- package/attributes-master/packages/autovideo/src/utils/constants.ts +4 -0
- package/attributes-master/packages/autovideo/tsconfig.json +3 -0
- package/attributes-master/packages/codehighlight/CHANGELOG.md +185 -0
- package/attributes-master/packages/codehighlight/README.md +27 -0
- package/attributes-master/packages/codehighlight/package.json +23 -0
- package/attributes-master/packages/codehighlight/src/actions/import.ts +50 -0
- package/attributes-master/packages/codehighlight/src/index.ts +3 -0
- package/attributes-master/packages/codehighlight/src/init.ts +53 -0
- package/attributes-master/packages/codehighlight/src/utils/constants.ts +24 -0
- package/attributes-master/packages/codehighlight/src/utils/selectors.ts +5 -0
- package/attributes-master/packages/codehighlight/src/utils/themes.ts +202 -0
- package/attributes-master/packages/codehighlight/tsconfig.json +3 -0
- package/attributes-master/packages/combobox/CHANGELOG.md +99 -0
- package/attributes-master/packages/combobox/README.md +27 -0
- package/attributes-master/packages/combobox/package.json +23 -0
- package/attributes-master/packages/combobox/src/actions/a11y.ts +29 -0
- package/attributes-master/packages/combobox/src/actions/body/index.ts +12 -0
- package/attributes-master/packages/combobox/src/actions/clearDropdown/index.ts +37 -0
- package/attributes-master/packages/combobox/src/actions/dropdownList/index.ts +220 -0
- package/attributes-master/packages/combobox/src/actions/dropdownToggle/index.ts +34 -0
- package/attributes-master/packages/combobox/src/actions/events.ts +75 -0
- package/attributes-master/packages/combobox/src/actions/input/index.ts +235 -0
- package/attributes-master/packages/combobox/src/actions/observe.ts +158 -0
- package/attributes-master/packages/combobox/src/actions/populate.ts +97 -0
- package/attributes-master/packages/combobox/src/actions/selectElement/index.ts +23 -0
- package/attributes-master/packages/combobox/src/actions/settings.ts +134 -0
- package/attributes-master/packages/combobox/src/actions/state.ts +34 -0
- package/attributes-master/packages/combobox/src/index.ts +3 -0
- package/attributes-master/packages/combobox/src/init.ts +52 -0
- package/attributes-master/packages/combobox/src/utils/constants.ts +48 -0
- package/attributes-master/packages/combobox/src/utils/dropdowns.ts +120 -0
- package/attributes-master/packages/combobox/src/utils/index.ts +1 -0
- package/attributes-master/packages/combobox/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/combobox/src/utils/types.ts +14 -0
- package/attributes-master/packages/combobox/tsconfig.json +3 -0
- package/attributes-master/packages/copyclip/CHANGELOG.md +213 -0
- package/attributes-master/packages/copyclip/README.md +27 -0
- package/attributes-master/packages/copyclip/package.json +23 -0
- package/attributes-master/packages/copyclip/src/factory.ts +67 -0
- package/attributes-master/packages/copyclip/src/index.ts +3 -0
- package/attributes-master/packages/copyclip/src/init.ts +68 -0
- package/attributes-master/packages/copyclip/src/utils/constants.ts +40 -0
- package/attributes-master/packages/copyclip/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/copyclip/tsconfig.json +3 -0
- package/attributes-master/packages/displayvalues/CHANGELOG.md +164 -0
- package/attributes-master/packages/displayvalues/README.md +27 -0
- package/attributes-master/packages/displayvalues/package.json +22 -0
- package/attributes-master/packages/displayvalues/src/actions/collect.ts +17 -0
- package/attributes-master/packages/displayvalues/src/actions/events.ts +22 -0
- package/attributes-master/packages/displayvalues/src/actions/sync.ts +23 -0
- package/attributes-master/packages/displayvalues/src/index.ts +3 -0
- package/attributes-master/packages/displayvalues/src/init.ts +31 -0
- package/attributes-master/packages/displayvalues/src/utils/constants.ts +20 -0
- package/attributes-master/packages/displayvalues/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/displayvalues/src/utils/stores.ts +3 -0
- package/attributes-master/packages/displayvalues/tsconfig.json +3 -0
- package/attributes-master/packages/docs/CHANGELOG.md +108 -0
- package/attributes-master/packages/docs/README.md +3 -0
- package/attributes-master/packages/docs/bin/build.js +92 -0
- package/attributes-master/packages/docs/bin/live-reload.js +1 -0
- package/attributes-master/packages/docs/package.json +40 -0
- package/attributes-master/packages/docs/src/copy.ts +260 -0
- package/attributes-master/packages/docs/src/x-ray.ts +377 -0
- package/attributes-master/packages/docs/tsconfig.json +3 -0
- package/attributes-master/packages/favcustom/CHANGELOG.md +194 -0
- package/attributes-master/packages/favcustom/README.md +27 -0
- package/attributes-master/packages/favcustom/package.json +22 -0
- package/attributes-master/packages/favcustom/src/index.ts +3 -0
- package/attributes-master/packages/favcustom/src/init.ts +30 -0
- package/attributes-master/packages/favcustom/src/utils/constants.ts +10 -0
- package/attributes-master/packages/favcustom/src/utils/selectors.ts +5 -0
- package/attributes-master/packages/favcustom/tsconfig.json +3 -0
- package/attributes-master/packages/formsubmit/CHANGELOG.md +161 -0
- package/attributes-master/packages/formsubmit/README.md +51 -0
- package/attributes-master/packages/formsubmit/package.json +22 -0
- package/attributes-master/packages/formsubmit/src/actions/redirect.ts +9 -0
- package/attributes-master/packages/formsubmit/src/actions/reset.ts +49 -0
- package/attributes-master/packages/formsubmit/src/actions/submit.ts +34 -0
- package/attributes-master/packages/formsubmit/src/components/Form.ts +231 -0
- package/attributes-master/packages/formsubmit/src/factory.ts +62 -0
- package/attributes-master/packages/formsubmit/src/index.ts +3 -0
- package/attributes-master/packages/formsubmit/src/init.ts +24 -0
- package/attributes-master/packages/formsubmit/src/utils/attributes.ts +19 -0
- package/attributes-master/packages/formsubmit/src/utils/constants.ts +89 -0
- package/attributes-master/packages/formsubmit/src/utils/dom.ts +76 -0
- package/attributes-master/packages/formsubmit/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/formsubmit/src/utils/types.ts +7 -0
- package/attributes-master/packages/formsubmit/tsconfig.json +3 -0
- package/attributes-master/packages/inject/CHANGELOG.md +117 -0
- package/attributes-master/packages/inject/README.md +60 -0
- package/attributes-master/packages/inject/package.json +22 -0
- package/attributes-master/packages/inject/src/actions/collect.ts +125 -0
- package/attributes-master/packages/inject/src/actions/css.ts +27 -0
- package/attributes-master/packages/inject/src/actions/prefetch.ts +44 -0
- package/attributes-master/packages/inject/src/factory.ts +123 -0
- package/attributes-master/packages/inject/src/index.ts +3 -0
- package/attributes-master/packages/inject/src/init.ts +22 -0
- package/attributes-master/packages/inject/src/utils/constants.ts +89 -0
- package/attributes-master/packages/inject/src/utils/helpers.ts +36 -0
- package/attributes-master/packages/inject/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/inject/src/utils/types.ts +16 -0
- package/attributes-master/packages/inject/tsconfig.json +3 -0
- package/attributes-master/packages/inputactive/CHANGELOG.md +58 -0
- package/attributes-master/packages/inputactive/README.md +25 -0
- package/attributes-master/packages/inputactive/package.json +22 -0
- package/attributes-master/packages/inputactive/src/actions/classes.ts +43 -0
- package/attributes-master/packages/inputactive/src/factory.ts +24 -0
- package/attributes-master/packages/inputactive/src/index.ts +3 -0
- package/attributes-master/packages/inputactive/src/init.ts +18 -0
- package/attributes-master/packages/inputactive/src/utils/constants.ts +13 -0
- package/attributes-master/packages/inputactive/src/utils/selectors.ts +5 -0
- package/attributes-master/packages/inputactive/tsconfig.json +3 -0
- package/attributes-master/packages/inputcounter/CHANGELOG.md +110 -0
- package/attributes-master/packages/inputcounter/README.md +25 -0
- package/attributes-master/packages/inputcounter/package.json +22 -0
- package/attributes-master/packages/inputcounter/src/actions/a11y.ts +23 -0
- package/attributes-master/packages/inputcounter/src/actions/buttons.ts +61 -0
- package/attributes-master/packages/inputcounter/src/actions/input.ts +31 -0
- package/attributes-master/packages/inputcounter/src/actions/style.ts +12 -0
- package/attributes-master/packages/inputcounter/src/factory.ts +51 -0
- package/attributes-master/packages/inputcounter/src/index.ts +3 -0
- package/attributes-master/packages/inputcounter/src/init.ts +22 -0
- package/attributes-master/packages/inputcounter/src/utils/constants.ts +59 -0
- package/attributes-master/packages/inputcounter/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/inputcounter/tsconfig.json +3 -0
- package/attributes-master/packages/list/CHANGELOG.md +185 -0
- package/attributes-master/packages/list/README.md +331 -0
- package/attributes-master/packages/list/package.json +37 -0
- package/attributes-master/packages/list/src/combine/index.ts +38 -0
- package/attributes-master/packages/list/src/components/List.ts +861 -0
- package/attributes-master/packages/list/src/components/ListItem.ts +229 -0
- package/attributes-master/packages/list/src/components/index.ts +2 -0
- package/attributes-master/packages/list/src/factory.ts +130 -0
- package/attributes-master/packages/list/src/filter/dynamic/conditions.ts +639 -0
- package/attributes-master/packages/list/src/filter/dynamic/groups.ts +221 -0
- package/attributes-master/packages/list/src/filter/dynamic/index.ts +119 -0
- package/attributes-master/packages/list/src/filter/dynamic/utils.ts +44 -0
- package/attributes-master/packages/list/src/filter/elements.ts +93 -0
- package/attributes-master/packages/list/src/filter/filter.ts +118 -0
- package/attributes-master/packages/list/src/filter/filter.worker.ts +152 -0
- package/attributes-master/packages/list/src/filter/index.ts +94 -0
- package/attributes-master/packages/list/src/filter/standard/conditions.ts +123 -0
- package/attributes-master/packages/list/src/filter/standard/facets.ts +253 -0
- package/attributes-master/packages/list/src/filter/standard/index.ts +176 -0
- package/attributes-master/packages/list/src/filter/standard/query.ts +111 -0
- package/attributes-master/packages/list/src/filter/tags.ts +314 -0
- package/attributes-master/packages/list/src/filter/types.ts +62 -0
- package/attributes-master/packages/list/src/filter/utils.ts +126 -0
- package/attributes-master/packages/list/src/index.ts +4 -0
- package/attributes-master/packages/list/src/init.ts +38 -0
- package/attributes-master/packages/list/src/load/all.ts +27 -0
- package/attributes-master/packages/list/src/load/elements.ts +39 -0
- package/attributes-master/packages/list/src/load/index.ts +63 -0
- package/attributes-master/packages/list/src/load/infinite.ts +79 -0
- package/attributes-master/packages/list/src/load/load.ts +191 -0
- package/attributes-master/packages/list/src/load/more.ts +97 -0
- package/attributes-master/packages/list/src/load/pagination.ts +402 -0
- package/attributes-master/packages/list/src/nest/index.ts +198 -0
- package/attributes-master/packages/list/src/prevnext/index.ts +98 -0
- package/attributes-master/packages/list/src/select/index.ts +56 -0
- package/attributes-master/packages/list/src/slider/index.ts +62 -0
- package/attributes-master/packages/list/src/sort/buttons.ts +96 -0
- package/attributes-master/packages/list/src/sort/dropdown.ts +179 -0
- package/attributes-master/packages/list/src/sort/index.ts +81 -0
- package/attributes-master/packages/list/src/sort/query.ts +63 -0
- package/attributes-master/packages/list/src/sort/select.ts +67 -0
- package/attributes-master/packages/list/src/sort/sort.ts +79 -0
- package/attributes-master/packages/list/src/sort/types.ts +28 -0
- package/attributes-master/packages/list/src/static/index.ts +73 -0
- package/attributes-master/packages/list/src/tabs/index.ts +97 -0
- package/attributes-master/packages/list/src/utils/constants.ts +728 -0
- package/attributes-master/packages/list/src/utils/dom.ts +108 -0
- package/attributes-master/packages/list/src/utils/pagination.ts +14 -0
- package/attributes-master/packages/list/src/utils/selectors.ts +18 -0
- package/attributes-master/packages/list/src/utils/store.ts +5 -0
- package/attributes-master/packages/list/tsconfig.json +3 -0
- package/attributes-master/packages/mirrorclick/CHANGELOG.md +171 -0
- package/attributes-master/packages/mirrorclick/README.md +25 -0
- package/attributes-master/packages/mirrorclick/package.json +22 -0
- package/attributes-master/packages/mirrorclick/src/index.ts +3 -0
- package/attributes-master/packages/mirrorclick/src/init.ts +35 -0
- package/attributes-master/packages/mirrorclick/src/utils/constants.ts +20 -0
- package/attributes-master/packages/mirrorclick/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/mirrorclick/tsconfig.json +3 -0
- package/attributes-master/packages/mirrorinput/CHANGELOG.md +172 -0
- package/attributes-master/packages/mirrorinput/README.md +25 -0
- package/attributes-master/packages/mirrorinput/package.json +22 -0
- package/attributes-master/packages/mirrorinput/src/index.ts +3 -0
- package/attributes-master/packages/mirrorinput/src/init.ts +48 -0
- package/attributes-master/packages/mirrorinput/src/utils/constants.ts +15 -0
- package/attributes-master/packages/mirrorinput/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/mirrorinput/tsconfig.json +3 -0
- package/attributes-master/packages/modal/CHANGELOG.md +94 -0
- package/attributes-master/packages/modal/README.md +29 -0
- package/attributes-master/packages/modal/package.json +23 -0
- package/attributes-master/packages/modal/src/actions/a11y.ts +46 -0
- package/attributes-master/packages/modal/src/actions/modal.ts +164 -0
- package/attributes-master/packages/modal/src/actions/settings.ts +21 -0
- package/attributes-master/packages/modal/src/factory.ts +26 -0
- package/attributes-master/packages/modal/src/index.ts +3 -0
- package/attributes-master/packages/modal/src/init.ts +22 -0
- package/attributes-master/packages/modal/src/utils/constants.ts +54 -0
- package/attributes-master/packages/modal/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/modal/src/utils/types.ts +12 -0
- package/attributes-master/packages/modal/tsconfig.json +3 -0
- package/attributes-master/packages/numbercount/CHANGELOG.md +90 -0
- package/attributes-master/packages/numbercount/README.md +27 -0
- package/attributes-master/packages/numbercount/package.json +23 -0
- package/attributes-master/packages/numbercount/src/actions/a11y.ts +26 -0
- package/attributes-master/packages/numbercount/src/actions/animate.ts +43 -0
- package/attributes-master/packages/numbercount/src/actions/observe.ts +44 -0
- package/attributes-master/packages/numbercount/src/factory.ts +31 -0
- package/attributes-master/packages/numbercount/src/index.ts +3 -0
- package/attributes-master/packages/numbercount/src/init.ts +22 -0
- package/attributes-master/packages/numbercount/src/utils/constants.ts +40 -0
- package/attributes-master/packages/numbercount/src/utils/helpers.ts +31 -0
- package/attributes-master/packages/numbercount/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/numbercount/tsconfig.json +3 -0
- package/attributes-master/packages/queryparam/CHANGELOG.md +118 -0
- package/attributes-master/packages/queryparam/README.md +25 -0
- package/attributes-master/packages/queryparam/package.json +22 -0
- package/attributes-master/packages/queryparam/src/factory.ts +51 -0
- package/attributes-master/packages/queryparam/src/index.ts +3 -0
- package/attributes-master/packages/queryparam/src/init.ts +40 -0
- package/attributes-master/packages/queryparam/src/utils/constants.ts +18 -0
- package/attributes-master/packages/queryparam/src/utils/selectors.ts +5 -0
- package/attributes-master/packages/queryparam/tsconfig.json +3 -0
- package/attributes-master/packages/rangeslider/CHANGELOG.md +236 -0
- package/attributes-master/packages/rangeslider/README.md +95 -0
- package/attributes-master/packages/rangeslider/package.json +23 -0
- package/attributes-master/packages/rangeslider/src/actions/a11y.ts +21 -0
- package/attributes-master/packages/rangeslider/src/actions/events.ts +9 -0
- package/attributes-master/packages/rangeslider/src/actions/settings.ts +97 -0
- package/attributes-master/packages/rangeslider/src/actions/styles.ts +10 -0
- package/attributes-master/packages/rangeslider/src/actions/values.ts +47 -0
- package/attributes-master/packages/rangeslider/src/components/Fill.ts +70 -0
- package/attributes-master/packages/rangeslider/src/components/Handle.ts +281 -0
- package/attributes-master/packages/rangeslider/src/factory.ts +100 -0
- package/attributes-master/packages/rangeslider/src/index.ts +3 -0
- package/attributes-master/packages/rangeslider/src/init.ts +194 -0
- package/attributes-master/packages/rangeslider/src/utils/constants.ts +87 -0
- package/attributes-master/packages/rangeslider/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/rangeslider/src/utils/types.ts +6 -0
- package/attributes-master/packages/rangeslider/tsconfig.json +3 -0
- package/attributes-master/packages/readtime/CHANGELOG.md +108 -0
- package/attributes-master/packages/readtime/README.md +25 -0
- package/attributes-master/packages/readtime/package.json +22 -0
- package/attributes-master/packages/readtime/src/factory.ts +21 -0
- package/attributes-master/packages/readtime/src/index.ts +3 -0
- package/attributes-master/packages/readtime/src/init.ts +19 -0
- package/attributes-master/packages/readtime/src/utils/constants.ts +33 -0
- package/attributes-master/packages/readtime/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/readtime/tsconfig.json +3 -0
- package/attributes-master/packages/removequery/CHANGELOG.md +8 -0
- package/attributes-master/packages/removequery/README.md +25 -0
- package/attributes-master/packages/removequery/package.json +22 -0
- package/attributes-master/packages/removequery/src/index.ts +3 -0
- package/attributes-master/packages/removequery/src/init.ts +18 -0
- package/attributes-master/packages/removequery/src/utils/constants.ts +5 -0
- package/attributes-master/packages/removequery/tsconfig.json +3 -0
- package/attributes-master/packages/scrolldisable/CHANGELOG.md +164 -0
- package/attributes-master/packages/scrolldisable/README.md +29 -0
- package/attributes-master/packages/scrolldisable/package.json +27 -0
- package/attributes-master/packages/scrolldisable/src/click.ts +40 -0
- package/attributes-master/packages/scrolldisable/src/display.ts +117 -0
- package/attributes-master/packages/scrolldisable/src/index.ts +3 -0
- package/attributes-master/packages/scrolldisable/src/init.ts +36 -0
- package/attributes-master/packages/scrolldisable/src/scroll.ts +63 -0
- package/attributes-master/packages/scrolldisable/src/utils/constants.ts +56 -0
- package/attributes-master/packages/scrolldisable/src/utils/selectors.ts +6 -0
- package/attributes-master/packages/scrolldisable/tsconfig.json +3 -0
- package/attributes-master/packages/selectcustom/CHANGELOG.md +242 -0
- package/attributes-master/packages/selectcustom/README.md +25 -0
- package/attributes-master/packages/selectcustom/package.json +23 -0
- package/attributes-master/packages/selectcustom/src/actions/a11y.ts +29 -0
- package/attributes-master/packages/selectcustom/src/actions/events.ts +159 -0
- package/attributes-master/packages/selectcustom/src/actions/observe.ts +83 -0
- package/attributes-master/packages/selectcustom/src/actions/populate.ts +67 -0
- package/attributes-master/packages/selectcustom/src/actions/settings.ts +68 -0
- package/attributes-master/packages/selectcustom/src/actions/state.ts +41 -0
- package/attributes-master/packages/selectcustom/src/index.ts +3 -0
- package/attributes-master/packages/selectcustom/src/init.ts +51 -0
- package/attributes-master/packages/selectcustom/src/utils/constants.ts +34 -0
- package/attributes-master/packages/selectcustom/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/selectcustom/src/utils/types.ts +14 -0
- package/attributes-master/packages/selectcustom/tsconfig.json +3 -0
- package/attributes-master/packages/sliderdots/CHANGELOG.md +220 -0
- package/attributes-master/packages/sliderdots/README.md +27 -0
- package/attributes-master/packages/sliderdots/package.json +22 -0
- package/attributes-master/packages/sliderdots/src/actions/events.ts +26 -0
- package/attributes-master/packages/sliderdots/src/actions/observe.ts +40 -0
- package/attributes-master/packages/sliderdots/src/actions/populate.ts +46 -0
- package/attributes-master/packages/sliderdots/src/actions/sync.ts +28 -0
- package/attributes-master/packages/sliderdots/src/actions/wait.ts +28 -0
- package/attributes-master/packages/sliderdots/src/factory.ts +57 -0
- package/attributes-master/packages/sliderdots/src/index.ts +3 -0
- package/attributes-master/packages/sliderdots/src/init.ts +30 -0
- package/attributes-master/packages/sliderdots/src/utils/constants.ts +33 -0
- package/attributes-master/packages/sliderdots/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/sliderdots/src/utils/types.ts +7 -0
- package/attributes-master/packages/sliderdots/tsconfig.json +3 -0
- package/attributes-master/packages/smartlightbox/CHANGELOG.md +203 -0
- package/attributes-master/packages/smartlightbox/README.md +25 -0
- package/attributes-master/packages/smartlightbox/package.json +22 -0
- package/attributes-master/packages/smartlightbox/src/actions/collect.ts +15 -0
- package/attributes-master/packages/smartlightbox/src/actions/move.ts +25 -0
- package/attributes-master/packages/smartlightbox/src/index.ts +3 -0
- package/attributes-master/packages/smartlightbox/src/init.ts +61 -0
- package/attributes-master/packages/smartlightbox/src/utils/constants.ts +31 -0
- package/attributes-master/packages/smartlightbox/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/smartlightbox/tsconfig.json +3 -0
- package/attributes-master/packages/socialshare/CHANGELOG.md +170 -0
- package/attributes-master/packages/socialshare/README.md +25 -0
- package/attributes-master/packages/socialshare/package.json +25 -0
- package/attributes-master/packages/socialshare/src/actions/collect.ts +93 -0
- package/attributes-master/packages/socialshare/src/actions/share.ts +91 -0
- package/attributes-master/packages/socialshare/src/actions/trigger.ts +46 -0
- package/attributes-master/packages/socialshare/src/factory.ts +149 -0
- package/attributes-master/packages/socialshare/src/index.ts +3 -0
- package/attributes-master/packages/socialshare/src/init.ts +35 -0
- package/attributes-master/packages/socialshare/src/utils/constants.ts +94 -0
- package/attributes-master/packages/socialshare/src/utils/dom.ts +8 -0
- package/attributes-master/packages/socialshare/src/utils/selectors.ts +6 -0
- package/attributes-master/packages/socialshare/src/utils/stores.ts +10 -0
- package/attributes-master/packages/socialshare/src/utils/types.ts +34 -0
- package/attributes-master/packages/socialshare/tsconfig.json +3 -0
- package/attributes-master/packages/starrating/CHANGELOG.md +70 -0
- package/attributes-master/packages/starrating/README.md +25 -0
- package/attributes-master/packages/starrating/package.json +22 -0
- package/attributes-master/packages/starrating/src/actions/classes.ts +41 -0
- package/attributes-master/packages/starrating/src/actions/events.ts +80 -0
- package/attributes-master/packages/starrating/src/factory.ts +24 -0
- package/attributes-master/packages/starrating/src/index.ts +3 -0
- package/attributes-master/packages/starrating/src/init.ts +24 -0
- package/attributes-master/packages/starrating/src/utils/constants.ts +20 -0
- package/attributes-master/packages/starrating/src/utils/helpers.ts +63 -0
- package/attributes-master/packages/starrating/src/utils/selectors.ts +9 -0
- package/attributes-master/packages/starrating/tsconfig.json +3 -0
- package/attributes-master/packages/template/README.md +25 -0
- package/attributes-master/packages/template/package.json +22 -0
- package/attributes-master/packages/template/src/actions/console.ts +4 -0
- package/attributes-master/packages/template/src/index.ts +3 -0
- package/attributes-master/packages/template/src/init.ts +14 -0
- package/attributes-master/packages/template/src/utils/constants.ts +18 -0
- package/attributes-master/packages/template/src/utils/selectors.ts +5 -0
- package/attributes-master/packages/template/tsconfig.json +3 -0
- package/attributes-master/packages/toc/CHANGELOG.md +192 -0
- package/attributes-master/packages/toc/README.md +25 -0
- package/attributes-master/packages/toc/package.json +23 -0
- package/attributes-master/packages/toc/src/actions/collect.ts +136 -0
- package/attributes-master/packages/toc/src/actions/create.ts +44 -0
- package/attributes-master/packages/toc/src/actions/events.ts +29 -0
- package/attributes-master/packages/toc/src/actions/observe.ts +31 -0
- package/attributes-master/packages/toc/src/actions/populate.ts +68 -0
- package/attributes-master/packages/toc/src/actions/prepare.ts +25 -0
- package/attributes-master/packages/toc/src/actions/scroll.ts +33 -0
- package/attributes-master/packages/toc/src/components/TOCItem.ts +88 -0
- package/attributes-master/packages/toc/src/factory.ts +47 -0
- package/attributes-master/packages/toc/src/index.ts +3 -0
- package/attributes-master/packages/toc/src/init.ts +37 -0
- package/attributes-master/packages/toc/src/utils/constants.ts +55 -0
- package/attributes-master/packages/toc/src/utils/helpers.ts +23 -0
- package/attributes-master/packages/toc/src/utils/selectors.ts +6 -0
- package/attributes-master/packages/toc/src/utils/types.ts +21 -0
- package/attributes-master/packages/toc/tsconfig.json +3 -0
- package/attributes-master/packages/utils/CHANGELOG.md +43 -0
- package/attributes-master/packages/utils/package.json +27 -0
- package/attributes-master/packages/utils/src/animations/factory.ts +100 -0
- package/attributes-master/packages/utils/src/animations/index.ts +73 -0
- package/attributes-master/packages/utils/src/animations/types.ts +37 -0
- package/attributes-master/packages/utils/src/components/Interaction.ts +79 -0
- package/attributes-master/packages/utils/src/components/Renderer.ts +59 -0
- package/attributes-master/packages/utils/src/components/index.ts +2 -0
- package/attributes-master/packages/utils/src/constants/a11y.ts +50 -0
- package/attributes-master/packages/utils/src/constants/attributes.ts +57 -0
- package/attributes-master/packages/utils/src/constants/index.ts +5 -0
- package/attributes-master/packages/utils/src/constants/keyboard.ts +10 -0
- package/attributes-master/packages/utils/src/constants/webflow.ts +74 -0
- package/attributes-master/packages/utils/src/helpers/dates.ts +17 -0
- package/attributes-master/packages/utils/src/helpers/dom.ts +82 -0
- package/attributes-master/packages/utils/src/helpers/events.ts +59 -0
- package/attributes-master/packages/utils/src/helpers/fetch.ts +217 -0
- package/attributes-master/packages/utils/src/helpers/forms.ts +238 -0
- package/attributes-master/packages/utils/src/helpers/guards.ts +138 -0
- package/attributes-master/packages/utils/src/helpers/index.ts +11 -0
- package/attributes-master/packages/utils/src/helpers/numbers.ts +86 -0
- package/attributes-master/packages/utils/src/helpers/selectors.ts +249 -0
- package/attributes-master/packages/utils/src/helpers/strings.ts +19 -0
- package/attributes-master/packages/utils/src/helpers/wait.ts +36 -0
- package/attributes-master/packages/utils/src/helpers/webflow.ts +117 -0
- package/attributes-master/packages/utils/src/index.ts +5 -0
- package/attributes-master/packages/utils/src/types/core.ts +100 -0
- package/attributes-master/packages/utils/src/types/dom.ts +31 -0
- package/attributes-master/packages/utils/src/types/index.ts +4 -0
- package/attributes-master/packages/utils/src/types/utils.ts +20 -0
- package/attributes-master/packages/utils/src/types/webflow.ts +147 -0
- package/attributes-master/packages/utils/tsconfig.json +3 -0
- package/attributes-master/packages/videohls/CHANGELOG.md +76 -0
- package/attributes-master/packages/videohls/README.md +27 -0
- package/attributes-master/packages/videohls/package.json +26 -0
- package/attributes-master/packages/videohls/src/actions/list.ts +23 -0
- package/attributes-master/packages/videohls/src/actions/video.ts +44 -0
- package/attributes-master/packages/videohls/src/index.ts +3 -0
- package/attributes-master/packages/videohls/src/init.ts +28 -0
- package/attributes-master/packages/videohls/src/utils/constants.ts +12 -0
- package/attributes-master/packages/videohls/src/utils/selectors.ts +5 -0
- package/attributes-master/packages/videohls/src/utils/stores.ts +3 -0
- package/attributes-master/packages/videohls/tsconfig.json +3 -0
- package/attributes-master/pnpm-lock.yaml +3317 -0
- package/attributes-master/pnpm-workspace.yaml +3 -0
- package/attributes-master/tsconfig.json +6 -0
- package/index.js +173 -275
- package/package.json +1 -1
@@ -0,0 +1,861 @@
|
|
1
|
+
import {
|
2
|
+
CMS_CSS_CLASSES,
|
3
|
+
fetchPageDocument,
|
4
|
+
getObjectEntries,
|
5
|
+
isHTMLAnchorElement,
|
6
|
+
isNumber,
|
7
|
+
restartWebflow,
|
8
|
+
type WebflowModule,
|
9
|
+
} from '@finsweet/attributes-utils';
|
10
|
+
import { computed, effect, type Ref, ref, type ShallowRef, shallowRef, watch } from '@vue/reactivity';
|
11
|
+
|
12
|
+
import type { AllFieldsData, Filters } from '../filter/types';
|
13
|
+
import type { Sorting } from '../sort/types';
|
14
|
+
import { RENDER_INDEX_CSS_VARIABLE } from '../utils/constants';
|
15
|
+
import { getAllCollectionListWrappers, getCMSElementSelector, getCollectionElements } from '../utils/dom';
|
16
|
+
import { getPaginationSearchEntries } from '../utils/pagination';
|
17
|
+
import { getAttribute, getInstance, hasAttributeValue, queryAllElements, queryElement } from '../utils/selectors';
|
18
|
+
import { listInstancesStore } from '../utils/store';
|
19
|
+
import { ListItem } from './ListItem';
|
20
|
+
|
21
|
+
type HookKey = 'start' | 'filter' | 'sort' | 'pagination' | 'beforeRender' | 'render' | 'afterRender';
|
22
|
+
type HookCallback = (items: ListItem[]) => ListItem[] | Promise<ListItem[]> | void | Promise<void>;
|
23
|
+
type Hooks = {
|
24
|
+
[key in HookKey]: {
|
25
|
+
previous?: HookKey;
|
26
|
+
callbacks: HookCallback[];
|
27
|
+
result: ShallowRef<ListItem[]>;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
|
31
|
+
export class List {
|
32
|
+
/**
|
33
|
+
* A signal holding all {@link ListItem} instances of the list.
|
34
|
+
*/
|
35
|
+
public readonly items = shallowRef<ListItem[]>([]);
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Contains all lifecycle hooks with their callbacks and last result.
|
39
|
+
*/
|
40
|
+
public readonly hooks: Hooks = {
|
41
|
+
start: {
|
42
|
+
callbacks: [],
|
43
|
+
result: shallowRef([]),
|
44
|
+
},
|
45
|
+
|
46
|
+
filter: {
|
47
|
+
previous: 'start',
|
48
|
+
callbacks: [],
|
49
|
+
result: shallowRef([]),
|
50
|
+
},
|
51
|
+
|
52
|
+
sort: {
|
53
|
+
previous: 'filter',
|
54
|
+
callbacks: [],
|
55
|
+
result: shallowRef([]),
|
56
|
+
},
|
57
|
+
|
58
|
+
pagination: {
|
59
|
+
previous: 'sort',
|
60
|
+
callbacks: [],
|
61
|
+
result: shallowRef([]),
|
62
|
+
},
|
63
|
+
|
64
|
+
beforeRender: {
|
65
|
+
previous: 'pagination',
|
66
|
+
callbacks: [],
|
67
|
+
result: shallowRef([]),
|
68
|
+
},
|
69
|
+
|
70
|
+
render: {
|
71
|
+
previous: 'beforeRender',
|
72
|
+
callbacks: [],
|
73
|
+
result: shallowRef([]),
|
74
|
+
},
|
75
|
+
|
76
|
+
afterRender: {
|
77
|
+
previous: 'render',
|
78
|
+
callbacks: [],
|
79
|
+
result: shallowRef([]),
|
80
|
+
},
|
81
|
+
};
|
82
|
+
|
83
|
+
/**
|
84
|
+
* The current hook being executed.
|
85
|
+
*/
|
86
|
+
public currentHook?: HookKey;
|
87
|
+
|
88
|
+
/**
|
89
|
+
* The hook that triggered the current lifecycle.
|
90
|
+
*/
|
91
|
+
public triggeredHook?: HookKey;
|
92
|
+
|
93
|
+
/**
|
94
|
+
* A set holding all rendered {@link ListItem} instances.
|
95
|
+
*/
|
96
|
+
public renderedItems: Set<ListItem> = new Set();
|
97
|
+
|
98
|
+
/**
|
99
|
+
* The instance.
|
100
|
+
*/
|
101
|
+
public readonly instance: string | null;
|
102
|
+
|
103
|
+
/**
|
104
|
+
* The `Collection List` element.
|
105
|
+
*/
|
106
|
+
public readonly listElement: HTMLElement | null;
|
107
|
+
|
108
|
+
/**
|
109
|
+
* The `Pagination` wrapper element.
|
110
|
+
*/
|
111
|
+
public readonly paginationWrapperElement?: HTMLElement | null;
|
112
|
+
|
113
|
+
/**
|
114
|
+
* The `Page Count` element.
|
115
|
+
*/
|
116
|
+
public readonly paginationCountElement?: HTMLElement | null;
|
117
|
+
|
118
|
+
/**
|
119
|
+
* All the `Previous` buttons defined by the user or native Webflow CMS.
|
120
|
+
* TODO: the way we're assigning to this shallowRef property may not trigger reactivity
|
121
|
+
*/
|
122
|
+
public readonly allPaginationPreviousElements = shallowRef<Set<HTMLElement>>(new Set());
|
123
|
+
|
124
|
+
/**
|
125
|
+
* The native Webflow CMS `Previous` button.
|
126
|
+
*/
|
127
|
+
public readonly paginationPreviousCMSElement = computed(() =>
|
128
|
+
[...this.allPaginationPreviousElements.value]
|
129
|
+
.filter(isHTMLAnchorElement)
|
130
|
+
.find((paginationPreviousElement) =>
|
131
|
+
paginationPreviousElement.classList.contains(CMS_CSS_CLASSES['paginationPrevious'])
|
132
|
+
)
|
133
|
+
);
|
134
|
+
|
135
|
+
/**
|
136
|
+
* The `Next` buttons defined by the user or native Webflow CMS.
|
137
|
+
* TODO: the way we're assigning to this shallowRef property may not trigger reactivity
|
138
|
+
*/
|
139
|
+
public readonly allPaginationNextElements = shallowRef<Set<HTMLElement>>(new Set());
|
140
|
+
|
141
|
+
/**
|
142
|
+
* The native Webflow CMS `Next` button.
|
143
|
+
*/
|
144
|
+
public readonly paginationNextCMSElement = computed(() =>
|
145
|
+
[...this.allPaginationNextElements.value]
|
146
|
+
.filter(isHTMLAnchorElement)
|
147
|
+
.find((paginationNextElement) => paginationNextElement.classList.contains(CMS_CSS_CLASSES['paginationNext']))
|
148
|
+
);
|
149
|
+
|
150
|
+
/**
|
151
|
+
* The `Empty State` element.
|
152
|
+
*/
|
153
|
+
public readonly emptyElement = ref<HTMLElement | null | undefined>();
|
154
|
+
|
155
|
+
/**
|
156
|
+
* An initial element to display when there are no filters applied.
|
157
|
+
*/
|
158
|
+
public readonly initialElement?: HTMLElement | null;
|
159
|
+
|
160
|
+
/**
|
161
|
+
* A custom loader element.
|
162
|
+
*/
|
163
|
+
public readonly loaderElement?: HTMLElement | null;
|
164
|
+
|
165
|
+
/**
|
166
|
+
* An element that displays the total amount of items in the list.
|
167
|
+
*/
|
168
|
+
public readonly itemsCountElement?: HTMLElement | null;
|
169
|
+
|
170
|
+
/**
|
171
|
+
* An element that displays the total amount of items in the list after filtering.
|
172
|
+
*/
|
173
|
+
public readonly resultsCountElement?: HTMLElement | null;
|
174
|
+
|
175
|
+
/**
|
176
|
+
* An element that displays the amount of visible items.
|
177
|
+
*/
|
178
|
+
public readonly visibleCountElement?: HTMLElement | null;
|
179
|
+
|
180
|
+
/**
|
181
|
+
* An element that displays the lower range of visible items.
|
182
|
+
*/
|
183
|
+
public readonly visibleCountFromElement?: HTMLElement | null;
|
184
|
+
|
185
|
+
/**
|
186
|
+
* An element that displays the upper range of visible items.
|
187
|
+
*/
|
188
|
+
public readonly visibleCountToElement?: HTMLElement | null;
|
189
|
+
|
190
|
+
/**
|
191
|
+
* The scroll anchor element.
|
192
|
+
*/
|
193
|
+
public readonly scrollAnchorElement?: HTMLElement | null;
|
194
|
+
|
195
|
+
/**
|
196
|
+
* A custom scroll anchor element for filter actions.
|
197
|
+
*/
|
198
|
+
public readonly scrollAnchorFilterElement?: HTMLElement | null;
|
199
|
+
|
200
|
+
/**
|
201
|
+
* A custom scroll anchor element for sort actions.
|
202
|
+
*/
|
203
|
+
public readonly scrollAnchorSortElement?: HTMLElement | null;
|
204
|
+
|
205
|
+
/**
|
206
|
+
* A custom scroll anchor element for pagination actions.
|
207
|
+
*/
|
208
|
+
public readonly scrollAnchorPaginationElement?: HTMLElement | null;
|
209
|
+
|
210
|
+
/**
|
211
|
+
* Defines the original amount of items per page.
|
212
|
+
*/
|
213
|
+
public initialItemsPerPage: number;
|
214
|
+
|
215
|
+
/**
|
216
|
+
* Defines the amount of items per page.
|
217
|
+
*/
|
218
|
+
public readonly itemsPerPage: Ref<number>;
|
219
|
+
|
220
|
+
/**
|
221
|
+
* Defines the total amount of pages in the list.
|
222
|
+
*/
|
223
|
+
public readonly totalPages = computed(() =>
|
224
|
+
Math.ceil(this.hooks.filter.result.value.length / this.itemsPerPage.value)
|
225
|
+
);
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Defines the current page in `Pagination` mode.
|
229
|
+
*/
|
230
|
+
public readonly currentPage = ref(1);
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Defines the active filters.
|
234
|
+
*/
|
235
|
+
public readonly filters = ref<Filters>({
|
236
|
+
groups: [],
|
237
|
+
});
|
238
|
+
|
239
|
+
/**
|
240
|
+
* Contains all the fields data of the list.
|
241
|
+
*/
|
242
|
+
public readonly allFieldsData = computed(() =>
|
243
|
+
this.items.value.reduce<AllFieldsData>((acc, item) => {
|
244
|
+
for (const [key, field] of Object.entries(item.fields)) {
|
245
|
+
acc[key] ||= {
|
246
|
+
type: field.type,
|
247
|
+
valueType: Array.isArray(field.value) ? 'multiple' : 'single',
|
248
|
+
rawValues: new Set<string>(),
|
249
|
+
};
|
250
|
+
|
251
|
+
const fieldRawValues = Array.isArray(field.rawValue) ? field.rawValue : [field.rawValue];
|
252
|
+
|
253
|
+
for (const rawValue of fieldRawValues) {
|
254
|
+
acc[key].rawValues.add(rawValue);
|
255
|
+
}
|
256
|
+
}
|
257
|
+
|
258
|
+
return acc;
|
259
|
+
}, {})
|
260
|
+
);
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Defines the active sorting.
|
264
|
+
*/
|
265
|
+
public readonly sorting = ref<Sorting>({});
|
266
|
+
|
267
|
+
/**
|
268
|
+
* Defines if the user has interacted with the filters.
|
269
|
+
*/
|
270
|
+
public readonly hasInteracted = computed(
|
271
|
+
() =>
|
272
|
+
this.sorting.value.interacted ||
|
273
|
+
this.filters.value.groups.some((group) => group.conditions.some((condition) => condition.interacted))
|
274
|
+
);
|
275
|
+
|
276
|
+
/**
|
277
|
+
* Defines if the pagination query param should be added to the URL when switching pages.
|
278
|
+
* @example '?5f7457b3_page=1'
|
279
|
+
*/
|
280
|
+
public readonly showQuery: boolean;
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Defines if the matched fields when filtering should be highlighted.
|
284
|
+
*/
|
285
|
+
public readonly highlight?: boolean;
|
286
|
+
|
287
|
+
/**
|
288
|
+
* Defines if loaded Items can be cached using IndexedDB after fetching them.
|
289
|
+
*/
|
290
|
+
public readonly cache: boolean;
|
291
|
+
|
292
|
+
/**
|
293
|
+
* Defines the Webflow modules to restart after rendering.
|
294
|
+
*/
|
295
|
+
public readonly webflowModules = new Set<WebflowModule>();
|
296
|
+
|
297
|
+
/**
|
298
|
+
* Defines the URL query key for the paginated pages.
|
299
|
+
* @example '5f7457b3_page'
|
300
|
+
*/
|
301
|
+
public paginationSearchParam?: string;
|
302
|
+
|
303
|
+
/**
|
304
|
+
* Defines the query prefix for all the list's query params.
|
305
|
+
* If pagination query exists, it is used as the prefix: '5f7457b3_page' => '5f7457b3'
|
306
|
+
* If not, it falls back to the list's instance or the list's index.
|
307
|
+
*/
|
308
|
+
public searchParamsPrefix!: string;
|
309
|
+
|
310
|
+
/**
|
311
|
+
* Defines an awaitable Promise that resolves once the pagination data (`currentPage` + `paginationSearchParam`) has been retrieved.
|
312
|
+
*/
|
313
|
+
public loadingSearchParamsData?: Promise<void>;
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Defines an awaitable Promise that resolves once the pagination elements have been loaded.
|
317
|
+
*/
|
318
|
+
public loadingPaginationElements?: Promise<void>;
|
319
|
+
|
320
|
+
/**
|
321
|
+
* Defines an awaitable Promise that resolves once all the Webflow CMS paginated items have been loaded.
|
322
|
+
*/
|
323
|
+
public loadingPaginatedItems?: Promise<void>;
|
324
|
+
|
325
|
+
/**
|
326
|
+
* Defines if the filter field values are being collected from the DOM or event listeners are being set.
|
327
|
+
*/
|
328
|
+
public readingFilters?: boolean;
|
329
|
+
|
330
|
+
/**
|
331
|
+
* Defines if the filter field values are being set to the DOM.
|
332
|
+
*/
|
333
|
+
public settingFilters?: boolean;
|
334
|
+
|
335
|
+
/**
|
336
|
+
* `@vue/reactivity`: [watch](https://vuejs.org/api/reactivity-core.html#watch)
|
337
|
+
*/
|
338
|
+
public watch = watch;
|
339
|
+
|
340
|
+
/**
|
341
|
+
* `@vue/reactivity`: [watch](https://vuejs.org/api/reactivity-core.html#watcheffect)
|
342
|
+
*/
|
343
|
+
public effect = effect;
|
344
|
+
|
345
|
+
constructor(
|
346
|
+
/**
|
347
|
+
* The `Collection List Wrapper` element.
|
348
|
+
*/
|
349
|
+
public readonly wrapperElement: HTMLElement,
|
350
|
+
|
351
|
+
/**
|
352
|
+
* The index of the list in the page.
|
353
|
+
*/
|
354
|
+
public readonly pageIndex: number,
|
355
|
+
|
356
|
+
/**
|
357
|
+
* Defines if the instance should be reactive.
|
358
|
+
* If set to `false`, the instance will not load any CMS data nor will it trigger any hooks.
|
359
|
+
*/
|
360
|
+
reactive = true
|
361
|
+
) {
|
362
|
+
// Collect elements
|
363
|
+
const listElement = getCollectionElements(wrapperElement, 'list');
|
364
|
+
this.listElement = listElement;
|
365
|
+
|
366
|
+
const instance = getInstance(listElement || wrapperElement);
|
367
|
+
this.instance = instance;
|
368
|
+
|
369
|
+
this.paginationWrapperElement = getCollectionElements(wrapperElement, 'pagination-wrapper');
|
370
|
+
this.paginationCountElement = getCollectionElements(wrapperElement, 'page-count');
|
371
|
+
|
372
|
+
this.emptyElement.value =
|
373
|
+
getCollectionElements(wrapperElement, 'empty') || queryElement<HTMLElement>('empty', { instance });
|
374
|
+
this.initialElement = queryElement('initial', { instance });
|
375
|
+
this.loaderElement = queryElement('loader', { instance });
|
376
|
+
this.itemsCountElement = queryElement('items-count', { instance });
|
377
|
+
this.visibleCountElement = queryElement('visible-count', { instance });
|
378
|
+
this.visibleCountFromElement = queryElement('visible-count-from', { instance });
|
379
|
+
this.visibleCountToElement = queryElement('visible-count-to', { instance });
|
380
|
+
this.resultsCountElement = queryElement('results-count', { instance });
|
381
|
+
this.scrollAnchorElement = queryElement('scroll-anchor', { instance });
|
382
|
+
this.scrollAnchorFilterElement = queryElement('scroll-anchor-filter', { instance });
|
383
|
+
this.scrollAnchorSortElement = queryElement('scroll-anchor-sort', { instance });
|
384
|
+
this.scrollAnchorPaginationElement = queryElement('scroll-anchor-pagination', { instance });
|
385
|
+
this.cache = hasAttributeValue(this.listOrWrapper, 'cache', 'true');
|
386
|
+
this.showQuery = hasAttributeValue(this.listOrWrapper, 'showquery', 'true');
|
387
|
+
this.highlight = hasAttributeValue(this.listOrWrapper, 'highlight', 'true');
|
388
|
+
|
389
|
+
// Get pagination next elements
|
390
|
+
const paginationNextElement = getCollectionElements(wrapperElement, 'pagination-next');
|
391
|
+
if (paginationNextElement) {
|
392
|
+
this.allPaginationNextElements.value.add(paginationNextElement);
|
393
|
+
}
|
394
|
+
|
395
|
+
queryAllElements<HTMLAnchorElement>('pagination-next', { instance }).forEach((element) =>
|
396
|
+
this.allPaginationNextElements.value.add(element)
|
397
|
+
);
|
398
|
+
|
399
|
+
// Get pagination previous elements
|
400
|
+
const paginationPreviousElement = getCollectionElements(wrapperElement, 'pagination-previous');
|
401
|
+
if (paginationPreviousElement) {
|
402
|
+
this.allPaginationPreviousElements.value.add(paginationPreviousElement);
|
403
|
+
}
|
404
|
+
|
405
|
+
queryAllElements<HTMLAnchorElement>('pagination-previous', { instance }).forEach((element) =>
|
406
|
+
this.allPaginationPreviousElements.value.add(element)
|
407
|
+
);
|
408
|
+
|
409
|
+
// Collect items
|
410
|
+
const collectionItemElements = getCollectionElements(wrapperElement, 'item');
|
411
|
+
|
412
|
+
this.initialItemsPerPage = getAttribute(this.listOrWrapper, 'itemsperpage') || collectionItemElements.length;
|
413
|
+
this.itemsPerPage = ref(this.initialItemsPerPage);
|
414
|
+
|
415
|
+
if (listElement) {
|
416
|
+
const items = collectionItemElements.map((element, index) => new ListItem(element, this, index));
|
417
|
+
|
418
|
+
this.items.value = items;
|
419
|
+
this.renderedItems = new Set(items);
|
420
|
+
}
|
421
|
+
|
422
|
+
// Init reactivity
|
423
|
+
if (!reactive) return;
|
424
|
+
|
425
|
+
// Extract pagination data
|
426
|
+
this.loadingSearchParamsData = this.#getCMSPaginationData().then((paginationSearchParam) => {
|
427
|
+
const prefix = paginationSearchParam ? paginationSearchParam.split('_')[0] : undefined;
|
428
|
+
|
429
|
+
this.searchParamsPrefix = prefix || instance || `${pageIndex}`;
|
430
|
+
});
|
431
|
+
|
432
|
+
this.loadingPaginationElements = this.#getCMSPaginationElements();
|
433
|
+
|
434
|
+
// Init hooks
|
435
|
+
this.#initHooks();
|
436
|
+
|
437
|
+
// Elements side effects
|
438
|
+
// TODO: Cleanup
|
439
|
+
this.#initElements();
|
440
|
+
}
|
441
|
+
|
442
|
+
/**
|
443
|
+
* Initializes the lifecycle hooks.
|
444
|
+
*/
|
445
|
+
#initHooks() {
|
446
|
+
// Add render hook
|
447
|
+
this.addHook('render', async (items) => {
|
448
|
+
let renderIndex = 0;
|
449
|
+
|
450
|
+
const renderPromise = Promise.all(
|
451
|
+
items.map((item, index) => {
|
452
|
+
const previousItem = items[index - 1];
|
453
|
+
|
454
|
+
const render = async () => {
|
455
|
+
item.element.style.setProperty(RENDER_INDEX_CSS_VARIABLE, `${renderIndex}`);
|
456
|
+
item.element.classList.add(item.startingClass);
|
457
|
+
|
458
|
+
if (item.stagger) {
|
459
|
+
item.element.style.transitionDelay = `${renderIndex * item.stagger}ms`;
|
460
|
+
}
|
461
|
+
|
462
|
+
if (previousItem) {
|
463
|
+
previousItem.element.after(item.element);
|
464
|
+
} else {
|
465
|
+
this.listElement?.prepend(item.element);
|
466
|
+
}
|
467
|
+
|
468
|
+
item.currentIndex = index;
|
469
|
+
renderIndex += 1;
|
470
|
+
|
471
|
+
await new Promise(requestAnimationFrame);
|
472
|
+
|
473
|
+
item.element.classList.remove(item.startingClass);
|
474
|
+
|
475
|
+
const animations = item.element.getAnimations({ subtree: true });
|
476
|
+
|
477
|
+
return Promise.all(animations.map((a) => a.finished)).then(() => {
|
478
|
+
item.element.style.removeProperty(RENDER_INDEX_CSS_VARIABLE);
|
479
|
+
|
480
|
+
if (item.stagger) {
|
481
|
+
item.element.style.transitionDelay = '';
|
482
|
+
}
|
483
|
+
});
|
484
|
+
};
|
485
|
+
|
486
|
+
// Is rendered
|
487
|
+
if (isNumber(item.currentIndex)) {
|
488
|
+
this.renderedItems.delete(item);
|
489
|
+
|
490
|
+
if (item.currentIndex !== index) {
|
491
|
+
return render();
|
492
|
+
}
|
493
|
+
}
|
494
|
+
|
495
|
+
// Is not rendered
|
496
|
+
else {
|
497
|
+
return render();
|
498
|
+
}
|
499
|
+
})
|
500
|
+
);
|
501
|
+
|
502
|
+
// Remove items that should not be rendered anymore
|
503
|
+
this.renderedItems.forEach((renderedItem) => {
|
504
|
+
renderedItem.element.remove();
|
505
|
+
renderedItem.currentIndex = undefined;
|
506
|
+
});
|
507
|
+
|
508
|
+
this.renderedItems = new Set(items);
|
509
|
+
|
510
|
+
await renderPromise;
|
511
|
+
|
512
|
+
return items;
|
513
|
+
});
|
514
|
+
|
515
|
+
// Restart Webflow modules
|
516
|
+
this.addHook('afterRender', async () => {
|
517
|
+
restartWebflow([...this.webflowModules]);
|
518
|
+
});
|
519
|
+
|
520
|
+
// Start hooks chain
|
521
|
+
for (const [key, { previous }] of getObjectEntries(this.hooks)) {
|
522
|
+
const items = previous ? this.hooks[previous].result : this.items;
|
523
|
+
|
524
|
+
// TODO: Cleanups
|
525
|
+
watch(items, () => this.#runHook(key), { immediate: true });
|
526
|
+
}
|
527
|
+
}
|
528
|
+
|
529
|
+
/**
|
530
|
+
* Initializes the elements side effects.
|
531
|
+
*/
|
532
|
+
#initElements() {
|
533
|
+
// items-count
|
534
|
+
const itemsCountRunner = effect(() => {
|
535
|
+
if (this.itemsCountElement) {
|
536
|
+
this.itemsCountElement.textContent = `${this.items.value.length}`;
|
537
|
+
}
|
538
|
+
});
|
539
|
+
|
540
|
+
// initial
|
541
|
+
const initialElementRunner = effect(() => {
|
542
|
+
if (this.initialElement) {
|
543
|
+
this.wrapperElement.style.display = this.hasInteracted.value ? '' : 'none';
|
544
|
+
this.initialElement.style.display = this.hasInteracted.value ? 'none' : '';
|
545
|
+
}
|
546
|
+
});
|
547
|
+
|
548
|
+
return () => {
|
549
|
+
itemsCountRunner.effect.stop();
|
550
|
+
initialElementRunner.effect.stop();
|
551
|
+
};
|
552
|
+
}
|
553
|
+
|
554
|
+
/**
|
555
|
+
* Collects the pagination query info.
|
556
|
+
* @returns A Promise that resolves once the pagination query info has been collected.
|
557
|
+
*/
|
558
|
+
async #getCMSPaginationData() {
|
559
|
+
const paginationButton = this.paginationNextCMSElement.value || this.paginationPreviousCMSElement.value;
|
560
|
+
if (!paginationButton) return;
|
561
|
+
|
562
|
+
const searchEntries = getPaginationSearchEntries(paginationButton);
|
563
|
+
if (!searchEntries.length) return;
|
564
|
+
|
565
|
+
let paginationSearchParam: string | undefined;
|
566
|
+
let rawTargetPage: string | undefined;
|
567
|
+
|
568
|
+
if (searchEntries.length === 1) {
|
569
|
+
const [pageEntry] = searchEntries;
|
570
|
+
|
571
|
+
if (!pageEntry) return;
|
572
|
+
|
573
|
+
[paginationSearchParam, rawTargetPage] = pageEntry;
|
574
|
+
}
|
575
|
+
|
576
|
+
// If there's more than one `searchParam` we need to fetch the original page to find the correspondent pageQuery.
|
577
|
+
else {
|
578
|
+
const { origin, pathname } = location;
|
579
|
+
|
580
|
+
const initialPage = await fetchPageDocument(origin + pathname);
|
581
|
+
if (!initialPage) return;
|
582
|
+
|
583
|
+
const initialCollectionListWrappers = initialPage.querySelectorAll(getCMSElementSelector('wrapper'));
|
584
|
+
|
585
|
+
const initialCollectionListWrapper = initialCollectionListWrappers[this.pageIndex];
|
586
|
+
if (!initialCollectionListWrapper) return;
|
587
|
+
|
588
|
+
const initialPaginationNext = getCollectionElements(initialCollectionListWrapper, 'pagination-next');
|
589
|
+
if (!initialPaginationNext) return;
|
590
|
+
|
591
|
+
const [initialPageEntry] = getPaginationSearchEntries(initialPaginationNext) || [];
|
592
|
+
if (!initialPageEntry) return;
|
593
|
+
|
594
|
+
[paginationSearchParam] = initialPageEntry;
|
595
|
+
|
596
|
+
[, rawTargetPage] = searchEntries.find(([query]) => query === paginationSearchParam) || [];
|
597
|
+
}
|
598
|
+
|
599
|
+
if (!paginationSearchParam || !rawTargetPage) return;
|
600
|
+
|
601
|
+
const targetPage = parseInt(rawTargetPage);
|
602
|
+
const currentPage = this.paginationNextCMSElement.value ? targetPage - 1 : targetPage + 1;
|
603
|
+
|
604
|
+
this.paginationSearchParam = paginationSearchParam;
|
605
|
+
this.currentPage.value = currentPage;
|
606
|
+
|
607
|
+
return paginationSearchParam;
|
608
|
+
}
|
609
|
+
|
610
|
+
/**
|
611
|
+
* Collects the missing pagination elements.
|
612
|
+
* @returns A Promise that resolves once the missing pagination elements have been collected.
|
613
|
+
*/
|
614
|
+
async #getCMSPaginationElements() {
|
615
|
+
await this.loadingSearchParamsData;
|
616
|
+
|
617
|
+
const { origin, pathname } = window.location;
|
618
|
+
const {
|
619
|
+
wrapperElement,
|
620
|
+
listElement,
|
621
|
+
paginationWrapperElement,
|
622
|
+
paginationNextCMSElement,
|
623
|
+
paginationPreviousCMSElement,
|
624
|
+
emptyElement,
|
625
|
+
currentPage,
|
626
|
+
paginationSearchParam,
|
627
|
+
pageIndex,
|
628
|
+
} = this;
|
629
|
+
|
630
|
+
await Promise.all([
|
631
|
+
// Pagination next
|
632
|
+
(async () => {
|
633
|
+
if (paginationNextCMSElement.value) return;
|
634
|
+
|
635
|
+
const $currentPage = currentPage.value;
|
636
|
+
if (!$currentPage || $currentPage === 1) return;
|
637
|
+
|
638
|
+
const page = await fetchPageDocument(`${origin}${pathname}?${paginationSearchParam}=${$currentPage - 1}`);
|
639
|
+
if (!page) return;
|
640
|
+
|
641
|
+
const allCollectionWrappers = getAllCollectionListWrappers(page);
|
642
|
+
const collectionListWrapper = allCollectionWrappers[pageIndex];
|
643
|
+
if (!collectionListWrapper) return;
|
644
|
+
|
645
|
+
const paginationNext = getCollectionElements(collectionListWrapper, 'pagination-next');
|
646
|
+
if (!paginationNext) return;
|
647
|
+
|
648
|
+
const anchor = paginationPreviousCMSElement.value?.parentElement || paginationWrapperElement;
|
649
|
+
if (!anchor) return;
|
650
|
+
|
651
|
+
paginationNext.style.display = 'none';
|
652
|
+
|
653
|
+
anchor.append(paginationNext);
|
654
|
+
this.allPaginationNextElements.value.add(paginationNext);
|
655
|
+
})(),
|
656
|
+
|
657
|
+
// Pagination previous & Empty state
|
658
|
+
(async () => {
|
659
|
+
if (paginationPreviousCMSElement.value && emptyElement.value) return;
|
660
|
+
|
661
|
+
const page = await fetchPageDocument(`${origin}${pathname}?${paginationSearchParam}=9999`);
|
662
|
+
if (!page) return;
|
663
|
+
|
664
|
+
const allCollectionWrappers = getAllCollectionListWrappers(page);
|
665
|
+
const collectionListWrapper = allCollectionWrappers[pageIndex];
|
666
|
+
if (!collectionListWrapper) return;
|
667
|
+
|
668
|
+
const paginationPrevious = getCollectionElements(collectionListWrapper, 'pagination-previous');
|
669
|
+
const empty = getCollectionElements(collectionListWrapper, 'empty');
|
670
|
+
|
671
|
+
// Pagination previous
|
672
|
+
if (paginationPrevious && !paginationPreviousCMSElement.value) {
|
673
|
+
const anchor = paginationNextCMSElement.value?.parentElement || paginationWrapperElement;
|
674
|
+
if (!anchor) return;
|
675
|
+
|
676
|
+
paginationPrevious.style.display = 'none';
|
677
|
+
|
678
|
+
anchor.prepend(paginationPrevious);
|
679
|
+
this.allPaginationPreviousElements.value.add(paginationPrevious);
|
680
|
+
}
|
681
|
+
|
682
|
+
// Empty state
|
683
|
+
if (empty && !emptyElement.value) {
|
684
|
+
empty.style.display = 'none';
|
685
|
+
|
686
|
+
wrapperElement.insertBefore(empty, listElement?.nextSibling || null);
|
687
|
+
emptyElement.value = empty;
|
688
|
+
}
|
689
|
+
})(),
|
690
|
+
]);
|
691
|
+
}
|
692
|
+
|
693
|
+
/**
|
694
|
+
* Adds a hook.
|
695
|
+
* @param key
|
696
|
+
* @param callback
|
697
|
+
*/
|
698
|
+
addHook(key: HookKey, callback: HookCallback) {
|
699
|
+
const hook = this.hooks[key];
|
700
|
+
|
701
|
+
hook.callbacks.push(callback);
|
702
|
+
|
703
|
+
return () => {
|
704
|
+
hook.callbacks = hook.callbacks.filter((cb) => cb !== callback);
|
705
|
+
};
|
706
|
+
}
|
707
|
+
|
708
|
+
/**
|
709
|
+
* Runs a hook.
|
710
|
+
* @param key
|
711
|
+
* @param scrollToAnchor
|
712
|
+
*/
|
713
|
+
async #runHook(key: HookKey) {
|
714
|
+
this.currentHook = key;
|
715
|
+
|
716
|
+
const hook = this.hooks[key];
|
717
|
+
|
718
|
+
const { previous } = hook;
|
719
|
+
|
720
|
+
const previousHookResult = previous ? this.hooks[previous].result : undefined;
|
721
|
+
|
722
|
+
let result = previousHookResult?.value || this.items.value;
|
723
|
+
|
724
|
+
for (const callback of hook.callbacks) {
|
725
|
+
result = (await callback(result)) || result;
|
726
|
+
}
|
727
|
+
|
728
|
+
hook.result.value = [...result];
|
729
|
+
|
730
|
+
this.currentHook = undefined;
|
731
|
+
}
|
732
|
+
|
733
|
+
/**
|
734
|
+
* Triggers a hook.
|
735
|
+
* @param key
|
736
|
+
* @param options.scrollToAnchor
|
737
|
+
*/
|
738
|
+
async triggerHook(
|
739
|
+
key: HookKey,
|
740
|
+
{ scrollToAnchor, resetCurrentPage }: { scrollToAnchor?: boolean; resetCurrentPage?: boolean } = {}
|
741
|
+
) {
|
742
|
+
this.triggeredHook = key;
|
743
|
+
|
744
|
+
if (scrollToAnchor) {
|
745
|
+
this.scrollToAnchor(key);
|
746
|
+
}
|
747
|
+
|
748
|
+
if (resetCurrentPage) {
|
749
|
+
this.currentPage.value = 1;
|
750
|
+
}
|
751
|
+
|
752
|
+
await this.#runHook(key);
|
753
|
+
|
754
|
+
this.triggeredHook = undefined;
|
755
|
+
}
|
756
|
+
|
757
|
+
/**
|
758
|
+
* Creates a new {@link ListItem} instance.
|
759
|
+
* @param itemElement The Collection Item element.
|
760
|
+
* @returns The created {@link ListItem} instance.
|
761
|
+
*/
|
762
|
+
createItem = (itemElement: HTMLElement) => new ListItem(itemElement, this);
|
763
|
+
|
764
|
+
/**
|
765
|
+
* Scrolls to the specified anchor based on the action provided.
|
766
|
+
* @param key
|
767
|
+
*/
|
768
|
+
scrollToAnchor(key?: HookKey) {
|
769
|
+
const { scrollAnchorFilterElement, scrollAnchorSortElement, scrollAnchorPaginationElement, scrollAnchorElement } =
|
770
|
+
this;
|
771
|
+
|
772
|
+
const anchor =
|
773
|
+
(key === 'filter'
|
774
|
+
? scrollAnchorFilterElement
|
775
|
+
: key === 'sort'
|
776
|
+
? scrollAnchorSortElement
|
777
|
+
: key === 'pagination'
|
778
|
+
? scrollAnchorPaginationElement
|
779
|
+
: scrollAnchorElement) || scrollAnchorElement;
|
780
|
+
|
781
|
+
if (!anchor) return;
|
782
|
+
|
783
|
+
anchor.scrollIntoView({ behavior: 'smooth' });
|
784
|
+
}
|
785
|
+
|
786
|
+
/**
|
787
|
+
* Gets a search param from the URL using the list's search params prefix.
|
788
|
+
* @param key
|
789
|
+
* @param usePrefix Whether to use the list's search params prefix or not.
|
790
|
+
* @returns The value of the search param or null if not found.
|
791
|
+
*/
|
792
|
+
async getSearchParam(key: string, usePrefix = true) {
|
793
|
+
await this.loadingSearchParamsData;
|
794
|
+
|
795
|
+
const { searchParams } = new URL(location.href);
|
796
|
+
|
797
|
+
const name = usePrefix ? `${this.searchParamsPrefix}_${key}` : key;
|
798
|
+
|
799
|
+
return searchParams.get(name);
|
800
|
+
}
|
801
|
+
|
802
|
+
/**
|
803
|
+
* @returns All search params from the URL using the list's search params prefix (if true).
|
804
|
+
* @param usePrefix Whether to use the list's search params prefix or not.
|
805
|
+
*/
|
806
|
+
async getAllSearchParams(usePrefix = true) {
|
807
|
+
await this.loadingSearchParamsData;
|
808
|
+
|
809
|
+
const { searchParams } = new URL(location.href);
|
810
|
+
|
811
|
+
const rawEntries = [...searchParams.entries()];
|
812
|
+
|
813
|
+
const entries = usePrefix
|
814
|
+
? rawEntries
|
815
|
+
.filter(([key]) => key.startsWith(`${this.searchParamsPrefix}_`))
|
816
|
+
.map(([key, value]) => {
|
817
|
+
const newKey = key.replace(`${this.searchParamsPrefix}_`, '');
|
818
|
+
return [newKey, value] as const;
|
819
|
+
})
|
820
|
+
: rawEntries;
|
821
|
+
|
822
|
+
return entries;
|
823
|
+
}
|
824
|
+
|
825
|
+
/**
|
826
|
+
* Sets a search param in the URL using the list's search params prefix.
|
827
|
+
* @param key
|
828
|
+
* @param value
|
829
|
+
* @param usePrefix Whether to use the list's search params prefix or not.
|
830
|
+
*/
|
831
|
+
async setSearchParam(key: string, value: string | null | undefined, usePrefix = true) {
|
832
|
+
await this.loadingSearchParamsData;
|
833
|
+
|
834
|
+
const url = new URL(location.href);
|
835
|
+
const name = usePrefix ? `${this.searchParamsPrefix}_${key}` : key;
|
836
|
+
|
837
|
+
if (value) {
|
838
|
+
url.searchParams.set(name, value);
|
839
|
+
} else {
|
840
|
+
url.searchParams.delete(name);
|
841
|
+
}
|
842
|
+
|
843
|
+
history.replaceState({}, '', url.toString());
|
844
|
+
}
|
845
|
+
|
846
|
+
/**
|
847
|
+
* Destroys the instance.
|
848
|
+
*/
|
849
|
+
destroy() {
|
850
|
+
// TODO: Call store.off() on all stores
|
851
|
+
|
852
|
+
listInstancesStore.delete(this.wrapperElement);
|
853
|
+
}
|
854
|
+
|
855
|
+
/**
|
856
|
+
* @returns The list element or wrapper element, whichever exists.
|
857
|
+
*/
|
858
|
+
get listOrWrapper() {
|
859
|
+
return this.listElement || this.wrapperElement;
|
860
|
+
}
|
861
|
+
}
|