UNPKG

@vuesax-alpha/nightly

Version:
126 lines (121 loc) 4.13 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var vue = require('vue'); require('../../../hooks/index.js'); require('../../../tokens/index.js'); var table = require('./table.js'); require('./composables/index.js'); var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js'); var index = require('../../../hooks/use-namespace/index.js'); var index$1 = require('../../../hooks/use-locale/index.js'); var useTable = require('./composables/use-table.js'); var table$1 = require('../../../tokens/table.js'); const _hoisted_1 = ["colspan"]; const __default__ = vue.defineComponent({ name: "VsTable" }); const _sfc_main = vue.defineComponent({ ...__default__, props: table.tableProps, emits: table.tableEmits, setup(__props, { emit }) { const props = __props; const ns = index.useNamespace("table"); const { t } = index$1.useLocale(); const { tableKls, colspan, selected, theadRef } = useTable.useTable(props, emit); vue.provide(table$1.tableContextKey, { selected, colspan, multiple: vue.computed(() => props.multiple), modelValue: vue.computed(() => props.modelValue) }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock( "div", { class: vue.normalizeClass(vue.unref(ns).b("wrapper")) }, [ _ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock( "div", { key: 0, class: vue.normalizeClass(vue.unref(ns).be("wrapper", "header")) }, [ vue.renderSlot(_ctx.$slots, "header") ], 2 )) : vue.createCommentVNode("v-if", true), vue.createElementVNode( "div", { class: vue.normalizeClass(vue.unref(tableKls)) }, [ vue.createElementVNode("table", null, [ vue.createElementVNode( "thead", { ref_key: "theadRef", ref: theadRef, class: vue.normalizeClass(vue.unref(ns).e("thead")) }, [ vue.renderSlot(_ctx.$slots, "thead") ], 2 ), vue.createElementVNode( "tbody", { class: vue.normalizeClass(vue.unref(ns).e("tbody")) }, [ vue.renderSlot(_ctx.$slots, "tbody") ], 2 ), vue.createElementVNode( "tbody", { class: vue.normalizeClass(vue.unref(ns).e("not-found")) }, [ vue.createElementVNode("tr", null, [ vue.createElementVNode("td", { colspan: vue.unref(colspan) }, [ vue.renderSlot(_ctx.$slots, "notFound", {}, () => [ vue.createTextVNode( vue.toDisplayString(vue.unref(t)("vs.table.noMatch")), 1 ) ]) ], 8, _hoisted_1) ]) ], 2 ) ]) ], 2 ), _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock( "div", { key: 1, class: vue.normalizeClass(vue.unref(ns).e("footer")) }, [ vue.renderSlot(_ctx.$slots, "footer") ], 2 )) : vue.createCommentVNode("v-if", true) ], 2 ); }; } }); var Table = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "/home/runner/work/vuesax-alpha/vuesax-alpha/packages/components/table/src/table.vue"]]); exports["default"] = Table; //# sourceMappingURL=table2.js.map