@farris/ui-vue 1.0.0-beta.2 → 1.0.0-beta.4
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/accordion/index.esm.js +93 -0
- package/accordion/index.umd.js +1 -0
- package/accordion/package.json +8 -0
- package/accordion/style.css +1 -0
- package/avatar/index.esm.js +94 -0
- package/avatar/index.umd.js +1 -0
- package/avatar/package.json +8 -0
- package/avatar/style.css +1 -0
- package/button/index.esm.js +206 -0
- package/button/index.umd.js +1 -0
- package/button/package.json +8 -0
- package/button-edit/index.esm.js +300 -0
- package/button-edit/index.umd.js +1 -0
- package/button-edit/package.json +8 -0
- package/checkbox/index.esm.js +97 -0
- package/checkbox/index.umd.js +1 -0
- package/checkbox/package.json +8 -0
- package/combo-list/index.esm.js +457 -0
- package/combo-list/index.umd.js +1 -0
- package/combo-list/package.json +8 -0
- package/data-grid/index.esm.js +1535 -0
- package/data-grid/index.umd.js +1 -0
- package/data-grid/package.json +8 -0
- package/data-grid/style.css +1 -0
- package/date-picker/index.esm.js +1479 -0
- package/date-picker/index.umd.js +1 -0
- package/date-picker/package.json +8 -0
- package/date-picker/style.css +1 -0
- package/{src/index.esm.js → farris.all.esm.js} +1 -2
- package/farris.all.umd.js +1 -0
- package/list-view/index.esm.js +144 -0
- package/list-view/index.umd.js +1 -0
- package/list-view/package.json +8 -0
- package/list-view/style.css +1 -0
- package/message-box/index.esm.js +499 -0
- package/message-box/index.umd.js +1 -0
- package/message-box/package.json +8 -0
- package/modal/index.esm.js +165 -0
- package/modal/index.umd.js +1 -0
- package/modal/package.json +8 -0
- package/notify/index.esm.js +187 -0
- package/notify/index.umd.js +1 -0
- package/notify/package.json +8 -0
- package/notify/style.css +1 -0
- package/package.json +6 -5
- package/pagination/index.esm.js +334 -0
- package/pagination/index.umd.js +1 -0
- package/pagination/package.json +8 -0
- package/pagination/style.css +1 -0
- package/popover/index.esm.js +83 -0
- package/popover/index.umd.js +1 -0
- package/popover/package.json +8 -0
- package/popover/style.css +1 -0
- package/radio-group/index.esm.js +79 -0
- package/radio-group/index.umd.js +1 -0
- package/radio-group/package.json +8 -0
- package/section/index.esm.js +70 -0
- package/section/index.umd.js +1 -0
- package/section/package.json +8 -0
- package/switch/index.esm.js +78 -0
- package/switch/index.umd.js +1 -0
- package/switch/package.json +8 -0
- package/tabs/index.esm.js +385 -0
- package/tabs/index.umd.js +1 -0
- package/tabs/package.json +8 -0
- package/tabs/style.css +1 -0
- package/text/index.esm.js +33 -0
- package/text/index.umd.js +1 -0
- package/text/package.json +8 -0
- package/tooltip/index.esm.js +195 -0
- package/tooltip/index.umd.js +1 -0
- package/tooltip/package.json +8 -0
- package/tooltip/style.css +1 -0
- package/types/accordion/index.d.ts +25 -0
- package/types/accordion/src/accordion.component.d.ts +70 -0
- package/types/accordion/src/accordion.props.d.ts +50 -0
- package/types/accordion/src/components/accordion-item.component.d.ts +38 -0
- package/types/accordion/src/components/accordion-item.props.d.ts +34 -0
- package/types/avatar/index.d.ts +23 -0
- package/types/avatar/src/avatar.component.d.ts +109 -0
- package/types/avatar/src/avatar.props.d.ts +96 -0
- package/types/avatar/src/composition/types.d.ts +31 -0
- package/types/avatar/src/composition/use-image.d.ts +19 -0
- package/types/button/index.d.ts +24 -0
- package/types/button/src/button-group.component.d.ts +106 -0
- package/types/button/src/button-group.props.d.ts +106 -0
- package/types/button/src/button.component.d.ts +34 -0
- package/types/button/src/button.props.d.ts +47 -0
- package/types/button/src/composition/types-group.d.ts +24 -0
- package/types/button/src/composition/types.d.ts +24 -0
- package/types/button/src/composition/use-button-group.d.ts +19 -0
- package/types/button/src/composition/use-button.d.ts +19 -0
- package/types/button-edit/index.d.ts +23 -0
- package/types/button-edit/src/button-edit.props.d.ts +135 -0
- package/types/button-edit/src/composition/types.d.ts +118 -0
- package/types/button-edit/src/composition/use-button.d.ts +19 -0
- package/types/button-edit/src/composition/use-clear.d.ts +19 -0
- package/types/button-edit/src/composition/use-text-box.d.ts +19 -0
- package/types/checkbox/index.d.ts +23 -0
- package/types/checkbox/src/checkbox-group.component.d.ts +148 -0
- package/types/checkbox/src/checkbox-group.props.d.ts +123 -0
- package/types/checkbox/src/composition/types.d.ts +46 -0
- package/types/checkbox/src/composition/use-checkbox-group.d.ts +19 -0
- package/types/combo-list/index.d.ts +25 -0
- package/types/combo-list/src/combo-list.props.d.ts +290 -0
- package/types/combo-list/src/components/option.component.d.ts +39 -0
- package/types/combo-list/src/components/options.component.d.ts +10 -0
- package/types/combo-list/src/composition/index.d.ts +18 -0
- package/types/combo-list/src/composition/use-combo-list.d.ts +30 -0
- package/types/combo-list/src/composition/use-option.d.ts +19 -0
- package/types/combo-list/src/composition/use-options.d.ts +2 -0
- package/types/combo-list/src/composition/use-panel.d.ts +8 -0
- package/types/combo-list/src/const.d.ts +40 -0
- package/types/combo-list/src/types.d.ts +186 -0
- package/types/data-grid/index.d.ts +23 -0
- package/types/data-grid/src/components/data/data-area.component.d.ts +21 -0
- package/types/data-grid/src/components/editors/date-picker.component.d.ts +2 -0
- package/types/data-grid/src/components/editors/text-area-editor.component.d.ts +2 -0
- package/types/data-grid/src/components/editors/text-editor.component.d.ts +17 -0
- package/types/data-grid/src/components/header/data-grid-header.component.d.ts +22 -0
- package/types/data-grid/src/components/pagination/data-grid-pagination.component.d.ts +5 -0
- package/types/data-grid/src/components/scrollbar/horizontal-scrollbar.component.d.ts +21 -0
- package/types/data-grid/src/components/scrollbar/vertical-scrollbar.component.d.ts +21 -0
- package/types/data-grid/src/components/sidebar/data-grid-sidebar.component.d.ts +21 -0
- package/types/data-grid/src/components/summary/data-grid-summary.component.d.ts +5 -0
- package/types/data-grid/src/composition/types.d.ts +175 -0
- package/types/data-grid/src/composition/use-column.d.ts +17 -0
- package/types/data-grid/src/composition/use-data-view.d.ts +19 -0
- package/types/data-grid/src/composition/use-edit.d.ts +18 -0
- package/types/data-grid/src/composition/use-fit-column.d.ts +20 -0
- package/types/data-grid/src/composition/use-group-column.d.ts +22 -0
- package/types/data-grid/src/composition/use-group-data.d.ts +3 -0
- package/types/data-grid/src/composition/use-positon-style.d.ts +20 -0
- package/types/data-grid/src/composition/use-resize.d.ts +20 -0
- package/types/data-grid/src/composition/use-row.d.ts +3 -0
- package/types/data-grid/src/composition/use-sidebar.d.ts +3 -0
- package/types/data-grid/src/composition/use-virtual-scroll.d.ts +20 -0
- package/types/data-grid/src/composition/use-visual-data.d.ts +19 -0
- package/types/data-grid/src/data-grid.component.d.ts +278 -0
- package/types/data-grid/src/data-grid.props.d.ts +650 -0
- package/types/date-picker/index.d.ts +28 -0
- package/types/date-picker/src/components/calendar/calendar.component.d.ts +166 -0
- package/types/date-picker/src/components/calendar/calendar.props.d.ts +94 -0
- package/types/date-picker/src/components/calendar-navbar/calendar-navbar.component.d.ts +138 -0
- package/types/date-picker/src/components/calendar-navbar/calendar-navbar.props.d.ts +81 -0
- package/types/date-picker/src/components/date-picker-container/date-picker-container.component.d.ts +626 -0
- package/types/date-picker/src/components/date-picker-container/date-picker-container.props.d.ts +306 -0
- package/types/date-picker/src/components/month/month.component.d.ts +86 -0
- package/types/date-picker/src/components/month/month.props.d.ts +57 -0
- package/types/date-picker/src/components/year/year.component.d.ts +86 -0
- package/types/date-picker/src/components/year/year.props.d.ts +57 -0
- package/types/date-picker/src/composition/types.d.ts +102 -0
- package/types/date-picker/src/composition/use-calendar.d.ts +2 -0
- package/types/date-picker/src/composition/use-compare.d.ts +2 -0
- package/types/date-picker/src/composition/use-date.d.ts +2 -0
- package/types/date-picker/src/composition/use-disable-date.d.ts +18 -0
- package/types/date-picker/src/composition/use-disable-month.d.ts +2 -0
- package/types/date-picker/src/composition/use-event.d.ts +45 -0
- package/types/date-picker/src/composition/use-mark.d.ts +2 -0
- package/types/date-picker/src/composition/use-month.d.ts +2 -0
- package/types/date-picker/src/composition/use-number.d.ts +2 -0
- package/types/date-picker/src/composition/use-year.d.ts +2 -0
- package/types/date-picker/src/date-picker.props.d.ts +168 -0
- package/types/date-picker/src/types/calendar.d.ts +30 -0
- package/types/date-picker/src/types/common.d.ts +42 -0
- package/types/date-picker/src/types/date-model.d.ts +38 -0
- package/types/date-picker/src/types/month.d.ts +48 -0
- package/types/date-picker/src/types/year.d.ts +24 -0
- package/types/index.d.ts +20 -0
- package/types/list-view/index.d.ts +23 -0
- package/types/list-view/src/components/list-view-checkbox.component.d.ts +32 -0
- package/types/list-view/src/components/list-view-checkbox.props.d.ts +31 -0
- package/types/list-view/src/list-view.props.d.ts +44 -0
- package/types/message-box/index.d.ts +24 -0
- package/types/message-box/src/composition/types.d.ts +18 -0
- package/types/message-box/src/composition/use-copy.d.ts +18 -0
- package/types/message-box/src/message-box.component.d.ts +72 -0
- package/types/message-box/src/message-box.props.d.ts +52 -0
- package/types/modal/index.d.ts +23 -0
- package/types/modal/src/modal.component.d.ts +104 -0
- package/types/modal/src/modal.props.d.ts +72 -0
- package/types/notify/index.d.ts +26 -0
- package/types/notify/src/components/toast.component.d.ts +21 -0
- package/types/notify/src/components/toast.props.d.ts +27 -0
- package/types/notify/src/notify.props.d.ts +99 -0
- package/types/number-range/index.d.ts +23 -0
- package/types/number-range/src/composition/types.d.ts +52 -0
- package/types/number-range/src/composition/use-data.d.ts +19 -0
- package/types/number-range/src/composition/use-util.d.ts +19 -0
- package/types/number-range/src/number-range.component.d.ts +247 -0
- package/types/number-range/src/number-range.props.d.ts +216 -0
- package/types/number-spinner/index.d.ts +23 -0
- package/types/number-spinner/src/composition/types.d.ts +52 -0
- package/types/number-spinner/src/composition/use-data.d.ts +19 -0
- package/types/number-spinner/src/composition/use-util.d.ts +19 -0
- package/types/number-spinner/src/number-spinner.component.d.ts +202 -0
- package/types/number-spinner/src/number-spinner.props.d.ts +181 -0
- package/types/overlay/src/overlay.component.d.ts +20 -0
- package/types/overlay/src/overlay.props.d.ts +26 -0
- package/types/pagination/index.d.ts +23 -0
- package/types/pagination/src/components/buttons/goto-buttons.component.d.ts +19 -0
- package/types/pagination/src/components/buttons/next-buttons.component.d.ts +20 -0
- package/types/pagination/src/components/buttons/previous-buttons.component.d.ts +20 -0
- package/types/pagination/src/components/pages/page-info.component.d.ts +19 -0
- package/types/pagination/src/components/pages/page-list.component.d.ts +19 -0
- package/types/pagination/src/components/pages/page-number.component.d.ts +20 -0
- package/types/pagination/src/composition/types.d.ts +24 -0
- package/types/pagination/src/composition/use-pages.d.ts +18 -0
- package/types/pagination/src/pagination.components.d.ts +41 -0
- package/types/pagination/src/pagination.props.d.ts +36 -0
- package/types/popover/index.d.ts +24 -0
- package/types/popover/src/popover.component.d.ts +26 -0
- package/types/popover/src/popover.directive.d.ts +5 -0
- package/types/popover/src/popover.props.d.ts +30 -0
- package/types/radio-group/index.d.ts +23 -0
- package/types/radio-group/src/composition/change-radio.d.ts +19 -0
- package/types/radio-group/src/composition/types.d.ts +42 -0
- package/types/radio-group/src/radio-group.component.d.ts +91 -0
- package/types/radio-group/src/radio-group.props.d.ts +87 -0
- package/types/section/index.d.ts +23 -0
- package/types/section/src/section.component.d.ts +187 -0
- package/types/section/src/section.props.d.ts +117 -0
- package/types/switch/index.d.ts +23 -0
- package/types/switch/src/switch.component.d.ts +66 -0
- package/types/switch/src/switch.props.d.ts +52 -0
- package/types/tabs/index.d.ts +25 -0
- package/types/tabs/src/components/tab-page.component.d.ts +101 -0
- package/types/tabs/src/components/tab-page.props.d.ts +63 -0
- package/types/tabs/src/composition/types.d.ts +35 -0
- package/types/tabs/src/composition/use-tabs.d.ts +18 -0
- package/types/tabs/src/tabs.component.d.ts +149 -0
- package/types/tabs/src/tabs.props.d.ts +86 -0
- package/types/text/index.d.ts +23 -0
- package/types/text/src/text.component.d.ts +14 -0
- package/types/text/src/text.props.d.ts +26 -0
- package/types/tooltip/index.d.ts +24 -0
- package/types/tooltip/src/composition/types.d.ts +45 -0
- package/types/tooltip/src/composition/use-adjust-placement.d.ts +20 -0
- package/types/tooltip/src/composition/use-adjust-position.d.ts +6 -0
- package/types/tooltip/src/composition/use-calculate-position.d.ts +21 -0
- package/types/tooltip/src/composition/use-relative.d.ts +19 -0
- package/types/tooltip/src/composition/use-tooltip-position.d.ts +22 -0
- package/types/tooltip/src/tooltip.component.d.ts +56 -0
- package/types/tooltip/src/tooltip.props.d.ts +45 -0
- package/src/index.umd.js +0 -1
- /package/{src/style.css → style.css} +0 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { computed as d, watch as P, ref as g, defineComponent as E, createVNode as f, Teleport as H, Fragment as _, mergeProps as q, withDirectives as z, vShow as J } from "vue";
|
|
2
|
+
const Q = {
|
|
3
|
+
id: String,
|
|
4
|
+
buttonContent: { type: String, default: '<i class="f-icon f-icon-lookup"></i>' },
|
|
5
|
+
autoComplete: { type: Boolean, default: !1 },
|
|
6
|
+
customClass: { type: String, default: "" },
|
|
7
|
+
disable: { type: Boolean, default: !1 },
|
|
8
|
+
editable: { type: Boolean, default: !0 },
|
|
9
|
+
enableClear: { type: Boolean, default: !1 },
|
|
10
|
+
modelValue: { type: String, default: "" },
|
|
11
|
+
readonly: { type: Boolean, default: !1 },
|
|
12
|
+
textAlign: { type: String, default: "left" },
|
|
13
|
+
showButtonWhenDisabled: { type: Boolean, default: !1 },
|
|
14
|
+
enableTitle: { type: Boolean, default: !1 },
|
|
15
|
+
inputType: { type: String, default: "text" },
|
|
16
|
+
forcePlaceholder: { type: Boolean, default: !1 },
|
|
17
|
+
placeholder: { type: String, default: "" },
|
|
18
|
+
minLength: Number,
|
|
19
|
+
maxLength: Number,
|
|
20
|
+
tabIndex: Number
|
|
21
|
+
};
|
|
22
|
+
function X(e, n, o) {
|
|
23
|
+
const r = d(() => ({
|
|
24
|
+
"input-group-append": !0,
|
|
25
|
+
"append-force-show": e.showButtonWhenDisabled && (e.readonly || e.disable)
|
|
26
|
+
})), a = d(() => e.showButtonWhenDisabled || (!e.editable || !e.readonly) && !e.disable);
|
|
27
|
+
function l(i) {
|
|
28
|
+
a.value && (o.value = !0, n.emit("clickButton", { origin: i, value: e.modelValue })), i.stopPropagation();
|
|
29
|
+
}
|
|
30
|
+
function u(i) {
|
|
31
|
+
n.emit("mouseEnterIcon", i);
|
|
32
|
+
}
|
|
33
|
+
function s(i) {
|
|
34
|
+
n.emit("mouseLeaveIcon", i);
|
|
35
|
+
}
|
|
36
|
+
function c() {
|
|
37
|
+
n.emit("mouseOverButton");
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
buttonClass: r,
|
|
41
|
+
onClickButton: l,
|
|
42
|
+
onMouseEnterButton: u,
|
|
43
|
+
onMouseLeaveButton: s,
|
|
44
|
+
onMouseOverButton: c
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function I(e, n, o, r) {
|
|
48
|
+
const a = d(() => e.enableTitle ? o.value : ""), l = d(() => (e.disable || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), u = d(() => e.readonly || !e.editable);
|
|
49
|
+
let s = !1;
|
|
50
|
+
const c = d(() => !e.disable && s), i = d(() => ({
|
|
51
|
+
"text-left": e.textAlign === "left",
|
|
52
|
+
"text-center": e.textAlign === "center",
|
|
53
|
+
"text-right": e.textAlign === "right",
|
|
54
|
+
"form-control": !0,
|
|
55
|
+
"f-utils-fill": !0
|
|
56
|
+
}));
|
|
57
|
+
function B(t, x = !0) {
|
|
58
|
+
o.value !== t && (o.value = t, x && n.emit("change", t), n.emit("update:modelValue", t));
|
|
59
|
+
}
|
|
60
|
+
P(
|
|
61
|
+
() => e.modelValue,
|
|
62
|
+
(t) => {
|
|
63
|
+
o.value = t, n.emit("change", t);
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
function m(t) {
|
|
67
|
+
s = !1, n.emit("blur", t), t.stopPropagation();
|
|
68
|
+
}
|
|
69
|
+
function v(t) {
|
|
70
|
+
n.emit("click", t);
|
|
71
|
+
}
|
|
72
|
+
function y(t) {
|
|
73
|
+
if (e.disable) {
|
|
74
|
+
s = !0;
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
s = !0, u.value || n.emit("focus", t);
|
|
78
|
+
}
|
|
79
|
+
function b(t) {
|
|
80
|
+
n.emit("input", t.target.value);
|
|
81
|
+
const x = t.target.value;
|
|
82
|
+
r.value = x, o.value !== x && B(x, !1);
|
|
83
|
+
}
|
|
84
|
+
function T(t) {
|
|
85
|
+
t.target.tagName !== "INPUT" && t.preventDefault(), t.stopPropagation();
|
|
86
|
+
}
|
|
87
|
+
function p(t) {
|
|
88
|
+
n.emit("keydown", t);
|
|
89
|
+
}
|
|
90
|
+
function k(t) {
|
|
91
|
+
n.emit("keyup", t);
|
|
92
|
+
}
|
|
93
|
+
function w(t) {
|
|
94
|
+
const x = t.target.value;
|
|
95
|
+
B(x);
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
hasFocusedTextBox: c,
|
|
99
|
+
isTextBoxReadonly: u,
|
|
100
|
+
textBoxClass: i,
|
|
101
|
+
textBoxPlaceholder: l,
|
|
102
|
+
textBoxTitle: a,
|
|
103
|
+
changeTextBoxValue: B,
|
|
104
|
+
onBlurTextBox: m,
|
|
105
|
+
onClickTextBox: v,
|
|
106
|
+
onFocusTextBox: y,
|
|
107
|
+
onInput: b,
|
|
108
|
+
onKeyDownTextBox: p,
|
|
109
|
+
onKeyUpTextBox: k,
|
|
110
|
+
onMouseDownTextBox: T,
|
|
111
|
+
onTextBoxValueChange: w
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function Y(e, n, o, r, a) {
|
|
115
|
+
const l = g(!1), u = d(() => e.enableClear && !e.readonly && !e.disable), { changeTextBoxValue: s } = I(e, n, o, a);
|
|
116
|
+
function c(v) {
|
|
117
|
+
l.value = v;
|
|
118
|
+
}
|
|
119
|
+
P(a, () => {
|
|
120
|
+
r.value ? c(!!a.value) : c(!1);
|
|
121
|
+
});
|
|
122
|
+
function i(v) {
|
|
123
|
+
const y = !e.readonly && !e.disable && e.editable, b = !e.editable;
|
|
124
|
+
v.stopPropagation(), (y || b) && (s("", !1), c(!l.value), n.emit("clear"));
|
|
125
|
+
}
|
|
126
|
+
function B(v) {
|
|
127
|
+
if (!!u.value) {
|
|
128
|
+
if (!o.value) {
|
|
129
|
+
c(!1);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
(!e.editable || !e.readonly) && !e.disable && c(!0);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function m(v) {
|
|
136
|
+
!u.value || c(!1);
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
enableClearButton: u,
|
|
140
|
+
showClearButton: l,
|
|
141
|
+
onClearValue: i,
|
|
142
|
+
onMouseEnterTextBox: B,
|
|
143
|
+
onMouseLeaveTextBox: m
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const Z = {
|
|
147
|
+
popupContentPosition: { type: Object, default: { left: 0, top: 0 } }
|
|
148
|
+
}, $ = E({
|
|
149
|
+
name: "FOverlay",
|
|
150
|
+
props: Z,
|
|
151
|
+
emits: ["click"],
|
|
152
|
+
setup(e, n) {
|
|
153
|
+
const o = g(e.popupContentPosition);
|
|
154
|
+
function r(l) {
|
|
155
|
+
n.emit("click"), l.preventDefault(), l.stopPropagation();
|
|
156
|
+
}
|
|
157
|
+
const a = d(() => ({
|
|
158
|
+
position: "relative",
|
|
159
|
+
left: `${o.value.left}px`,
|
|
160
|
+
top: `${o.value.top}px`
|
|
161
|
+
}));
|
|
162
|
+
return () => f(H, {
|
|
163
|
+
to: "body"
|
|
164
|
+
}, {
|
|
165
|
+
default: () => {
|
|
166
|
+
var l, u;
|
|
167
|
+
return [f("div", {
|
|
168
|
+
class: "overlay-container",
|
|
169
|
+
style: "pointer-events: auto;",
|
|
170
|
+
onClick: (s) => r(s)
|
|
171
|
+
}, [f("div", {
|
|
172
|
+
style: a.value
|
|
173
|
+
}, [(u = (l = n.slots).default) == null ? void 0 : u.call(l)])])];
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}), M = E({
|
|
178
|
+
name: "FButtonEdit",
|
|
179
|
+
props: Q,
|
|
180
|
+
emits: ["updateExtendInfo", "clear", "change", "click", "clickButton", "blur", "focus", "mouseEnterIcon", "mouseLeaveIcon", "keyup", "keydown", "inputClick", "input", "update:modelValue"],
|
|
181
|
+
setup(e, n) {
|
|
182
|
+
const o = g(), r = g(e.modelValue), a = g(!1), {
|
|
183
|
+
buttonClass: l,
|
|
184
|
+
onClickButton: u,
|
|
185
|
+
onMouseEnterButton: s,
|
|
186
|
+
onMouseLeaveButton: c
|
|
187
|
+
} = X(e, n, a), i = g(""), {
|
|
188
|
+
hasFocusedTextBox: B,
|
|
189
|
+
isTextBoxReadonly: m,
|
|
190
|
+
textBoxClass: v,
|
|
191
|
+
textBoxPlaceholder: y,
|
|
192
|
+
textBoxTitle: b,
|
|
193
|
+
onBlurTextBox: T,
|
|
194
|
+
onClickTextBox: p,
|
|
195
|
+
onFocusTextBox: k,
|
|
196
|
+
onInput: w,
|
|
197
|
+
onKeyDownTextBox: t,
|
|
198
|
+
onKeyUpTextBox: x,
|
|
199
|
+
onMouseDownTextBox: L,
|
|
200
|
+
onTextBoxValueChange: S
|
|
201
|
+
} = I(e, n, r, i), {
|
|
202
|
+
enableClearButton: D,
|
|
203
|
+
showClearButton: O,
|
|
204
|
+
onClearValue: V,
|
|
205
|
+
onMouseEnterTextBox: F,
|
|
206
|
+
onMouseLeaveTextBox: K
|
|
207
|
+
} = Y(e, n, r, B, i), N = d(() => ({
|
|
208
|
+
"input-group": !0,
|
|
209
|
+
"f-state-disable": e.disable,
|
|
210
|
+
"f-state-editable": e.editable && !e.disable && !e.readonly,
|
|
211
|
+
"f-state-readonly": e.readonly && !e.disable,
|
|
212
|
+
"f-state-focus": B
|
|
213
|
+
}));
|
|
214
|
+
function A() {
|
|
215
|
+
a.value = !1;
|
|
216
|
+
}
|
|
217
|
+
const R = d(() => a.value), j = () => {
|
|
218
|
+
if (o.value) {
|
|
219
|
+
const C = o.value.getBoundingClientRect(), {
|
|
220
|
+
left: h,
|
|
221
|
+
top: W,
|
|
222
|
+
height: G
|
|
223
|
+
} = C;
|
|
224
|
+
return {
|
|
225
|
+
left: h,
|
|
226
|
+
top: W + G
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
left: 0,
|
|
231
|
+
top: 0
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
function U(C) {
|
|
235
|
+
a.value = !1;
|
|
236
|
+
}
|
|
237
|
+
return n.expose({
|
|
238
|
+
commitValue: U
|
|
239
|
+
}), () => f(_, null, [f("div", q(n.attrs, {
|
|
240
|
+
ref: o,
|
|
241
|
+
class: "f-cmp-inputgroup",
|
|
242
|
+
id: e.id
|
|
243
|
+
}), [f("div", {
|
|
244
|
+
class: [e.customClass, N.value],
|
|
245
|
+
onMouseenter: F,
|
|
246
|
+
onMouseleave: K
|
|
247
|
+
}, [f("input", {
|
|
248
|
+
name: "input-group-value",
|
|
249
|
+
autocomplete: "" + e.autoComplete,
|
|
250
|
+
class: v.value,
|
|
251
|
+
disabled: e.disable,
|
|
252
|
+
maxlength: e.maxLength,
|
|
253
|
+
minlength: e.minLength,
|
|
254
|
+
placeholder: y.value,
|
|
255
|
+
readonly: m.value,
|
|
256
|
+
tabindex: e.tabIndex,
|
|
257
|
+
title: b.value,
|
|
258
|
+
type: e.inputType,
|
|
259
|
+
value: r.value,
|
|
260
|
+
onBlur: T,
|
|
261
|
+
onChange: S,
|
|
262
|
+
onClick: p,
|
|
263
|
+
onFocus: k,
|
|
264
|
+
onInput: w,
|
|
265
|
+
onKeydown: t,
|
|
266
|
+
onKeyup: x,
|
|
267
|
+
onMousedown: L
|
|
268
|
+
}, null), f("div", {
|
|
269
|
+
class: l.value
|
|
270
|
+
}, [D.value && z(f("span", {
|
|
271
|
+
class: "input-group-text input-group-clear",
|
|
272
|
+
onClick: V
|
|
273
|
+
}, [f("i", {
|
|
274
|
+
class: "f-icon modal_close"
|
|
275
|
+
}, null)]), [[J, O.value]]), e.buttonContent && f("span", {
|
|
276
|
+
class: "input-group-text input-group-append-button",
|
|
277
|
+
onClick: u,
|
|
278
|
+
onMouseenter: s,
|
|
279
|
+
onMouseleave: c,
|
|
280
|
+
innerHTML: e.buttonContent
|
|
281
|
+
}, null)])])]), R.value && f($, {
|
|
282
|
+
"popup-content-position": j(),
|
|
283
|
+
onClick: A
|
|
284
|
+
}, {
|
|
285
|
+
default: () => {
|
|
286
|
+
var C, h;
|
|
287
|
+
return [(h = (C = n.slots).default) == null ? void 0 : h.call(C)];
|
|
288
|
+
}
|
|
289
|
+
})]);
|
|
290
|
+
}
|
|
291
|
+
}), te = {
|
|
292
|
+
install(e) {
|
|
293
|
+
e.component(M.name, M);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
export {
|
|
297
|
+
M as ButtonEdit,
|
|
298
|
+
Q as buttonEditProps,
|
|
299
|
+
te as default
|
|
300
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(m,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(m=typeof globalThis<"u"?globalThis:m||self,t(m["button-edit"]={},m.Vue))})(this,function(m,t){"use strict";const w={id:String,buttonContent:{type:String,default:'<i class="f-icon f-icon-lookup"></i>'},autoComplete:{type:Boolean,default:!1},customClass:{type:String,default:""},disable:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},enableClear:{type:Boolean,default:!1},modelValue:{type:String,default:""},readonly:{type:Boolean,default:!1},textAlign:{type:String,default:"left"},showButtonWhenDisabled:{type:Boolean,default:!1},enableTitle:{type:Boolean,default:!1},inputType:{type:String,default:"text"},forcePlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},minLength:Number,maxLength:Number,tabIndex:Number};function P(e,o,l){const f=t.computed(()=>({"input-group-append":!0,"append-force-show":e.showButtonWhenDisabled&&(e.readonly||e.disable)})),u=t.computed(()=>e.showButtonWhenDisabled||(!e.editable||!e.readonly)&&!e.disable);function a(c){u.value&&(l.value=!0,o.emit("clickButton",{origin:c,value:e.modelValue})),c.stopPropagation()}function i(c){o.emit("mouseEnterIcon",c)}function s(c){o.emit("mouseLeaveIcon",c)}function d(){o.emit("mouseOverButton")}return{buttonClass:f,onClickButton:a,onMouseEnterButton:i,onMouseLeaveButton:s,onMouseOverButton:d}}function M(e,o,l,f){const u=t.computed(()=>e.enableTitle?l.value:""),a=t.computed(()=>(e.disable||e.readonly)&&!e.forcePlaceholder?"":e.placeholder),i=t.computed(()=>e.readonly||!e.editable);let s=!1;const d=t.computed(()=>!e.disable&&s),c=t.computed(()=>({"text-left":e.textAlign==="left","text-center":e.textAlign==="center","text-right":e.textAlign==="right","form-control":!0,"f-utils-fill":!0}));function x(n,r=!0){l.value!==n&&(l.value=n,r&&o.emit("change",n),o.emit("update:modelValue",n))}t.watch(()=>e.modelValue,n=>{l.value=n,o.emit("change",n)});function g(n){s=!1,o.emit("blur",n),n.stopPropagation()}function B(n){o.emit("click",n)}function b(n){if(e.disable){s=!0;return}s=!0,i.value||o.emit("focus",n)}function y(n){o.emit("input",n.target.value);const r=n.target.value;f.value=r,l.value!==r&&x(r,!1)}function T(n){n.target.tagName!=="INPUT"&&n.preventDefault(),n.stopPropagation()}function v(n){o.emit("keydown",n)}function k(n){o.emit("keyup",n)}function V(n){const r=n.target.value;x(r)}return{hasFocusedTextBox:d,isTextBoxReadonly:i,textBoxClass:c,textBoxPlaceholder:a,textBoxTitle:u,changeTextBoxValue:x,onBlurTextBox:g,onClickTextBox:B,onFocusTextBox:b,onInput:y,onKeyDownTextBox:v,onKeyUpTextBox:k,onMouseDownTextBox:T,onTextBoxValueChange:V}}function N(e,o,l,f,u){const a=t.ref(!1),i=t.computed(()=>e.enableClear&&!e.readonly&&!e.disable),{changeTextBoxValue:s}=M(e,o,l,u);function d(B){a.value=B}t.watch(u,()=>{f.value?d(!!u.value):d(!1)});function c(B){const b=!e.readonly&&!e.disable&&e.editable,y=!e.editable;B.stopPropagation(),(b||y)&&(s("",!1),d(!a.value),o.emit("clear"))}function x(B){if(!!i.value){if(!l.value){d(!1);return}(!e.editable||!e.readonly)&&!e.disable&&d(!0)}}function g(B){!i.value||d(!1)}return{enableClearButton:i,showClearButton:a,onClearValue:c,onMouseEnterTextBox:x,onMouseLeaveTextBox:g}}const E={popupContentPosition:{type:Object,default:{left:0,top:0}}},S=t.defineComponent({name:"FOverlay",props:E,emits:["click"],setup(e,o){const l=t.ref(e.popupContentPosition);function f(a){o.emit("click"),a.preventDefault(),a.stopPropagation()}const u=t.computed(()=>({position:"relative",left:`${l.value.left}px`,top:`${l.value.top}px`}));return()=>t.createVNode(t.Teleport,{to:"body"},{default:()=>{var a,i;return[t.createVNode("div",{class:"overlay-container",style:"pointer-events: auto;",onClick:s=>f(s)},[t.createVNode("div",{style:u.value},[(i=(a=o.slots).default)==null?void 0:i.call(a)])])]}})}}),p=t.defineComponent({name:"FButtonEdit",props:w,emits:["updateExtendInfo","clear","change","click","clickButton","blur","focus","mouseEnterIcon","mouseLeaveIcon","keyup","keydown","inputClick","input","update:modelValue"],setup(e,o){const l=t.ref(),f=t.ref(e.modelValue),u=t.ref(!1),{buttonClass:a,onClickButton:i,onMouseEnterButton:s,onMouseLeaveButton:d}=P(e,o,u),c=t.ref(""),{hasFocusedTextBox:x,isTextBoxReadonly:g,textBoxClass:B,textBoxPlaceholder:b,textBoxTitle:y,onBlurTextBox:T,onClickTextBox:v,onFocusTextBox:k,onInput:V,onKeyDownTextBox:n,onKeyUpTextBox:r,onMouseDownTextBox:L,onTextBoxValueChange:O}=M(e,o,f,c),{enableClearButton:D,showClearButton:F,onClearValue:K,onMouseEnterTextBox:j,onMouseLeaveTextBox:A}=N(e,o,f,x,c),R=t.computed(()=>({"input-group":!0,"f-state-disable":e.disable,"f-state-editable":e.editable&&!e.disable&&!e.readonly,"f-state-readonly":e.readonly&&!e.disable,"f-state-focus":x}));function U(){u.value=!1}const W=t.computed(()=>u.value),_=()=>{if(l.value){const C=l.value.getBoundingClientRect(),{left:h,top:G,height:H}=C;return{left:h,top:G+H}}return{left:0,top:0}};function q(C){u.value=!1}return o.expose({commitValue:q}),()=>t.createVNode(t.Fragment,null,[t.createVNode("div",t.mergeProps(o.attrs,{ref:l,class:"f-cmp-inputgroup",id:e.id}),[t.createVNode("div",{class:[e.customClass,R.value],onMouseenter:j,onMouseleave:A},[t.createVNode("input",{name:"input-group-value",autocomplete:""+e.autoComplete,class:B.value,disabled:e.disable,maxlength:e.maxLength,minlength:e.minLength,placeholder:b.value,readonly:g.value,tabindex:e.tabIndex,title:y.value,type:e.inputType,value:f.value,onBlur:T,onChange:O,onClick:v,onFocus:k,onInput:V,onKeydown:n,onKeyup:r,onMousedown:L},null),t.createVNode("div",{class:a.value},[D.value&&t.withDirectives(t.createVNode("span",{class:"input-group-text input-group-clear",onClick:K},[t.createVNode("i",{class:"f-icon modal_close"},null)]),[[t.vShow,F.value]]),e.buttonContent&&t.createVNode("span",{class:"input-group-text input-group-append-button",onClick:i,onMouseenter:s,onMouseleave:d,innerHTML:e.buttonContent},null)])])]),W.value&&t.createVNode(S,{"popup-content-position":_(),onClick:U},{default:()=>{var C,h;return[(h=(C=o.slots).default)==null?void 0:h.call(C)]}})])}}),I={install(e){e.component(p.name,p)}};m.ButtonEdit=p,m.buttonEditProps=w,m.default=I,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { computed as x, ref as v, defineComponent as p, createVNode as m } from "vue";
|
|
2
|
+
const V = {
|
|
3
|
+
id: String,
|
|
4
|
+
name: { type: String, default: "" },
|
|
5
|
+
enumData: { type: Array, default: [] },
|
|
6
|
+
textField: { type: String, default: "name" },
|
|
7
|
+
valueField: { type: String, default: "value" },
|
|
8
|
+
horizontal: { type: Boolean, default: !1 },
|
|
9
|
+
disable: { type: Boolean, default: !1 },
|
|
10
|
+
modelValue: [String, Array],
|
|
11
|
+
tabIndex: { type: Number, default: 0 },
|
|
12
|
+
separator: { type: String, default: "," },
|
|
13
|
+
isStringValue: { type: Boolean, default: !0 },
|
|
14
|
+
loadData: { type: Function }
|
|
15
|
+
};
|
|
16
|
+
function y(e, i, l) {
|
|
17
|
+
const h = x(() => !e.disable), s = v(e.enumData);
|
|
18
|
+
function o(t) {
|
|
19
|
+
return t[e.valueField];
|
|
20
|
+
}
|
|
21
|
+
function d(t) {
|
|
22
|
+
return t[e.textField];
|
|
23
|
+
}
|
|
24
|
+
function f(t) {
|
|
25
|
+
return t ? e.isStringValue ? t.split(e.separator) : t : [];
|
|
26
|
+
}
|
|
27
|
+
function g(t) {
|
|
28
|
+
const a = s.value.map((n) => o(n)).filter((n) => t.some((c) => c === n));
|
|
29
|
+
return e.isStringValue ? a.join(e.separator) : a;
|
|
30
|
+
}
|
|
31
|
+
function u(t) {
|
|
32
|
+
const r = String(o(t));
|
|
33
|
+
return f(l.value).some((n) => n === r);
|
|
34
|
+
}
|
|
35
|
+
function b(t, r) {
|
|
36
|
+
if (h.value) {
|
|
37
|
+
let a = f(l.value) || [];
|
|
38
|
+
const n = String(o(t));
|
|
39
|
+
!a || !a.length ? a.push(n) : a.some((c) => c === n) ? a = a.filter((c) => c !== n) : a.push(n), l.value = g(a), i.emit("changeValue", l.value), i.emit("update:modelValue", l.value);
|
|
40
|
+
}
|
|
41
|
+
r.stopPropagation();
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
enumData: s,
|
|
45
|
+
getValue: o,
|
|
46
|
+
getText: d,
|
|
47
|
+
checked: u,
|
|
48
|
+
onClickCheckbox: b
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const k = p({
|
|
52
|
+
name: "FCheckboxGroup",
|
|
53
|
+
props: V,
|
|
54
|
+
emits: ["changeValue", "update:modelValue"],
|
|
55
|
+
setup(e, i) {
|
|
56
|
+
const l = v(e.modelValue), {
|
|
57
|
+
enumData: h,
|
|
58
|
+
onClickCheckbox: s,
|
|
59
|
+
getValue: o,
|
|
60
|
+
getText: d,
|
|
61
|
+
checked: f
|
|
62
|
+
} = y(e, i, l), g = x(() => ({
|
|
63
|
+
"farris-checkradio-hor": e.horizontal
|
|
64
|
+
}));
|
|
65
|
+
return () => m("div", {
|
|
66
|
+
class: ["farris-input-wrap", g.value]
|
|
67
|
+
}, [h.value.map((u, b) => {
|
|
68
|
+
const t = "checkbox_" + e.name + b;
|
|
69
|
+
return m("div", {
|
|
70
|
+
class: "custom-control custom-checkbox"
|
|
71
|
+
}, [m("input", {
|
|
72
|
+
type: "checkbox",
|
|
73
|
+
class: "custom-control-input",
|
|
74
|
+
name: e.name,
|
|
75
|
+
id: t,
|
|
76
|
+
value: o(u),
|
|
77
|
+
checked: f(u),
|
|
78
|
+
disabled: e.disable,
|
|
79
|
+
tabindex: e.tabIndex,
|
|
80
|
+
onClick: (r) => s(u, r)
|
|
81
|
+
}, null), m("label", {
|
|
82
|
+
class: "custom-control-label",
|
|
83
|
+
for: t,
|
|
84
|
+
title: d(u)
|
|
85
|
+
}, [d(u)])]);
|
|
86
|
+
})]);
|
|
87
|
+
}
|
|
88
|
+
}), C = {
|
|
89
|
+
install(e) {
|
|
90
|
+
e.component(k.name, k);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
export {
|
|
94
|
+
k as CheckBoxGroup,
|
|
95
|
+
V as checkboxGroupProps,
|
|
96
|
+
C as default
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(u,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(u=typeof globalThis<"u"?globalThis:u||self,n(u.checkbox={},u.Vue))})(this,function(u,n){"use strict";const x={id:String,name:{type:String,default:""},enumData:{type:Array,default:[]},textField:{type:String,default:"name"},valueField:{type:String,default:"value"},horizontal:{type:Boolean,default:!1},disable:{type:Boolean,default:!1},modelValue:[String,Array],tabIndex:{type:Number,default:0},separator:{type:String,default:","},isStringValue:{type:Boolean,default:!0},loadData:{type:Function}};function V(e,s,l){const g=n.computed(()=>!e.disable),f=n.ref(e.enumData);function c(t){return t[e.valueField]}function m(t){return t[e.textField]}function h(t){return t?e.isStringValue?t.split(e.separator):t:[]}function k(t){const a=f.value.map(o=>c(o)).filter(o=>t.some(d=>d===o));return e.isStringValue?a.join(e.separator):a}function r(t){const i=String(c(t));return h(l.value).some(o=>o===i)}function p(t,i){if(g.value){let a=h(l.value)||[];const o=String(c(t));!a||!a.length?a.push(o):a.some(d=>d===o)?a=a.filter(d=>d!==o):a.push(o),l.value=k(a),s.emit("changeValue",l.value),s.emit("update:modelValue",l.value)}i.stopPropagation()}return{enumData:f,getValue:c,getText:m,checked:r,onClickCheckbox:p}}const b=n.defineComponent({name:"FCheckboxGroup",props:x,emits:["changeValue","update:modelValue"],setup(e,s){const l=n.ref(e.modelValue),{enumData:g,onClickCheckbox:f,getValue:c,getText:m,checked:h}=V(e,s,l),k=n.computed(()=>({"farris-checkradio-hor":e.horizontal}));return()=>n.createVNode("div",{class:["farris-input-wrap",k.value]},[g.value.map((r,p)=>{const t="checkbox_"+e.name+p;return n.createVNode("div",{class:"custom-control custom-checkbox"},[n.createVNode("input",{type:"checkbox",class:"custom-control-input",name:e.name,id:t,value:c(r),checked:h(r),disabled:e.disable,tabindex:e.tabIndex,onClick:i=>f(r,i)},null),n.createVNode("label",{class:"custom-control-label",for:t,title:m(r)},[m(r)])])})])}}),y={install(e){e.component(b.name,b)}};u.CheckBoxGroup=b,u.checkboxGroupProps=x,u.default=y,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|