@farris/ui-vue 1.3.1 → 1.3.3
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 +103 -99
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +301 -351
- package/components/avatar/index.umd.cjs +1 -1
- package/components/binding-selector/index.esm.js +444 -0
- package/components/binding-selector/index.umd.cjs +1 -0
- package/components/binding-selector/package.json +8 -0
- package/components/border-editor/index.esm.js +5 -3
- package/components/border-editor/index.umd.cjs +1 -1
- package/components/button-edit/index.esm.js +143 -139
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +407 -396
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +266 -255
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +628 -641
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +379 -374
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.esm.js +471 -471
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +155 -148
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +487 -478
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +330 -279
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.esm.js +1171 -1277
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +220 -204
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.esm.js +4743 -4641
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.esm.js +2916 -3019
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.esm.js +2375 -2590
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +9518 -1198
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +2 -1
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/drawer/index.esm.js +34 -38
- package/components/drawer/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +149 -138
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.esm.js +1602 -1740
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +159 -151
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +218 -218
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/event-parameter/index.esm.js +311 -0
- package/components/event-parameter/index.umd.cjs +1 -0
- package/components/event-parameter/package.json +8 -0
- package/components/events-editor/index.css +1 -1
- package/components/events-editor/index.esm.js +533 -563
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +95 -91
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.esm.js +2356 -2455
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.esm.js +3048 -3308
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +10537 -3249
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +9781 -1327
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +353 -341
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +510 -827
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +278 -268
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +144 -136
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.esm.js +2139 -2237
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.esm.js +6414 -6367
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.esm.js +5216 -5114
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.esm.js +252 -252
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.esm.js +70 -70
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +486 -984
- package/components/nav/index.umd.cjs +3 -3
- package/components/number-range/index.esm.js +446 -498
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +363 -388
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.esm.js +1050 -1308
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +134 -131
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1072 -1082
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +412 -910
- package/components/pagination/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +214 -203
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.esm.js +1361 -1536
- package/components/property-editor/index.umd.cjs +2 -2
- package/components/property-panel/index.esm.js +650 -677
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +12344 -5048
- package/components/query-solution/index.umd.cjs +6 -1
- package/components/radio-button/index.esm.js +97 -97
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.css +1 -1
- package/components/radio-group/index.esm.js +1821 -565
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +251 -244
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +151 -140
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.esm.js +707 -676
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +719 -740
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.esm.js +4977 -5249
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +145 -134
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +348 -337
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +141 -130
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +311 -301
- package/components/splitter/index.umd.cjs +1 -1
- package/components/step/index.esm.js +231 -220
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +385 -432
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.esm.js +1932 -1914
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +351 -340
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +209 -199
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +388 -415
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.esm.js +619 -666
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.esm.js +493 -486
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.esm.js +3169 -3278
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.esm.js +2320 -2418
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +563 -554
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +287 -276
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +368 -324
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +498 -487
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +51302 -47651
- package/farris.all.umd.cjs +14 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/binding-selector/index.d.ts +55 -0
- package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
- package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
- package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
- package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
- package/types/combo-list/src/components/list-container.component.d.ts +6 -6
- package/types/combo-list/src/components/list-container.props.d.ts +1 -1
- package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
- package/types/common/entity/entity-schema.d.ts +26 -11
- package/types/common/index.d.ts +1 -0
- package/types/common/types.d.ts +2 -2
- package/types/condition/src/condition-fields.design.component.d.ts +18 -0
- package/types/condition/src/types.d.ts +6 -6
- package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
- package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
- package/types/data-grid/src/data-grid.props.d.ts +2 -2
- package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
- package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +2 -2
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
- package/types/date-picker/src/components/month/month.component.d.ts +3 -3
- package/types/date-picker/src/components/year/year.component.d.ts +3 -3
- package/types/designer-canvas/index.d.ts +2 -1
- package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
- package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
- package/types/designer-canvas/src/composition/types.d.ts +49 -40
- package/types/designer-canvas/src/types.d.ts +8 -20
- package/types/dynamic-form/index.d.ts +1 -1
- package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
- package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
- package/types/dynamic-form/src/types.d.ts +1 -1
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +5 -0
- package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
- package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
- package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
- package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
- package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
- package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
- package/types/event-parameter/index.d.ts +31 -0
- package/types/event-parameter/src/composition/type.d.ts +77 -0
- package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
- package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
- package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
- package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
- package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
- package/types/field-selector/src/field-selector.component.d.ts +1 -2
- package/types/field-selector/src/field-selector.props.d.ts +0 -9
- package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
- package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
- package/types/list-view/src/list-view-table.component.d.ts +15 -0
- package/types/lookup/src/composition/use-user-data.d.ts +2 -2
- package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
- package/types/modal/src/composition/modal.service.d.ts +2 -1
- package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
- package/types/page-header/src/page-header.component.d.ts +1 -1
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
- package/types/property-panel/src/composition/type.d.ts +0 -13
- package/types/query-solution/src/composition/types.d.ts +35 -4
- package/types/query-solution/src/composition/use-header.d.ts +21 -0
- package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
- package/types/query-solution/src/composition/use-solution.d.ts +20 -0
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +17 -16
- package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +3 -51
- package/types/query-solution/src/query-solution.d.ts +10 -2
- package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
- package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
- package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
- package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
- package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
- package/types/section/src/property-config/section.property-config.d.ts +17 -17
- package/types/section/src/schema/schema-resolver.d.ts +1 -2
- package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
- package/types/tabs/src/composition/types.d.ts +4 -1
- package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
- package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
- package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
- package/types/text/src/composition/types.d.ts +4 -4
- package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
- package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
- package/types/weather/src/composition/use-weather-color.d.ts +15 -0
- package/types/weather/src/composition/use-weather-data.d.ts +15 -0
- package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
- package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
- package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
- package/types/weather/src/composition/types.d.ts +0 -2
- /package/types/dynamic-form/src/designer/{use-designer-rules.d.ts → response-form-use-designer-rules.d.ts} +0 -0
- /package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +0 -0
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import { defineComponent as w, ref as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as w, ref as m, computed as j, watch as S, createVNode as v, Fragment as _, inject as X, onMounted as U, resolveComponent as W } from "vue";
|
|
2
|
+
import C from "../button-edit/index.esm.js";
|
|
3
3
|
import { isPlainObject as N, cloneDeep as z } from "lodash-es";
|
|
4
4
|
import G from "../list-view/index.esm.js";
|
|
5
5
|
import J from "../loading/index.esm.js";
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const { properties: e, title: i, ignore: o } = t, l = o && Array.isArray(o), d = Object.keys(e).reduce((p, s) => ((!l || !o.find((g) => g
|
|
9
|
-
|
|
6
|
+
const $ = {}, H = {};
|
|
7
|
+
function M(t) {
|
|
8
|
+
const { properties: e, title: i, ignore: o } = t, l = o && Array.isArray(o), d = Object.keys(e).reduce((p, s) => ((!l || !o.find((g) => g === s)) && (p[s] = e[s].type === "object" && e[s].properties ? M(e[s]) : z(e[s].default)), p), {});
|
|
9
|
+
if (i && (!l || !o.find((p) => p === "id"))) {
|
|
10
|
+
const p = i.toLowerCase().replace(/-/g, "_");
|
|
11
|
+
d.id = `${p}_${Math.random().toString().slice(2, 6)}`;
|
|
12
|
+
}
|
|
13
|
+
return d;
|
|
10
14
|
}
|
|
11
|
-
function
|
|
12
|
-
const o =
|
|
15
|
+
function T(t, e = {}, i) {
|
|
16
|
+
const o = $[t];
|
|
13
17
|
if (o) {
|
|
14
|
-
let l =
|
|
15
|
-
const d =
|
|
16
|
-
return l = d ? d({ getSchemaByType:
|
|
18
|
+
let l = M(o);
|
|
19
|
+
const d = H[t];
|
|
20
|
+
return l = d ? d({ getSchemaByType: T }, l, e, i) : l, l;
|
|
17
21
|
}
|
|
18
22
|
return null;
|
|
19
23
|
}
|
|
20
24
|
function Q(t, e) {
|
|
21
|
-
const i =
|
|
22
|
-
return Object.keys(
|
|
25
|
+
const i = M(e);
|
|
26
|
+
return Object.keys(i).reduce((o, l) => (o[l] && N(o[l]) && N(t[l] || !t[l]) ? Object.assign(o[l], t[l] || {}) : o[l] = t[l], o), i), i;
|
|
23
27
|
}
|
|
24
28
|
function Y(t, e) {
|
|
25
29
|
return Object.keys(t).filter((o) => t[o] != null).reduce((o, l) => {
|
|
@@ -41,22 +45,22 @@ function Z(t, e, i = /* @__PURE__ */ new Map()) {
|
|
|
41
45
|
return Y(o, i);
|
|
42
46
|
}
|
|
43
47
|
function x(t = {}) {
|
|
44
|
-
function e(a, n,
|
|
45
|
-
if (typeof
|
|
46
|
-
return
|
|
47
|
-
if (typeof
|
|
48
|
-
const r = Object.keys(
|
|
48
|
+
function e(a, n, c, u) {
|
|
49
|
+
if (typeof c == "number")
|
|
50
|
+
return u[a].length === c;
|
|
51
|
+
if (typeof c == "object") {
|
|
52
|
+
const r = Object.keys(c)[0], f = c[r];
|
|
49
53
|
if (r === "not")
|
|
50
|
-
return Number(
|
|
54
|
+
return Number(u[a].length) !== Number(f);
|
|
51
55
|
if (r === "moreThan")
|
|
52
|
-
return Number(
|
|
56
|
+
return Number(u[a].length) >= Number(f);
|
|
53
57
|
if (r === "lessThan")
|
|
54
|
-
return Number(
|
|
58
|
+
return Number(u[a].length) <= Number(f);
|
|
55
59
|
}
|
|
56
60
|
return !1;
|
|
57
61
|
}
|
|
58
|
-
function i(a, n,
|
|
59
|
-
return
|
|
62
|
+
function i(a, n, c, u) {
|
|
63
|
+
return u[a] && u[a].propertyValue && String(u[a].propertyValue.value) === String(c);
|
|
60
64
|
}
|
|
61
65
|
const o = /* @__PURE__ */ new Map([
|
|
62
66
|
["length", e],
|
|
@@ -64,24 +68,24 @@ function x(t = {}) {
|
|
|
64
68
|
]);
|
|
65
69
|
Object.keys(t).reduce((a, n) => (a.set(n, t[n]), a), o);
|
|
66
70
|
function l(a, n) {
|
|
67
|
-
const
|
|
68
|
-
return typeof n == "number" ? [{ target:
|
|
69
|
-
if (
|
|
70
|
-
return { target:
|
|
71
|
-
const r =
|
|
72
|
-
return { target:
|
|
71
|
+
const c = a;
|
|
72
|
+
return typeof n == "number" ? [{ target: c, operator: "length", param: null, value: Number(n) }] : typeof n == "boolean" ? [{ target: c, operator: "getProperty", param: a, value: !!n }] : typeof n == "object" ? Object.keys(n).map((u) => {
|
|
73
|
+
if (u === "length")
|
|
74
|
+
return { target: c, operator: "length", param: null, value: n[u] };
|
|
75
|
+
const r = u, f = n[u];
|
|
76
|
+
return { target: c, operator: "getProperty", param: r, value: f };
|
|
73
77
|
}) : [];
|
|
74
78
|
}
|
|
75
79
|
function d(a) {
|
|
76
|
-
return Object.keys(a).reduce((
|
|
77
|
-
const r = l(
|
|
78
|
-
return
|
|
80
|
+
return Object.keys(a).reduce((c, u) => {
|
|
81
|
+
const r = l(u, a[u]);
|
|
82
|
+
return c.push(...r), c;
|
|
79
83
|
}, []);
|
|
80
84
|
}
|
|
81
85
|
function p(a, n) {
|
|
82
86
|
if (o.has(a.operator)) {
|
|
83
|
-
const
|
|
84
|
-
return
|
|
87
|
+
const c = o.get(a.operator);
|
|
88
|
+
return c && c(a.target, a.param, a.value, n) || !1;
|
|
85
89
|
}
|
|
86
90
|
return !1;
|
|
87
91
|
}
|
|
@@ -89,15 +93,15 @@ function x(t = {}) {
|
|
|
89
93
|
return d(a).reduce((r, f) => r && p(f, n), !0);
|
|
90
94
|
}
|
|
91
95
|
function g(a, n) {
|
|
92
|
-
const
|
|
93
|
-
return
|
|
96
|
+
const c = Object.keys(a), u = c.includes("allOf"), r = c.includes("anyOf"), f = u || r, F = (f ? a[f ? u ? "allOf" : "anyOf" : "allOf"] : [a]).map((R) => s(R, n));
|
|
97
|
+
return u ? !F.includes(!1) : F.includes(!0);
|
|
94
98
|
}
|
|
95
99
|
return { parseValueSchema: g };
|
|
96
100
|
}
|
|
97
101
|
const K = {}, I = {};
|
|
98
102
|
x();
|
|
99
|
-
function ee(t, e, i = /* @__PURE__ */ new Map(), o = (p, s, g) => s, l = {}, d = (p) => p) {
|
|
100
|
-
return
|
|
103
|
+
function ee(t, e, i = /* @__PURE__ */ new Map(), o = (p, s, g, a) => s, l = {}, d = (p) => p) {
|
|
104
|
+
return $[e.title] = e, H[e.title] = o, K[e.title] = l, I[e.title] = d, (p = {}) => {
|
|
101
105
|
const s = Z(p, e, i), g = Object.keys(t).reduce((a, n) => (a[n] = t[n].default, a), {});
|
|
102
106
|
return Object.assign(g, s);
|
|
103
107
|
};
|
|
@@ -107,7 +111,7 @@ function te(t, e) {
|
|
|
107
111
|
}
|
|
108
112
|
const ne = /* @__PURE__ */ new Map([
|
|
109
113
|
["appearance", te]
|
|
110
|
-
]), oe = "https://json-schema.org/draft/2020-12/schema", ae = "https://farris-design.gitee.io/search-box.schema.json", re = "search-box", le = "A Farris Component",
|
|
114
|
+
]), oe = "https://json-schema.org/draft/2020-12/schema", ae = "https://farris-design.gitee.io/search-box.schema.json", re = "search-box", le = "A Farris Component", ce = "object", ie = {
|
|
111
115
|
id: {
|
|
112
116
|
description: "The unique identifier for a search-box",
|
|
113
117
|
type: "string"
|
|
@@ -169,7 +173,7 @@ const ne = /* @__PURE__ */ new Map([
|
|
|
169
173
|
type: "boolean",
|
|
170
174
|
default: !0
|
|
171
175
|
}
|
|
172
|
-
},
|
|
176
|
+
}, ue = [
|
|
173
177
|
"id",
|
|
174
178
|
"type"
|
|
175
179
|
], se = {
|
|
@@ -177,9 +181,9 @@ const ne = /* @__PURE__ */ new Map([
|
|
|
177
181
|
$id: ae,
|
|
178
182
|
title: re,
|
|
179
183
|
description: le,
|
|
180
|
-
type:
|
|
184
|
+
type: ce,
|
|
181
185
|
properties: ie,
|
|
182
|
-
required:
|
|
186
|
+
required: ue
|
|
183
187
|
};
|
|
184
188
|
function fe(t, e, i) {
|
|
185
189
|
return e;
|
|
@@ -211,7 +215,7 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
211
215
|
description: de,
|
|
212
216
|
type: he,
|
|
213
217
|
categories: me
|
|
214
|
-
},
|
|
218
|
+
}, P = {
|
|
215
219
|
/**
|
|
216
220
|
* 自定义图标
|
|
217
221
|
*/
|
|
@@ -261,7 +265,7 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
261
265
|
* 值变化事件触发时机
|
|
262
266
|
*/
|
|
263
267
|
updateOn: { default: "blur", type: String }
|
|
264
|
-
}, A = ee(
|
|
268
|
+
}, A = ee(P, se, ne, fe, ge), ye = {
|
|
265
269
|
data: { type: Array, default: [] },
|
|
266
270
|
/** 确认结果事件 */
|
|
267
271
|
onConfirmResult: { type: Function, default: () => {
|
|
@@ -285,12 +289,12 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
285
289
|
*/
|
|
286
290
|
maxHeight: { default: 350, type: Number },
|
|
287
291
|
loading: { default: !1, type: Boolean }
|
|
288
|
-
},
|
|
292
|
+
}, L = /* @__PURE__ */ w({
|
|
289
293
|
name: "FSearchBoxContainer",
|
|
290
294
|
props: ye,
|
|
291
295
|
emits: ["confirmResult", "searchedValue"],
|
|
292
296
|
setup(t, e) {
|
|
293
|
-
const i =
|
|
297
|
+
const i = m(t.data), o = m(), {
|
|
294
298
|
slots: l
|
|
295
299
|
} = e, d = j(() => ({
|
|
296
300
|
"search-box-container": !0,
|
|
@@ -298,22 +302,22 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
298
302
|
"position-relative": !0
|
|
299
303
|
}));
|
|
300
304
|
function p(n) {
|
|
301
|
-
var
|
|
302
|
-
(
|
|
305
|
+
var c;
|
|
306
|
+
(c = o.value) == null || c.search(n);
|
|
303
307
|
}
|
|
304
308
|
function s(n) {
|
|
305
309
|
n.length && (e.emit("confirmResult", n[0].name), e.emit("searchedValue", n));
|
|
306
310
|
}
|
|
307
311
|
function g(n) {
|
|
308
|
-
return l.default ?
|
|
312
|
+
return l.default ? v(_, null, [l.default(n)]) : v("span", null, [n.item[t.textField]]);
|
|
309
313
|
}
|
|
310
314
|
const a = j(() => {
|
|
311
315
|
const n = {};
|
|
312
316
|
return n.padding = "8px", t.maxHeight !== void 0 && t.maxHeight > 0 && (n.maxHeight = `${t.maxHeight}px`), n;
|
|
313
317
|
});
|
|
314
|
-
return
|
|
318
|
+
return S(() => t.loading, (n) => {
|
|
315
319
|
console.log("loading状态改变" + n);
|
|
316
|
-
}),
|
|
320
|
+
}), S(() => t.data, (n) => {
|
|
317
321
|
n !== i.value && (i.value = n), o.value.updateDataSource(n);
|
|
318
322
|
}), e.expose({
|
|
319
323
|
search: p
|
|
@@ -321,18 +325,18 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
321
325
|
const n = {
|
|
322
326
|
content: g
|
|
323
327
|
};
|
|
324
|
-
return
|
|
328
|
+
return v("div", {
|
|
325
329
|
class: d.value,
|
|
326
330
|
style: a.value
|
|
327
|
-
}, [
|
|
331
|
+
}, [v(J, {
|
|
328
332
|
ref: "loadingInstance",
|
|
329
333
|
isActive: t.loading
|
|
330
|
-
}, null),
|
|
334
|
+
}, null), v(G, {
|
|
331
335
|
ref: o,
|
|
332
336
|
itemClass: "dropdown-item",
|
|
333
337
|
data: i.value,
|
|
334
338
|
view: "ContentView",
|
|
335
|
-
onClickItem: (
|
|
339
|
+
onClickItem: (c) => s(c.data),
|
|
336
340
|
idField: t.idField,
|
|
337
341
|
textField: t.textField,
|
|
338
342
|
titleField: t.textField,
|
|
@@ -340,19 +344,19 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
340
344
|
}, n)]);
|
|
341
345
|
};
|
|
342
346
|
}
|
|
343
|
-
}),
|
|
347
|
+
}), B = /* @__PURE__ */ w({
|
|
344
348
|
name: "FSearchBox",
|
|
345
|
-
props:
|
|
349
|
+
props: P,
|
|
346
350
|
emits: ["update:modelValue", "change", "selectedValue", "clickButton"],
|
|
347
351
|
setup(t, e) {
|
|
348
|
-
|
|
349
|
-
const i =
|
|
350
|
-
|
|
351
|
-
const s =
|
|
352
|
-
|
|
352
|
+
m(t.data);
|
|
353
|
+
const i = m(), o = m(), l = m(t.placeholder), d = '<i class="f-icon f-icon-clockwise f-icon-spin"></i>', p = j(() => t.loading ? d : t.buttonContent);
|
|
354
|
+
m(t.editable);
|
|
355
|
+
const s = m(t.modelValue);
|
|
356
|
+
S(s, (r) => {
|
|
353
357
|
var f;
|
|
354
358
|
(f = o.value) == null || f.search(r), e.emit("update:modelValue", r);
|
|
355
|
-
}),
|
|
359
|
+
}), S(() => t.modelValue, (r) => {
|
|
356
360
|
s.value = r;
|
|
357
361
|
});
|
|
358
362
|
function g(r) {
|
|
@@ -364,26 +368,26 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
364
368
|
function n(r) {
|
|
365
369
|
e.emit("selectedValue", r);
|
|
366
370
|
}
|
|
367
|
-
function
|
|
371
|
+
function c(r) {
|
|
368
372
|
e.emit("clickButton", r);
|
|
369
373
|
}
|
|
370
|
-
function
|
|
374
|
+
function u() {
|
|
371
375
|
i.value.togglePopup();
|
|
372
376
|
}
|
|
373
377
|
return e.expose({
|
|
374
|
-
togglePopup:
|
|
378
|
+
togglePopup: u
|
|
375
379
|
}), () => {
|
|
376
380
|
const r = {
|
|
377
381
|
default: e.slots.default
|
|
378
382
|
};
|
|
379
|
-
return
|
|
383
|
+
return v(C, {
|
|
380
384
|
ref: i,
|
|
381
385
|
"button-content": p.value,
|
|
382
386
|
"custom-class": t.customClass,
|
|
383
387
|
updateOn: t.updateOn,
|
|
384
388
|
placeholder: l.value,
|
|
385
389
|
onChange: (f) => a(f),
|
|
386
|
-
onClickButton: (f) =>
|
|
390
|
+
onClickButton: (f) => c(f),
|
|
387
391
|
disable: t.disable,
|
|
388
392
|
"enable-clear": !0,
|
|
389
393
|
"button-behavior": "Execute",
|
|
@@ -395,7 +399,7 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
395
399
|
"popup-on-input": t.showDropdown,
|
|
396
400
|
"popup-on-focus": t.showDropdown
|
|
397
401
|
}, {
|
|
398
|
-
default: () => [t.showDropdown &&
|
|
402
|
+
default: () => [t.showDropdown && v(L, {
|
|
399
403
|
ref: o,
|
|
400
404
|
data: t.data,
|
|
401
405
|
onConfirmResult: g,
|
|
@@ -410,105 +414,112 @@ const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
|
410
414
|
});
|
|
411
415
|
function be(t, e, i) {
|
|
412
416
|
var k;
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
const l = "", d = "", p = h();
|
|
416
|
-
function s() {
|
|
417
|
+
const o = "", l = "", d = m();
|
|
418
|
+
function p() {
|
|
417
419
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
418
420
|
}
|
|
419
|
-
function
|
|
421
|
+
function s() {
|
|
420
422
|
return !1;
|
|
421
423
|
}
|
|
422
|
-
function
|
|
424
|
+
function g() {
|
|
423
425
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
424
426
|
}
|
|
425
|
-
function
|
|
427
|
+
function a() {
|
|
426
428
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
427
429
|
}
|
|
428
|
-
function
|
|
429
|
-
if (!
|
|
430
|
+
function n(h) {
|
|
431
|
+
if (!h || !h.value)
|
|
430
432
|
return null;
|
|
431
|
-
if (
|
|
432
|
-
return
|
|
433
|
-
const b = h
|
|
434
|
-
return
|
|
433
|
+
if (h.value.schema && h.value.schema.type === "component")
|
|
434
|
+
return h.value;
|
|
435
|
+
const b = m(h == null ? void 0 : h.value.parent), y = n(b);
|
|
436
|
+
return y || null;
|
|
435
437
|
}
|
|
436
|
-
function c(
|
|
437
|
-
const { componentInstance: b, designerItemElementRef:
|
|
438
|
-
return !b || !b.value ? null : b.value.canMove ?
|
|
438
|
+
function c(h = e) {
|
|
439
|
+
const { componentInstance: b, designerItemElementRef: y } = h;
|
|
440
|
+
return !b || !b.value ? null : b.value.canMove ? y : c(h.parent);
|
|
439
441
|
}
|
|
440
|
-
function
|
|
442
|
+
function u(h) {
|
|
441
443
|
return !!i;
|
|
442
444
|
}
|
|
443
|
-
function
|
|
445
|
+
function r() {
|
|
444
446
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
445
447
|
}
|
|
446
|
-
function
|
|
448
|
+
function f() {
|
|
447
449
|
}
|
|
448
|
-
function
|
|
450
|
+
function O(h, b) {
|
|
449
451
|
}
|
|
450
|
-
function
|
|
451
|
-
const { componentType:
|
|
452
|
-
let
|
|
453
|
-
const
|
|
454
|
-
return
|
|
452
|
+
function D(h, b) {
|
|
453
|
+
const { componentType: y } = h;
|
|
454
|
+
let V = T(y, h, b);
|
|
455
|
+
const q = y.toLowerCase().replace(/-/g, "_");
|
|
456
|
+
return V && !V.id && V.type === y && (V.id = `${q}_${Math.random().toString().slice(2, 6)}`), V;
|
|
455
457
|
}
|
|
456
|
-
function
|
|
458
|
+
function F(h) {
|
|
457
459
|
}
|
|
458
|
-
function
|
|
460
|
+
function E(...h) {
|
|
461
|
+
}
|
|
462
|
+
function R() {
|
|
463
|
+
e != null && e.schema.contents && e.schema.contents.map((h) => {
|
|
464
|
+
var V;
|
|
465
|
+
let b = h.id;
|
|
466
|
+
h.type === "component-ref" && (b = h.component);
|
|
467
|
+
const y = t.value.querySelector(`#${b}-design-item`);
|
|
468
|
+
(V = y == null ? void 0 : y.componentInstance) != null && V.value.onRemoveComponent && y.componentInstance.value.onRemoveComponent();
|
|
469
|
+
});
|
|
459
470
|
}
|
|
460
|
-
return
|
|
461
|
-
canMove:
|
|
462
|
-
canSelectParent:
|
|
463
|
-
canDelete:
|
|
464
|
-
canNested: !
|
|
471
|
+
return d.value = {
|
|
472
|
+
canMove: p(),
|
|
473
|
+
canSelectParent: s(),
|
|
474
|
+
canDelete: g(),
|
|
475
|
+
canNested: !a(),
|
|
465
476
|
contents: e == null ? void 0 : e.schema.contents,
|
|
466
477
|
elementRef: t,
|
|
467
478
|
parent: (k = e == null ? void 0 : e.parent) == null ? void 0 : k.componentInstance,
|
|
468
479
|
schema: e == null ? void 0 : e.schema,
|
|
469
|
-
styles:
|
|
470
|
-
designerClass:
|
|
471
|
-
canAccepts:
|
|
472
|
-
getBelongedComponentInstance:
|
|
480
|
+
styles: o,
|
|
481
|
+
designerClass: l,
|
|
482
|
+
canAccepts: u,
|
|
483
|
+
getBelongedComponentInstance: n,
|
|
473
484
|
getDraggableDesignItemElement: c,
|
|
474
|
-
getDraggingDisplayText:
|
|
475
|
-
getPropConfig:
|
|
476
|
-
getDragScopeElement:
|
|
477
|
-
onAcceptMovedChildElement:
|
|
478
|
-
onChildElementMovedOut:
|
|
479
|
-
addNewChildComponentSchema:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
},
|
|
485
|
+
getDraggingDisplayText: r,
|
|
486
|
+
getPropConfig: E,
|
|
487
|
+
getDragScopeElement: f,
|
|
488
|
+
onAcceptMovedChildElement: O,
|
|
489
|
+
onChildElementMovedOut: F,
|
|
490
|
+
addNewChildComponentSchema: D,
|
|
491
|
+
triggerBelongedComponentToMoveWhenMoved: m(!1),
|
|
492
|
+
triggerBelongedComponentToDeleteWhenDeleted: m(!1),
|
|
493
|
+
onRemoveComponent: R
|
|
494
|
+
}, d;
|
|
484
495
|
}
|
|
485
496
|
const ve = /* @__PURE__ */ w({
|
|
486
497
|
name: "FSearchBoxDesign",
|
|
487
|
-
props:
|
|
498
|
+
props: P,
|
|
488
499
|
emits: ["update:modelValue", "change"],
|
|
489
500
|
setup(t, e) {
|
|
490
|
-
const i =
|
|
501
|
+
const i = m(t.data), o = m(), l = m(), d = m("请输入关键词"), p = m('<i class="f-icon f-icon-search"></i>'), s = m(t.modelValue), g = m(), a = X("design-item-context"), n = be(g, a);
|
|
491
502
|
U(() => {
|
|
492
503
|
g.value.componentInstance = n;
|
|
493
|
-
}), e.expose(n.value),
|
|
504
|
+
}), e.expose(n.value), S(s, (r) => {
|
|
494
505
|
var f;
|
|
495
506
|
(f = l.value) == null || f.search(r), e.emit("update:modelValue", r);
|
|
496
|
-
}),
|
|
507
|
+
}), S(() => t.modelValue, (r) => {
|
|
497
508
|
s.value = r;
|
|
498
509
|
});
|
|
499
|
-
function
|
|
510
|
+
function c(r) {
|
|
500
511
|
o.value.commitValue(r);
|
|
501
512
|
}
|
|
502
|
-
function
|
|
513
|
+
function u(r) {
|
|
503
514
|
e.emit("change", r);
|
|
504
515
|
}
|
|
505
|
-
return () =>
|
|
516
|
+
return () => v("div", {
|
|
506
517
|
ref: g
|
|
507
|
-
}, [
|
|
518
|
+
}, [v(W("f-button-edit"), {
|
|
508
519
|
ref: o,
|
|
509
520
|
"button-content": p.value,
|
|
510
521
|
placeholder: d.value,
|
|
511
|
-
onChange:
|
|
522
|
+
onChange: u,
|
|
512
523
|
"enable-clear": !0,
|
|
513
524
|
"button-behavior": "Execute",
|
|
514
525
|
modelValue: s.value,
|
|
@@ -519,26 +530,26 @@ const ve = /* @__PURE__ */ w({
|
|
|
519
530
|
"popup-on-input": !0,
|
|
520
531
|
"popup-on-focus": !0
|
|
521
532
|
}, {
|
|
522
|
-
default: () => [
|
|
533
|
+
default: () => [v(L, {
|
|
523
534
|
ref: l,
|
|
524
535
|
data: i.value,
|
|
525
|
-
onConfirmResult:
|
|
536
|
+
onConfirmResult: c
|
|
526
537
|
}, null)]
|
|
527
538
|
})]);
|
|
528
539
|
}
|
|
529
540
|
});
|
|
530
|
-
|
|
531
|
-
t.component(
|
|
541
|
+
B.install = (t) => {
|
|
542
|
+
t.component(B.name, B);
|
|
532
543
|
};
|
|
533
|
-
|
|
534
|
-
t["search-box"] =
|
|
544
|
+
B.register = (t, e, i, o) => {
|
|
545
|
+
t["search-box"] = B, e["search-box"] = A;
|
|
535
546
|
};
|
|
536
|
-
|
|
547
|
+
B.registerDesigner = (t, e, i) => {
|
|
537
548
|
t["search-box"] = ve, e["search-box"] = A;
|
|
538
549
|
};
|
|
539
550
|
export {
|
|
540
|
-
|
|
541
|
-
|
|
551
|
+
B as FSearchBox,
|
|
552
|
+
B as default,
|
|
542
553
|
A as propsResolver,
|
|
543
|
-
|
|
554
|
+
P as searchBoxProps
|
|
544
555
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(g,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("../button-edit/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../loading/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","lodash-es","../list-view/index.umd.js","../loading/index.umd.js"],r):(g=typeof globalThis<"u"?globalThis:g||self,r(g["search-box"]={},g.Vue,g.FButtonEdit,g.LodashES,g.FListView,g.FLoading))})(this,function(g,r,C,O,A,H){"use strict";const P={},M={};function w(t){const{properties:e,title:s,ignore:o}=t,c=o&&Array.isArray(o),h=Object.keys(e).reduce((p,f)=>((!c||!o.find(y=>y==f))&&(p[f]=e[f].type==="object"&&e[f].properties?w(e[f]):O.cloneDeep(e[f].default)),p),{});return s&&(!c||!o.find(p=>p=="id"))&&(h.id=`${s}-${Date.now()}`),h}function E(t,e={},s){const o=P[t];if(o){let c=w(o);const h=M[t];return c=h?h({getSchemaByType:E},c,e,s):c,c}return null}function q(t,e){const s=w(e);return Object.keys(t).reduce((o,c)=>(o[c]&&O.isPlainObject(o[c])&&O.isPlainObject(t[c])?Object.assign(o[c],t[c]):o[c]=t[c],o),s),s}function L(t,e){return Object.keys(t).filter(o=>t[o]!=null).reduce((o,c)=>{if(e.has(c)){const h=e.get(c);if(typeof h=="string")o[h]=t[c];else{const p=h(c,t[c],t);Object.assign(o,p)}}else o[c]=t[c];return o},{})}function x(t,e,s=new Map){const o=q(t,e);return L(o,s)}function _(t={}){function e(a,n,l,u){if(typeof l=="number")return u[a].length===l;if(typeof l=="object"){const i=Object.keys(l)[0],d=l[i];if(i==="not")return Number(u[a].length)!==Number(d);if(i==="moreThan")return Number(u[a].length)>=Number(d);if(i==="lessThan")return Number(u[a].length)<=Number(d)}return!1}function s(a,n,l,u){return u[a]&&u[a].propertyValue&&String(u[a].propertyValue.value)===String(l)}const o=new Map([["length",e],["getProperty",s]]);Object.keys(t).reduce((a,n)=>(a.set(n,t[n]),a),o);function c(a,n){const l=a;return typeof n=="number"?[{target:l,operator:"length",param:null,value:Number(n)}]:typeof n=="boolean"?[{target:l,operator:"getProperty",param:a,value:!!n}]:typeof n=="object"?Object.keys(n).map(u=>{if(u==="length")return{target:l,operator:"length",param:null,value:n[u]};const i=u,d=n[u];return{target:l,operator:"getProperty",param:i,value:d}}):[]}function h(a){return Object.keys(a).reduce((l,u)=>{const i=c(u,a[u]);return l.push(...i),l},[])}function p(a,n){if(o.has(a.operator)){const l=o.get(a.operator);return l&&l(a.target,a.param,a.value,n)||!1}return!1}function f(a,n){return h(a).reduce((i,d)=>i&&p(d,n),!0)}function y(a,n){const l=Object.keys(a),u=l.includes("allOf"),i=l.includes("anyOf"),d=u||i,F=(d?a[d?u?"allOf":"anyOf":"allOf"]:[a]).map(N=>f(N,n));return u?!F.includes(!1):F.includes(!0)}return{parseValueSchema:y}}const X={},U={};_();function W(t,e,s=new Map,o=(p,f,y)=>f,c={},h=p=>p){return P[e.title]=e,M[e.title]=o,X[e.title]=c,U[e.title]=h,(p={})=>{const f=x(p,e,s),y=Object.keys(t).reduce((a,n)=>(a[n]=t[n].default,a),{});return Object.assign(y,f)}}function z(t,e){return{customClass:e.class,customStyle:e.style}}const G=new Map([["appearance",z]]),J={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/search-box.schema.json",title:"search-box",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a search-box",type:"string"},type:{description:"The type string of search-box component",type:"string",default:"search-box"},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"]};function Q(t,e,s){return e}const Y={title:"search-box",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:[]}}}}}},j={buttonContent:{type:String,default:'<i class="f-icon f-icon-search"></i>'},customClass:{type:String,default:""},modelValue:{type:String,default:""},popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},data:{type:Array,default:[]},placeholder:{type:String,default:"请输入关键词"},idField:{default:"id",type:String},textField:{default:"name",type:String},maxHeight:{default:350,type:Number},loading:{default:!1,type:Boolean},disable:{default:!1,type:Boolean},showDropdown:{default:!0,type:Boolean},updateOn:{default:"blur",type:String}},R=W(j,J,G,Q,Y),Z={data:{type:Array,default:[]},onConfirmResult:{type:Function,default:()=>{}},onSearchedValue:{type:Function,default:()=>{}},idField:{default:"id",type:String},textField:{default:"name",type:String},maxHeight:{default:350,type:Number},loading:{default:!1,type:Boolean}},$=r.defineComponent({name:"FSearchBoxContainer",props:Z,emits:["confirmResult","searchedValue"],setup(t,e){const s=r.ref(t.data),o=r.ref(),{slots:c}=e,h=r.computed(()=>({"search-box-container":!0,"f-utils-overflow-xhya":!0,"position-relative":!0}));function p(n){var l;(l=o.value)==null||l.search(n)}function f(n){n.length&&(e.emit("confirmResult",n[0].name),e.emit("searchedValue",n))}function y(n){return c.default?r.createVNode(r.Fragment,null,[c.default(n)]):r.createVNode("span",null,[n.item[t.textField]])}const a=r.computed(()=>{const n={};return n.padding="8px",t.maxHeight!==void 0&&t.maxHeight>0&&(n.maxHeight=`${t.maxHeight}px`),n});return r.watch(()=>t.loading,n=>{console.log("loading状态改变"+n)}),r.watch(()=>t.data,n=>{n!==s.value&&(s.value=n),o.value.updateDataSource(n)}),e.expose({search:p}),()=>{const n={content:y};return r.createVNode("div",{class:h.value,style:a.value},[r.createVNode(H,{ref:"loadingInstance",isActive:t.loading},null),r.createVNode(A,{ref:o,itemClass:"dropdown-item",data:s.value,view:"ContentView",onClickItem:l=>f(l.data),idField:t.idField,textField:t.textField,titleField:t.textField,valueField:t.idField},n)])}}}),V=r.defineComponent({name:"FSearchBox",props:j,emits:["update:modelValue","change","selectedValue","clickButton"],setup(t,e){r.ref(t.data);const s=r.ref(),o=r.ref(),c=r.ref(t.placeholder),h='<i class="f-icon f-icon-clockwise f-icon-spin"></i>',p=r.computed(()=>t.loading?h:t.buttonContent);r.ref(t.editable);const f=r.ref(t.modelValue);r.watch(f,i=>{var d;(d=o.value)==null||d.search(i),e.emit("update:modelValue",i)}),r.watch(()=>t.modelValue,i=>{f.value=i});function y(i){s.value.commitValue(i)}function a(i){e.emit("change",i)}function n(i){e.emit("selectedValue",i)}function l(i){e.emit("clickButton",i)}function u(){s.value.togglePopup()}return e.expose({togglePopup:u}),()=>{const i={default:e.slots.default};return r.createVNode(C,{ref:s,"button-content":p.value,"custom-class":t.customClass,updateOn:t.updateOn,placeholder:c.value,onChange:d=>a(d),onClickButton:d=>l(d),disable:t.disable,"enable-clear":!0,"button-behavior":"Execute",modelValue:f.value,"onUpdate:modelValue":d=>f.value=d,"popup-host":t.popupHost,"popup-right-boundary":t.popupRightBoundary,"popup-offset-x":t.popupOffsetX,"popup-on-input":t.showDropdown,"popup-on-focus":t.showDropdown},{default:()=>[t.showDropdown&&r.createVNode($,{ref:o,data:t.data,onConfirmResult:y,onSearchedValue:d=>n(d),loading:t.loading,maxHeight:t.maxHeight},i)],...e.slots})}}});function K(t,e,s){var v;function o(){}const c="",h="",p=r.ref();function f(){return(e==null?void 0:e.schema.componentType)!=="frame"}function y(){return!1}function a(){return(e==null?void 0:e.schema.componentType)!=="frame"}function n(){return(e==null?void 0:e.schema.componentType)==="frame"}function l(m){if(!m||!m.value)return null;if(m.value.schema&&m.value.schema.type==="component")return m.value;const b=r.ref(m==null?void 0:m.value.parent),B=l(b);return B||null}function u(m=e){const{componentInstance:b,designerItemElementRef:B}=m;return!b||!b.value?null:b.value.canMove?B:u(m.parent)}function i(m){return!!s}function d(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function D(){}function T(m,b){}function F(m,b){const{componentType:B}=m;let S=E(B,m,b);const ee=B.toLowerCase().replace("-","_");return S&&!S.id&&S.type===B&&(S.id=`${ee}_${Math.random().toString().slice(2,6)}`),S}function k(m){}function N(...m){}return p.value={canMove:f(),canSelectParent:y(),canDelete:a(),canNested:!n(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(v=e==null?void 0:e.parent)==null?void 0:v.componentInstance,schema:e==null?void 0:e.schema,styles:c,designerClass:h,canAccepts:i,getBelongedComponentInstance:l,getDraggableDesignItemElement:u,getDraggingDisplayText:d,getPropConfig:N,getDragScopeElement:D,onAcceptMovedChildElement:T,onChildElementMovedOut:k,addNewChildComponentSchema:F,updateDragAndDropRules:o,triggerBelongedComponentToMoveWhenMoved:r.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:r.ref(!1)},p}const I=r.defineComponent({name:"FSearchBoxDesign",props:j,emits:["update:modelValue","change"],setup(t,e){const s=r.ref(t.data),o=r.ref(),c=r.ref(),h=r.ref("请输入关键词"),p=r.ref('<i class="f-icon f-icon-search"></i>'),f=r.ref(t.modelValue),y=r.ref(),a=r.inject("design-item-context"),n=K(y,a);r.onMounted(()=>{y.value.componentInstance=n}),e.expose(n.value),r.watch(f,i=>{var d;(d=c.value)==null||d.search(i),e.emit("update:modelValue",i)}),r.watch(()=>t.modelValue,i=>{f.value=i});function l(i){o.value.commitValue(i)}function u(i){e.emit("change",i)}return()=>r.createVNode("div",{ref:y},[r.createVNode(r.resolveComponent("f-button-edit"),{ref:o,"button-content":p.value,placeholder:h.value,onChange:u,"enable-clear":!0,"button-behavior":"Execute",modelValue:f.value,"onUpdate:modelValue":i=>f.value=i,"popup-host":t.popupHost,"popup-right-boundary":t.popupRightBoundary,"popup-offset-x":t.popupOffsetX,"popup-on-input":!0,"popup-on-focus":!0},{default:()=>[r.createVNode($,{ref:c,data:s.value,onConfirmResult:l},null)]})])}});V.install=t=>{t.component(V.name,V)},V.register=(t,e,s,o)=>{t["search-box"]=V,e["search-box"]=R},V.registerDesigner=(t,e,s)=>{t["search-box"]=I,e["search-box"]=R},g.FSearchBox=V,g.default=V,g.propsResolver=R,g.searchBoxProps=j,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(g,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue"),require("../button-edit/index.umd.js"),require("lodash-es"),require("../list-view/index.umd.js"),require("../loading/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","../button-edit/index.umd.js","lodash-es","../list-view/index.umd.js","../loading/index.umd.js"],o):(g=typeof globalThis<"u"?globalThis:g||self,o(g["search-box"]={},g.Vue,g.FButtonEdit,g.LodashES,g.FListView,g.FLoading))})(this,function(g,o,H,O,q,A){"use strict";const N={},v={};function w(t){const{properties:e,title:s,ignore:a}=t,c=a&&Array.isArray(a),h=Object.keys(e).reduce((d,f)=>((!c||!a.find(y=>y===f))&&(d[f]=e[f].type==="object"&&e[f].properties?w(e[f]):O.cloneDeep(e[f].default)),d),{});if(s&&(!c||!a.find(d=>d==="id"))){const d=s.toLowerCase().replace(/-/g,"_");h.id=`${d}_${Math.random().toString().slice(2,6)}`}return h}function D(t,e={},s){const a=N[t];if(a){let c=w(a);const h=v[t];return c=h?h({getSchemaByType:D},c,e,s):c,c}return null}function L(t,e){const s=w(e);return Object.keys(s).reduce((a,c)=>(a[c]&&O.isPlainObject(a[c])&&O.isPlainObject(t[c]||!t[c])?Object.assign(a[c],t[c]||{}):a[c]=t[c],a),s),s}function _(t,e){return Object.keys(t).filter(a=>t[a]!=null).reduce((a,c)=>{if(e.has(c)){const h=e.get(c);if(typeof h=="string")a[h]=t[c];else{const d=h(c,t[c],t);Object.assign(a,d)}}else a[c]=t[c];return a},{})}function C(t,e,s=new Map){const a=L(t,e);return _(a,s)}function X(t={}){function e(r,n,l,u){if(typeof l=="number")return u[r].length===l;if(typeof l=="object"){const i=Object.keys(l)[0],p=l[i];if(i==="not")return Number(u[r].length)!==Number(p);if(i==="moreThan")return Number(u[r].length)>=Number(p);if(i==="lessThan")return Number(u[r].length)<=Number(p)}return!1}function s(r,n,l,u){return u[r]&&u[r].propertyValue&&String(u[r].propertyValue.value)===String(l)}const a=new Map([["length",e],["getProperty",s]]);Object.keys(t).reduce((r,n)=>(r.set(n,t[n]),r),a);function c(r,n){const l=r;return typeof n=="number"?[{target:l,operator:"length",param:null,value:Number(n)}]:typeof n=="boolean"?[{target:l,operator:"getProperty",param:r,value:!!n}]:typeof n=="object"?Object.keys(n).map(u=>{if(u==="length")return{target:l,operator:"length",param:null,value:n[u]};const i=u,p=n[u];return{target:l,operator:"getProperty",param:i,value:p}}):[]}function h(r){return Object.keys(r).reduce((l,u)=>{const i=c(u,r[u]);return l.push(...i),l},[])}function d(r,n){if(a.has(r.operator)){const l=a.get(r.operator);return l&&l(r.target,r.param,r.value,n)||!1}return!1}function f(r,n){return h(r).reduce((i,p)=>i&&d(p,n),!0)}function y(r,n){const l=Object.keys(r),u=l.includes("allOf"),i=l.includes("anyOf"),p=u||i,F=(p?r[p?u?"allOf":"anyOf":"allOf"]:[r]).map(M=>f(M,n));return u?!F.includes(!1):F.includes(!0)}return{parseValueSchema:y}}const U={},W={};X();function x(t,e,s=new Map,a=(d,f,y,r)=>f,c={},h=d=>d){return N[e.title]=e,v[e.title]=a,U[e.title]=c,W[e.title]=h,(d={})=>{const f=C(d,e,s),y=Object.keys(t).reduce((r,n)=>(r[n]=t[n].default,r),{});return Object.assign(y,f)}}function z(t,e){return{customClass:e.class,customStyle:e.style}}const G=new Map([["appearance",z]]),J={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/search-box.schema.json",title:"search-box",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for a search-box",type:"string"},type:{description:"The type string of search-box component",type:"string",default:"search-box"},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"]};function Q(t,e,s){return e}const Y={title:"search-box",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:[]}}}}}},j={buttonContent:{type:String,default:'<i class="f-icon f-icon-search"></i>'},customClass:{type:String,default:""},modelValue:{type:String,default:""},popupHost:{type:Object},popupRightBoundary:{type:Object},popupOffsetX:{type:Object},data:{type:Array,default:[]},placeholder:{type:String,default:"请输入关键词"},idField:{default:"id",type:String},textField:{default:"name",type:String},maxHeight:{default:350,type:Number},loading:{default:!1,type:Boolean},disable:{default:!1,type:Boolean},showDropdown:{default:!0,type:Boolean},updateOn:{default:"blur",type:String}},R=x(j,J,G,Q,Y),Z={data:{type:Array,default:[]},onConfirmResult:{type:Function,default:()=>{}},onSearchedValue:{type:Function,default:()=>{}},idField:{default:"id",type:String},textField:{default:"name",type:String},maxHeight:{default:350,type:Number},loading:{default:!1,type:Boolean}},E=o.defineComponent({name:"FSearchBoxContainer",props:Z,emits:["confirmResult","searchedValue"],setup(t,e){const s=o.ref(t.data),a=o.ref(),{slots:c}=e,h=o.computed(()=>({"search-box-container":!0,"f-utils-overflow-xhya":!0,"position-relative":!0}));function d(n){var l;(l=a.value)==null||l.search(n)}function f(n){n.length&&(e.emit("confirmResult",n[0].name),e.emit("searchedValue",n))}function y(n){return c.default?o.createVNode(o.Fragment,null,[c.default(n)]):o.createVNode("span",null,[n.item[t.textField]])}const r=o.computed(()=>{const n={};return n.padding="8px",t.maxHeight!==void 0&&t.maxHeight>0&&(n.maxHeight=`${t.maxHeight}px`),n});return o.watch(()=>t.loading,n=>{console.log("loading状态改变"+n)}),o.watch(()=>t.data,n=>{n!==s.value&&(s.value=n),a.value.updateDataSource(n)}),e.expose({search:d}),()=>{const n={content:y};return o.createVNode("div",{class:h.value,style:r.value},[o.createVNode(A,{ref:"loadingInstance",isActive:t.loading},null),o.createVNode(q,{ref:a,itemClass:"dropdown-item",data:s.value,view:"ContentView",onClickItem:l=>f(l.data),idField:t.idField,textField:t.textField,titleField:t.textField,valueField:t.idField},n)])}}}),S=o.defineComponent({name:"FSearchBox",props:j,emits:["update:modelValue","change","selectedValue","clickButton"],setup(t,e){o.ref(t.data);const s=o.ref(),a=o.ref(),c=o.ref(t.placeholder),h='<i class="f-icon f-icon-clockwise f-icon-spin"></i>',d=o.computed(()=>t.loading?h:t.buttonContent);o.ref(t.editable);const f=o.ref(t.modelValue);o.watch(f,i=>{var p;(p=a.value)==null||p.search(i),e.emit("update:modelValue",i)}),o.watch(()=>t.modelValue,i=>{f.value=i});function y(i){s.value.commitValue(i)}function r(i){e.emit("change",i)}function n(i){e.emit("selectedValue",i)}function l(i){e.emit("clickButton",i)}function u(){s.value.togglePopup()}return e.expose({togglePopup:u}),()=>{const i={default:e.slots.default};return o.createVNode(H,{ref:s,"button-content":d.value,"custom-class":t.customClass,updateOn:t.updateOn,placeholder:c.value,onChange:p=>r(p),onClickButton:p=>l(p),disable:t.disable,"enable-clear":!0,"button-behavior":"Execute",modelValue:f.value,"onUpdate:modelValue":p=>f.value=p,"popup-host":t.popupHost,"popup-right-boundary":t.popupRightBoundary,"popup-offset-x":t.popupOffsetX,"popup-on-input":t.showDropdown,"popup-on-focus":t.showDropdown},{default:()=>[t.showDropdown&&o.createVNode(E,{ref:a,data:t.data,onConfirmResult:y,onSearchedValue:p=>n(p),loading:t.loading,maxHeight:t.maxHeight},i)],...e.slots})}}});function K(t,e,s){var k;const a="",c="",h=o.ref();function d(){return(e==null?void 0:e.schema.componentType)!=="frame"}function f(){return!1}function y(){return(e==null?void 0:e.schema.componentType)!=="frame"}function r(){return(e==null?void 0:e.schema.componentType)==="frame"}function n(m){if(!m||!m.value)return null;if(m.value.schema&&m.value.schema.type==="component")return m.value;const V=o.ref(m==null?void 0:m.value.parent),b=n(V);return b||null}function l(m=e){const{componentInstance:V,designerItemElementRef:b}=m;return!V||!V.value?null:V.value.canMove?b:l(m.parent)}function u(m){return!!s}function i(){return(e==null?void 0:e.schema.label)||(e==null?void 0:e.schema.title)||(e==null?void 0:e.schema.name)}function p(){}function P(m,V){}function $(m,V){const{componentType:b}=m;let B=D(b,m,V);const ee=b.toLowerCase().replace(/-/g,"_");return B&&!B.id&&B.type===b&&(B.id=`${ee}_${Math.random().toString().slice(2,6)}`),B}function F(m){}function T(...m){}function M(){e!=null&&e.schema.contents&&e.schema.contents.map(m=>{var B;let V=m.id;m.type==="component-ref"&&(V=m.component);const b=t.value.querySelector(`#${V}-design-item`);(B=b==null?void 0:b.componentInstance)!=null&&B.value.onRemoveComponent&&b.componentInstance.value.onRemoveComponent()})}return h.value={canMove:d(),canSelectParent:f(),canDelete:y(),canNested:!r(),contents:e==null?void 0:e.schema.contents,elementRef:t,parent:(k=e==null?void 0:e.parent)==null?void 0:k.componentInstance,schema:e==null?void 0:e.schema,styles:a,designerClass:c,canAccepts:u,getBelongedComponentInstance:n,getDraggableDesignItemElement:l,getDraggingDisplayText:i,getPropConfig:T,getDragScopeElement:p,onAcceptMovedChildElement:P,onChildElementMovedOut:F,addNewChildComponentSchema:$,triggerBelongedComponentToMoveWhenMoved:o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:o.ref(!1),onRemoveComponent:M},h}const I=o.defineComponent({name:"FSearchBoxDesign",props:j,emits:["update:modelValue","change"],setup(t,e){const s=o.ref(t.data),a=o.ref(),c=o.ref(),h=o.ref("请输入关键词"),d=o.ref('<i class="f-icon f-icon-search"></i>'),f=o.ref(t.modelValue),y=o.ref(),r=o.inject("design-item-context"),n=K(y,r);o.onMounted(()=>{y.value.componentInstance=n}),e.expose(n.value),o.watch(f,i=>{var p;(p=c.value)==null||p.search(i),e.emit("update:modelValue",i)}),o.watch(()=>t.modelValue,i=>{f.value=i});function l(i){a.value.commitValue(i)}function u(i){e.emit("change",i)}return()=>o.createVNode("div",{ref:y},[o.createVNode(o.resolveComponent("f-button-edit"),{ref:a,"button-content":d.value,placeholder:h.value,onChange:u,"enable-clear":!0,"button-behavior":"Execute",modelValue:f.value,"onUpdate:modelValue":i=>f.value=i,"popup-host":t.popupHost,"popup-right-boundary":t.popupRightBoundary,"popup-offset-x":t.popupOffsetX,"popup-on-input":!0,"popup-on-focus":!0},{default:()=>[o.createVNode(E,{ref:c,data:s.value,onConfirmResult:l},null)]})])}});S.install=t=>{t.component(S.name,S)},S.register=(t,e,s,a)=>{t["search-box"]=S,e["search-box"]=R},S.registerDesigner=(t,e,s)=>{t["search-box"]=I,e["search-box"]=R},g.FSearchBox=S,g.default=S,g.propsResolver=R,g.searchBoxProps=j,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|