@opentiny/tiny-robot 0.3.0-alpha.3 → 0.3.0-alpha.5

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/dist/index3.js CHANGED
@@ -1,28 +1,28 @@
1
- import { A as B, s as C, d as k, a as _, p as $, b as A, c as O, f as D } from "./index6.js";
2
- import { createElementBlock as w, openBlock as f, createElementVNode as r, resolveComponent as I, mergeProps as j, createBlock as h, createCommentVNode as T, renderSlot as E, resolveDynamicComponent as L, normalizeClass as M, toDisplayString as U } from "vue";
3
- const z = ({ emit: e, props: t, state: n, designConfig: o }) => (u) => {
1
+ import { A as B, s as C, d as k, a as _, p as O, b as $, c as A, f as j } from "./index6.js";
2
+ import { createElementBlock as w, openBlock as f, createElementVNode as r, resolveComponent as D, mergeProps as I, createBlock as h, createCommentVNode as T, renderSlot as E, resolveDynamicComponent as L, normalizeClass as M, toDisplayString as U } from "vue";
3
+ const z = ({ emit: e, props: t, state: n, designConfig: o }) => (d) => {
4
4
  var s, l;
5
- const i = B.filterUrl(t.href), d = 1e3;
6
- let a = d;
7
- t.resetTime !== d ? a = t.resetTime : a = (l = (s = o == null ? void 0 : o.props) == null ? void 0 : s.resetTime) != null ? l : t.resetTime, i ? location.href = i : t.nativeType === "button" && a > 0 && (n.disabled = !0, n.timer = window.setTimeout(() => {
5
+ const i = B.filterUrl(t.href), u = 1e3;
6
+ let a = u;
7
+ t.resetTime !== u ? a = t.resetTime : a = (l = (s = o == null ? void 0 : o.props) == null ? void 0 : s.resetTime) != null ? l : t.resetTime, i ? location.href = i : t.nativeType === "button" && a > 0 && (n.disabled = !0, n.timer = window.setTimeout(() => {
8
8
  n.disabled = !1;
9
- }, a)), e("click", u);
10
- }, F = (e) => () => clearTimeout(e.timer), N = ["state", "handleClick"], G = (e, { computed: t, onBeforeUnmount: n, reactive: o, watch: u, inject: s }, { emit: l, parent: i, designConfig: d }) => {
9
+ }, a)), e("click", d);
10
+ }, F = (e) => () => clearTimeout(e.timer), N = ["state", "handleClick"], G = (e, { computed: t, onBeforeUnmount: n, reactive: o, watch: d, inject: s }, { emit: l, parent: i, designConfig: u }) => {
11
11
  i.tinyForm = i.tinyForm || s("form", null);
12
12
  const a = o({
13
13
  timer: 0,
14
14
  disabled: e.disabled,
15
15
  plain: t(() => e.plain || (i.buttonGroup || {}).plain),
16
16
  round: t(() => {
17
- var c, y, g;
18
- return (g = (y = e.round) != null ? y : (c = d == null ? void 0 : d.props) == null ? void 0 : c.round) != null ? g : !1;
17
+ var c, v, g;
18
+ return (g = (v = e.round) != null ? v : (c = u == null ? void 0 : u.props) == null ? void 0 : c.round) != null ? g : !1;
19
19
  }),
20
20
  formDisabled: t(() => (i.tinyForm || {}).disabled),
21
21
  buttonDisabled: t(
22
22
  () => e.disabled || a.disabled || (i.buttonGroup || {}).disabled || a.formDisabled
23
23
  )
24
24
  });
25
- u(
25
+ d(
26
26
  () => e.disabled,
27
27
  (c) => {
28
28
  a.disabled = c;
@@ -32,7 +32,7 @@ const z = ({ emit: e, props: t, state: n, designConfig: o }) => (u) => {
32
32
  const b = {
33
33
  state: a,
34
34
  clearTimer: F(a),
35
- handleClick: z({ emit: l, props: e, state: a, designConfig: d })
35
+ handleClick: z({ emit: l, props: e, state: a, designConfig: u })
36
36
  };
37
37
  return n(b.clearTimer), b;
38
38
  };
@@ -135,14 +135,14 @@ function S(e, t) {
135
135
  return o;
136
136
  }
137
137
  var Q = function(t, n) {
138
- for (var o = t.__vccOpts || t, u = J(n), s; !(s = u()).done; ) {
139
- var l = s.value, i = l[0], d = l[1];
140
- o[i] = d;
138
+ for (var o = t.__vccOpts || t, d = J(n), s; !(s = d()).done; ) {
139
+ var l = s.value, i = l[0], u = l[1];
140
+ o[i] = u;
141
141
  }
142
142
  return o;
143
143
  }, W = k({
144
144
  emits: ["click"],
145
- props: [].concat($, ["type", "text", "size", "icon", "resetTime", "nativeType", "loading", "disabled", "plain", "autofocus", "round", "circle", "tabindex", "customClass", "ghost"]),
145
+ props: [].concat(O, ["type", "text", "size", "icon", "resetTime", "nativeType", "loading", "disabled", "plain", "autofocus", "round", "circle", "tabindex", "customClass", "ghost", "customStyle"]),
146
146
  components: {
147
147
  IconLoading: q()
148
148
  },
@@ -155,9 +155,9 @@ var Q = function(t, n) {
155
155
  });
156
156
  }
157
157
  }), x = ["disabled", "autofocus", "type", "tabindex"];
158
- function ee(e, t, n, o, u, s) {
159
- var l = I("icon-loading");
160
- return f(), w("button", j({
158
+ function ee(e, t, n, o, d, s) {
159
+ var l = D("icon-loading");
160
+ return f(), w("button", I({
161
161
  class: ["tiny-button", [e.type ? "tiny-button--" + e.type : "", e.size ? "tiny-button--" + e.size : "", {
162
162
  "is-disabled": e.state.buttonDisabled,
163
163
  "is-loading": e.loading,
@@ -174,6 +174,7 @@ function ee(e, t, n, o, u, s) {
174
174
  disabled: e.state.buttonDisabled || e.loading,
175
175
  autofocus: e.autofocus,
176
176
  type: e.nativeType,
177
+ style: e.customStyle,
177
178
  tabindex: e.tabindex
178
179
  }, e.a(e.$attrs, ["class", "style", "title", "id"], !0)), [e.loading ? (f(), h(l, {
179
180
  key: 0,
@@ -194,19 +195,19 @@ function ee(e, t, n, o, u, s) {
194
195
  })], 16, x);
195
196
  }
196
197
  var m = /* @__PURE__ */ Q(W, [["render", ee]]);
197
- function v() {
198
- return v = Object.assign ? Object.assign.bind() : function(e) {
198
+ function y() {
199
+ return y = Object.assign ? Object.assign.bind() : function(e) {
199
200
  for (var t = 1; t < arguments.length; t++) {
200
201
  var n = arguments[t];
201
202
  for (var o in n) ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
202
203
  }
203
204
  return e;
204
- }, v.apply(null, arguments);
205
+ }, y.apply(null, arguments);
205
206
  }
206
207
  var te = function(t) {
207
208
  var n, o = typeof process == "object" ? (n = process.env) == null ? void 0 : n.TINY_MODE : null;
208
209
  return m;
209
- }, ne = v({}, D, {
210
+ }, ne = y({}, j, {
210
211
  /** 展示按钮不同的状态,设置为text则展示为文本按钮。可取值为:'default' | 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text' */
211
212
  type: {
212
213
  type: String,
@@ -275,6 +276,13 @@ var te = function(t) {
275
276
  type: Boolean,
276
277
  default: !1
277
278
  },
279
+ /** 自定义样式 */
280
+ customStyle: {
281
+ type: Object,
282
+ default: function() {
283
+ return {};
284
+ }
285
+ },
278
286
  /** 是否幽灵按钮 */
279
287
  ghost: Boolean,
280
288
  /** 点击事件 */
@@ -282,7 +290,7 @@ var te = function(t) {
282
290
  type: Function
283
291
  }
284
292
  }), p = k({
285
- name: O + "Button",
293
+ name: A + "Button",
286
294
  inject: {
287
295
  buttonGroup: {
288
296
  default: ""
@@ -291,7 +299,7 @@ var te = function(t) {
291
299
  props: ne,
292
300
  slots: Object,
293
301
  setup: function(t, n) {
294
- return A({
302
+ return $({
295
303
  props: t,
296
304
  context: n,
297
305
  template: te