@farris/ui-vue 1.2.9 → 1.3.1
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 +64 -64
- package/components/accordion/index.umd.cjs +1 -1
- package/components/avatar/index.esm.js +521 -336
- package/components/avatar/index.umd.cjs +1 -1
- package/components/button-edit/index.css +1 -1
- package/components/button-edit/index.esm.js +99 -97
- package/components/button-edit/index.umd.cjs +1 -1
- package/components/calendar/index.esm.js +496 -504
- package/components/calendar/index.umd.cjs +1 -1
- package/components/capsule/index.esm.js +251 -259
- package/components/capsule/index.umd.cjs +1 -1
- package/components/checkbox/index.esm.js +696 -519
- package/components/checkbox/index.umd.cjs +1 -1
- package/components/color-picker/index.esm.js +368 -376
- package/components/color-picker/index.umd.cjs +2 -2
- package/components/combo-list/index.css +1 -0
- package/components/combo-list/index.esm.js +1141 -340
- package/components/combo-list/index.umd.cjs +1 -1
- package/components/combo-tree/index.esm.js +116 -116
- package/components/combo-tree/index.umd.cjs +1 -1
- package/components/common/index.esm.js +986 -798
- package/components/common/index.umd.cjs +1 -1
- package/components/component/index.esm.js +463 -998
- package/components/component/index.umd.cjs +1 -1
- package/components/condition/index.css +1 -0
- package/components/condition/index.esm.js +2233 -1057
- package/components/condition/index.umd.cjs +1 -1
- package/components/content-container/index.esm.js +335 -1002
- package/components/content-container/index.umd.cjs +1 -1
- package/components/data-grid/index.css +1 -1
- package/components/data-grid/index.esm.js +6193 -4702
- package/components/data-grid/index.umd.cjs +1 -1
- package/components/data-view/index.css +1 -0
- package/components/data-view/index.esm.js +4562 -3294
- package/components/data-view/index.umd.cjs +1 -1
- package/components/date-picker/index.css +1 -1
- package/components/date-picker/index.esm.js +3420 -2623
- package/components/date-picker/index.umd.cjs +1 -1
- package/components/designer-canvas/index.css +1 -1
- package/components/designer-canvas/index.esm.js +914 -883
- package/components/designer-canvas/index.umd.cjs +1 -1
- package/components/designer-outline/index.esm.js +14 -13
- package/components/designer-outline/index.umd.cjs +1 -1
- package/components/dropdown/index.esm.js +204 -212
- package/components/dropdown/index.umd.cjs +2 -2
- package/components/dynamic-form/index.css +1 -0
- package/components/dynamic-form/index.esm.js +2795 -1835
- package/components/dynamic-form/index.umd.cjs +1 -1
- package/components/dynamic-resolver/index.esm.js +180 -130
- package/components/dynamic-resolver/index.umd.cjs +1 -1
- package/components/dynamic-view/index.esm.js +303 -290
- package/components/dynamic-view/index.umd.cjs +1 -1
- package/components/events-editor/index.esm.js +328 -336
- package/components/events-editor/index.umd.cjs +1 -1
- package/components/expression-editor/index.esm.js +65 -65
- package/components/expression-editor/index.umd.cjs +1 -1
- package/components/external-container/index.css +1 -1
- package/components/external-container/index.esm.js +3349 -3626
- package/components/external-container/index.umd.cjs +1 -1
- package/components/field-selector/index.css +1 -1
- package/components/field-selector/index.esm.js +5344 -8588
- package/components/field-selector/index.umd.cjs +1 -1
- package/components/filter-bar/index.css +1 -1
- package/components/filter-bar/index.esm.js +2179 -2227
- package/components/filter-bar/index.umd.cjs +1 -1
- package/components/flow-canvas/index.css +1 -1
- package/components/flow-canvas/index.esm.js +684 -675
- package/components/flow-canvas/index.umd.cjs +1 -1
- package/components/image-cropper/index.esm.js +482 -490
- package/components/image-cropper/index.umd.cjs +1 -1
- package/components/input-group/index.esm.js +746 -569
- package/components/input-group/index.umd.cjs +1 -1
- package/components/layout/index.esm.js +409 -385
- package/components/layout/index.umd.cjs +1 -1
- package/components/list-nav/index.esm.js +348 -1019
- package/components/list-nav/index.umd.cjs +1 -1
- package/components/list-view/index.css +1 -1
- package/components/list-view/index.esm.js +3606 -2388
- package/components/list-view/index.umd.cjs +1 -1
- package/components/lookup/index.css +1 -1
- package/components/lookup/index.esm.js +10871 -8970
- package/components/lookup/index.umd.cjs +1 -1
- package/components/mapping-editor/index.css +1 -1
- package/components/mapping-editor/index.esm.js +6019 -5631
- package/components/mapping-editor/index.umd.cjs +1 -1
- package/components/message-box/index.css +1 -1
- package/components/message-box/index.esm.js +511 -471
- package/components/message-box/index.umd.cjs +1 -1
- package/components/modal/index.css +1 -1
- package/components/modal/index.esm.js +438 -398
- package/components/modal/index.umd.cjs +1 -1
- package/components/nav/index.esm.js +912 -1281
- package/components/nav/index.umd.cjs +3 -3
- package/components/notify/index.esm.js +59 -53
- package/components/notify/index.umd.cjs +1 -1
- package/components/number-range/index.esm.js +660 -484
- package/components/number-range/index.umd.cjs +1 -1
- package/components/number-spinner/index.esm.js +682 -506
- package/components/number-spinner/index.umd.cjs +1 -1
- package/components/order/index.css +1 -1
- package/components/order/index.esm.js +1848 -1658
- package/components/order/index.umd.cjs +1 -1
- package/components/page-footer/index.esm.js +100 -100
- package/components/page-footer/index.umd.cjs +1 -1
- package/components/page-header/index.esm.js +1120 -1923
- package/components/page-header/index.umd.cjs +1 -1
- package/components/pagination/index.esm.js +875 -1214
- package/components/pagination/index.umd.cjs +1 -1
- package/components/popover/index.esm.js +71 -70
- package/components/popover/index.umd.cjs +1 -1
- package/components/progress/index.esm.js +229 -237
- package/components/progress/index.umd.cjs +3 -3
- package/components/property-editor/index.css +1 -1
- package/components/property-editor/index.esm.js +2314 -1521
- package/components/property-editor/index.umd.cjs +3 -3
- package/components/property-panel/index.esm.js +867 -868
- package/components/property-panel/index.umd.cjs +1 -1
- package/components/query-solution/index.css +1 -1
- package/components/query-solution/index.esm.js +4332 -3623
- package/components/query-solution/index.umd.cjs +1 -1
- package/components/radio-button/index.esm.js +72 -72
- package/components/radio-button/index.umd.cjs +1 -1
- package/components/radio-group/index.esm.js +613 -437
- package/components/radio-group/index.umd.cjs +1 -1
- package/components/rate/index.esm.js +255 -263
- package/components/rate/index.umd.cjs +1 -1
- package/components/response-layout/index.esm.js +144 -152
- package/components/response-layout/index.umd.cjs +1 -1
- package/components/response-layout-editor/index.css +1 -1
- package/components/response-layout-editor/index.esm.js +1101 -1038
- package/components/response-layout-editor/index.umd.cjs +1 -1
- package/components/response-toolbar/index.esm.js +935 -1750
- package/components/response-toolbar/index.umd.cjs +1 -1
- package/components/schema-selector/index.css +1 -1
- package/components/schema-selector/index.esm.js +5264 -5677
- package/components/schema-selector/index.umd.cjs +2 -2
- package/components/search-box/index.esm.js +151 -154
- package/components/search-box/index.umd.cjs +1 -1
- package/components/section/index.esm.js +438 -1125
- package/components/section/index.umd.cjs +1 -1
- package/components/smoke-detector/index.esm.js +93 -101
- package/components/smoke-detector/index.umd.cjs +1 -1
- package/components/splitter/index.esm.js +563 -1202
- package/components/splitter/index.umd.cjs +1 -1
- package/components/splitter/style.js +2 -0
- package/components/step/index.esm.js +248 -256
- package/components/step/index.umd.cjs +1 -1
- package/components/switch/index.esm.js +549 -373
- package/components/switch/index.umd.cjs +1 -1
- package/components/tabs/index.css +1 -1
- package/components/tabs/index.esm.js +2436 -3110
- package/components/tabs/index.umd.cjs +1 -1
- package/components/tags/index.esm.js +328 -336
- package/components/tags/index.umd.cjs +1 -1
- package/components/text/index.esm.js +339 -347
- package/components/text/index.umd.cjs +1 -1
- package/components/textarea/index.esm.js +554 -378
- package/components/textarea/index.umd.cjs +1 -1
- package/components/time-picker/index.css +1 -1
- package/components/time-picker/index.esm.js +1322 -1144
- package/components/time-picker/index.umd.cjs +1 -1
- package/components/transfer/index.css +1 -1
- package/components/transfer/index.esm.js +537 -543
- package/components/transfer/index.umd.cjs +1 -1
- package/components/tree-grid/index.css +1 -1
- package/components/tree-grid/index.esm.js +5113 -9426
- package/components/tree-grid/index.umd.cjs +1 -1
- package/components/tree-view/index.css +1 -0
- package/components/tree-view/index.esm.js +3900 -2677
- package/components/tree-view/index.umd.cjs +1 -1
- package/components/uploader/index.esm.js +568 -570
- package/components/uploader/index.umd.cjs +2 -2
- package/components/verify-detail/index.esm.js +266 -274
- package/components/verify-detail/index.umd.cjs +1 -1
- package/components/video/index.esm.js +553 -1052
- package/components/video/index.umd.cjs +1 -1
- package/components/weather/index.esm.js +558 -566
- package/components/weather/index.umd.cjs +5 -5
- package/farris.all.esm.js +22009 -22688
- package/farris.all.umd.cjs +9 -9
- package/index.css +1 -1
- package/package.json +1 -1
- package/types/capsule/src/capsule.props.d.ts +2 -2
- package/types/combo-list/src/components/list-container.component.d.ts +0 -3
- package/types/combo-list/src/components/list-container.props.d.ts +0 -4
- package/types/common/directive/area-response.d.ts +10 -0
- package/types/common/index.d.ts +9 -0
- package/types/common/radio-checkbox/radio-checkbox.props.d.ts +1 -0
- package/types/common/types.d.ts +1 -1
- package/types/common/utils/encrypt.d.ts +2 -0
- package/types/common/utils/resolve-field.d.ts +2 -0
- package/types/common/utils/use-class.d.ts +7 -0
- package/types/component/src/component.props.d.ts +7 -0
- package/types/component/src/designer/use-designer-rules.d.ts +2 -2
- package/types/component/src/property-config/component.property-config.d.ts +9 -0
- package/types/components.d.ts +1 -0
- package/types/condition/src/types.d.ts +2 -1
- package/types/content-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/data-grid/index.d.ts +11 -5
- package/types/data-grid/src/data-grid.component.d.ts +4 -2
- package/types/data-grid/src/data-grid.props.d.ts +1 -0
- package/types/data-grid/src/designer/data-grid.design.component.d.ts +2 -2
- package/types/data-grid/src/designer/use-designer-rules.d.ts +2 -2
- package/types/data-view/components/row/hierarchy-row.component.d.ts +2 -2
- package/types/data-view/composition/data/use-tree-data.d.ts +1 -1
- package/types/data-view/composition/types.d.ts +19 -4
- package/types/data-view/composition/visualization/use-virtual-scroll.d.ts +0 -15
- 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/rule/use-dragula-common-rule.d.ts +4 -0
- package/types/designer-canvas/src/composition/rule/use-template-rule.d.ts +30 -0
- package/types/designer-canvas/src/composition/types.d.ts +2 -3
- package/types/designer-canvas/src/types.d.ts +2 -1
- package/types/dynamic-form/src/composition/use-response-form-layout-setting.d.ts +2 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.component.d.ts +8 -0
- package/types/dynamic-form/src/designer/response-form-layout-setting.props.d.ts +4 -0
- package/types/dynamic-form/src/designer/response-form.design.component.d.ts +7 -1
- package/types/dynamic-form/src/designer/use-designer-rules.d.ts +1 -1
- package/types/dynamic-form/src/property-config/form.property-config.d.ts +9 -0
- package/types/dynamic-form/src/schema/schema-mapper.d.ts +1 -0
- package/types/dynamic-form/src/schema/schema-resolver.d.ts +1 -0
- package/types/dynamic-form/src/types.d.ts +12 -1
- package/types/dynamic-resolver/index.d.ts +1 -0
- package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +1 -1
- package/types/dynamic-resolver/src/event-handler-resolver.d.ts +4 -0
- package/types/dynamic-resolver/src/types.d.ts +9 -0
- package/types/dynamic-view/index.d.ts +1 -0
- package/types/dynamic-view/src/event-dispatcher.d.ts +1 -1
- package/types/external-container/src/designer/use-designer-rules.d.ts +3 -3
- package/types/index.d.ts +2 -0
- package/types/layout/src/designer/layout-pane-use-designer-rules.d.ts +3 -3
- package/types/list-nav/src/designer/use-designer-rules.d.ts +3 -0
- package/types/lookup/src/components/favorite/lookup-favorite.component.d.ts +29 -0
- package/types/lookup/src/components/favorite/lookup-favorite.props.d.ts +15 -0
- package/types/lookup/src/components/modal-container.component.d.ts +25 -0
- package/types/lookup/src/components/modal-container.props.d.ts +29 -0
- package/types/lookup/src/composition/types.d.ts +8 -0
- package/types/lookup/src/composition/use-check-props.d.ts +9 -2
- package/types/lookup/src/composition/use-dialog.d.ts +5 -1
- package/types/lookup/src/composition/use-favorite.d.ts +12 -0
- package/types/lookup/src/composition/use-http.d.ts +9 -5
- package/types/lookup/src/composition/use-input-change.d.ts +3 -0
- package/types/lookup/src/composition/use-user-data.d.ts +24 -0
- package/types/lookup/src/property-config/lookup.property-config.d.ts +6 -4
- package/types/mapping-editor/src/mapping-editor.component.d.ts +3 -0
- package/types/mapping-editor/src/mapping-editor.props.d.ts +0 -1
- package/types/modal/src/composition/use-draggable.d.ts +2 -1
- package/types/modal/src/composition/use-shortcut.d.ts +6 -0
- package/types/modal/src/modal.component.d.ts +3 -0
- package/types/modal/src/modal.props.d.ts +4 -0
- package/types/page-header/src/page-header.props.d.ts +1 -0
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-list.component.d.ts +2 -2
- package/types/pagination/src/components/pages/page-number.component.d.ts +2 -2
- package/types/property-panel/index.d.ts +2 -1
- package/types/property-panel/src/composition/entity/base-property.d.ts +8 -0
- package/types/property-panel/src/composition/entity/input-base-property.d.ts +20 -1
- package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +34 -27
- package/types/query-solution/src/designer/query-solution-config/composition/use-panel.d.ts +2 -16
- package/types/{data-grid/src/designer/use-group-column.d.ts → query-solution/src/designer/query-solution-config/composition/use-property.d.ts} +4 -5
- package/types/query-solution/src/designer/query-solution-config/composition/use-querysolution-rules.d.ts +3 -0
- package/types/query-solution/src/designer/query-solution-config/composition/use-transfer.d.ts +1 -1
- package/types/query-solution/src/property-config/query-solution.property-config.d.ts +60 -0
- package/types/query-solution/src/solutions.d.ts +108 -509
- package/types/response-layout-editor/index.d.ts +3 -1
- package/types/response-layout-editor/src/composition/converter/use-response-layout-editor-setting.d.ts +2 -0
- package/types/response-layout-editor/src/type.d.ts +21 -0
- package/types/response-toolbar/src/designer/use-designer-rules.d.ts +3 -3
- package/types/response-toolbar/src/property-config/response-toolbar-item.property-config.d.ts +1 -0
- package/types/section/src/designer/use-designer-rules.d.ts +3 -3
- package/types/splitter/src/components/splitter-pane.component.d.ts +1 -1
- package/types/splitter/src/designer/splitter-pane-use-designer-rules.d.ts +3 -3
- package/types/splitter/src/designer/splitter-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-page-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/designer/tab-use-designer-rules.d.ts +3 -3
- package/types/tabs/src/tabs.props.d.ts +1 -0
- package/types/tree-grid/index.d.ts +8 -2
- package/types/tree-grid/src/tree-grid.component.d.ts +3 -1
- package/types/designer-canvas/src/composition/rule/use-drag-drop-rules.d.ts +0 -19
- package/types/designer-canvas/src/composition/use-dragula-common-rule.d.ts +0 -4
- package/types/list-nav/src/composition/use-designer-rules.d.ts +0 -3
- package/types/modal/src/composition/use-esc.d.ts +0 -1
- package/types/query-solution/src/designer/query-solution-config/composition/mock-data.d.ts +0 -6
- package/types/response-layout-editor/src/composition/converter/response-layout-editor.converter.d.ts +0 -3
- package/types/response-layout-editor/src/composition/converter/use-convert-property-value.d.ts +0 -20
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { cloneDeep as z } from "lodash-es";
|
|
1
|
+
import { defineComponent as w, ref as h, computed as j, watch as B, createVNode as y, Fragment as q, inject as X, onMounted as U, resolveComponent as W } from "vue";
|
|
2
|
+
import _ from "../button-edit/index.esm.js";
|
|
3
|
+
import { isPlainObject as N, cloneDeep as z } from "lodash-es";
|
|
4
4
|
import G from "../list-view/index.esm.js";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
const { properties: e, title:
|
|
9
|
-
return (!l || !o.find((p) => p == "id")) && (d.id = `${
|
|
5
|
+
import J from "../loading/index.esm.js";
|
|
6
|
+
const C = {}, T = {};
|
|
7
|
+
function D(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 ? D(e[s]) : z(e[s].default)), p), {});
|
|
9
|
+
return i && (!l || !o.find((p) => p == "id")) && (d.id = `${i}-${Date.now()}`), d;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const o =
|
|
11
|
+
function $(t, e = {}, i) {
|
|
12
|
+
const o = C[t];
|
|
13
13
|
if (o) {
|
|
14
|
-
let l =
|
|
14
|
+
let l = D(o);
|
|
15
15
|
const d = T[t];
|
|
16
|
-
return l = d ? d({ getSchemaByType:
|
|
16
|
+
return l = d ? d({ getSchemaByType: $ }, l, e, i) : l, l;
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
22
|
-
return Object.keys(t).reduce((o, l) => (o[l] &&
|
|
20
|
+
function Q(t, e) {
|
|
21
|
+
const i = D(e);
|
|
22
|
+
return Object.keys(t).reduce((o, l) => (o[l] && N(o[l]) && N(t[l]) ? Object.assign(o[l], t[l]) : o[l] = t[l], o), i), i;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Y(t, e) {
|
|
25
25
|
return Object.keys(t).filter((o) => t[o] != null).reduce((o, l) => {
|
|
26
26
|
if (e.has(l)) {
|
|
27
27
|
const d = e.get(l);
|
|
@@ -36,45 +36,45 @@ function Z(t, e) {
|
|
|
36
36
|
return o;
|
|
37
37
|
}, {});
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const o =
|
|
41
|
-
return
|
|
39
|
+
function Z(t, e, i = /* @__PURE__ */ new Map()) {
|
|
40
|
+
const o = Q(t, e);
|
|
41
|
+
return Y(o, i);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
function e(a, n, u,
|
|
43
|
+
function x(t = {}) {
|
|
44
|
+
function e(a, n, u, c) {
|
|
45
45
|
if (typeof u == "number")
|
|
46
|
-
return
|
|
46
|
+
return c[a].length === u;
|
|
47
47
|
if (typeof u == "object") {
|
|
48
48
|
const r = Object.keys(u)[0], f = u[r];
|
|
49
49
|
if (r === "not")
|
|
50
|
-
return Number(
|
|
50
|
+
return Number(c[a].length) !== Number(f);
|
|
51
51
|
if (r === "moreThan")
|
|
52
|
-
return Number(
|
|
52
|
+
return Number(c[a].length) >= Number(f);
|
|
53
53
|
if (r === "lessThan")
|
|
54
|
-
return Number(
|
|
54
|
+
return Number(c[a].length) <= Number(f);
|
|
55
55
|
}
|
|
56
56
|
return !1;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function i(a, n, u, c) {
|
|
59
|
+
return c[a] && c[a].propertyValue && String(c[a].propertyValue.value) === String(u);
|
|
60
60
|
}
|
|
61
61
|
const o = /* @__PURE__ */ new Map([
|
|
62
62
|
["length", e],
|
|
63
|
-
["getProperty",
|
|
63
|
+
["getProperty", i]
|
|
64
64
|
]);
|
|
65
65
|
Object.keys(t).reduce((a, n) => (a.set(n, t[n]), a), o);
|
|
66
66
|
function l(a, n) {
|
|
67
67
|
const u = a;
|
|
68
|
-
return typeof n == "number" ? [{ target: u, operator: "length", param: null, value: Number(n) }] : typeof n == "boolean" ? [{ target: u, operator: "getProperty", param: a, value: !!n }] : typeof n == "object" ? Object.keys(n).map((
|
|
69
|
-
if (
|
|
70
|
-
return { target: u, operator: "length", param: null, value: n[
|
|
71
|
-
const r =
|
|
68
|
+
return typeof n == "number" ? [{ target: u, operator: "length", param: null, value: Number(n) }] : typeof n == "boolean" ? [{ target: u, operator: "getProperty", param: a, value: !!n }] : typeof n == "object" ? Object.keys(n).map((c) => {
|
|
69
|
+
if (c === "length")
|
|
70
|
+
return { target: u, operator: "length", param: null, value: n[c] };
|
|
71
|
+
const r = c, f = n[c];
|
|
72
72
|
return { target: u, operator: "getProperty", param: r, value: f };
|
|
73
73
|
}) : [];
|
|
74
74
|
}
|
|
75
75
|
function d(a) {
|
|
76
|
-
return Object.keys(a).reduce((u,
|
|
77
|
-
const r = l(
|
|
76
|
+
return Object.keys(a).reduce((u, c) => {
|
|
77
|
+
const r = l(c, a[c]);
|
|
78
78
|
return u.push(...r), u;
|
|
79
79
|
}, []);
|
|
80
80
|
}
|
|
@@ -89,25 +89,25 @@ function I(t = {}) {
|
|
|
89
89
|
return d(a).reduce((r, f) => r && p(f, n), !0);
|
|
90
90
|
}
|
|
91
91
|
function g(a, n) {
|
|
92
|
-
const u = Object.keys(a),
|
|
93
|
-
return
|
|
92
|
+
const u = Object.keys(a), c = u.includes("allOf"), r = u.includes("anyOf"), f = c || r, S = (f ? a[f ? c ? "allOf" : "anyOf" : "allOf"] : [a]).map((R) => s(R, n));
|
|
93
|
+
return c ? !S.includes(!1) : S.includes(!0);
|
|
94
94
|
}
|
|
95
95
|
return { parseValueSchema: g };
|
|
96
96
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
function
|
|
100
|
-
return
|
|
101
|
-
const s =
|
|
97
|
+
const K = {}, I = {};
|
|
98
|
+
x();
|
|
99
|
+
function ee(t, e, i = /* @__PURE__ */ new Map(), o = (p, s, g) => s, l = {}, d = (p) => p) {
|
|
100
|
+
return C[e.title] = e, T[e.title] = o, K[e.title] = l, I[e.title] = d, (p = {}) => {
|
|
101
|
+
const s = Z(p, e, i), g = Object.keys(t).reduce((a, n) => (a[n] = t[n].default, a), {});
|
|
102
102
|
return Object.assign(g, s);
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function te(t, e) {
|
|
106
106
|
return { customClass: e.class, customStyle: e.style };
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
["appearance",
|
|
110
|
-
]),
|
|
108
|
+
const ne = /* @__PURE__ */ new Map([
|
|
109
|
+
["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", ue = "object", ie = {
|
|
111
111
|
id: {
|
|
112
112
|
description: "The unique identifier for a search-box",
|
|
113
113
|
type: "string"
|
|
@@ -169,22 +169,22 @@ const ae = /* @__PURE__ */ new Map([
|
|
|
169
169
|
type: "boolean",
|
|
170
170
|
default: !0
|
|
171
171
|
}
|
|
172
|
-
},
|
|
172
|
+
}, ce = [
|
|
173
173
|
"id",
|
|
174
174
|
"type"
|
|
175
|
-
],
|
|
176
|
-
$schema:
|
|
177
|
-
$id:
|
|
178
|
-
title:
|
|
179
|
-
description:
|
|
180
|
-
type:
|
|
181
|
-
properties:
|
|
182
|
-
required:
|
|
175
|
+
], se = {
|
|
176
|
+
$schema: oe,
|
|
177
|
+
$id: ae,
|
|
178
|
+
title: re,
|
|
179
|
+
description: le,
|
|
180
|
+
type: ue,
|
|
181
|
+
properties: ie,
|
|
182
|
+
required: ce
|
|
183
183
|
};
|
|
184
|
-
function
|
|
184
|
+
function fe(t, e, i) {
|
|
185
185
|
return e;
|
|
186
186
|
}
|
|
187
|
-
const
|
|
187
|
+
const pe = "search-box", de = "A Farris Component", he = "object", me = {
|
|
188
188
|
basic: {
|
|
189
189
|
description: "Basic Infomation",
|
|
190
190
|
title: "基本信息",
|
|
@@ -206,12 +206,12 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
},
|
|
210
|
-
title:
|
|
211
|
-
description:
|
|
212
|
-
type:
|
|
213
|
-
categories:
|
|
214
|
-
},
|
|
209
|
+
}, ge = {
|
|
210
|
+
title: pe,
|
|
211
|
+
description: de,
|
|
212
|
+
type: he,
|
|
213
|
+
categories: me
|
|
214
|
+
}, E = {
|
|
215
215
|
/**
|
|
216
216
|
* 自定义图标
|
|
217
217
|
*/
|
|
@@ -253,11 +253,15 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
253
253
|
/**
|
|
254
254
|
* 是否展示搜索结果面板
|
|
255
255
|
*/
|
|
256
|
-
showDropdown: { default: !0, type: Boolean }
|
|
256
|
+
showDropdown: { default: !0, type: Boolean },
|
|
257
257
|
/**
|
|
258
258
|
* popupOnFoucs TODO
|
|
259
259
|
*/
|
|
260
|
-
|
|
260
|
+
/**
|
|
261
|
+
* 值变化事件触发时机
|
|
262
|
+
*/
|
|
263
|
+
updateOn: { default: "blur", type: String }
|
|
264
|
+
}, A = ee(E, se, ne, fe, ge), ye = {
|
|
261
265
|
data: { type: Array, default: [] },
|
|
262
266
|
/** 确认结果事件 */
|
|
263
267
|
onConfirmResult: { type: Function, default: () => {
|
|
@@ -281,14 +285,14 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
281
285
|
*/
|
|
282
286
|
maxHeight: { default: 350, type: Number },
|
|
283
287
|
loading: { default: !1, type: Boolean }
|
|
284
|
-
},
|
|
288
|
+
}, H = /* @__PURE__ */ w({
|
|
285
289
|
name: "FSearchBoxContainer",
|
|
286
|
-
props:
|
|
290
|
+
props: ye,
|
|
287
291
|
emits: ["confirmResult", "searchedValue"],
|
|
288
292
|
setup(t, e) {
|
|
289
|
-
const
|
|
293
|
+
const i = h(t.data), o = h(), {
|
|
290
294
|
slots: l
|
|
291
|
-
} = e, d =
|
|
295
|
+
} = e, d = j(() => ({
|
|
292
296
|
"search-box-container": !0,
|
|
293
297
|
"f-utils-overflow-xhya": !0,
|
|
294
298
|
"position-relative": !0
|
|
@@ -301,32 +305,32 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
301
305
|
n.length && (e.emit("confirmResult", n[0].name), e.emit("searchedValue", n));
|
|
302
306
|
}
|
|
303
307
|
function g(n) {
|
|
304
|
-
return l.default ?
|
|
308
|
+
return l.default ? y(q, null, [l.default(n)]) : y("span", null, [n.item[t.textField]]);
|
|
305
309
|
}
|
|
306
|
-
const a =
|
|
310
|
+
const a = j(() => {
|
|
307
311
|
const n = {};
|
|
308
312
|
return n.padding = "8px", t.maxHeight !== void 0 && t.maxHeight > 0 && (n.maxHeight = `${t.maxHeight}px`), n;
|
|
309
313
|
});
|
|
310
|
-
return
|
|
314
|
+
return B(() => t.loading, (n) => {
|
|
311
315
|
console.log("loading状态改变" + n);
|
|
312
|
-
}),
|
|
313
|
-
n !==
|
|
316
|
+
}), B(() => t.data, (n) => {
|
|
317
|
+
n !== i.value && (i.value = n), o.value.updateDataSource(n);
|
|
314
318
|
}), e.expose({
|
|
315
319
|
search: p
|
|
316
320
|
}), () => {
|
|
317
321
|
const n = {
|
|
318
322
|
content: g
|
|
319
323
|
};
|
|
320
|
-
return
|
|
324
|
+
return y("div", {
|
|
321
325
|
class: d.value,
|
|
322
326
|
style: a.value
|
|
323
|
-
}, [
|
|
327
|
+
}, [y(J, {
|
|
324
328
|
ref: "loadingInstance",
|
|
325
329
|
isActive: t.loading
|
|
326
|
-
}, null),
|
|
330
|
+
}, null), y(G, {
|
|
327
331
|
ref: o,
|
|
328
332
|
itemClass: "dropdown-item",
|
|
329
|
-
data:
|
|
333
|
+
data: i.value,
|
|
330
334
|
view: "ContentView",
|
|
331
335
|
onClickItem: (u) => s(u.data),
|
|
332
336
|
idField: t.idField,
|
|
@@ -336,23 +340,23 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
336
340
|
}, n)]);
|
|
337
341
|
};
|
|
338
342
|
}
|
|
339
|
-
}),
|
|
343
|
+
}), V = /* @__PURE__ */ w({
|
|
340
344
|
name: "FSearchBox",
|
|
341
|
-
props:
|
|
345
|
+
props: E,
|
|
342
346
|
emits: ["update:modelValue", "change", "selectedValue", "clickButton"],
|
|
343
347
|
setup(t, e) {
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
const s =
|
|
348
|
-
|
|
348
|
+
h(t.data);
|
|
349
|
+
const i = h(), o = h(), l = h(t.placeholder), d = '<i class="f-icon f-icon-clockwise f-icon-spin"></i>', p = j(() => t.loading ? d : t.buttonContent);
|
|
350
|
+
h(t.editable);
|
|
351
|
+
const s = h(t.modelValue);
|
|
352
|
+
B(s, (r) => {
|
|
349
353
|
var f;
|
|
350
354
|
(f = o.value) == null || f.search(r), e.emit("update:modelValue", r);
|
|
351
|
-
}),
|
|
355
|
+
}), B(() => t.modelValue, (r) => {
|
|
352
356
|
s.value = r;
|
|
353
357
|
});
|
|
354
358
|
function g(r) {
|
|
355
|
-
|
|
359
|
+
i.value.commitValue(r);
|
|
356
360
|
}
|
|
357
361
|
function a(r) {
|
|
358
362
|
e.emit("change", r);
|
|
@@ -363,19 +367,20 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
363
367
|
function u(r) {
|
|
364
368
|
e.emit("clickButton", r);
|
|
365
369
|
}
|
|
366
|
-
function
|
|
367
|
-
|
|
370
|
+
function c() {
|
|
371
|
+
i.value.togglePopup();
|
|
368
372
|
}
|
|
369
373
|
return e.expose({
|
|
370
|
-
togglePopup:
|
|
374
|
+
togglePopup: c
|
|
371
375
|
}), () => {
|
|
372
376
|
const r = {
|
|
373
377
|
default: e.slots.default
|
|
374
378
|
};
|
|
375
|
-
return
|
|
376
|
-
ref:
|
|
379
|
+
return y(_, {
|
|
380
|
+
ref: i,
|
|
377
381
|
"button-content": p.value,
|
|
378
382
|
"custom-class": t.customClass,
|
|
383
|
+
updateOn: t.updateOn,
|
|
379
384
|
placeholder: l.value,
|
|
380
385
|
onChange: (f) => a(f),
|
|
381
386
|
onClickButton: (f) => u(f),
|
|
@@ -390,7 +395,7 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
390
395
|
"popup-on-input": t.showDropdown,
|
|
391
396
|
"popup-on-focus": t.showDropdown
|
|
392
397
|
}, {
|
|
393
|
-
default: () => [t.showDropdown &&
|
|
398
|
+
default: () => [t.showDropdown && y(H, {
|
|
394
399
|
ref: o,
|
|
395
400
|
data: t.data,
|
|
396
401
|
onConfirmResult: g,
|
|
@@ -403,11 +408,11 @@ const he = "search-box", me = "A Farris Component", ge = "object", ye = {
|
|
|
403
408
|
};
|
|
404
409
|
}
|
|
405
410
|
});
|
|
406
|
-
function
|
|
407
|
-
var
|
|
411
|
+
function be(t, e, i) {
|
|
412
|
+
var k;
|
|
408
413
|
function o() {
|
|
409
414
|
}
|
|
410
|
-
const l = "", d = "", p =
|
|
415
|
+
const l = "", d = "", p = h();
|
|
411
416
|
function s() {
|
|
412
417
|
return (e == null ? void 0 : e.schema.componentType) !== "frame";
|
|
413
418
|
}
|
|
@@ -420,44 +425,37 @@ function Ve(t, e, c) {
|
|
|
420
425
|
function n() {
|
|
421
426
|
return (e == null ? void 0 : e.schema.componentType) === "frame";
|
|
422
427
|
}
|
|
423
|
-
function u(
|
|
424
|
-
if (!
|
|
428
|
+
function u(m) {
|
|
429
|
+
if (!m || !m.value)
|
|
425
430
|
return null;
|
|
426
|
-
if (
|
|
427
|
-
return
|
|
428
|
-
const b = m
|
|
429
|
-
return
|
|
431
|
+
if (m.value.schema && m.value.schema.type === "component")
|
|
432
|
+
return m.value;
|
|
433
|
+
const b = h(m == null ? void 0 : m.value.parent), v = u(b);
|
|
434
|
+
return v || null;
|
|
430
435
|
}
|
|
431
|
-
function
|
|
432
|
-
const { componentInstance: b, designerItemElementRef:
|
|
433
|
-
return !b || !b.value ? null : b.value.canMove ?
|
|
436
|
+
function c(m = e) {
|
|
437
|
+
const { componentInstance: b, designerItemElementRef: v } = m;
|
|
438
|
+
return !b || !b.value ? null : b.value.canMove ? v : c(m.parent);
|
|
434
439
|
}
|
|
435
|
-
function r(
|
|
436
|
-
return !!
|
|
440
|
+
function r(m) {
|
|
441
|
+
return !!i;
|
|
437
442
|
}
|
|
438
443
|
function f() {
|
|
439
444
|
return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
|
|
440
445
|
}
|
|
441
|
-
function
|
|
442
|
-
}
|
|
443
|
-
function N(h, b) {
|
|
446
|
+
function O() {
|
|
444
447
|
}
|
|
445
|
-
function
|
|
446
|
-
const { componentType: y } = h;
|
|
447
|
-
let V = E(y, h, b);
|
|
448
|
-
const O = y.toLowerCase().replace("-", "_");
|
|
449
|
-
return V && !V.id && V.type === y && (V.id = `${O}_${Math.random().toString().slice(2, 6)}`), V;
|
|
448
|
+
function M(m, b) {
|
|
450
449
|
}
|
|
451
|
-
function
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
return F && !F.id && F.type === y && (F.id = `${_}_${Math.random().toString().slice(2, 6)}`), F;
|
|
450
|
+
function S(m, b) {
|
|
451
|
+
const { componentType: v } = m;
|
|
452
|
+
let F = $(v, m, b);
|
|
453
|
+
const L = v.toLowerCase().replace("-", "_");
|
|
454
|
+
return F && !F.id && F.type === v && (F.id = `${L}_${Math.random().toString().slice(2, 6)}`), F;
|
|
457
455
|
}
|
|
458
|
-
function
|
|
456
|
+
function P(m) {
|
|
459
457
|
}
|
|
460
|
-
function
|
|
458
|
+
function R(...m) {
|
|
461
459
|
}
|
|
462
460
|
return p.value = {
|
|
463
461
|
canMove: s(),
|
|
@@ -466,52 +464,51 @@ function Ve(t, e, c) {
|
|
|
466
464
|
canNested: !n(),
|
|
467
465
|
contents: e == null ? void 0 : e.schema.contents,
|
|
468
466
|
elementRef: t,
|
|
469
|
-
parent: (
|
|
467
|
+
parent: (k = e == null ? void 0 : e.parent) == null ? void 0 : k.componentInstance,
|
|
470
468
|
schema: e == null ? void 0 : e.schema,
|
|
471
469
|
styles: l,
|
|
472
470
|
designerClass: d,
|
|
473
471
|
canAccepts: r,
|
|
474
472
|
getBelongedComponentInstance: u,
|
|
475
|
-
getDraggableDesignItemElement:
|
|
473
|
+
getDraggableDesignItemElement: c,
|
|
476
474
|
getDraggingDisplayText: f,
|
|
477
|
-
getPropConfig:
|
|
478
|
-
getDragScopeElement:
|
|
479
|
-
onAcceptMovedChildElement:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
addNewChildComponentSchema: R,
|
|
475
|
+
getPropConfig: R,
|
|
476
|
+
getDragScopeElement: O,
|
|
477
|
+
onAcceptMovedChildElement: M,
|
|
478
|
+
onChildElementMovedOut: P,
|
|
479
|
+
addNewChildComponentSchema: S,
|
|
483
480
|
updateDragAndDropRules: o,
|
|
484
|
-
triggerBelongedComponentToMoveWhenMoved:
|
|
485
|
-
triggerBelongedComponentToDeleteWhenDeleted:
|
|
481
|
+
triggerBelongedComponentToMoveWhenMoved: h(!1),
|
|
482
|
+
triggerBelongedComponentToDeleteWhenDeleted: h(!1)
|
|
486
483
|
}, p;
|
|
487
484
|
}
|
|
488
|
-
const
|
|
485
|
+
const ve = /* @__PURE__ */ w({
|
|
489
486
|
name: "FSearchBoxDesign",
|
|
490
|
-
props:
|
|
487
|
+
props: E,
|
|
491
488
|
emits: ["update:modelValue", "change"],
|
|
492
489
|
setup(t, e) {
|
|
493
|
-
const
|
|
494
|
-
|
|
490
|
+
const i = h(t.data), o = h(), l = h(), d = h("请输入关键词"), p = h('<i class="f-icon f-icon-search"></i>'), s = h(t.modelValue), g = h(), a = X("design-item-context"), n = be(g, a);
|
|
491
|
+
U(() => {
|
|
495
492
|
g.value.componentInstance = n;
|
|
496
|
-
}), e.expose(n.value),
|
|
493
|
+
}), e.expose(n.value), B(s, (r) => {
|
|
497
494
|
var f;
|
|
498
495
|
(f = l.value) == null || f.search(r), e.emit("update:modelValue", r);
|
|
499
|
-
}),
|
|
496
|
+
}), B(() => t.modelValue, (r) => {
|
|
500
497
|
s.value = r;
|
|
501
498
|
});
|
|
502
499
|
function u(r) {
|
|
503
500
|
o.value.commitValue(r);
|
|
504
501
|
}
|
|
505
|
-
function
|
|
502
|
+
function c(r) {
|
|
506
503
|
e.emit("change", r);
|
|
507
504
|
}
|
|
508
|
-
return () =>
|
|
505
|
+
return () => y("div", {
|
|
509
506
|
ref: g
|
|
510
|
-
}, [
|
|
507
|
+
}, [y(W("f-button-edit"), {
|
|
511
508
|
ref: o,
|
|
512
509
|
"button-content": p.value,
|
|
513
510
|
placeholder: d.value,
|
|
514
|
-
onChange:
|
|
511
|
+
onChange: c,
|
|
515
512
|
"enable-clear": !0,
|
|
516
513
|
"button-behavior": "Execute",
|
|
517
514
|
modelValue: s.value,
|
|
@@ -522,26 +519,26 @@ const Be = /* @__PURE__ */ M({
|
|
|
522
519
|
"popup-on-input": !0,
|
|
523
520
|
"popup-on-focus": !0
|
|
524
521
|
}, {
|
|
525
|
-
default: () => [
|
|
522
|
+
default: () => [y(H, {
|
|
526
523
|
ref: l,
|
|
527
|
-
data:
|
|
524
|
+
data: i.value,
|
|
528
525
|
onConfirmResult: u
|
|
529
526
|
}, null)]
|
|
530
527
|
})]);
|
|
531
528
|
}
|
|
532
529
|
});
|
|
533
|
-
|
|
534
|
-
t.component(
|
|
530
|
+
V.install = (t) => {
|
|
531
|
+
t.component(V.name, V);
|
|
535
532
|
};
|
|
536
|
-
|
|
537
|
-
t["search-box"] =
|
|
533
|
+
V.register = (t, e, i, o) => {
|
|
534
|
+
t["search-box"] = V, e["search-box"] = A;
|
|
538
535
|
};
|
|
539
|
-
|
|
540
|
-
t["search-box"] =
|
|
536
|
+
V.registerDesigner = (t, e, i) => {
|
|
537
|
+
t["search-box"] = ve, e["search-box"] = A;
|
|
541
538
|
};
|
|
542
539
|
export {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
540
|
+
V as FSearchBox,
|
|
541
|
+
V as default,
|
|
542
|
+
A as propsResolver,
|
|
543
|
+
E as searchBoxProps
|
|
547
544
|
};
|
|
@@ -1 +1 @@
|
|
|
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,A,H,q,x){"use strict";const P={},$={};function O(t){const{properties:e,title:s,ignore:r}=t,c=r&&Array.isArray(r),h=Object.keys(e).reduce((p,f)=>((!c||!r.find(y=>y==f))&&(p[f]=e[f].type==="object"&&e[f].properties?O(e[f]):H.cloneDeep(e[f].default)),p),{});return(!c||!r.find(p=>p=="id"))&&(h.id=`${s}-${Date.now()}`),h}function N(t,e={},s){const r=P[t];if(r){let c=O(r);const h=$[t];return c=h?h({getSchemaByType:N},c,e,s):c,c}return null}function L(t,e){const s=O(e);return Object.keys(t).reduce((r,c)=>(r[c]&&typeof r[c]=="object"?Object.assign(r[c],t[c]):r[c]=t[c],r),s),s}function _(t,e){return Object.keys(t).filter(r=>t[r]!=null).reduce((r,c)=>{if(e.has(c)){const h=e.get(c);if(typeof h=="string")r[h]=t[c];else{const p=h(c,t[c],t);Object.assign(r,p)}}else r[c]=t[c];return r},{})}function X(t,e,s=new Map){const r=L(t,e);return _(r,s)}function U(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 r=new Map([["length",e],["getProperty",s]]);Object.keys(t).reduce((a,n)=>(a.set(n,t[n]),a),r);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(r.has(a.operator)){const l=r.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(M=>f(M,n));return u?!F.includes(!1):F.includes(!0)}return{parseValueSchema:y}}const W={},J={};U();function z(t,e,s=new Map,r=(p,f,y)=>f,c={},h=p=>p){return P[e.title]=e,$[e.title]=r,W[e.title]=c,J[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 G(t,e){return{customClass:e.class,customStyle:e.style}}const Q=new Map([["appearance",G]]),Y={$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 Z(t,e,s){return e}const K={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}},D=z(j,Y,Q,Z,K),I={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}},C=o.defineComponent({name:"FSearchBoxContainer",props:I,emits:["confirmResult","searchedValue"],setup(t,e){const s=o.ref(t.data),r=o.ref(),{slots:c}=e,h=o.computed(()=>({"search-box-container":!0,"f-utils-overflow-xhya":!0,"position-relative":!0}));function p(n){var l;(l=r.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 a=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),r.value.updateDataSource(n)}),e.expose({search:p}),()=>{const n={content:y};return o.createVNode("div",{class:h.value,style:a.value},[o.createVNode(x,{ref:"loadingInstance",isActive:t.loading},null),o.createVNode(q,{ref:r,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(),r=o.ref(),c=o.ref(t.placeholder),h='<i class="f-icon f-icon-clockwise f-icon-spin"></i>',p=o.computed(()=>t.loading?h:t.buttonContent);o.ref(t.editable);const f=o.ref(t.modelValue);o.watch(f,i=>{var d;(d=r.value)==null||d.search(i),e.emit("update:modelValue",i)}),o.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 o.createVNode(A,{ref:s,"button-content":p.value,"custom-class":t.customClass,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&&o.createVNode(C,{ref:r,data:t.data,onConfirmResult:y,onSearchedValue:d=>n(d),loading:t.loading,maxHeight:t.maxHeight},i)],...e.slots})}}});function ee(t,e,s){var k;function r(){}const c="",h="",p=o.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 V=o.ref(m==null?void 0:m.value.parent),b=l(V);return b||null}function u(m=e){const{componentInstance:V,designerItemElementRef:b}=m;return!V||!V.value?null:V.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 E(){}function v(m,V){}function F(m,V){const{componentType:b}=m;let B=N(b,m,V);const R=b.toLowerCase().replace("-","_");return B&&!B.id&&B.type===b&&(B.id=`${R}_${Math.random().toString().slice(2,6)}`),B}function T(m,V){const b=String(m.getAttribute("data-controltype")),B=m.getAttribute("data-feature"),R=B?JSON.parse(B):{};R.parentComponentInstance=p.value;let w=N(b,R);const oe=b.toLowerCase().replace("-","_");return w&&!w.id&&w.type===b&&(w.id=`${oe}_${Math.random().toString().slice(2,6)}`),w}function M(m){}function ne(...m){}return p.value={canMove:f(),canSelectParent:y(),canDelete:a(),canNested:!n(),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:c,designerClass:h,canAccepts:i,getBelongedComponentInstance:l,getDraggableDesignItemElement:u,getDraggingDisplayText:d,getPropConfig:ne,getDragScopeElement:E,onAcceptMovedChildElement:v,onAcceptNewChildElement:T,onChildElementMovedOut:M,addNewChildComponentSchema:F,updateDragAndDropRules:r,triggerBelongedComponentToMoveWhenMoved:o.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:o.ref(!1)},p}const te=o.defineComponent({name:"FSearchBoxDesign",props:j,emits:["update:modelValue","change"],setup(t,e){const s=o.ref(t.data),r=o.ref(),c=o.ref(),h=o.ref("请输入关键词"),p=o.ref('<i class="f-icon f-icon-search"></i>'),f=o.ref(t.modelValue),y=o.ref(),a=o.inject("design-item-context"),n=ee(y,a);o.onMounted(()=>{y.value.componentInstance=n}),e.expose(n.value),o.watch(f,i=>{var d;(d=c.value)==null||d.search(i),e.emit("update:modelValue",i)}),o.watch(()=>t.modelValue,i=>{f.value=i});function l(i){r.value.commitValue(i)}function u(i){e.emit("change",i)}return()=>o.createVNode("div",{ref:y},[o.createVNode(o.resolveComponent("f-button-edit"),{ref:r,"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:()=>[o.createVNode(C,{ref:c,data:s.value,onConfirmResult:l},null)]})])}});S.install=t=>{t.component(S.name,S)},S.register=(t,e,s,r)=>{t["search-box"]=S,e["search-box"]=D},S.registerDesigner=(t,e,s)=>{t["search-box"]=te,e["search-box"]=D},g.FSearchBox=S,g.default=S,g.propsResolver=D,g.searchBoxProps=j,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
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"}})});
|