UNPKG

@oruga-ui/oruga-next

Version:

UI components for Vue.js and CSS framework agnostic

61 lines (60 loc) 2.4 kB
"use strict"; /*! Oruga v0.11.0 | 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-D-rFtctf.cjs"); require("vue"); const useProgrammatic = require("./useProgrammatic-D_ewnsB3.cjs"); const config = require("./config-eYBvpFOZ.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) { var _a, _b; (_b = (_a = registry.last()) == null ? void 0 : _a.exposed) == null ? void 0 : _b.close(...args); }, /** Close all instances in the programmatic loading instance registry. */ closeAll(...args) { registry.walk((entry) => { var _a; return (_a = entry.exposed) == null ? void 0 : _a.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