UNPKG

@vue-js-cron/element-plus

Version:
205 lines (204 loc) 5.98 kB
import { openBlock as l, createElementBlock as n, createElementVNode as g, defineComponent as k, resolveComponent as r, createVNode as d, mergeProps as y, withCtx as a, Fragment as v, renderList as b, normalizeClass as j, toDisplayString as i, createCommentVNode as $, createTextVNode as c, createBlock as B, withModifiers as L } from "vue"; import { selectProps as N, setupSelect as U, setupCron as z, cronCoreProps as M } from "@vue-js-cron/core"; /*! Element Plus Icons Vue v2.1.0 */ var A = (e, o) => { let s = e.__vccOpts || e; for (let [p, u] of o) s[p] = u; return s; }, D = { name: "Close" }, F = { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, I = /* @__PURE__ */ g( "path", { fill: "currentColor", d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z" }, null, -1 /* HOISTED */ ), R = [ I ]; function T(e, o, s, p, u, w) { return l(), n("svg", F, R); } var q = /* @__PURE__ */ A(D, [["render", T], ["__file", "close.vue"]]); const G = k({ inheritAttrs: !1, components: { Close: q }, name: "CustomSelect", props: { buttonProps: { type: Object, default: () => { } }, dropdownProps: { type: Object, default: () => { } }, ...N() }, emits: ["update:model-value"], setup(e, o) { return U(e, () => e.modelValue, o); } }); const h = (e, o) => { const s = e.__vccOpts || e; for (const [p, u] of o) s[p] = u; return s; }, H = { class: "custom-select" }, J = ["onClick"]; function K(e, o, s, p, u, w) { const m = r("Close"), t = r("el-icon"), f = r("el-button"), E = r("el-dropdown-item"), V = r("el-dropdown-menu"), O = r("el-dropdown"); return l(), n("span", H, [ d(O, y({ style: { "vertical-align": "baseline" }, trigger: "click" }, e.dropdownProps), { dropdown: a(() => [ d(V, null, { default: a(() => [ (l(!0), n(v, null, b(e.itemRows, (C, P) => (l(), n("div", { class: "vcron-el-row", key: P }, [ (l(!0), n(v, null, b(C, (_, S) => (l(), n("div", { key: P + "-" + S, class: "vcron-el-col", onClick: (ee) => e.select(_) }, [ d(E, null, { default: a(() => [ _ ? (l(), n("span", { key: 0, class: j({ "vcron-el-selected": e.has(_) }) }, i(_.text), 3)) : $("", !0) ]), _: 2 }, 1024) ], 8, J))), 128)) ]))), 128)) ]), _: 1 }) ]), default: a(() => [ d(f, y(e.buttonProps, { disabled: e.disabled }), { default: a(() => [ c(i(e.selection ?? e.selectedStr) + " ", 1), e.clearable && !e.isEmpty ? (l(), B(t, { key: 0, class: "el-icon--right", onClick: [ o[0] || (o[0] = (C) => e.clear()), o[1] || (o[1] = L(() => { }, ["stop"])) ] }, { default: a(() => [ d(m) ]), _: 1 })) : $("", !0) ]), _: 1 }, 16, ["disabled"]) ]), _: 1 }, 16) ]); } const Q = /* @__PURE__ */ h(G, [["render", K], ["__scopeId", "data-v-97b782dd"]]), W = () => ({ /** * Properties of Element Plus Button * * @remarks * See {@link https://element-plus.org/en-US/component/button.html#button-attributes} */ buttonProps: { type: Object, default() { return {}; } }, /** * Properties of Element Plus Dropdown * * @remarks * See {@link https://element-plus.org/en-US/component/dropdown.html#dropdown-attributes} */ dropdownProps: { type: Object, default: () => { } }, ...M() }), X = k({ name: "VueCronEditor", components: { CustomSelect: Q }, props: W(), emits: ["update:model-value", "update:period", "error"], setup(e, o) { return z(e, o); } }); const Y = { class: "vcron-el-spacer" }; function Z(e, o, s, p, u, w) { const m = r("custom-select"); return l(), n("div", null, [ c(i(e.period.prefix.value) + " ", 1), d(m, { "model-value": e.period.selected.value.id, "item-value": "id", items: e.period.items, "onUpdate:modelValue": o[0] || (o[0] = (t) => e.period.select(t)), disabled: e.disabled, "button-props": e.buttonProps, "dropdown-props": e.dropdownProps }, null, 8, ["model-value", "items", "disabled", "button-props", "dropdown-props"]), c(" " + i(e.period.suffix.value) + " ", 1), (l(!0), n(v, null, b(e.selected, (t) => (l(), n(v, { key: t.id }, [ c(i(t.prefix.value) + " ", 1), g("div", Y, [ d(m, { "model-value": t.selected.value, "onUpdate:modelValue": (f) => t.select(f), items: t.items, cols: e.cols[t.id] || 1, selection: t.text.value, multiple: "", clearable: "", disabled: e.disabled, "button-props": e.buttonProps, "dropdown-props": { ...e.dropdownProps, hideOnClick: !1 } }, null, 8, ["model-value", "onUpdate:modelValue", "items", "cols", "selection", "disabled", "button-props", "dropdown-props"]) ]), c(" " + i(t.suffix.value), 1) ], 64))), 128)) ]); } const x = /* @__PURE__ */ h(X, [["render", Z]]), le = { install: (e) => { e.component("CronElementPlus", x); } }; export { x as CronElementPlus, le as CronElementPlusPlugin, W as cronElementPlusProps, le as default }; //# sourceMappingURL=element-plus.js.map