@farris/ui-vue 1.3.4 → 1.3.6
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/components/accordion/index.esm.js +16 -16
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +65 -65
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +13 -13
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +504 -490
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +247 -233
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +356 -344
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +159 -145
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +127 -128
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +15 -15
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/component/index.esm.js +101 -87
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +9 -7
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +181 -167
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +746 -730
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +9 -7
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +789 -777
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.esm.js +3096 -3069
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +257 -243
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +322 -306
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +177 -163
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +78 -82
- package/components/event-parameter/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +501 -487
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +37 -37
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +487 -472
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +440 -433
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.esm.js +594 -587
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.esm.js +2766 -2739
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +402 -388
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +201 -202
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +264 -245
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +157 -143
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +314 -298
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +862 -843
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +1031 -1015
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +169 -155
- package/components/nav/index.umd.cjs +2 -2
- package/components/number-range/index.esm.js +150 -137
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +207 -194
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +427 -414
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +22 -22
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +510 -492
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +192 -178
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +234 -220
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +288 -277
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +62 -61
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.esm.js +776 -770
- package/components/query-solution/index.umd.cjs +6 -6
- package/components/radio-button/index.esm.js +64 -64
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +296 -283
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +222 -208
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +187 -173
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +554 -542
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +483 -469
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +634 -619
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +228 -214
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +419 -406
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +162 -148
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +308 -284
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +279 -265
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +183 -170
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +307 -294
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +320 -306
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +245 -231
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +260 -247
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +409 -396
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +424 -410
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +383 -376
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +595 -575
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +325 -311
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +304 -290
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +99 -85
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +947 -933
- package/components/weather/index.umd.cjs +4 -4
- package/farris.all.esm.js +5492 -5470
- package/farris.all.umd.cjs +13 -13
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/condition/src/composition/condition-value/input-group-value.d.ts +1 -1
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-field-tree.d.ts +1 -0
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
import { defineComponent as j, ref as
|
|
2
|
-
import { isPlainObject as
|
|
1
|
+
import { defineComponent as j, ref as w, watch as M, createVNode as b, Fragment as C } from "vue";
|
|
2
|
+
import { isPlainObject as O, cloneDeep as T } from "lodash-es";
|
|
3
3
|
import { withInstall as $ } from "../common/index.esm.js";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const { properties: n, title: l, ignore: r } =
|
|
7
|
-
if (l && (!
|
|
4
|
+
const D = {}, P = {};
|
|
5
|
+
function x(t) {
|
|
6
|
+
const { properties: n, title: l, ignore: r } = t, o = r && Array.isArray(r), i = Object.keys(n).reduce((u, p) => ((!o || !r.find((g) => g === p)) && (u[p] = n[p].type === "object" && n[p].properties ? x(n[p]) : T(n[p].default)), u), {});
|
|
7
|
+
if (l && (!o || !r.find((u) => u === "id"))) {
|
|
8
8
|
const u = l.toLowerCase().replace(/-/g, "_");
|
|
9
9
|
i.id = `${u}_${Math.random().toString().slice(2, 6)}`;
|
|
10
10
|
}
|
|
11
11
|
return i;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const l =
|
|
15
|
-
return Object.keys(l).reduce((r,
|
|
13
|
+
function V(t, n) {
|
|
14
|
+
const l = x(n);
|
|
15
|
+
return Object.keys(l).reduce((r, o) => (Object.prototype.hasOwnProperty.call(t, o) && (r[o] && O(r[o]) && O(t[o] || !t[o]) ? Object.assign(r[o], t[o] || {}) : r[o] = t[o]), r), l), l;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return Object.keys(
|
|
19
|
-
if (n.has(
|
|
20
|
-
const i = n.get(
|
|
17
|
+
function B(t, n) {
|
|
18
|
+
return Object.keys(t).filter((r) => t[r] != null).reduce((r, o) => {
|
|
19
|
+
if (n.has(o)) {
|
|
20
|
+
const i = n.get(o);
|
|
21
21
|
if (typeof i == "string")
|
|
22
|
-
r[i] =
|
|
22
|
+
r[i] = t[o];
|
|
23
23
|
else {
|
|
24
|
-
const u = i(
|
|
24
|
+
const u = i(o, t[o], t);
|
|
25
25
|
Object.assign(r, u);
|
|
26
26
|
}
|
|
27
27
|
} else
|
|
28
|
-
r[
|
|
28
|
+
r[o] = t[o];
|
|
29
29
|
return r;
|
|
30
30
|
}, {});
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const r =
|
|
34
|
-
return
|
|
32
|
+
function N(t, n, l = /* @__PURE__ */ new Map()) {
|
|
33
|
+
const r = V(t, n);
|
|
34
|
+
return B(r, l);
|
|
35
35
|
}
|
|
36
|
-
function A(
|
|
37
|
-
function n(
|
|
36
|
+
function A(t = {}) {
|
|
37
|
+
function n(e, s, a, c) {
|
|
38
38
|
if (typeof a == "number")
|
|
39
|
-
return c[
|
|
39
|
+
return c[e].length === a;
|
|
40
40
|
if (typeof a == "object") {
|
|
41
41
|
const f = Object.keys(a)[0], d = a[f];
|
|
42
42
|
if (f === "not")
|
|
43
|
-
return Number(c[
|
|
43
|
+
return Number(c[e].length) !== Number(d);
|
|
44
44
|
if (f === "moreThan")
|
|
45
|
-
return Number(c[
|
|
45
|
+
return Number(c[e].length) >= Number(d);
|
|
46
46
|
if (f === "lessThan")
|
|
47
|
-
return Number(c[
|
|
47
|
+
return Number(c[e].length) <= Number(d);
|
|
48
48
|
}
|
|
49
49
|
return !1;
|
|
50
50
|
}
|
|
51
|
-
function l(
|
|
52
|
-
return c[
|
|
51
|
+
function l(e, s, a, c) {
|
|
52
|
+
return c[e] && c[e].propertyValue && String(c[e].propertyValue.value) === String(a);
|
|
53
53
|
}
|
|
54
54
|
const r = /* @__PURE__ */ new Map([
|
|
55
55
|
["length", n],
|
|
56
56
|
["getProperty", l]
|
|
57
57
|
]);
|
|
58
|
-
Object.keys(
|
|
59
|
-
function
|
|
60
|
-
const a =
|
|
61
|
-
return typeof
|
|
58
|
+
Object.keys(t).reduce((e, s) => (e.set(s, t[s]), e), r);
|
|
59
|
+
function o(e, s) {
|
|
60
|
+
const a = e;
|
|
61
|
+
return typeof s == "number" ? [{ target: a, operator: "length", param: null, value: Number(s) }] : typeof s == "boolean" ? [{ target: a, operator: "getProperty", param: e, value: !!s }] : typeof s == "object" ? Object.keys(s).map((c) => {
|
|
62
62
|
if (c === "length")
|
|
63
|
-
return { target: a, operator: "length", param: null, value:
|
|
64
|
-
const f = c, d =
|
|
63
|
+
return { target: a, operator: "length", param: null, value: s[c] };
|
|
64
|
+
const f = c, d = s[c];
|
|
65
65
|
return { target: a, operator: "getProperty", param: f, value: d };
|
|
66
66
|
}) : [];
|
|
67
67
|
}
|
|
68
|
-
function i(
|
|
69
|
-
return Object.keys(
|
|
70
|
-
const f =
|
|
68
|
+
function i(e) {
|
|
69
|
+
return Object.keys(e).reduce((a, c) => {
|
|
70
|
+
const f = o(c, e[c]);
|
|
71
71
|
return a.push(...f), a;
|
|
72
72
|
}, []);
|
|
73
73
|
}
|
|
74
|
-
function u(
|
|
75
|
-
if (r.has(
|
|
76
|
-
const a = r.get(
|
|
77
|
-
return a && a(
|
|
74
|
+
function u(e, s) {
|
|
75
|
+
if (r.has(e.operator)) {
|
|
76
|
+
const a = r.get(e.operator);
|
|
77
|
+
return a && a(e.target, e.param, e.value, s) || !1;
|
|
78
78
|
}
|
|
79
79
|
return !1;
|
|
80
80
|
}
|
|
81
|
-
function p(
|
|
82
|
-
return i(
|
|
81
|
+
function p(e, s) {
|
|
82
|
+
return i(e).reduce((f, d) => f && u(d, s), !0);
|
|
83
83
|
}
|
|
84
|
-
function g(
|
|
85
|
-
const a = Object.keys(
|
|
84
|
+
function g(e, s) {
|
|
85
|
+
const a = Object.keys(e), c = a.includes("allOf"), f = a.includes("anyOf"), d = c || f, h = (d ? e[d ? c ? "allOf" : "anyOf" : "allOf"] : [e]).map((R) => p(R, s));
|
|
86
86
|
return c ? !h.includes(!1) : h.includes(!0);
|
|
87
87
|
}
|
|
88
88
|
return { parseValueSchema: g };
|
|
89
89
|
}
|
|
90
90
|
const F = {}, k = {};
|
|
91
91
|
A();
|
|
92
|
-
function L(
|
|
93
|
-
return
|
|
94
|
-
const p =
|
|
92
|
+
function L(t, n, l = /* @__PURE__ */ new Map(), r = (u, p, g, e) => p, o = {}, i = (u) => u) {
|
|
93
|
+
return D[n.title] = n, P[n.title] = r, F[n.title] = o, k[n.title] = i, (u = {}) => {
|
|
94
|
+
const p = N(u, n, l), g = Object.keys(t).reduce((e, s) => (e[s] = t[s].default, e), {});
|
|
95
95
|
return Object.assign(g, p);
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
-
function q(
|
|
98
|
+
function q(t, n) {
|
|
99
99
|
return { customClass: n.class, customStyle: n.style };
|
|
100
100
|
}
|
|
101
101
|
const I = /* @__PURE__ */ new Map([
|
|
102
102
|
["appearance", q]
|
|
103
103
|
]);
|
|
104
|
-
function S(
|
|
104
|
+
function S(t, n, l) {
|
|
105
105
|
return n;
|
|
106
106
|
}
|
|
107
107
|
const _ = "https://json-schema.org/draft/2020-12/schema", H = "https://farris-design.gitee.io/radio-button.schema.json", z = "radio-button", G = "A Farris Component", J = "object", Q = {
|
|
@@ -222,46 +222,46 @@ const _ = "https://json-schema.org/draft/2020-12/schema", H = "https://farris-de
|
|
|
222
222
|
name: "FRadioButton",
|
|
223
223
|
props: y,
|
|
224
224
|
emits: ["selectedValueChanged"],
|
|
225
|
-
setup(
|
|
226
|
-
const l =
|
|
225
|
+
setup(t, n) {
|
|
226
|
+
const l = w(t.enumData);
|
|
227
227
|
function r(i, u) {
|
|
228
228
|
if (i.currentTarget.classList.value = "btn btn-secondary active", i.currentTarget.tagName.toLowerCase() === "label") {
|
|
229
229
|
const {
|
|
230
230
|
currentTarget: p
|
|
231
231
|
} = i, g = p.parentElement;
|
|
232
|
-
Array.from(g.querySelectorAll("label")).filter((
|
|
232
|
+
Array.from(g.querySelectorAll("label")).filter((s) => s !== p).forEach((s) => s.classList.remove("active"));
|
|
233
233
|
}
|
|
234
234
|
n.emit("selectedValueChanged", u);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
return `${i.text}${
|
|
236
|
+
function o(i) {
|
|
237
|
+
return `${i.text}${t.suffixValue}`;
|
|
238
238
|
}
|
|
239
|
-
return
|
|
240
|
-
i !== u && (l.value =
|
|
239
|
+
return M(() => t.enumData, (i, u) => {
|
|
240
|
+
i !== u && (l.value = t.enumData);
|
|
241
241
|
}), () => b("div", {
|
|
242
242
|
class: "f-radio-button"
|
|
243
243
|
}, [b("div", {
|
|
244
244
|
class: ["farris-input-wrap"]
|
|
245
|
-
}, [l.value.map((i, u) => b(
|
|
245
|
+
}, [l.value.map((i, u) => b(C, null, [b("label", {
|
|
246
246
|
class: i.active ? "btn btn-secondary active" : "btn btn-secondary",
|
|
247
247
|
onClick: (p) => r(p, i)
|
|
248
248
|
}, [b("span", {
|
|
249
249
|
class: "f-radio-button-text"
|
|
250
|
-
}, [
|
|
250
|
+
}, [o(i)])])]))])]);
|
|
251
251
|
}
|
|
252
252
|
}), et = /* @__PURE__ */ j({
|
|
253
253
|
name: "FRadioButtonDesign",
|
|
254
254
|
props: y,
|
|
255
255
|
emits: [""],
|
|
256
|
-
setup(
|
|
257
|
-
return () => b(
|
|
256
|
+
setup(t, n) {
|
|
257
|
+
return () => b(C, null, null);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
-
m.register = (
|
|
261
|
-
|
|
260
|
+
m.register = (t, n, l, r) => {
|
|
261
|
+
t["radio-button"] = m, n["radio-button"] = v;
|
|
262
262
|
};
|
|
263
|
-
m.registerDesigner = (
|
|
264
|
-
|
|
263
|
+
m.registerDesigner = (t, n, l) => {
|
|
264
|
+
t["radio-button"] = et, n["radio-button"] = v;
|
|
265
265
|
};
|
|
266
266
|
const at = $(m);
|
|
267
267
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f["radio-button"]={},f.Vue,f.LodashES,f.common))})(this,function(f,d,j,$){"use strict";const x={},N={};function
|
|
1
|
+
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f["radio-button"]={},f.Vue,f.LodashES,f.common))})(this,function(f,d,j,$){"use strict";const x={},N={};function C(e){const{properties:n,title:l,ignore:r}=e,o=r&&Array.isArray(r),i=Object.keys(n).reduce((u,p)=>((!o||!r.find(b=>b===p))&&(u[p]=n[p].type==="object"&&n[p].properties?C(n[p]):j.cloneDeep(n[p].default)),u),{});if(l&&(!o||!r.find(u=>u==="id"))){const u=l.toLowerCase().replace(/-/g,"_");i.id=`${u}_${Math.random().toString().slice(2,6)}`}return i}function R(e,n){const l=C(n);return Object.keys(l).reduce((r,o)=>(Object.prototype.hasOwnProperty.call(e,o)&&(r[o]&&j.isPlainObject(r[o])&&j.isPlainObject(e[o]||!e[o])?Object.assign(r[o],e[o]||{}):r[o]=e[o]),r),l),l}function T(e,n){return Object.keys(e).filter(r=>e[r]!=null).reduce((r,o)=>{if(n.has(o)){const i=n.get(o);if(typeof i=="string")r[i]=e[o];else{const u=i(o,e[o],e);Object.assign(r,u)}}else r[o]=e[o];return r},{})}function M(e,n,l=new Map){const r=R(e,n);return T(r,l)}function P(e={}){function n(t,s,a,c){if(typeof a=="number")return c[t].length===a;if(typeof a=="object"){const g=Object.keys(a)[0],m=a[g];if(g==="not")return Number(c[t].length)!==Number(m);if(g==="moreThan")return Number(c[t].length)>=Number(m);if(g==="lessThan")return Number(c[t].length)<=Number(m)}return!1}function l(t,s,a,c){return c[t]&&c[t].propertyValue&&String(c[t].propertyValue.value)===String(a)}const r=new Map([["length",n],["getProperty",l]]);Object.keys(e).reduce((t,s)=>(t.set(s,e[s]),t),r);function o(t,s){const a=t;return typeof s=="number"?[{target:a,operator:"length",param:null,value:Number(s)}]:typeof s=="boolean"?[{target:a,operator:"getProperty",param:t,value:!!s}]:typeof s=="object"?Object.keys(s).map(c=>{if(c==="length")return{target:a,operator:"length",param:null,value:s[c]};const g=c,m=s[c];return{target:a,operator:"getProperty",param:g,value:m}}):[]}function i(t){return Object.keys(t).reduce((a,c)=>{const g=o(c,t[c]);return a.push(...g),a},[])}function u(t,s){if(r.has(t.operator)){const a=r.get(t.operator);return a&&a(t.target,t.param,t.value,s)||!1}return!1}function p(t,s){return i(t).reduce((g,m)=>g&&u(m,s),!0)}function b(t,s){const a=Object.keys(t),c=a.includes("allOf"),g=a.includes("anyOf"),m=c||g,V=(m?t[m?c?"allOf":"anyOf":"allOf"]:[t]).map(I=>p(I,s));return c?!V.includes(!1):V.includes(!0)}return{parseValueSchema:b}}const w={},B={};P();function E(e,n,l=new Map,r=(u,p,b,t)=>p,o={},i=u=>u){return x[n.title]=n,N[n.title]=r,w[n.title]=o,B[n.title]=i,(u={})=>{const p=M(u,n,l),b=Object.keys(e).reduce((t,s)=>(t[s]=e[s].default,t),{});return Object.assign(b,p)}}function D(e,n){return{customClass:n.class,customStyle:n.style}}const q=new Map([["appearance",D]]);function F(e,n,l){return n}const A={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/radio-button.schema.json",title:"radio-button",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for radio-button",type:"string"},type:{description:"The type string of radio-button",type:"string",default:"radio-button"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},k={title:"radio-button",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}},h={enumData:{type:Array,default:[{text:"1",active:!0}]},suffixValue:{type:String,default:""},onSelectedValueChanged:{type:Function,default:()=>{}}},O=E(h,A,q,F,k),y=d.defineComponent({name:"FRadioButton",props:h,emits:["selectedValueChanged"],setup(e,n){const l=d.ref(e.enumData);function r(i,u){if(i.currentTarget.classList.value="btn btn-secondary active",i.currentTarget.tagName.toLowerCase()==="label"){const{currentTarget:p}=i,b=p.parentElement;Array.from(b.querySelectorAll("label")).filter(s=>s!==p).forEach(s=>s.classList.remove("active"))}n.emit("selectedValueChanged",u)}function o(i){return`${i.text}${e.suffixValue}`}return d.watch(()=>e.enumData,(i,u)=>{i!==u&&(l.value=e.enumData)}),()=>d.createVNode("div",{class:"f-radio-button"},[d.createVNode("div",{class:["farris-input-wrap"]},[l.value.map((i,u)=>d.createVNode(d.Fragment,null,[d.createVNode("label",{class:i.active?"btn btn-secondary active":"btn btn-secondary",onClick:p=>r(p,i)},[d.createVNode("span",{class:"f-radio-button-text"},[o(i)])])]))])])}}),L=d.defineComponent({name:"FRadioButtonDesign",props:h,emits:[""],setup(e,n){return()=>d.createVNode(d.Fragment,null,null)}});y.register=(e,n,l,r)=>{e["radio-button"]=y,n["radio-button"]=O},y.registerDesigner=(e,n,l)=>{e["radio-button"]=L,n["radio-button"]=O};const v=$.withInstall(y);f.RadioButton=y,f.default=v,f.propsResolver=O,f.radioButtonProps=h,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|