UNPKG

@oruga-ui/oruga-next

Version:

UI components for Vue.js and CSS framework agnostic

57 lines (56 loc) 2.26 kB
"use strict"; /*! Oruga v0.11.4 | MIT License | github.com/oruga-ui/oruga */ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); const Loading_vue_vue_type_script_setup_true_lang = require("./Loading.vue_vue_type_script_setup_true_lang-PCUfNIRG.cjs"); require("vue"); const useProgrammatic = require("./useProgrammatic-DvenwIXg.cjs"); const config = require("./config-D4SNSQp_.cjs"); const registry = new useProgrammatic.InstanceRegistry(); const LoadingProgrammatic = { /** Returns the number of registered active instances. */ count: registry.count, /** * Create a new programmatic loading component instance. * @param options loading label string or loading component props object * @param target specify a target the component get rendered into * @returns ProgrammaticExpose */ open(options, target) { const _options = typeof options === "string" ? { label: options } : options; const componentProps = { active: true, // set the active default state to true fullPage: false, // set the full page default state to false ..._options }; return useProgrammatic.ComponentProgrammatic.open(Loading_vue_vue_type_script_setup_true_lang._sfc_main, { registry, // custom programmatic instance registry target, // target the component get rendered into props: componentProps, // component specific props onClose: _options.onClose // on close event handler }); }, /** Close the last registred instance in the loading programmatic instance registry. */ close(...args) { registry.last()?.exposed?.close(...args); }, /** Close all instances in the programmatic loading instance registry. */ closeAll(...args) { registry.walk((entry) => entry.exposed?.close(...args)); } }; const index = { install(app) { config.registerComponent(app, Loading_vue_vue_type_script_setup_true_lang._sfc_main); config.registerComponentProgrammatic(app, "loading", LoadingProgrammatic); } }; exports.OLoading = Loading_vue_vue_type_script_setup_true_lang._sfc_main; exports.LoadingProgrammatic = LoadingProgrammatic; exports.default = index; //# sourceMappingURL=loading.cjs.map