@daracl/form 0.0.20 → 0.0.22
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/README.md +51 -18
- package/dist/daracl.form.css +308 -159
- package/dist/daracl.form.min.css +1 -10
- package/dist/daracl.form.min.umd.js +36 -41
- package/dist/daracl.form.min.umd.js.map +1 -1
- package/dist/daracl.form.umd.js +221 -226
- package/dist/daracl.form.umd.js.map +1 -1
- package/dist/defaultOption.d.ts +3 -0
- package/dist/index.cjs +104 -1537
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +58 -1491
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +33 -98
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +471 -1384
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.d.ts +1 -0
- package/dist/util/utils.d.ts +8 -30
- package/package.json +37 -49
- package/style/base/_base.scss +7 -6
- package/style/components/_button.scss +5 -4
- package/style/components/_field-container.scss +4 -3
- package/style/components/_field-group.scss +1 -1
- package/style/components/_file-list.scss +3 -2
- package/style/components/_form-field.scss +10 -4
- package/style/components/_form-group.scss +8 -7
- package/style/components/_grid-field.scss +12 -11
- package/style/components/_icon.scss +2 -1
- package/style/components/_label.scss +9 -8
- package/style/components/_tab.scss +8 -7
- package/style/daracl.form.scss +17 -31
- package/style/themes/_common.scss +0 -18
- package/style/themes/_dark.scss +0 -32
- package/style/themes/_index.scss +0 -14
- package/style/themes/_light.scss +0 -26
- package/style/themes/_mixin.scss +0 -6
package/dist/index.min.js
CHANGED
|
@@ -1,93 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'"': """,
|
|
12
|
-
"'": "'"
|
|
13
|
-
}, Q = (l) => {
|
|
14
|
-
let e = l;
|
|
15
|
-
return e && Object.keys(ae).forEach((t) => {
|
|
16
|
-
e = e.replaceAll(t, ae[t]);
|
|
17
|
-
}), e;
|
|
18
|
-
}, He = (l, e) => l.hasOwnProperty(e), D = (l) => l === null || l === "" || typeof l > "u" || typeof l == "string" && (l === "" || l.replace(/\s/g, "") === ""), y = (l) => typeof l > "u", be = (l) => typeof l == "function", oe = (l) => typeof l == "string", M = (l) => D(l) ? !1 : (l = +l, !isNaN(l)), L = (l) => Se(l), C = (l) => y(l) || l == null, j = (l) => l && l.renderType === "tab", Le = (l) => l && l.renderType === "grid", Ye = (l) => (l.$xssName = Te(l), l.label = Q(l.label), l), Ce = (l) => Le(l.$parent) || j(l.$parent), Te = (l) => {
|
|
19
|
-
if (y(l.$xssName)) {
|
|
20
|
-
let e = l.name;
|
|
21
|
-
return e && Object.keys(ae).forEach((t) => {
|
|
22
|
-
e = e.replaceAll(t, "_");
|
|
23
|
-
}), "df_" + e;
|
|
24
|
-
}
|
|
25
|
-
return l.$xssName;
|
|
26
|
-
}, _e = (l) => {
|
|
27
|
-
let e = 0;
|
|
28
|
-
if (l.length == 0) return e;
|
|
29
|
-
for (let t = 0; t < l.length; t++) {
|
|
30
|
-
let i = l.charCodeAt(t);
|
|
31
|
-
e = (e << 5) - e + i, e = e & e;
|
|
32
|
-
}
|
|
33
|
-
return String(e).replaceAll(/-/g, "_");
|
|
34
|
-
}, je = (l) => l.renderType === "hidden", z = (l) => {
|
|
35
|
-
const e = document.createElement("template");
|
|
36
|
-
return e.innerHTML = l, e.content.firstElementChild;
|
|
37
|
-
};
|
|
38
|
-
function de(l) {
|
|
39
|
-
if (typeof l != "object" || l === null)
|
|
40
|
-
return !1;
|
|
41
|
-
let e = l;
|
|
42
|
-
for (; Object.getPrototypeOf(e) !== null; )
|
|
43
|
-
e = Object.getPrototypeOf(e);
|
|
44
|
-
return Object.getPrototypeOf(l) === e;
|
|
45
|
-
}
|
|
46
|
-
function ke(l) {
|
|
47
|
-
return typeof l == "object" && l !== null && !L(l);
|
|
48
|
-
}
|
|
49
|
-
function ze(l) {
|
|
50
|
-
return l instanceof Date && !isNaN(l.valueOf());
|
|
51
|
-
}
|
|
52
|
-
const he = (...l) => {
|
|
53
|
-
let e = l[0];
|
|
54
|
-
if (!de(e) || C(e))
|
|
55
|
-
return e;
|
|
56
|
-
let t = 1;
|
|
57
|
-
Object.keys(e).length > 0 && (t = 0, e = L(e) ? [] : {});
|
|
58
|
-
const i = l.length;
|
|
59
|
-
for (; t < i; t += 1)
|
|
60
|
-
G(e, l[t]);
|
|
61
|
-
return e;
|
|
62
|
-
};
|
|
63
|
-
function G(l, e) {
|
|
64
|
-
return ke(e) ? We(l, e) : L(e) ? Pe(l, e) : ze(e) ? new e.constructor(e) : e;
|
|
65
|
-
}
|
|
66
|
-
function We(l, e) {
|
|
67
|
-
if (be(e))
|
|
68
|
-
return e;
|
|
69
|
-
for (const t of Object.keys(e)) {
|
|
70
|
-
const i = e[t];
|
|
71
|
-
y(i) || (i === null || be(i) ? l[t] = i : C(l[t]) ? l[t] = G(L(i) ? [] : {}, i) : ke(i) ? G(l[t], i) : l[t] = i);
|
|
72
|
-
}
|
|
73
|
-
return l;
|
|
74
|
-
}
|
|
75
|
-
function Pe(l, e) {
|
|
76
|
-
const t = de(l);
|
|
77
|
-
for (let i = 0; i < e.length; i += 1) {
|
|
78
|
-
const s = e[i];
|
|
79
|
-
let n;
|
|
80
|
-
s == null ? n = s : n = G(L(s) ? [] : {}, s), t ? l[i] = n : l.push(n);
|
|
81
|
-
}
|
|
82
|
-
return l;
|
|
83
|
-
}
|
|
84
|
-
class f {
|
|
1
|
+
import { xss as j, isPlainObject as re, objectDeepMerge as pe, isUndefined as g, isBlank as F, isNumeric as ge, isString as K, isArray as I, isNil as w, resolveClassName as W, isFunction as ve, templateToElement as N, hasProperty as oe, getHashCode as $e } from "@daracl/core/utils";
|
|
2
|
+
import { DateTimePicker as Ee } from "@daracl/datetimepicker";
|
|
3
|
+
const E = (n) => !F(n) && ge(+n, !0), k = (n) => (n == null ? void 0 : n.renderType) === "tab", de = (n) => (n == null ? void 0 : n.renderType) === "grid", ye = (n) => (n.$xssName = he(n), n.label = j(n.label), n), ue = (n) => de(n.$parent) || k(n.$parent), he = (n) => {
|
|
4
|
+
if (g(n.$xssName)) {
|
|
5
|
+
let e = n.name;
|
|
6
|
+
return e && (e = e.replace(/[&<>"']/g, "_")), "df_" + e;
|
|
7
|
+
}
|
|
8
|
+
return n.$xssName;
|
|
9
|
+
}, Fe = (n) => (n == null ? void 0 : n.renderType) === "hidden", X = (...n) => re(n[0]) ? pe(...n, {}) : n[0];
|
|
10
|
+
class c {
|
|
85
11
|
constructor(e, t, i) {
|
|
86
12
|
var s;
|
|
87
13
|
this.enableView = !0, this.daraForm = e, this.field = t, this.rowElement = i, this.createField(), t.tooltip && ((s = i.querySelector(".df-tooltip")) == null || s.setAttribute("tooltip", t.tooltip));
|
|
88
14
|
}
|
|
89
15
|
setDefaultInfo() {
|
|
90
|
-
if (
|
|
16
|
+
if (g(this.field.defaultValue) ? this.setValue("", !1) : this.setValue(this.field.defaultValue, !1), !g(this.field.placeholder)) {
|
|
91
17
|
const e = this.getElement();
|
|
92
18
|
e instanceof Element && e.setAttribute("placeholder", this.field.placeholder);
|
|
93
19
|
}
|
|
@@ -111,11 +37,11 @@ class f {
|
|
|
111
37
|
setValueItems(e) {
|
|
112
38
|
}
|
|
113
39
|
static getDescriptionTemplate(e) {
|
|
114
|
-
const t = e.descriptionClass ?
|
|
40
|
+
const t = e.descriptionClass ? j(e.descriptionClass) : "", i = e.descriptionStyle ? 'style="' + j(e.descriptionStyle) + '"' : "";
|
|
115
41
|
return e.description ? `<div class="df-description ${t}" ${i}>${e.description}</div>` : "";
|
|
116
42
|
}
|
|
117
43
|
changeEventCall(e, t, i, s) {
|
|
118
|
-
var
|
|
44
|
+
var l;
|
|
119
45
|
if (e.onChange) {
|
|
120
46
|
let a = {
|
|
121
47
|
field: e,
|
|
@@ -123,19 +49,19 @@ class f {
|
|
|
123
49
|
oldValue: e.$value,
|
|
124
50
|
value: s
|
|
125
51
|
};
|
|
126
|
-
if ((
|
|
127
|
-
let
|
|
128
|
-
const
|
|
52
|
+
if ((l = e.listItem) != null && l.list) {
|
|
53
|
+
let r = [];
|
|
54
|
+
const o = c.valuesValueKey(e);
|
|
129
55
|
for (let d of e.listItem.list) {
|
|
130
|
-
let
|
|
131
|
-
if (
|
|
132
|
-
if (
|
|
133
|
-
|
|
56
|
+
let u = d[o];
|
|
57
|
+
if (K(s)) {
|
|
58
|
+
if (u == s) {
|
|
59
|
+
r.push(d);
|
|
134
60
|
break;
|
|
135
61
|
}
|
|
136
|
-
} else
|
|
62
|
+
} else I(s) && s.includes(u) && r.push(d);
|
|
137
63
|
}
|
|
138
|
-
a.valueItems =
|
|
64
|
+
a.valueItems = r;
|
|
139
65
|
}
|
|
140
66
|
if (a.oldValue != a.value && e.onChange.call(null, a) === !1)
|
|
141
67
|
return i.setValue(e.$value, !1), !1;
|
|
@@ -169,9 +95,9 @@ class f {
|
|
|
169
95
|
else {
|
|
170
96
|
const s = this.rowElement.querySelector(".df-field");
|
|
171
97
|
if (s) {
|
|
172
|
-
const
|
|
98
|
+
const l = new DOMParser();
|
|
173
99
|
this.field.description = e;
|
|
174
|
-
const a =
|
|
100
|
+
const a = l.parseFromString(c.getDescriptionTemplate(this.field), "text/html").querySelector(".df-description");
|
|
175
101
|
a && ((i = s.parentNode) == null || i.insertBefore(a, s.nextSibling));
|
|
176
102
|
}
|
|
177
103
|
}
|
|
@@ -193,11 +119,11 @@ class f {
|
|
|
193
119
|
}
|
|
194
120
|
static valuesLabelValue(e, t) {
|
|
195
121
|
let i = !1;
|
|
196
|
-
const s = e.replace(/\{\{([A-Za-z0-9_.]*)\}\}/g, (
|
|
122
|
+
const s = e.replace(/\{\{([A-Za-z0-9_.]*)\}\}/g, (l, a) => (i = !0, t[a] || ""));
|
|
197
123
|
return i ? s : t[e] || "";
|
|
198
124
|
}
|
|
199
125
|
}
|
|
200
|
-
const
|
|
126
|
+
const be = {
|
|
201
127
|
mobile: /^\d{3}-\d{3,4}-\d{4}$/,
|
|
202
128
|
email: /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
203
129
|
url: /^(?:(?:https?|HTTPS?|ftp|FTP):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)(?:\.(?:[a-zA-Z\u00a1-\uffff0-9]-*)*[a-zA-Z\u00a1-\uffff0-9]+)*(?:\.(?:[a-zA-Z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/,
|
|
@@ -209,44 +135,44 @@ const Be = {
|
|
|
209
135
|
"upper-char": /^(?=.*?[A-Z])(?=.*?[a-z])/,
|
|
210
136
|
"upper-char-special": /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[#?!@$%^&*-])/,
|
|
211
137
|
"upper-char-special-number": /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!%*#?&])[A-Za-z\d@$!%*#?&]/
|
|
212
|
-
},
|
|
138
|
+
}, ce = (n, e, t) => {
|
|
213
139
|
if (!e.$instance.isEnableView())
|
|
214
140
|
return { name: e.name, constraint: [] };
|
|
215
141
|
typeof t > "u" && (t = { name: e.name, constraint: [] });
|
|
216
142
|
const i = e.regexpType;
|
|
217
|
-
return i && !
|
|
218
|
-
},
|
|
219
|
-
if (e.validator && (t.validator = e.validator(e,
|
|
143
|
+
return i && !be[i].test(n) && (t.regexp = i), t;
|
|
144
|
+
}, fe = (n, e, t) => {
|
|
145
|
+
if (e.validator && (t.validator = e.validator(e, n), typeof t.validator == "object") || (t = ce(n, e, t), t.regexp))
|
|
220
146
|
return t;
|
|
221
147
|
if (e.different) {
|
|
222
148
|
const i = e.different.field, s = e.$instance.getForm().getField(i);
|
|
223
|
-
if (!
|
|
149
|
+
if (!w(s) && e.$instance.getValue() == s.$instance.getValue())
|
|
224
150
|
return t.message = e.different.message, t;
|
|
225
151
|
}
|
|
226
152
|
if (e.identical) {
|
|
227
153
|
const i = e.identical.field, s = e.$instance.getForm().getField(i);
|
|
228
|
-
if (!
|
|
154
|
+
if (!w(s) && e.$instance.getValue() != s.$instance.getValue())
|
|
229
155
|
return t.message = e.identical.message, t;
|
|
230
156
|
}
|
|
231
157
|
return !0;
|
|
232
|
-
},
|
|
158
|
+
}, U = (n, e) => {
|
|
233
159
|
if (!e.$instance.isEnableView())
|
|
234
160
|
return !0;
|
|
235
|
-
const t = { name: e.name, constraint: [] }, i = Number(
|
|
236
|
-
if (e.required &&
|
|
237
|
-
return t.constraint.push(
|
|
238
|
-
if (!
|
|
239
|
-
return t.constraint.push(
|
|
240
|
-
if (
|
|
161
|
+
const t = { name: e.name, constraint: [] }, i = Number(n);
|
|
162
|
+
if (e.required && F(n))
|
|
163
|
+
return t.constraint.push(p.REQUIRED), t;
|
|
164
|
+
if (!E(n))
|
|
165
|
+
return t.constraint.push(p.NAN), t;
|
|
166
|
+
if (fe(n, e, t) !== !0)
|
|
241
167
|
return t;
|
|
242
168
|
const s = e.rule;
|
|
243
169
|
if (s) {
|
|
244
|
-
const
|
|
245
|
-
let
|
|
246
|
-
|
|
170
|
+
const l = E(s.minimum), a = E(s.maximum);
|
|
171
|
+
let r = !1, o = !1, d = !1, u = !1;
|
|
172
|
+
l && (s.exclusiveMinimum && i <= s.minimum ? o = !0 : i < s.minimum && (r = !0)), a && (s.exclusiveMaximum && i >= s.maximum ? u = !0 : i > s.maximum && (d = !0)), l && a && (r || o || d || u) ? s.exclusiveMinimum && s.exclusiveMaximum && (o || u) ? t.constraint.push(p.BETWEEN_EXCLUSIVE_MINMAX) : o ? t.constraint.push(p.BETWEEN_EXCLUSIVE_MIN) : u ? t.constraint.push(p.BETWEEN_EXCLUSIVE_MAX) : t.constraint.push(p.BETWEEN) : (o && t.constraint.push(p.EXCLUSIVE_MIN), u && t.constraint.push(p.EXCLUSIVE_MAX), r && t.constraint.push(p.MIN), d && t.constraint.push(p.MAX));
|
|
247
173
|
}
|
|
248
174
|
return t.constraint.length > 0 ? t : !0;
|
|
249
|
-
},
|
|
175
|
+
}, v = (n, e, t) => {
|
|
250
176
|
if (t === !0) {
|
|
251
177
|
e.classList.remove("invalid"), e.classList.contains("valid") || e.classList.add("valid");
|
|
252
178
|
const i = e.querySelector(".df-help-message");
|
|
@@ -254,40 +180,40 @@ const Be = {
|
|
|
254
180
|
return;
|
|
255
181
|
}
|
|
256
182
|
if (e.classList.remove("valid"), e.classList.contains("invalid") || e.classList.add("invalid"), t !== !1) {
|
|
257
|
-
const i =
|
|
183
|
+
const i = V.validMessage(n, t);
|
|
258
184
|
t.message && i.push(t.message);
|
|
259
185
|
const s = e.querySelector(".df-help-message");
|
|
260
186
|
if (s && i.length > 0) {
|
|
261
|
-
const
|
|
187
|
+
const l = [];
|
|
262
188
|
i.forEach((a) => {
|
|
263
|
-
|
|
264
|
-
}), s.innerHTML =
|
|
189
|
+
l.push(`<div>${a}</div>`);
|
|
190
|
+
}), s.innerHTML = l.join("");
|
|
265
191
|
}
|
|
266
192
|
}
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
},
|
|
193
|
+
}, $ = (n) => {
|
|
194
|
+
n.classList.remove("invalid"), n.classList.remove("valid");
|
|
195
|
+
}, B = (n, e, t) => {
|
|
270
196
|
e.addEventListener("input", (i) => {
|
|
271
|
-
|
|
197
|
+
x(n, i, t, t.getValue()), t.valid();
|
|
272
198
|
});
|
|
273
|
-
},
|
|
199
|
+
}, Ve = (n, e, t) => {
|
|
274
200
|
e.addEventListener("keyup", (i) => {
|
|
275
201
|
const s = i.target.value;
|
|
276
|
-
|
|
202
|
+
E(s) || (e.value = s.replace(/[^0-9\.\-\+]/g, ""), i.preventDefault()), x(n, i, t, t.getValue()), t.valid();
|
|
277
203
|
});
|
|
278
|
-
},
|
|
204
|
+
}, we = (n, e, t) => {
|
|
279
205
|
e.addEventListener("change", (i) => {
|
|
280
|
-
|
|
206
|
+
x(n, i, t, t.getValue()), t.valid();
|
|
281
207
|
});
|
|
282
|
-
},
|
|
283
|
-
t.changeEventCall(
|
|
208
|
+
}, x = (n, e, t, i) => {
|
|
209
|
+
t.changeEventCall(n, e, t, i);
|
|
284
210
|
};
|
|
285
|
-
class
|
|
211
|
+
class xe extends c {
|
|
286
212
|
constructor(e, t, i) {
|
|
287
213
|
super(i, e, t), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
288
214
|
}
|
|
289
215
|
mounted() {
|
|
290
|
-
|
|
216
|
+
Ve(this.field, this.element, this);
|
|
291
217
|
}
|
|
292
218
|
createField() {
|
|
293
219
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
@@ -295,7 +221,7 @@ class Ke extends f {
|
|
|
295
221
|
<div class="df-field">
|
|
296
222
|
<input type="text" name="${e.$xssName}" class="df-form-field df-number df-help-icon" />
|
|
297
223
|
</div>
|
|
298
|
-
${
|
|
224
|
+
${c.getDescriptionTemplate(e)}
|
|
299
225
|
<div class="df-help-message"></div>
|
|
300
226
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
301
227
|
}
|
|
@@ -310,40 +236,40 @@ class Ke extends f {
|
|
|
310
236
|
this.field.$value = e, this.element.value = e;
|
|
311
237
|
}
|
|
312
238
|
reset() {
|
|
313
|
-
this.setDefaultInfo(), this.setDisabled(!1),
|
|
239
|
+
this.setDefaultInfo(), this.setDisabled(!1), $(this.rowElement);
|
|
314
240
|
}
|
|
315
241
|
getElement() {
|
|
316
242
|
return this.element;
|
|
317
243
|
}
|
|
318
244
|
valid() {
|
|
319
|
-
const e =
|
|
320
|
-
return
|
|
245
|
+
const e = U(this.getValue(), this.field);
|
|
246
|
+
return v(this.field, this.rowElement, e), e;
|
|
321
247
|
}
|
|
322
248
|
}
|
|
323
|
-
const
|
|
249
|
+
const S = (n, e) => {
|
|
324
250
|
if (!e.$instance.isEnableView())
|
|
325
251
|
return !0;
|
|
326
252
|
let t = { name: e.name, constraint: [] };
|
|
327
|
-
if (e.required &&
|
|
328
|
-
return t.constraint.push(
|
|
329
|
-
const i =
|
|
253
|
+
if (e.required && F(n))
|
|
254
|
+
return t.constraint.push(p.REQUIRED), t;
|
|
255
|
+
const i = fe(n, e, t);
|
|
330
256
|
if (i !== !0)
|
|
331
257
|
return i;
|
|
332
258
|
const s = e.rule;
|
|
333
259
|
if (s) {
|
|
334
|
-
const
|
|
335
|
-
let
|
|
336
|
-
if (a &&
|
|
260
|
+
const l = n.length, a = E(s.minLength), r = E(s.maxLength);
|
|
261
|
+
let o = !1, d = !1;
|
|
262
|
+
if (a && l < s.minLength && (o = !0), r && l > s.maxLength && (d = !0), a && r && (o || d) ? t.constraint.push(p.BETWEEN) : (o && t.constraint.push(p.MIN_LENGTH), d && t.constraint.push(p.MAX_LENGTH)), t.constraint.length > 0)
|
|
337
263
|
return t;
|
|
338
264
|
}
|
|
339
265
|
return !0;
|
|
340
266
|
};
|
|
341
|
-
class
|
|
267
|
+
class Ie extends c {
|
|
342
268
|
constructor(e, t, i) {
|
|
343
269
|
super(i, e, t), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
344
270
|
}
|
|
345
271
|
mounted() {
|
|
346
|
-
|
|
272
|
+
B(this.field, this.element, this);
|
|
347
273
|
}
|
|
348
274
|
createField() {
|
|
349
275
|
var s;
|
|
@@ -353,7 +279,7 @@ class Ze extends f {
|
|
|
353
279
|
<div class="df-field">
|
|
354
280
|
<textarea name="${e.$xssName}" rows="${i}" class="df-form-field df-textarea df-help-icon"></textarea>
|
|
355
281
|
</div>
|
|
356
|
-
${
|
|
282
|
+
${c.getDescriptionTemplate(e)}
|
|
357
283
|
<div class="df-help-message"></div>
|
|
358
284
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
359
285
|
}
|
|
@@ -368,38 +294,38 @@ class Ze extends f {
|
|
|
368
294
|
this.field.$value = e, this.element.value = e;
|
|
369
295
|
}
|
|
370
296
|
reset() {
|
|
371
|
-
this.setDefaultInfo(), this.setDisabled(!1),
|
|
297
|
+
this.setDefaultInfo(), this.setDisabled(!1), $(this.rowElement);
|
|
372
298
|
}
|
|
373
299
|
getElement() {
|
|
374
300
|
return this.element;
|
|
375
301
|
}
|
|
376
302
|
valid() {
|
|
377
|
-
const e =
|
|
378
|
-
return
|
|
303
|
+
const e = S(this.getValue(), this.field);
|
|
304
|
+
return v(this.field, this.rowElement, e), e;
|
|
379
305
|
}
|
|
380
306
|
}
|
|
381
|
-
class
|
|
307
|
+
class Z extends c {
|
|
382
308
|
constructor(e, t, i) {
|
|
383
|
-
var
|
|
309
|
+
var r, o, d, u, h;
|
|
384
310
|
super(i, e, t);
|
|
385
311
|
let s = "";
|
|
386
|
-
|
|
387
|
-
const
|
|
312
|
+
g(e.defaultValue) || (s = e.defaultValue);
|
|
313
|
+
const l = Z.valuesValueKey(e);
|
|
388
314
|
let a = !1;
|
|
389
|
-
(
|
|
390
|
-
let
|
|
391
|
-
|
|
392
|
-
}), a ? this.defaultSelected = s : this.defaultSelected || ((d = e.rendererOptions) == null ? void 0 : d.disableDefaultOption) === !0 && (this.defaultSelected = ((
|
|
315
|
+
(o = (r = this.field.listItem) == null ? void 0 : r.list) == null || o.forEach((f) => {
|
|
316
|
+
let m = f[l];
|
|
317
|
+
f.selected && (this.defaultSelected = m), m == s && (a = !0);
|
|
318
|
+
}), a ? this.defaultSelected = s : this.defaultSelected || ((d = e.rendererOptions) == null ? void 0 : d.disableDefaultOption) === !0 && (this.defaultSelected = ((h = (u = this.field.listItem) == null ? void 0 : u.list) == null ? void 0 : h.length) > 0 && this.field.listItem.list[0][l] || ""), g(this.defaultSelected) && (this.defaultSelected = ""), this.mounted(), this.setDefaultOption(), this.setValue(this.defaultSelected, !1);
|
|
393
319
|
}
|
|
394
320
|
mounted() {
|
|
395
|
-
|
|
321
|
+
we(this.field, this.element, this);
|
|
396
322
|
}
|
|
397
323
|
createField() {
|
|
398
324
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
399
325
|
let i = ` <div class="df-field"><select name="${e.$xssName}" class="df-form-field df-dropdown">
|
|
400
326
|
${this.dropdownValuesTemplate(e)}
|
|
401
327
|
</select> <i class="df-help-icon"></i></div>
|
|
402
|
-
${
|
|
328
|
+
${c.getDescriptionTemplate(e)}
|
|
403
329
|
<div class="df-help-message"></div>
|
|
404
330
|
`;
|
|
405
331
|
t.innerHTML = i, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
@@ -407,7 +333,7 @@ class fe extends f {
|
|
|
407
333
|
setValueItems(e) {
|
|
408
334
|
if (this.field.listItem ? this.field.listItem.list = e : this.field.listItem = {
|
|
409
335
|
list: e
|
|
410
|
-
}, this.element.innerHTML = this.dropdownValuesTemplate(this.field), !
|
|
336
|
+
}, this.element.innerHTML = this.dropdownValuesTemplate(this.field), !F(this.field.$value)) {
|
|
411
337
|
const t = this.field.$value;
|
|
412
338
|
this.field.$value = "", this.setValue(t);
|
|
413
339
|
}
|
|
@@ -423,7 +349,7 @@ class fe extends f {
|
|
|
423
349
|
this.field.$value = e, this.element.value = e;
|
|
424
350
|
}
|
|
425
351
|
reset() {
|
|
426
|
-
this.setValue(this.defaultSelected, !1), this.setDisabled(!1),
|
|
352
|
+
this.setValue(this.defaultSelected, !1), this.setDisabled(!1), $(this.rowElement);
|
|
427
353
|
}
|
|
428
354
|
getElement() {
|
|
429
355
|
return this.element;
|
|
@@ -431,24 +357,24 @@ class fe extends f {
|
|
|
431
357
|
valid() {
|
|
432
358
|
const e = this.getValue();
|
|
433
359
|
let t = !0;
|
|
434
|
-
return this.field.required && e.length < 1 && (t = { name: this.field.name, constraint: [] }, t.constraint.push(
|
|
360
|
+
return this.field.required && e.length < 1 && (t = { name: this.field.name, constraint: [] }, t.constraint.push(p.REQUIRED)), v(this.field, this.rowElement, t), t;
|
|
435
361
|
}
|
|
436
362
|
dropdownValuesTemplate(e) {
|
|
437
|
-
var
|
|
438
|
-
const t =
|
|
363
|
+
var l, a, r;
|
|
364
|
+
const t = c.valuesLabelKey(e), i = c.valuesValueKey(e);
|
|
439
365
|
let s = "";
|
|
440
|
-
return ((
|
|
441
|
-
const d = `${
|
|
442
|
-
|
|
366
|
+
return ((l = e.rendererOptions) == null ? void 0 : l.disableDefaultOption) !== !0 && (s += `<option value="">${V.getMessage("selection")}</option>`), (r = (a = e.listItem) == null ? void 0 : a.list) == null || r.forEach((o) => {
|
|
367
|
+
const d = `${o.selected ? "selected" : ""} ${o.disabled ? "disabled" : ""}`;
|
|
368
|
+
g(o[i]) && o.label ? s += `<option value="${o.value || ""}" ${d}>${o.label}</option>` : s += `<option value="${o[i]}" ${d}>${c.valuesLabelValue(t, o)}</option>`;
|
|
443
369
|
}), s;
|
|
444
370
|
}
|
|
445
371
|
}
|
|
446
|
-
class
|
|
372
|
+
class Ce extends c {
|
|
447
373
|
constructor(e, t, i) {
|
|
448
374
|
super(i, e, t), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
449
375
|
}
|
|
450
376
|
mounted() {
|
|
451
|
-
|
|
377
|
+
B(this.field, this.element, this);
|
|
452
378
|
}
|
|
453
379
|
createField() {
|
|
454
380
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
@@ -456,7 +382,7 @@ class Qe extends f {
|
|
|
456
382
|
<div class="df-field">
|
|
457
383
|
<input type="text" name="${e.$xssName}" class="df-form-field df-text df-help-icon" />
|
|
458
384
|
</div>
|
|
459
|
-
${
|
|
385
|
+
${c.getDescriptionTemplate(e)}
|
|
460
386
|
<div class="df-help-message"></div>
|
|
461
387
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
462
388
|
}
|
|
@@ -471,20 +397,20 @@ class Qe extends f {
|
|
|
471
397
|
this.field.$value = e, this.element.value = e;
|
|
472
398
|
}
|
|
473
399
|
reset() {
|
|
474
|
-
this.setDefaultInfo(), this.setDisabled(!1),
|
|
400
|
+
this.setDefaultInfo(), this.setDisabled(!1), $(this.rowElement);
|
|
475
401
|
}
|
|
476
402
|
getElement() {
|
|
477
403
|
return this.element;
|
|
478
404
|
}
|
|
479
405
|
valid() {
|
|
480
|
-
const e =
|
|
481
|
-
return
|
|
406
|
+
const e = S(this.getValue(), this.field);
|
|
407
|
+
return v(this.field, this.rowElement, e), e;
|
|
482
408
|
}
|
|
483
409
|
}
|
|
484
|
-
function
|
|
485
|
-
var
|
|
410
|
+
function C(n, e, t, i) {
|
|
411
|
+
var f, m, A, T, b, R, Y, J, ee;
|
|
486
412
|
const s = {
|
|
487
|
-
rowStyleClass:
|
|
413
|
+
rowStyleClass: P(e.orientation),
|
|
488
414
|
fieldClass: "",
|
|
489
415
|
fieldStyle: "",
|
|
490
416
|
labelClass: "",
|
|
@@ -493,38 +419,35 @@ function A(l, e, t, i) {
|
|
|
493
419
|
valueClass: "",
|
|
494
420
|
valueStyle: "",
|
|
495
421
|
tabAlignClass: ""
|
|
496
|
-
},
|
|
497
|
-
let a = ((
|
|
498
|
-
const
|
|
499
|
-
s.fieldClass = `${d[0] ? "df-" + d[0] : ""} ${((
|
|
500
|
-
const
|
|
501
|
-
if (s.labelAlignClass = d[1], !i &&
|
|
502
|
-
if (
|
|
503
|
-
const
|
|
504
|
-
a = 12 -
|
|
422
|
+
}, l = ((f = t == null ? void 0 : t.style) == null ? void 0 : f.labelWidth) ?? n.style.labelWidth ?? "3";
|
|
423
|
+
let a = ((m = t == null ? void 0 : t.style) == null ? void 0 : m.valueWidth) ?? n.style.valueWidth ?? "9";
|
|
424
|
+
const r = ((A = t == null ? void 0 : t.style) == null ? void 0 : A.position) ?? n.style.position, o = (T = e.style) == null ? void 0 : T.width, d = y[(b = e.style) == null ? void 0 : b.position] ?? y[r] ?? y.top;
|
|
425
|
+
s.fieldClass = `${d[0] ? "df-" + d[0] : ""} ${((R = e.style) == null ? void 0 : R.customClass) || ""}`, o && (E(o) ? s.fieldClass += E(o) ? ` df-col-xs-${o}` : "" : s.fieldStyle = E(o) ? "" : `width:${o};`), s.tabAlignClass = "df-tab-al-" + (["right", "center"].includes((Y = e.style) == null ? void 0 : Y.tabAlign) ? e.style.tabAlign : "left");
|
|
426
|
+
const u = ((J = e.style) == null ? void 0 : J.labelWidth) || l;
|
|
427
|
+
if (s.labelAlignClass = d[1], !i && u && !["top", "bottom"].includes(d[0]))
|
|
428
|
+
if (E(u)) {
|
|
429
|
+
const te = +u;
|
|
430
|
+
a = 12 - te, s.labelClass = `df-col-xs-${te}`, s.valueClass = s.labelStyle ? "df-col-full" : `df-col-xs-${a}`;
|
|
505
431
|
} else
|
|
506
|
-
s.labelStyle = `width:${
|
|
507
|
-
const
|
|
508
|
-
return i && !["left", "right"].includes(d[0]) ? s.valueClass = "df-col-full" :
|
|
432
|
+
s.labelStyle = `width:${u};`;
|
|
433
|
+
const h = ((ee = e.style) == null ? void 0 : ee.valueWidth) || a;
|
|
434
|
+
return i && !["left", "right"].includes(d[0]) ? s.valueClass = "df-col-full" : h && !["top", "bottom"].includes(d[0]) ? E(h) ? s.valueClass = s.labelStyle ? "df-col-full" : `df-col-xs-${h}` : s.valueStyle = `width:${h};` : s.valueClass = s.labelStyle ? "df-col-full" : "", s.fieldClass = W(s.fieldClass).join(" "), s.labelClass = W(s.labelClass).join(" "), s.valueClass = W(s.valueClass).join(" "), s;
|
|
509
435
|
}
|
|
510
|
-
function
|
|
511
|
-
return
|
|
436
|
+
function P(n) {
|
|
437
|
+
return n === "horizontal" ? "df-horizontal" : "df-vertical";
|
|
512
438
|
}
|
|
513
|
-
|
|
514
|
-
return l.replace(/\s+/g, " ").trim();
|
|
515
|
-
}
|
|
516
|
-
class pe extends f {
|
|
439
|
+
class Q extends c {
|
|
517
440
|
constructor(e, t, i) {
|
|
518
|
-
var
|
|
441
|
+
var r, o;
|
|
519
442
|
super(i, e, t), this.defaultCheckValue = [], this.defaultCheckValue = [];
|
|
520
443
|
let s = [];
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
|
|
444
|
+
g(e.defaultValue) || (I(e.defaultValue) ? s = e.defaultValue : s = [e.defaultValue]);
|
|
445
|
+
const l = Q.valuesValueKey(e);
|
|
446
|
+
g(this.field.listItem) && this.setValueItems([{ label: "", value: "Y" }]);
|
|
524
447
|
let a = !1;
|
|
525
|
-
(
|
|
526
|
-
let
|
|
527
|
-
d.selected && this.defaultCheckValue.push(
|
|
448
|
+
(o = (r = this.field.listItem) == null ? void 0 : r.list) == null || o.forEach((d) => {
|
|
449
|
+
let u = d[l];
|
|
450
|
+
d.selected && this.defaultCheckValue.push(u || !0), s.includes(u) && (a = !0);
|
|
528
451
|
}), this.defaultCheckValue = a ? s : this.defaultCheckValue, this.mounted(), this.setDefaultOption(), this.setValue(this.defaultCheckValue, !1);
|
|
529
452
|
}
|
|
530
453
|
mounted() {
|
|
@@ -533,7 +456,7 @@ class pe extends f {
|
|
|
533
456
|
initEvent() {
|
|
534
457
|
this.rowElement.querySelectorAll(this.getSelector()).forEach((t) => {
|
|
535
458
|
t.addEventListener("change", (i) => {
|
|
536
|
-
|
|
459
|
+
x(this.field, i, this, this.getValue()), this.valid();
|
|
537
460
|
});
|
|
538
461
|
});
|
|
539
462
|
}
|
|
@@ -541,24 +464,24 @@ class pe extends f {
|
|
|
541
464
|
return `input[type="checkbox"][name="${this.field.$xssName}"]`;
|
|
542
465
|
}
|
|
543
466
|
createField() {
|
|
544
|
-
var
|
|
545
|
-
const e = this.field, t = this.rowElement.querySelector(".df-field-container"), i = [], s = e.$xssName,
|
|
546
|
-
i.push(' <div class="df-field"><div class="df-field-group">'), (
|
|
547
|
-
const
|
|
467
|
+
var r, o;
|
|
468
|
+
const e = this.field, t = this.rowElement.querySelector(".df-field-container"), i = [], s = e.$xssName, l = c.valuesLabelKey(e), a = c.valuesValueKey(e);
|
|
469
|
+
i.push(' <div class="df-field"><div class="df-field-group">'), (o = (r = e.listItem) == null ? void 0 : r.list) == null || o.forEach((d) => {
|
|
470
|
+
const u = String(d[a] ?? "");
|
|
548
471
|
i.push(`
|
|
549
|
-
<span class="df-field-item ${
|
|
472
|
+
<span class="df-field-item ${P(e.listItem.orientation ?? me.horizontal)}">
|
|
550
473
|
<label>
|
|
551
|
-
<input type="checkbox" name="${s}" value="${
|
|
552
|
-
${
|
|
474
|
+
<input type="checkbox" name="${s}" value="${u ? j(u) : ""}" class="df-form-field df-checkbox" ${d.selected ? "checked" : ""} ${d.disabled ? "disabled" : ""} />
|
|
475
|
+
${c.valuesLabelValue(l, d)}
|
|
553
476
|
</label>
|
|
554
477
|
</span>
|
|
555
478
|
`);
|
|
556
|
-
}), i.push(`<i class="df-form-icon df-help-icon"></i></div></div> ${
|
|
479
|
+
}), i.push(`<i class="df-form-icon df-help-icon"></i></div></div> ${c.getDescriptionTemplate(e)}<div class="df-help-message"></div>`), t.innerHTML = i.join("");
|
|
557
480
|
}
|
|
558
481
|
setValueItems(e) {
|
|
559
482
|
if (this.rowElement.querySelector(".df-field-container") && (this.field.listItem ? this.field.listItem.list = e : this.field.listItem = {
|
|
560
483
|
list: e
|
|
561
|
-
}, this.createField(), !
|
|
484
|
+
}, this.createField(), !F(this.field.$value))) {
|
|
562
485
|
const i = this.field.$value;
|
|
563
486
|
this.field.$value = "", this.setValue(i);
|
|
564
487
|
}
|
|
@@ -586,16 +509,16 @@ class pe extends f {
|
|
|
586
509
|
return;
|
|
587
510
|
}
|
|
588
511
|
let i = [];
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
}), i.forEach((
|
|
592
|
-
const a = this.rowElement.querySelector(`[name="${this.field.$xssName}"][value="${
|
|
512
|
+
I(e) ? i = e : i.push(e), this.rowElement.querySelectorAll(this.getSelector()).forEach((l) => {
|
|
513
|
+
l.checked = !1;
|
|
514
|
+
}), i.forEach((l) => {
|
|
515
|
+
const a = this.rowElement.querySelector(`[name="${this.field.$xssName}"][value="${l}"]`);
|
|
593
516
|
a && (a.checked = !0);
|
|
594
517
|
});
|
|
595
518
|
}
|
|
596
519
|
reset() {
|
|
597
520
|
var e, t;
|
|
598
|
-
((t = (e = this.field.listItem) == null ? void 0 : e.list) == null ? void 0 : t.length) == 1 && this.defaultCheckValue.length == 1 ? this.setValue(!0, !1) : this.setValue(this.defaultCheckValue, !1), this.setDisabled(!1),
|
|
521
|
+
((t = (e = this.field.listItem) == null ? void 0 : e.list) == null ? void 0 : t.length) == 1 && this.defaultCheckValue.length == 1 ? this.setValue(!0, !1) : this.setValue(this.defaultCheckValue, !1), this.setDisabled(!1), $(this.rowElement);
|
|
599
522
|
}
|
|
600
523
|
getElement() {
|
|
601
524
|
return this.rowElement.querySelectorAll(`[name="${this.field.$xssName}"]`);
|
|
@@ -607,21 +530,21 @@ class pe extends f {
|
|
|
607
530
|
valid() {
|
|
608
531
|
const e = this.getValue();
|
|
609
532
|
let t = !0;
|
|
610
|
-
return this.field.required &&
|
|
533
|
+
return this.field.required && I(e) && e.length < 1 && (t = { name: this.field.name, constraint: [] }, t.constraint.push(p.REQUIRED)), v(this.field, this.rowElement, t), t;
|
|
611
534
|
}
|
|
612
535
|
}
|
|
613
|
-
class
|
|
536
|
+
class G extends c {
|
|
614
537
|
constructor(e, t, i) {
|
|
615
|
-
var
|
|
538
|
+
var r, o, d, u, h;
|
|
616
539
|
super(i, e, t), this.defaultCheckValue = "";
|
|
617
540
|
let s = [];
|
|
618
|
-
|
|
619
|
-
const
|
|
541
|
+
g(e.defaultValue) || (s = e.defaultValue);
|
|
542
|
+
const l = G.valuesValueKey(e);
|
|
620
543
|
let a = !1;
|
|
621
|
-
(
|
|
622
|
-
let
|
|
623
|
-
|
|
624
|
-
}), a ? this.defaultCheckValue = s : this.defaultCheckValue || (this.defaultCheckValue = ((
|
|
544
|
+
(o = (r = this.field.listItem) == null ? void 0 : r.list) == null || o.forEach((f) => {
|
|
545
|
+
let m = f[l];
|
|
546
|
+
f.selected && (this.defaultCheckValue = m), s == m && (a = !0);
|
|
547
|
+
}), a ? this.defaultCheckValue = s : this.defaultCheckValue || (this.defaultCheckValue = ((u = (d = this.field.listItem) == null ? void 0 : d.list) == null ? void 0 : u.length) > 0 ? (h = this.field.listItem) == null ? void 0 : h.list[0][l] : ""), this.mounted(), this.setDefaultOption(), this.setValue(this.defaultCheckValue, !1);
|
|
625
548
|
}
|
|
626
549
|
mounted() {
|
|
627
550
|
this.initEvent();
|
|
@@ -629,7 +552,7 @@ class ge extends f {
|
|
|
629
552
|
initEvent() {
|
|
630
553
|
this.rowElement.querySelectorAll(this.getSelector()).forEach((t) => {
|
|
631
554
|
t.addEventListener("change", (i) => {
|
|
632
|
-
|
|
555
|
+
x(this.field, i, this, this.getValue()), this.valid();
|
|
633
556
|
});
|
|
634
557
|
});
|
|
635
558
|
}
|
|
@@ -637,28 +560,28 @@ class ge extends f {
|
|
|
637
560
|
return `input[type="radio"][name="${this.field.$xssName}"]`;
|
|
638
561
|
}
|
|
639
562
|
createField() {
|
|
640
|
-
var
|
|
641
|
-
const e = this.field, t = this.rowElement.querySelector(".df-field-container"), i = [], s = e.$xssName,
|
|
642
|
-
i.push('<div class="df-field"><div class="df-field-group">'), (
|
|
643
|
-
const
|
|
563
|
+
var r, o;
|
|
564
|
+
const e = this.field, t = this.rowElement.querySelector(".df-field-container"), i = [], s = e.$xssName, l = c.valuesLabelKey(e), a = c.valuesValueKey(e);
|
|
565
|
+
i.push('<div class="df-field"><div class="df-field-group">'), (o = (r = e.listItem) == null ? void 0 : r.list) == null || o.forEach((d) => {
|
|
566
|
+
const u = d[a];
|
|
644
567
|
i.push(
|
|
645
|
-
`<span class="df-field-item ${
|
|
568
|
+
`<span class="df-field-item ${P(e.orientation ?? me.horizontal)}">
|
|
646
569
|
<label>
|
|
647
|
-
<input type="radio" name="${s}" value="${
|
|
648
|
-
${
|
|
570
|
+
<input type="radio" name="${s}" value="${u}" class="df-form-field df-radio" ${d.selected ? "checked" : ""} ${d.disabled ? "disabled" : ""}/>
|
|
571
|
+
${c.valuesLabelValue(l, d)}
|
|
649
572
|
</label>
|
|
650
573
|
</span>
|
|
651
574
|
`
|
|
652
575
|
);
|
|
653
576
|
}), i.push(`<i class="df-form-icon df-help-icon"></i></div></div>
|
|
654
|
-
${
|
|
577
|
+
${c.getDescriptionTemplate(e)}
|
|
655
578
|
<div class="df-help-message"></div>
|
|
656
579
|
`), t.innerHTML = i.join(""), this.initEvent();
|
|
657
580
|
}
|
|
658
581
|
setValueItems(e) {
|
|
659
582
|
if (this.rowElement.querySelector(".df-field-container") && (this.field.listItem ? this.field.listItem.list = e : this.field.listItem = {
|
|
660
583
|
list: e
|
|
661
|
-
}, this.createField(), !
|
|
584
|
+
}, this.createField(), !F(this.field.$value))) {
|
|
662
585
|
const i = this.field.$value;
|
|
663
586
|
this.field.$value = "", this.setValue(i);
|
|
664
587
|
}
|
|
@@ -677,12 +600,12 @@ class ge extends f {
|
|
|
677
600
|
return;
|
|
678
601
|
}
|
|
679
602
|
this.rowElement.querySelectorAll(this.getSelector()).forEach((s) => {
|
|
680
|
-
let
|
|
681
|
-
|
|
603
|
+
let l = s;
|
|
604
|
+
l.value == e ? l.checked = !0 : l.checked = !1;
|
|
682
605
|
});
|
|
683
606
|
}
|
|
684
607
|
reset() {
|
|
685
|
-
this.setValue(this.defaultCheckValue, !1), this.setDisabled(!1),
|
|
608
|
+
this.setValue(this.defaultCheckValue, !1), this.setDisabled(!1), $(this.rowElement);
|
|
686
609
|
}
|
|
687
610
|
getElement() {
|
|
688
611
|
return this.rowElement.querySelectorAll(this.getSelector());
|
|
@@ -694,15 +617,15 @@ class ge extends f {
|
|
|
694
617
|
valid() {
|
|
695
618
|
const e = this.getValue();
|
|
696
619
|
let t = !0;
|
|
697
|
-
return this.field.required &&
|
|
620
|
+
return this.field.required && F(e) && (t = { name: this.field.name, constraint: [] }, t.constraint.push(p.REQUIRED)), v(this.field, this.rowElement, t), t;
|
|
698
621
|
}
|
|
699
622
|
}
|
|
700
|
-
class
|
|
623
|
+
class Se extends c {
|
|
701
624
|
constructor(e, t, i) {
|
|
702
625
|
super(i, e, t), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
703
626
|
}
|
|
704
627
|
mounted() {
|
|
705
|
-
|
|
628
|
+
B(this.field, this.element, this);
|
|
706
629
|
}
|
|
707
630
|
createField() {
|
|
708
631
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
@@ -710,7 +633,7 @@ class Ge extends f {
|
|
|
710
633
|
<div class="df-field">
|
|
711
634
|
<input type="password" name="${e.$xssName}" class="df-form-field df-password df-help-icon" autocomplete="off" />
|
|
712
635
|
</div>
|
|
713
|
-
${
|
|
636
|
+
${c.getDescriptionTemplate(e)}
|
|
714
637
|
<div class="df-help-message"></div>
|
|
715
638
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
716
639
|
}
|
|
@@ -725,21 +648,21 @@ class Ge extends f {
|
|
|
725
648
|
this.field.$value = e, this.element.value = e;
|
|
726
649
|
}
|
|
727
650
|
reset() {
|
|
728
|
-
this.setDefaultInfo(), this.setDisabled(!1),
|
|
651
|
+
this.setDefaultInfo(), this.setDisabled(!1), $(this.rowElement);
|
|
729
652
|
}
|
|
730
653
|
getElement() {
|
|
731
654
|
return this.element;
|
|
732
655
|
}
|
|
733
656
|
valid() {
|
|
734
|
-
const e =
|
|
735
|
-
return
|
|
657
|
+
const e = S(this.getValue(), this.field);
|
|
658
|
+
return v(this.field, this.rowElement, e), e;
|
|
736
659
|
}
|
|
737
660
|
}
|
|
738
|
-
const
|
|
661
|
+
const Te = (n, e, t) => {
|
|
739
662
|
const i = { name: e.name, constraint: [] };
|
|
740
|
-
return e.required && t.length < 1 ? (i.constraint.push(
|
|
663
|
+
return e.required && t.length < 1 ? (i.constraint.push(p.REQUIRED), i) : i.constraint.length > 0 ? i : !0;
|
|
741
664
|
};
|
|
742
|
-
class
|
|
665
|
+
class Le extends c {
|
|
743
666
|
constructor(e, t, i) {
|
|
744
667
|
var s;
|
|
745
668
|
super(i, e, t), this.removeIds = [], this.uploadFiles = {}, this.fileList = [], this.fileSeq = 0, this.element = t.querySelector(`[name="${e.$xssName}"]`), this.fileList = ((s = e.listItem) == null ? void 0 : s.list) || [], this.mounted(), this.setDefaultOption();
|
|
@@ -750,11 +673,11 @@ class et extends f {
|
|
|
750
673
|
const t = (i = e.target) == null ? void 0 : i.files;
|
|
751
674
|
if (t) {
|
|
752
675
|
let s = [];
|
|
753
|
-
for (let
|
|
754
|
-
s.push(
|
|
676
|
+
for (let l of t)
|
|
677
|
+
s.push(l);
|
|
755
678
|
this.addFiles(s);
|
|
756
679
|
}
|
|
757
|
-
|
|
680
|
+
x(this.field, e, this, this.fileList), this.valid();
|
|
758
681
|
}), this.fileList.forEach((e) => {
|
|
759
682
|
e.$seq = this.fileSeq += 1;
|
|
760
683
|
}), this.setFileList(this.fileList);
|
|
@@ -766,12 +689,12 @@ class et extends f {
|
|
|
766
689
|
<span class="df-file-wrapper">
|
|
767
690
|
<label class="df-file-label">
|
|
768
691
|
<input type="file" name="${e.$xssName}" class="df-form-field df-file" multiple />
|
|
769
|
-
${
|
|
692
|
+
${V.getMessage("fileButton")}
|
|
770
693
|
</label>
|
|
771
694
|
<i class="df-form-icon df-help-icon"></i>
|
|
772
695
|
</span>
|
|
773
696
|
</div>
|
|
774
|
-
${
|
|
697
|
+
${c.getDescriptionTemplate(e)}
|
|
775
698
|
<div class="df-file-list"></div>
|
|
776
699
|
<div class="df-help-message"></div>
|
|
777
700
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
@@ -780,7 +703,7 @@ class et extends f {
|
|
|
780
703
|
let t = !1;
|
|
781
704
|
const i = [];
|
|
782
705
|
for (let s of e) {
|
|
783
|
-
if (this.fileList.filter((
|
|
706
|
+
if (this.fileList.filter((r) => r.fileName == s.name && r.fileSize == s.size && r.lastModified == s.lastModified).length > 0) continue;
|
|
784
707
|
this.fileSeq += 1, this.uploadFiles[this.fileSeq] = s;
|
|
785
708
|
let a = {
|
|
786
709
|
fileName: s.name,
|
|
@@ -797,14 +720,14 @@ class et extends f {
|
|
|
797
720
|
if (i) {
|
|
798
721
|
t === !0 && (i.innerHTML = "");
|
|
799
722
|
const s = [];
|
|
800
|
-
e.forEach((
|
|
723
|
+
e.forEach((l) => {
|
|
801
724
|
s.push(`
|
|
802
|
-
<div class="df-file-item" data-seq="${
|
|
803
|
-
${
|
|
804
|
-
<span class="df-file-name">${
|
|
725
|
+
<div class="df-file-item" data-seq="${l.$seq}">
|
|
726
|
+
${l.fileId ? '<span class="df-file-icon df-file-download"></span>' : '<span class="df-file-icon df-empty-icon"></span>'} <span class="df-file-icon df-file-remove"></span>
|
|
727
|
+
<span class="df-file-name">${l.fileName}</span >
|
|
805
728
|
</div>`);
|
|
806
|
-
}), i.insertAdjacentHTML("beforeend", s.join("")), e.forEach((
|
|
807
|
-
this.removeFileEvent(
|
|
729
|
+
}), i.insertAdjacentHTML("beforeend", s.join("")), e.forEach((l) => {
|
|
730
|
+
this.removeFileEvent(l, i), this.downloadFileEvent(l, i);
|
|
808
731
|
});
|
|
809
732
|
}
|
|
810
733
|
}
|
|
@@ -817,11 +740,11 @@ class et extends f {
|
|
|
817
740
|
downloadFileEvent(e, t) {
|
|
818
741
|
const i = t.querySelector(`[data-seq="${e.$seq}"] .df-file-download`);
|
|
819
742
|
i && i.addEventListener("click", (s) => {
|
|
820
|
-
const
|
|
821
|
-
if (
|
|
822
|
-
const a =
|
|
743
|
+
const l = s.target.closest(".df-file-item");
|
|
744
|
+
if (l) {
|
|
745
|
+
const a = l.getAttribute("data-seq");
|
|
823
746
|
if (a) {
|
|
824
|
-
const
|
|
747
|
+
const r = parseInt(a, 10), o = this.fileList.findIndex((u) => u.$seq === r), d = this.fileList[o];
|
|
825
748
|
if (d.url) {
|
|
826
749
|
location.href = d.url;
|
|
827
750
|
return;
|
|
@@ -843,12 +766,12 @@ class et extends f {
|
|
|
843
766
|
removeFileEvent(e, t) {
|
|
844
767
|
const i = t.querySelector(`[data-seq="${e.$seq}"] .df-file-remove`);
|
|
845
768
|
i && i.addEventListener("click", (s) => {
|
|
846
|
-
const
|
|
847
|
-
if (
|
|
848
|
-
const a =
|
|
769
|
+
const l = s.target.closest(".df-file-item");
|
|
770
|
+
if (l) {
|
|
771
|
+
const a = l.getAttribute("data-seq");
|
|
849
772
|
if (a) {
|
|
850
|
-
const
|
|
851
|
-
this.fileList.splice(
|
|
773
|
+
const r = parseInt(a, 10), o = this.fileList.findIndex((u) => u.$seq === r), d = this.fileList[o];
|
|
774
|
+
this.fileList.splice(o, 1), delete this.uploadFiles[r], l.remove(), d.fileId && this.removeIds.push(d.fileId);
|
|
852
775
|
}
|
|
853
776
|
}
|
|
854
777
|
this.valid();
|
|
@@ -867,20 +790,20 @@ class et extends f {
|
|
|
867
790
|
this.setFileList(this.fileList, !0);
|
|
868
791
|
}
|
|
869
792
|
setValue(e) {
|
|
870
|
-
|
|
793
|
+
I(e) && this.setValueItems(e), this.element.value = "";
|
|
871
794
|
}
|
|
872
795
|
reset() {
|
|
873
|
-
this.setValue(""), this.setValueItems([]),
|
|
796
|
+
this.setValue(""), this.setValueItems([]), $(this.rowElement);
|
|
874
797
|
}
|
|
875
798
|
getElement() {
|
|
876
799
|
return this.element;
|
|
877
800
|
}
|
|
878
801
|
valid() {
|
|
879
|
-
const e =
|
|
880
|
-
return
|
|
802
|
+
const e = Te(this.element, this.field, this.fileList);
|
|
803
|
+
return v(this.field, this.rowElement, e), e;
|
|
881
804
|
}
|
|
882
805
|
}
|
|
883
|
-
class
|
|
806
|
+
class Me extends c {
|
|
884
807
|
constructor(e, t, i) {
|
|
885
808
|
super(i, e, t), e.renderer ? (this.customFunction = e.renderer, this.mounted(), this.setDefaultOption(), this.setDefaultInfo()) : this.customFunction = {};
|
|
886
809
|
}
|
|
@@ -891,11 +814,11 @@ class tt extends f {
|
|
|
891
814
|
return !1;
|
|
892
815
|
}
|
|
893
816
|
createField() {
|
|
894
|
-
const e = this.field, t =
|
|
817
|
+
const e = this.field, t = w(e.template) ? "" : K(e.template) ? e.template : e.template(), i = this.rowElement.querySelector(".df-field-container");
|
|
895
818
|
i.innerHTML = ` <div class="df-field">
|
|
896
819
|
${t}
|
|
897
820
|
</div>
|
|
898
|
-
${
|
|
821
|
+
${c.getDescriptionTemplate(e)}
|
|
899
822
|
<div class="df-help-message"></div>`;
|
|
900
823
|
}
|
|
901
824
|
getValue() {
|
|
@@ -905,7 +828,7 @@ class tt extends f {
|
|
|
905
828
|
this.customFunction.setValue && (t !== !1 && this.changeEventCall(this.field, null, this, e) === !1 && (e = this.field.$value), this.customFunction.setValue.call(this, e, this.field, this.rowElement)), this.field.$value = e;
|
|
906
829
|
}
|
|
907
830
|
reset() {
|
|
908
|
-
this.setDefaultInfo(),
|
|
831
|
+
this.setDefaultInfo(), $(this.rowElement);
|
|
909
832
|
}
|
|
910
833
|
getElement() {
|
|
911
834
|
return this.customFunction.getElement ? this.customFunction.getElement.call(this, this.field, this.rowElement) : null;
|
|
@@ -913,11 +836,11 @@ class tt extends f {
|
|
|
913
836
|
valid() {
|
|
914
837
|
if (this.customFunction.valid) {
|
|
915
838
|
const t = this.customFunction.valid.call(this, this.field, this.rowElement);
|
|
916
|
-
|
|
839
|
+
v(this.field, this.rowElement, t);
|
|
917
840
|
return;
|
|
918
841
|
}
|
|
919
|
-
const e =
|
|
920
|
-
return
|
|
842
|
+
const e = S(this.getValue(), this.field);
|
|
843
|
+
return v(this.field, this.rowElement, e), e;
|
|
921
844
|
}
|
|
922
845
|
/**
|
|
923
846
|
* focus
|
|
@@ -926,7 +849,7 @@ class tt extends f {
|
|
|
926
849
|
this.customFunction.focus && this.customFunction.focus.call(this, this.field, this.rowElement);
|
|
927
850
|
}
|
|
928
851
|
}
|
|
929
|
-
class
|
|
852
|
+
class Ne extends c {
|
|
930
853
|
constructor(e, t, i) {
|
|
931
854
|
super(i, e, t);
|
|
932
855
|
}
|
|
@@ -958,7 +881,7 @@ class it extends f {
|
|
|
958
881
|
focus() {
|
|
959
882
|
}
|
|
960
883
|
}
|
|
961
|
-
class
|
|
884
|
+
class ke extends c {
|
|
962
885
|
constructor(e, t, i) {
|
|
963
886
|
super(i, e, t), this.field.$value = e.defaultValue;
|
|
964
887
|
}
|
|
@@ -982,7 +905,7 @@ class st extends f {
|
|
|
982
905
|
return !0;
|
|
983
906
|
}
|
|
984
907
|
}
|
|
985
|
-
class
|
|
908
|
+
class qe extends c {
|
|
986
909
|
constructor(e, t, i) {
|
|
987
910
|
super(i, e, t), this.mounted(), this.setDefaultOption();
|
|
988
911
|
}
|
|
@@ -998,7 +921,7 @@ class lt extends f {
|
|
|
998
921
|
createField() {
|
|
999
922
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
1000
923
|
t.innerHTML = `
|
|
1001
|
-
<button type="button" id="${e.$key}" class="df-btn">${e.label}</button> ${
|
|
924
|
+
<button type="button" id="${e.$key}" class="df-btn">${e.label}</button> ${c.getDescriptionTemplate(e)}
|
|
1002
925
|
`;
|
|
1003
926
|
}
|
|
1004
927
|
getValue() {
|
|
@@ -1016,13 +939,13 @@ class lt extends f {
|
|
|
1016
939
|
return !0;
|
|
1017
940
|
}
|
|
1018
941
|
}
|
|
1019
|
-
class
|
|
942
|
+
class Ae extends c {
|
|
1020
943
|
constructor(e, t, i) {
|
|
1021
944
|
super(i, e, t), this.rangeNumElement = t.querySelector(".df-range-num"), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
1022
945
|
}
|
|
1023
946
|
mounted() {
|
|
1024
947
|
this.element.addEventListener("input", (e) => {
|
|
1025
|
-
this.rangeNumElement.innerHTML = e.target.value, this.element.setAttribute("title", e.target.value),
|
|
948
|
+
this.rangeNumElement.innerHTML = e.target.value, this.element.setAttribute("title", e.target.value), x(this.field, e, this, this.getValue()), this.valid();
|
|
1026
949
|
});
|
|
1027
950
|
}
|
|
1028
951
|
createField() {
|
|
@@ -1032,7 +955,7 @@ class nt extends f {
|
|
|
1032
955
|
<span class="df-range-num">${e.defaultValue ? e.defaultValue : 0}</span>
|
|
1033
956
|
<input type="range" name="${e.$xssName}" class="df-form-field df-range df-help-icon" min="${e.rule.minimum}" max="${e.rule.maximum}"/>
|
|
1034
957
|
</div>
|
|
1035
|
-
${
|
|
958
|
+
${c.getDescriptionTemplate(e)}
|
|
1036
959
|
<div class="df-help-message"></div>
|
|
1037
960
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
1038
961
|
}
|
|
@@ -1047,868 +970,25 @@ class nt extends f {
|
|
|
1047
970
|
this.field.$value = e, this.element.value = e;
|
|
1048
971
|
}
|
|
1049
972
|
reset() {
|
|
1050
|
-
this.setDefaultInfo(), this.setDisabled(!1),
|
|
973
|
+
this.setDefaultInfo(), this.setDisabled(!1), $(this.rowElement);
|
|
1051
974
|
}
|
|
1052
975
|
getElement() {
|
|
1053
976
|
return this.element;
|
|
1054
977
|
}
|
|
1055
978
|
valid() {
|
|
1056
|
-
const e =
|
|
1057
|
-
return
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
let B = {
|
|
1061
|
-
year: "Year",
|
|
1062
|
-
month: "Month",
|
|
1063
|
-
day: "Day",
|
|
1064
|
-
am: "AM",
|
|
1065
|
-
pm: "PM",
|
|
1066
|
-
today: "Today",
|
|
1067
|
-
ok: "Ok",
|
|
1068
|
-
months: {
|
|
1069
|
-
full: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
|
|
1070
|
-
abbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
|
|
1071
|
-
},
|
|
1072
|
-
weeks: {
|
|
1073
|
-
full: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
|
|
1074
|
-
abbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
|
|
1075
|
-
}
|
|
1076
|
-
}, at = class {
|
|
1077
|
-
constructor() {
|
|
1078
|
-
this.lang = B;
|
|
1079
|
-
}
|
|
1080
|
-
setDefaultMessage(e) {
|
|
1081
|
-
B = Object.assign(B, e);
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
* 다국어 메시지 등록
|
|
1085
|
-
*
|
|
1086
|
-
* @public
|
|
1087
|
-
* @param {?Message} [lang] 둥록할 메시지
|
|
1088
|
-
*/
|
|
1089
|
-
set(e) {
|
|
1090
|
-
this.lang = Object.assign({}, B, e);
|
|
1091
|
-
}
|
|
1092
|
-
/**
|
|
1093
|
-
* 메시지 얻기
|
|
1094
|
-
*
|
|
1095
|
-
* @public
|
|
1096
|
-
* @param {string} messageKey 메시지 키
|
|
1097
|
-
* @returns {*}
|
|
1098
|
-
*/
|
|
1099
|
-
getMessage(e) {
|
|
1100
|
-
return this.lang[e];
|
|
1101
|
-
}
|
|
1102
|
-
getMonthsMessage(e, t = "abbr") {
|
|
1103
|
-
return this.lang.months[t][e] || "";
|
|
1104
|
-
}
|
|
1105
|
-
getWeeksMessage(e, t = "abbr") {
|
|
1106
|
-
return this.lang.weeks[t][e] || "";
|
|
1107
|
-
}
|
|
1108
|
-
getMonthsIdx(e, t = "abbr") {
|
|
1109
|
-
return t == "full" ? this.lang.months.full.indexOf(e) : this.lang.months.abbr.indexOf(e);
|
|
1110
|
-
}
|
|
1111
|
-
getWeeksIdx(e, t = "abbr") {
|
|
1112
|
-
return t == "full" ? this.lang.weeks.full.indexOf(e) : this.lang.weeks.abbr.indexOf(e);
|
|
1113
|
-
}
|
|
1114
|
-
};
|
|
1115
|
-
const g = new at(), J = ["YY", "YYYY", "MMMM", "MMM", "MM", "M", "dddd", "ddd", "dd", "d", "DD", "D", "S", "HH", "H", "hh", "h", "mm", "m", "ss", "s", "SSS", "zzzz", "zzz", "zz", "z", "a", "A"];
|
|
1116
|
-
let ee = 0, S = {
|
|
1117
|
-
year: "YYYY",
|
|
1118
|
-
month: "YYYY-MM",
|
|
1119
|
-
date: "YYYY-MM-DD",
|
|
1120
|
-
time: "HH:mm",
|
|
1121
|
-
datetime: "YYYY-MM-DD HH:mm"
|
|
1122
|
-
};
|
|
1123
|
-
const k = ["ddtp-sun", "ddtp-mon", "ddtp-tue", "ddtp-wed", "ddtp-thu", "ddtp-fri", "ddtp-sat"];
|
|
1124
|
-
var m = /* @__PURE__ */ ((l) => (l.year = "year", l.month = "month", l.date = "date", l.datetime = "datetime", l.time = "time", l))(m || {});
|
|
1125
|
-
J.forEach((l) => {
|
|
1126
|
-
ee = Math.max(l.length, ee);
|
|
1127
|
-
});
|
|
1128
|
-
const qe = (l, e) => {
|
|
1129
|
-
e = e || "YYYY-MM-DD";
|
|
1130
|
-
const t = e.length;
|
|
1131
|
-
let i = [];
|
|
1132
|
-
for (let s = 0; s < t; ) {
|
|
1133
|
-
let a = Math.min(ee, t - s);
|
|
1134
|
-
for (; a > 0; a--) {
|
|
1135
|
-
const o = e.substring(s, s + a);
|
|
1136
|
-
if (J.includes(o)) {
|
|
1137
|
-
try {
|
|
1138
|
-
i.push(rt[o](l));
|
|
1139
|
-
} catch (r) {
|
|
1140
|
-
console.log(J.includes(o), o, r);
|
|
1141
|
-
}
|
|
1142
|
-
break;
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
|
-
a < 1 ? (i.push(e.substring(s, s + 1)), s += 1) : s += a;
|
|
1146
|
-
}
|
|
1147
|
-
return i.join("");
|
|
1148
|
-
}, rt = {
|
|
1149
|
-
YY: (l) => String(l.getFullYear()).slice(-2),
|
|
1150
|
-
YYYY: (l) => String(l.getFullYear()),
|
|
1151
|
-
M: (l) => String(l.getMonth() + 1),
|
|
1152
|
-
MM: (l) => w(l.getMonth() + 1, 2),
|
|
1153
|
-
MMM: (l) => g.getMonthsMessage(l.getMonth()),
|
|
1154
|
-
MMMM: (l) => g.getMonthsMessage(l.getMonth(), "full"),
|
|
1155
|
-
D: (l) => String(l.getDate()),
|
|
1156
|
-
DD: (l) => w(l.getDate(), 2),
|
|
1157
|
-
d: (l) => String(l.getDate()),
|
|
1158
|
-
dd: (l) => w(l.getDate(), 2),
|
|
1159
|
-
ddd: (l) => g.getWeeksMessage(l.getDay()),
|
|
1160
|
-
dddd: (l) => g.getWeeksMessage(l.getDay(), "full"),
|
|
1161
|
-
H: (l) => String(l.getHours()),
|
|
1162
|
-
HH: (l) => w(l.getHours(), 2),
|
|
1163
|
-
h: (l) => we(l),
|
|
1164
|
-
hh: (l) => w(we(l), 2),
|
|
1165
|
-
a: (l) => String(l.getFullYear()).slice(-2),
|
|
1166
|
-
A: (l) => ot(l),
|
|
1167
|
-
m: (l) => String(l.getMinutes()),
|
|
1168
|
-
mm: (l) => w(l.getMinutes(), 2),
|
|
1169
|
-
s: (l) => String(l.getSeconds()),
|
|
1170
|
-
ss: (l) => w(l.getSeconds(), 2),
|
|
1171
|
-
SSS: (l) => w(l.getMilliseconds(), 3)
|
|
1172
|
-
};
|
|
1173
|
-
function we(l) {
|
|
1174
|
-
let e = l.getHours();
|
|
1175
|
-
return e > 12 ? e -= 12 : e < 1 && (e = 12), e;
|
|
1176
|
-
}
|
|
1177
|
-
function ot(l, e, t) {
|
|
1178
|
-
let s = l.getHours() < 12 ? "am" : "pm";
|
|
1179
|
-
return s = g.getMessage(s), s = s.toUpperCase(), s;
|
|
1180
|
-
}
|
|
1181
|
-
const Y = (l, e) => {
|
|
1182
|
-
if (l.length > 1e3)
|
|
1183
|
-
return null;
|
|
1184
|
-
e = e || S.date;
|
|
1185
|
-
const t = {
|
|
1186
|
-
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1187
|
-
month: 0,
|
|
1188
|
-
day: 1,
|
|
1189
|
-
hour: 0,
|
|
1190
|
-
minute: 0,
|
|
1191
|
-
second: 0,
|
|
1192
|
-
millisecond: 0,
|
|
1193
|
-
isPm: !1,
|
|
1194
|
-
isH: !1,
|
|
1195
|
-
charIdx: 0
|
|
1196
|
-
}, i = e.length;
|
|
1197
|
-
let s = 0;
|
|
1198
|
-
for (let a = 0; a < i; ) {
|
|
1199
|
-
let r = Math.min(ee, i - a);
|
|
1200
|
-
for (; r > 0; r--) {
|
|
1201
|
-
const d = e.substring(a, a + r);
|
|
1202
|
-
if (J.includes(d)) {
|
|
1203
|
-
const h = ht[d], u = dt(l.substring(s), h[0]);
|
|
1204
|
-
h[1](t, u), s += u.length;
|
|
1205
|
-
break;
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
r < 1 ? (a += 1, s += 1) : a += r;
|
|
1209
|
-
}
|
|
1210
|
-
t.hour != null && !t.isH && (t.isPm && +t.hour != 12 ? t.hour = +t.hour + 12 : !t.isPm && +t.hour == 12 && (t.hour = 0));
|
|
1211
|
-
let n;
|
|
1212
|
-
return n = new Date(t.year, t.month, t.day, t.hour, t.minute, t.second, t.millisecond), n;
|
|
1213
|
-
}, dt = (l, e) => {
|
|
1214
|
-
const t = e.exec(l);
|
|
1215
|
-
return t == null ? "" : t[0];
|
|
1216
|
-
}, E = {
|
|
1217
|
-
twoOptional: /\d\d?/,
|
|
1218
|
-
two: /\d\d/,
|
|
1219
|
-
three: /\d{3}/,
|
|
1220
|
-
four: /\d{4}/
|
|
1221
|
-
}, q = /[^\s]+/, ht = {
|
|
1222
|
-
YY: [
|
|
1223
|
-
E.two,
|
|
1224
|
-
(l, e) => (l.year = +(("" + (/* @__PURE__ */ new Date()).getFullYear()).substring(0, 2) + e), l)
|
|
1225
|
-
],
|
|
1226
|
-
YYYY: [
|
|
1227
|
-
E.four,
|
|
1228
|
-
(l, e) => (l.year = +e, l)
|
|
1229
|
-
],
|
|
1230
|
-
M: [
|
|
1231
|
-
E.twoOptional,
|
|
1232
|
-
(l, e) => (l.month = +e - 1, l)
|
|
1233
|
-
],
|
|
1234
|
-
MM: [
|
|
1235
|
-
E.two,
|
|
1236
|
-
(l, e) => (l.month = +e - 1, l)
|
|
1237
|
-
],
|
|
1238
|
-
MMM: [
|
|
1239
|
-
q,
|
|
1240
|
-
(l, e) => (l.month = g.getMonthsIdx(e, "abbr"), l)
|
|
1241
|
-
],
|
|
1242
|
-
MMMM: [
|
|
1243
|
-
q,
|
|
1244
|
-
(l, e) => (l.month = g.getMonthsIdx(e, "full"), l)
|
|
1245
|
-
],
|
|
1246
|
-
D: [
|
|
1247
|
-
E.twoOptional,
|
|
1248
|
-
(l, e) => (l.day = +e, l)
|
|
1249
|
-
],
|
|
1250
|
-
DD: [
|
|
1251
|
-
E.two,
|
|
1252
|
-
(l, e) => (l.day = +e, l)
|
|
1253
|
-
],
|
|
1254
|
-
d: [
|
|
1255
|
-
E.twoOptional,
|
|
1256
|
-
(l, e) => (l.day = +e, l)
|
|
1257
|
-
],
|
|
1258
|
-
dd: [
|
|
1259
|
-
E.two,
|
|
1260
|
-
(l, e) => (l.day = +e, l)
|
|
1261
|
-
],
|
|
1262
|
-
ddd: [
|
|
1263
|
-
q,
|
|
1264
|
-
(l, e) => l
|
|
1265
|
-
],
|
|
1266
|
-
dddd: [
|
|
1267
|
-
q,
|
|
1268
|
-
(l, e) => l
|
|
1269
|
-
],
|
|
1270
|
-
H: [
|
|
1271
|
-
E.twoOptional,
|
|
1272
|
-
(l, e) => (l.hour = +e, l.isH = !0, l)
|
|
1273
|
-
],
|
|
1274
|
-
HH: [
|
|
1275
|
-
E.two,
|
|
1276
|
-
(l, e) => (l.hour = +e, l.isH = !0, l)
|
|
1277
|
-
],
|
|
1278
|
-
h: [
|
|
1279
|
-
E.twoOptional,
|
|
1280
|
-
(l, e) => (l.hour = +e, l)
|
|
1281
|
-
],
|
|
1282
|
-
hh: [
|
|
1283
|
-
E.two,
|
|
1284
|
-
(l, e) => (l.hour = +e, l)
|
|
1285
|
-
],
|
|
1286
|
-
a: [
|
|
1287
|
-
q,
|
|
1288
|
-
(l, e) => (g.getMessage("am") != e.toLowerCase() && (l.isPm = !0), l)
|
|
1289
|
-
],
|
|
1290
|
-
A: [
|
|
1291
|
-
q,
|
|
1292
|
-
(l, e) => (g.getMessage("am") != e.toLowerCase() && (l.isPm = !0), l)
|
|
1293
|
-
],
|
|
1294
|
-
m: [
|
|
1295
|
-
E.twoOptional,
|
|
1296
|
-
(l, e) => (l.minute = +e, l)
|
|
1297
|
-
],
|
|
1298
|
-
mm: [
|
|
1299
|
-
E.two,
|
|
1300
|
-
(l, e) => (l.minute = +e, l)
|
|
1301
|
-
],
|
|
1302
|
-
s: [
|
|
1303
|
-
E.twoOptional,
|
|
1304
|
-
(l, e) => (l.second = +e, l)
|
|
1305
|
-
],
|
|
1306
|
-
ss: [
|
|
1307
|
-
E.two,
|
|
1308
|
-
(l, e) => (l.second = +e, l)
|
|
1309
|
-
],
|
|
1310
|
-
SSS: [
|
|
1311
|
-
E.three,
|
|
1312
|
-
(l, e) => (l.millisecond = +e, l)
|
|
1313
|
-
]
|
|
1314
|
-
};
|
|
1315
|
-
function ut(l, e) {
|
|
1316
|
-
let t = l;
|
|
1317
|
-
for (; t; ) {
|
|
1318
|
-
if (t == e)
|
|
1319
|
-
return !0;
|
|
1320
|
-
t = t.parentElement;
|
|
1321
|
-
}
|
|
1322
|
-
return !1;
|
|
1323
|
-
}
|
|
1324
|
-
class N {
|
|
1325
|
-
constructor(e) {
|
|
1326
|
-
this.date = e;
|
|
979
|
+
const e = U(this.getValue(), this.field);
|
|
980
|
+
return v(this.field, this.rowElement, e), e;
|
|
1327
981
|
}
|
|
1328
|
-
setYear(e) {
|
|
1329
|
-
return this.date.setFullYear(e), this;
|
|
1330
|
-
}
|
|
1331
|
-
addYear(e) {
|
|
1332
|
-
return this.date.setFullYear(this.date.getFullYear() + e), this;
|
|
1333
|
-
}
|
|
1334
|
-
addMonth(e) {
|
|
1335
|
-
return this.date.setMonth(this.date.getMonth() + e), this;
|
|
1336
|
-
}
|
|
1337
|
-
setMonth(e) {
|
|
1338
|
-
return this.date.setMonth(e), this;
|
|
1339
|
-
}
|
|
1340
|
-
setDate(e) {
|
|
1341
|
-
return this.date.setDate(e), this;
|
|
1342
|
-
}
|
|
1343
|
-
addDate(e) {
|
|
1344
|
-
return this.date.setDate(this.date.getDate() + e), this;
|
|
1345
|
-
}
|
|
1346
|
-
addWeek(e) {
|
|
1347
|
-
return this.date.setDate(this.date.getDate() + e * 7), this;
|
|
1348
|
-
}
|
|
1349
|
-
addHours(e) {
|
|
1350
|
-
return this.date.setHours(this.date.getHours() + e), this;
|
|
1351
|
-
}
|
|
1352
|
-
setHour(e) {
|
|
1353
|
-
return this.date.setHours(e), this;
|
|
1354
|
-
}
|
|
1355
|
-
addMinutes(e) {
|
|
1356
|
-
return this.date.setMinutes(this.date.getMinutes() + e), this;
|
|
1357
|
-
}
|
|
1358
|
-
setMinutes(e) {
|
|
1359
|
-
return this.date.setMinutes(e), this;
|
|
1360
|
-
}
|
|
1361
|
-
addSeconds(e) {
|
|
1362
|
-
return this.date.setSeconds(this.date.getSeconds() + e), this;
|
|
1363
|
-
}
|
|
1364
|
-
addMilliseconds(e) {
|
|
1365
|
-
return this.date.setMilliseconds(this.date.getMilliseconds() + e), this;
|
|
1366
|
-
}
|
|
1367
|
-
compare(e) {
|
|
1368
|
-
return this.date.valueOf() < e.valueOf() ? -1 : this.date.valueOf() > e.valueOf() ? 1 : 0;
|
|
1369
|
-
}
|
|
1370
|
-
getYear() {
|
|
1371
|
-
return this.date.getFullYear();
|
|
1372
|
-
}
|
|
1373
|
-
getMonth() {
|
|
1374
|
-
return this.date.getMonth() + 1;
|
|
1375
|
-
}
|
|
1376
|
-
getDate() {
|
|
1377
|
-
return this.date.getDate();
|
|
1378
|
-
}
|
|
1379
|
-
getDay() {
|
|
1380
|
-
return this.date.getDay();
|
|
1381
|
-
}
|
|
1382
|
-
getTime() {
|
|
1383
|
-
return this.date.getTime();
|
|
1384
|
-
}
|
|
1385
|
-
format(e) {
|
|
1386
|
-
return qe(this.date, e);
|
|
1387
|
-
}
|
|
1388
|
-
clone() {
|
|
1389
|
-
return new N(new Date(this.date.valueOf()));
|
|
1390
|
-
}
|
|
1391
|
-
}
|
|
1392
|
-
let le = {
|
|
1393
|
-
inline: !1,
|
|
1394
|
-
// layer or innerhtml
|
|
1395
|
-
weekStartDay: 0,
|
|
1396
|
-
initialDate: "",
|
|
1397
|
-
autoClose: !0,
|
|
1398
|
-
isRTL: !1,
|
|
1399
|
-
mode: m.date,
|
|
1400
|
-
enableTodayBtn: !1,
|
|
1401
|
-
showMonthAfterYear: !1,
|
|
1402
|
-
isPositionFixed: !1,
|
|
1403
|
-
format: "",
|
|
1404
|
-
zIndex: 1e3,
|
|
1405
|
-
minDate: "",
|
|
1406
|
-
maxDate: "",
|
|
1407
|
-
beforeDrawDate: (l) => ({
|
|
1408
|
-
check: !1,
|
|
1409
|
-
style: "",
|
|
1410
|
-
tooltip: ""
|
|
1411
|
-
})
|
|
1412
|
-
};
|
|
1413
|
-
function ct() {
|
|
1414
|
-
var l;
|
|
1415
|
-
return document.getElementById("hiddenDaraDatetimeElement") == null && ((l = document.querySelector("body")) == null || l.insertAdjacentHTML("beforeend", '<div id="hiddenDaraDatetimeElement" class="daracl-datetime-hidden"></div>')), document.getElementById("hiddenDaraDatetimeElement");
|
|
1416
982
|
}
|
|
1417
|
-
|
|
1418
|
-
const ie = class Ne {
|
|
1419
|
-
constructor(e, t, i) {
|
|
1420
|
-
var s;
|
|
1421
|
-
this.isInput = !1, this.isVisible = !1, this.minYear = -1, this.maxYear = -1, this.minMonth = -1, this.maxMonth = -1, this.dayOrder = [0, 1, 2, 3, 4, 5, 6], this._documentClickEvent = (o) => {
|
|
1422
|
-
this.isVisible && o.target != this.targetElement && !ut(o.target, this.datetimeElement) && this.hide();
|
|
1423
|
-
}, this.options = Object.assign({}, le, t), ne += 1;
|
|
1424
|
-
let n;
|
|
1425
|
-
if (typeof e == "string" ? n = document.querySelector(e) : n = e, !n)
|
|
1426
|
-
throw new Error(`${e} datetimepicker element not found`);
|
|
1427
|
-
this._viewMode = Object.keys(m).includes(this.options.mode) ? this.options.mode : m.date, this.initMode = this._viewMode, g.set(i), this.initMode == m.year ? this.dateFormat = this.options.format || S.year : this.initMode == m.month ? this.dateFormat = this.options.format || S.month : this.initMode == m.time ? this.dateFormat = this.options.format || S.time : this.initMode == m.datetime ? this.dateFormat = this.options.format || S.datetime : this.dateFormat = this.options.format || S.date;
|
|
1428
|
-
let a;
|
|
1429
|
-
if (this.options.initialDate ? typeof this.options.initialDate == "string" ? a = new N(Y(this.options.initialDate, this.dateFormat) || /* @__PURE__ */ new Date()) : a = new N(this.options.initialDate) : (a = new N(/* @__PURE__ */ new Date()), this.options.initialDate = a.format(this.dateFormat)), this.setWeekDays(), this.todayDate = a.format(S.date), this.currentDate = a, this.targetElement = n, this.minDate = this._minDate(), this.maxDate = this._maxDate(), this.options.inline)
|
|
1430
|
-
this.datetimeElement = n, this.datetimeElement.className = `daracl-datetime-wrapper ddtp-${ne} embed`;
|
|
1431
|
-
else {
|
|
1432
|
-
this.isInput = !0, this.targetElement.setAttribute("value", a.format(this.dateFormat));
|
|
1433
|
-
const o = document.createElement("div");
|
|
1434
|
-
o.className = `daracl-datetime-wrapper ddtp-${ne} layer`, o.setAttribute("style", `z-index:${this.options.zIndex};`), (s = ct()) == null || s.appendChild(o), this.datetimeElement = o, this.initTargetEvent();
|
|
1435
|
-
}
|
|
1436
|
-
this.createDatetimeTemplate(), this.isTimeMode() ? (this.hourInputEle = this.datetimeElement.querySelector(".ddtp-hour"), this.minuteInputEle = this.datetimeElement.querySelector(".ddtp-minute")) : (this.hourInputEle = {}, this.minuteInputEle = {}), this.changeViewMode(this._viewMode), this.initHeaderEvent(), this.initDateEvent(), this.initTimeEvent();
|
|
1437
|
-
}
|
|
1438
|
-
setWeekDays() {
|
|
1439
|
-
let e = this.options.weekStartDay;
|
|
1440
|
-
if (e != 0) {
|
|
1441
|
-
(e < 0 || e > 6) && (e = 0);
|
|
1442
|
-
for (let t = 0; t < 7; t++) {
|
|
1443
|
-
let i = e + t;
|
|
1444
|
-
this.dayOrder[t] = i < 7 ? i : i - 7;
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
static create(e, t, i) {
|
|
1449
|
-
return new Ne(e, t, i);
|
|
1450
|
-
}
|
|
1451
|
-
/**
|
|
1452
|
-
* default date format setting
|
|
1453
|
-
* @example
|
|
1454
|
-
```
|
|
1455
|
-
setDefaultFormat({
|
|
1456
|
-
year: "YYYY",
|
|
1457
|
-
month: "YYYY-MM",
|
|
1458
|
-
date: "YYYY-MM-DD",
|
|
1459
|
-
time: "HH:mm",
|
|
1460
|
-
datetime: "YYYY-MM-DD HH:mm",
|
|
1461
|
-
});
|
|
1462
|
-
```
|
|
1463
|
-
* @public
|
|
1464
|
-
* @static
|
|
1465
|
-
* @param {*} dateFormat
|
|
1466
|
-
*/
|
|
1467
|
-
static setDefaultFormat(e) {
|
|
1468
|
-
Object.assign(S, e);
|
|
1469
|
-
}
|
|
1470
|
-
_minDate() {
|
|
1471
|
-
let e = this.options.minDate;
|
|
1472
|
-
if (e != "") {
|
|
1473
|
-
if (typeof e == "string") {
|
|
1474
|
-
const t = Y(e, this.dateFormat);
|
|
1475
|
-
if (!t)
|
|
1476
|
-
return -1;
|
|
1477
|
-
e = t;
|
|
1478
|
-
}
|
|
1479
|
-
return this.minYear = e.getFullYear(), this.minMonth = +(this.minYear + w(e.getMonth(), 2)), new Date(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0).getTime();
|
|
1480
|
-
}
|
|
1481
|
-
return -1;
|
|
1482
|
-
}
|
|
1483
|
-
_maxDate() {
|
|
1484
|
-
let e = this.options.maxDate;
|
|
1485
|
-
if (e != "") {
|
|
1486
|
-
if (typeof e == "string") {
|
|
1487
|
-
const t = Y(e, this.dateFormat);
|
|
1488
|
-
if (!t)
|
|
1489
|
-
return -1;
|
|
1490
|
-
e = t;
|
|
1491
|
-
}
|
|
1492
|
-
return this.maxYear = e.getFullYear(), this.maxMonth = +(this.maxYear + w(e.getMonth(), 2)), new Date(e.getFullYear(), e.getMonth(), e.getDate(), 23, 59).getTime();
|
|
1493
|
-
}
|
|
1494
|
-
return -1;
|
|
1495
|
-
}
|
|
1496
|
-
set viewMode(e) {
|
|
1497
|
-
this._viewMode !== e && (this._viewMode = e, this.changeViewMode(e));
|
|
1498
|
-
}
|
|
1499
|
-
get viewMode() {
|
|
1500
|
-
return this._viewMode;
|
|
1501
|
-
}
|
|
1502
|
-
/**
|
|
1503
|
-
* 모드 change
|
|
1504
|
-
* @param mode
|
|
1505
|
-
*/
|
|
1506
|
-
changeViewMode(e) {
|
|
1507
|
-
var t;
|
|
1508
|
-
(t = this.datetimeElement.querySelector(".ddtp-datetime")) == null || t.setAttribute("view-mode", e), e === "year" ? this.yearDraw() : e === "month" ? this.monthDraw() : this.dayDraw();
|
|
1509
|
-
}
|
|
1510
|
-
/**
|
|
1511
|
-
* init header event
|
|
1512
|
-
*
|
|
1513
|
-
* @public
|
|
1514
|
-
*/
|
|
1515
|
-
initHeaderEvent() {
|
|
1516
|
-
var e, t, i, s;
|
|
1517
|
-
const n = this.options.isRTL;
|
|
1518
|
-
(e = this.datetimeElement.querySelector(".ddtp-move-btn.prev")) == null || e.addEventListener("click", (a) => {
|
|
1519
|
-
this.moveDate(n ? "next" : "prev", a);
|
|
1520
|
-
}), (t = this.datetimeElement.querySelector(".ddtp-move-btn.next")) == null || t.addEventListener("click", (a) => {
|
|
1521
|
-
this.moveDate(n ? "prev" : "next", a);
|
|
1522
|
-
}), (i = this.datetimeElement.querySelector(".ddtp-header-year")) == null || i.addEventListener("click", (a) => {
|
|
1523
|
-
this.viewMode = m.year;
|
|
1524
|
-
}), (s = this.datetimeElement.querySelector(".ddtp-header-month")) == null || s.addEventListener("click", (a) => {
|
|
1525
|
-
this.viewMode = m.month;
|
|
1526
|
-
});
|
|
1527
|
-
}
|
|
1528
|
-
/**
|
|
1529
|
-
* 날짜 달력 이벤트처리.
|
|
1530
|
-
*/
|
|
1531
|
-
initDateEvent() {
|
|
1532
|
-
var e, t;
|
|
1533
|
-
(e = this.datetimeElement.querySelector(".ddtp-day-body")) == null || e.addEventListener("click", (i) => {
|
|
1534
|
-
var s;
|
|
1535
|
-
const n = i.target;
|
|
1536
|
-
if (n.classList.contains("ddtp-day") || n.closest(".ddtp-day")) {
|
|
1537
|
-
const o = (n.getAttribute("data-day") || "1").split(",");
|
|
1538
|
-
if (this.currentDate.setMonth(+o[0] - 1), this.currentDate.setDate(+o[1]), this.isDayDisabled(this.currentDate))
|
|
1539
|
-
return;
|
|
1540
|
-
(s = this.datetimeElement.querySelector(".select")) == null || s.classList.remove("select"), n.classList.add("select"), this.isTimeMode() && (this.currentDate.setHour(+this.hourInputEle.value), this.currentDate.setMinutes(+this.minuteInputEle.value)), this.dateChangeEvent(i);
|
|
1541
|
-
}
|
|
1542
|
-
}), (t = this.datetimeElement.querySelector(".ddtp-today")) == null || t.addEventListener("click", (i) => {
|
|
1543
|
-
const s = new N(Y(this.todayDate, S.date) || /* @__PURE__ */ new Date());
|
|
1544
|
-
this.currentDate.setYear(s.getYear()), this.currentDate.setMonth(s.getMonth() - 1), this.currentDate.setDate(s.getDate()), this.changeViewMode(this.initMode);
|
|
1545
|
-
});
|
|
1546
|
-
}
|
|
1547
|
-
isTimeMode() {
|
|
1548
|
-
return this._viewMode === m.time || this._viewMode === m.datetime;
|
|
1549
|
-
}
|
|
1550
|
-
getTimeNumberValue(e) {
|
|
1551
|
-
return Re(e) ? parseInt(e, 10) : 0;
|
|
1552
|
-
}
|
|
1553
|
-
/**
|
|
1554
|
-
* 시간 분 설정 이벤트 처리.
|
|
1555
|
-
*
|
|
1556
|
-
* @public
|
|
1557
|
-
*/
|
|
1558
|
-
initTimeEvent() {
|
|
1559
|
-
var e;
|
|
1560
|
-
if (!this.isTimeMode()) return;
|
|
1561
|
-
let t = this.currentDate.format("HH");
|
|
1562
|
-
const i = this.datetimeElement, s = i.querySelector(".ddtp-hour"), n = i.querySelector(".ddtp-hour-range");
|
|
1563
|
-
s.value = t, n.value = t, s.addEventListener("input", (d) => {
|
|
1564
|
-
const h = d.target;
|
|
1565
|
-
let u = this.getTimeNumberValue(h.value), c = P(u, 2, "0");
|
|
1566
|
-
parseInt(c, 10) > 23 && (c = "23"), s.value = c, n.value = c;
|
|
1567
|
-
}), n.addEventListener("input", (d) => {
|
|
1568
|
-
const h = d.target;
|
|
1569
|
-
s.value = P(h.value, 2, "0");
|
|
1570
|
-
});
|
|
1571
|
-
let a = this.currentDate.format("mm");
|
|
1572
|
-
const o = i.querySelector(".ddtp-minute"), r = i.querySelector(".ddtp-minute-range");
|
|
1573
|
-
o.value = a, r.value = a, o.addEventListener("input", (d) => {
|
|
1574
|
-
const h = d.target;
|
|
1575
|
-
let u = this.getTimeNumberValue(h.value), c = P(u, 2, "0");
|
|
1576
|
-
parseInt(c, 10) > 59 && (c = "59"), o.value = c, r.value = c;
|
|
1577
|
-
}), r.addEventListener("input", (d) => {
|
|
1578
|
-
const h = d.target;
|
|
1579
|
-
o.value = P(h.value, 2, "0");
|
|
1580
|
-
}), (e = i.querySelector(".time-select")) == null || e.addEventListener("click", (d) => {
|
|
1581
|
-
this.currentDate.setHour(+s.value), this.currentDate.setMinutes(+o.value), this.dateChangeEvent(d);
|
|
1582
|
-
});
|
|
1583
|
-
}
|
|
1584
|
-
/**
|
|
1585
|
-
* 날짜 이동
|
|
1586
|
-
* @param moveMode // 앞뒤 이동 prev, next
|
|
1587
|
-
* @returns
|
|
1588
|
-
*/
|
|
1589
|
-
moveDate(e, t) {
|
|
1590
|
-
if (this._viewMode === m.date || this._viewMode === m.datetime) {
|
|
1591
|
-
this.currentDate.setDate(1), this.currentDate.addMonth(e === "prev" ? -1 : 1), this.dayDraw();
|
|
1592
|
-
return;
|
|
1593
|
-
}
|
|
1594
|
-
if (this._viewMode === m.month) {
|
|
1595
|
-
this.currentDate.setDate(1), this.currentDate.addYear(e === "prev" ? -1 : 1), this.monthDraw();
|
|
1596
|
-
return;
|
|
1597
|
-
}
|
|
1598
|
-
this._viewMode === m.year && (this.currentDate.setDate(1), this.currentDate.addYear(e === "prev" ? -16 : 16), this.yearDraw());
|
|
1599
|
-
}
|
|
1600
|
-
/**
|
|
1601
|
-
* get date value
|
|
1602
|
-
*
|
|
1603
|
-
* @returns
|
|
1604
|
-
*/
|
|
1605
|
-
getDateValue() {
|
|
1606
|
-
return this.currentDate.format(this.dateFormat);
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
|
-
* 옵션 셋팅
|
|
1610
|
-
* @static
|
|
1611
|
-
* @param {DateTimePickerOptions} options
|
|
1612
|
-
*/
|
|
1613
|
-
static setOptions(e) {
|
|
1614
|
-
le = Object.assign({}, le, e);
|
|
1615
|
-
}
|
|
1616
|
-
/**
|
|
1617
|
-
* 달력 보이기 처리.
|
|
1618
|
-
*
|
|
1619
|
-
* @returns
|
|
1620
|
-
*/
|
|
1621
|
-
show() {
|
|
1622
|
-
if (this.isVisible)
|
|
1623
|
-
return;
|
|
1624
|
-
this.isVisible = !0;
|
|
1625
|
-
const e = mt();
|
|
1626
|
-
this.datetimeElement.classList.remove("hide"), this.datetimeElement.classList.add("show");
|
|
1627
|
-
const t = this.targetElement.getBoundingClientRect(), i = window.scrollY || document.documentElement.scrollTop, s = window.scrollX || document.documentElement.scrollLeft, n = this.datetimeElement.offsetHeight, a = this.targetElement.offsetHeight + 2;
|
|
1628
|
-
let o = t.left + s, r = 0;
|
|
1629
|
-
this.options.isPositionFixed ? (r = t.top + a, o = t.left) : t.top + a + n > e.clientHeight && t.top >= n ? r = i + t.top - n - 2 : r = i + t.top + a, this.datetimeElement.setAttribute("style", `${this.options.isPositionFixed ? "position:fixed;" : ""}top:${r}px;left:${o}px;z-index:${this.options.zIndex}`), document.addEventListener("click", this._documentClickEvent);
|
|
1630
|
-
}
|
|
1631
|
-
/**
|
|
1632
|
-
* 달력 숨기기
|
|
1633
|
-
*/
|
|
1634
|
-
hide() {
|
|
1635
|
-
this.isVisible = !1, !(this.options.onClose && this.options.onClose() === !1) && (this.datetimeElement.classList.remove("show"), this.datetimeElement.classList.add("hide"), document.removeEventListener("click", this._documentClickEvent));
|
|
1636
|
-
}
|
|
1637
|
-
/**
|
|
1638
|
-
* 타켓 이벤트 처리.
|
|
1639
|
-
*/
|
|
1640
|
-
initTargetEvent() {
|
|
1641
|
-
this.targetElement && this.targetElement.addEventListener("click", (e) => {
|
|
1642
|
-
this.show();
|
|
1643
|
-
});
|
|
1644
|
-
}
|
|
1645
|
-
/**
|
|
1646
|
-
* 날짜 변경후 이벤트
|
|
1647
|
-
*/
|
|
1648
|
-
afterChangeDatepicker() {
|
|
1649
|
-
const e = this.currentDate.format(this.dateFormat);
|
|
1650
|
-
this.options.afterChangeDatepicker && H(this.options.afterChangeDatepicker) && this.options.afterChangeDatepicker(e, this.viewMode);
|
|
1651
|
-
}
|
|
1652
|
-
/**
|
|
1653
|
-
* 날짜 변경 전 이벤트.
|
|
1654
|
-
* @returns void
|
|
1655
|
-
*/
|
|
1656
|
-
beforeChangeDatepicker() {
|
|
1657
|
-
const e = this.currentDate.format(this.dateFormat);
|
|
1658
|
-
if (this.options.beforeChangeDatepicker && H(this.options.beforeChangeDatepicker)) {
|
|
1659
|
-
if (this.options.beforeChangeDatepicker(e, (i) => {
|
|
1660
|
-
i !== !1 && this.refresh(!1);
|
|
1661
|
-
}) === !1)
|
|
1662
|
-
return;
|
|
1663
|
-
this.refresh(!1);
|
|
1664
|
-
return;
|
|
1665
|
-
}
|
|
1666
|
-
this.refresh(!1);
|
|
1667
|
-
}
|
|
1668
|
-
dateChangeEvent(e) {
|
|
1669
|
-
const t = this.currentDate.format(this.dateFormat);
|
|
1670
|
-
this.options.onSelect && this.options.onSelect(t, this.viewMode, e) === !1 || (this.isInput && this.targetElement.setAttribute("value", t), !this.options.inline && this.options.autoClose && this.hide());
|
|
1671
|
-
}
|
|
1672
|
-
/**
|
|
1673
|
-
* datepicker template 그리기
|
|
1674
|
-
*/
|
|
1675
|
-
createDatetimeTemplate() {
|
|
1676
|
-
const e = this.options.showMonthAfterYear;
|
|
1677
|
-
let t = `<div class="ddtp-datetime ${this.options.isRTL ? "rtl" : ""}" view-mode="${this._viewMode}">
|
|
1678
|
-
<div class="ddtp-header">
|
|
1679
|
-
<span class="${e ? "ddtp-header-year" : "ddtp-header-month"}"></span>
|
|
1680
|
-
<span class="${e ? "ddtp-header-month" : "ddtp-header-year"}"></span>
|
|
1681
|
-
|
|
1682
|
-
<span class="ddtp-date-move">
|
|
1683
|
-
<a href="javascript:;" class="ddtp-move-btn prev">
|
|
1684
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>
|
|
1685
|
-
</a>
|
|
1686
|
-
<a href="javascript:;" class="ddtp-move-btn next">
|
|
1687
|
-
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>
|
|
1688
|
-
</a>
|
|
1689
|
-
</span>
|
|
1690
|
-
</div>
|
|
1691
|
-
<div class="ddtp-body">
|
|
1692
|
-
<table class="ddtp-days">
|
|
1693
|
-
<thead class="ddtp-day-header">
|
|
1694
|
-
<tr>
|
|
1695
|
-
<td class="ddtp-day-label ${k[this.dayOrder[0]]}">${g.getWeeksMessage(this.dayOrder[0])}</td>
|
|
1696
|
-
<td class="ddtp-day-label ${k[this.dayOrder[1]]}">${g.getWeeksMessage(this.dayOrder[1])}</td>
|
|
1697
|
-
<td class="ddtp-day-label ${k[this.dayOrder[2]]}">${g.getWeeksMessage(this.dayOrder[2])}</td>
|
|
1698
|
-
<td class="ddtp-day-label ${k[this.dayOrder[3]]}">${g.getWeeksMessage(this.dayOrder[3])}</td>
|
|
1699
|
-
<td class="ddtp-day-label ${k[this.dayOrder[4]]}">${g.getWeeksMessage(this.dayOrder[4])}</td>
|
|
1700
|
-
<td class="ddtp-day-label ${k[this.dayOrder[5]]}">${g.getWeeksMessage(this.dayOrder[5])}</td>
|
|
1701
|
-
<td class="ddtp-day-label ${k[this.dayOrder[6]]}">${g.getWeeksMessage(this.dayOrder[6])}</td>
|
|
1702
|
-
</tr>
|
|
1703
|
-
</thead>
|
|
1704
|
-
<tbody class="ddtp-day-body">
|
|
1705
|
-
</tbody>
|
|
1706
|
-
|
|
1707
|
-
<tfoot class="ddtp-day-footer">
|
|
1708
|
-
<td colspan="7">
|
|
1709
|
-
<div style="width:99%;text-align:center;margin-top: 5px;${this.options.enableTodayBtn ? "" : "display:none;"}"><button type="button" class="ddtp-today">${g.getMessage("today")}</button></div>
|
|
1710
|
-
<div class="footer-tooltip"></div>
|
|
1711
|
-
</td>
|
|
1712
|
-
</tfoot>
|
|
1713
|
-
</table>
|
|
1714
|
-
|
|
1715
|
-
<div class="ddtp-times">
|
|
1716
|
-
<div class="time-container">
|
|
1717
|
-
<div class="ddtp-time">
|
|
1718
|
-
<span>H: </span><input type="number" class="ddtp-hour" min="0" max="23" maxlength="2">
|
|
1719
|
-
<input type="range" min="0" max="23" class="ddtp-hour-range">
|
|
1720
|
-
</div>
|
|
1721
|
-
<div class="ddtp-time">
|
|
1722
|
-
<span>M: </span><input type="number" class="ddtp-minute" min="0" max="59" size="2" maxlength="2">
|
|
1723
|
-
<input type="range" min="0" max="59" class="ddtp-minute-range">
|
|
1724
|
-
</div>
|
|
1725
|
-
</div>
|
|
1726
|
-
<div class="ddtp-btn">
|
|
1727
|
-
<button type="button" class="time-select">${g.getMessage("ok")}</button>
|
|
1728
|
-
</div>
|
|
1729
|
-
</div>
|
|
1730
|
-
|
|
1731
|
-
<div class="ddtp-months">
|
|
1732
|
-
</div>
|
|
1733
|
-
|
|
1734
|
-
<div class="ddtp-years">
|
|
1735
|
-
</div>
|
|
1736
|
-
</div>
|
|
1737
|
-
</div>`;
|
|
1738
|
-
this.datetimeElement.innerHTML = t;
|
|
1739
|
-
}
|
|
1740
|
-
refresh(e) {
|
|
1741
|
-
if (this._viewMode === m.date || this._viewMode === m.datetime) {
|
|
1742
|
-
this.dayDraw(e);
|
|
1743
|
-
return;
|
|
1744
|
-
}
|
|
1745
|
-
if (this._viewMode === m.month) {
|
|
1746
|
-
this.monthDraw(e);
|
|
1747
|
-
return;
|
|
1748
|
-
}
|
|
1749
|
-
this._viewMode === m.year && this.yearDraw(e);
|
|
1750
|
-
}
|
|
1751
|
-
/**
|
|
1752
|
-
* 년 달력 그리기
|
|
1753
|
-
*/
|
|
1754
|
-
yearDraw(e) {
|
|
1755
|
-
var t;
|
|
1756
|
-
const i = this.currentDate.format("YYYY");
|
|
1757
|
-
if (e !== !1 && this.initMode == m.year) {
|
|
1758
|
-
this.beforeChangeDatepicker();
|
|
1759
|
-
return;
|
|
1760
|
-
}
|
|
1761
|
-
const s = +i - 8;
|
|
1762
|
-
this.datetimeElement.querySelector(".ddtp-header-year").textContent = `${s} ~ ${s + 15}`;
|
|
1763
|
-
const n = H(this.options.beforeDrawDate), a = n ? this.options.beforeDrawDate : !1, o = [];
|
|
1764
|
-
for (let r = 0; r < 16; r++) {
|
|
1765
|
-
const d = s + r;
|
|
1766
|
-
let u = this.isYearDisabled(d) ? " disabled" : "", c = "";
|
|
1767
|
-
if (n && a) {
|
|
1768
|
-
const p = a({ mode: this._viewMode, date: d });
|
|
1769
|
-
u += p.style ? " " + p.style : "", c = p.tooltip, c = c ? `title="${c}"` : "";
|
|
1770
|
-
}
|
|
1771
|
-
o.push(`<div class="ddtp-year ${u}" data-year="${d}" ${c}>${d}</div>`);
|
|
1772
|
-
}
|
|
1773
|
-
this.datetimeElement.querySelector(".ddtp-years").innerHTML = o.join(""), this.initMode == m.year && this.afterChangeDatepicker(), (t = this.datetimeElement.querySelectorAll(".ddtp-year")) == null || t.forEach((r) => {
|
|
1774
|
-
r.addEventListener("click", (d) => {
|
|
1775
|
-
const h = d.target;
|
|
1776
|
-
if (h) {
|
|
1777
|
-
const u = h.getAttribute("data-year");
|
|
1778
|
-
if (u) {
|
|
1779
|
-
const c = +u;
|
|
1780
|
-
if (this.isYearDisabled(c))
|
|
1781
|
-
return;
|
|
1782
|
-
if (this.initMode == m.year) {
|
|
1783
|
-
if (this.isYearDisabled(c))
|
|
1784
|
-
return;
|
|
1785
|
-
this.currentDate.setYear(c), this.dateChangeEvent(d);
|
|
1786
|
-
return;
|
|
1787
|
-
}
|
|
1788
|
-
this.currentDate.setYear(c), this.viewMode = this.initMode;
|
|
1789
|
-
}
|
|
1790
|
-
}
|
|
1791
|
-
});
|
|
1792
|
-
});
|
|
1793
|
-
}
|
|
1794
|
-
/**
|
|
1795
|
-
* 월 달력 그리기
|
|
1796
|
-
*/
|
|
1797
|
-
monthDraw(e) {
|
|
1798
|
-
var t;
|
|
1799
|
-
if (e !== !1 && this.initMode == m.month) {
|
|
1800
|
-
this.beforeChangeDatepicker();
|
|
1801
|
-
return;
|
|
1802
|
-
}
|
|
1803
|
-
const i = this.currentDate.format("YYYY");
|
|
1804
|
-
this.datetimeElement.querySelector(".ddtp-header-year").textContent = `${i}`;
|
|
1805
|
-
const s = this.datetimeElement.querySelectorAll(".ddtp-months > .ddtp-month");
|
|
1806
|
-
if (s.length > 0) {
|
|
1807
|
-
if (this.isYearDisabled(+i)) {
|
|
1808
|
-
s.forEach((r) => {
|
|
1809
|
-
r.classList.contains("disabled") || r.classList.add("disabled");
|
|
1810
|
-
});
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
s.forEach((r, d) => {
|
|
1814
|
-
this.isMonthDisabled(+i, d) ? r.classList.contains("disabled") || r.classList.add("disabled") : r.classList.remove("disabled");
|
|
1815
|
-
}), this.initMode == m.month && this.afterChangeDatepicker();
|
|
1816
|
-
return;
|
|
1817
|
-
}
|
|
1818
|
-
this.datetimeElement.querySelector(".ddtp-header-month").textContent = this.currentDate.format("MMMM");
|
|
1819
|
-
const n = H(this.options.beforeDrawDate), a = n ? this.options.beforeDrawDate : !1, o = [];
|
|
1820
|
-
for (let r = 0; r < 12; r++) {
|
|
1821
|
-
let h = this.isMonthDisabled(+i, r) ? " disabled" : "", u = "";
|
|
1822
|
-
if (n && a) {
|
|
1823
|
-
const c = a({ mode: this._viewMode, date: i + "/" + (r + 1) });
|
|
1824
|
-
h += c.style ? " " + c.style : "", u = c.tooltip, u = u ? `title="${u}"` : "";
|
|
1825
|
-
}
|
|
1826
|
-
o.push(`<div class="ddtp-month ${h}" data-month="${r}" ${u}>${g.getMonthsMessage(r, "abbr")}</div>`);
|
|
1827
|
-
}
|
|
1828
|
-
this.datetimeElement.querySelector(".ddtp-months").innerHTML = o.join(""), this.initMode == m.month && this.afterChangeDatepicker(), (t = this.datetimeElement.querySelectorAll(".ddtp-month")) == null || t.forEach((r) => {
|
|
1829
|
-
r.addEventListener("click", (d) => {
|
|
1830
|
-
const h = d.target;
|
|
1831
|
-
if (h) {
|
|
1832
|
-
const u = h.getAttribute("data-month");
|
|
1833
|
-
if (u) {
|
|
1834
|
-
if (this.isMonthDisabled(this.currentDate.getYear(), +u))
|
|
1835
|
-
return !1;
|
|
1836
|
-
if (this.initMode == m.month) {
|
|
1837
|
-
this.currentDate.setMonth(+u), this.dateChangeEvent(d);
|
|
1838
|
-
return;
|
|
1839
|
-
}
|
|
1840
|
-
this.currentDate.setMonth(+u), this.viewMode = this.initMode, this.dayDraw();
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
});
|
|
1844
|
-
});
|
|
1845
|
-
}
|
|
1846
|
-
/**
|
|
1847
|
-
* 날짜 그리기
|
|
1848
|
-
*/
|
|
1849
|
-
dayDraw(e) {
|
|
1850
|
-
if (e !== !1 && (this.initMode == m.date || this.initMode == m.datetime)) {
|
|
1851
|
-
this.beforeChangeDatepicker();
|
|
1852
|
-
return;
|
|
1853
|
-
}
|
|
1854
|
-
let t = this.currentDate.clone();
|
|
1855
|
-
const i = t.getMonth();
|
|
1856
|
-
t.setDate(1), this.datetimeElement.querySelector(".ddtp-header-year").textContent = t.format("YYYY"), this.datetimeElement.querySelector(".ddtp-header-month").textContent = t.format("MMMM");
|
|
1857
|
-
let s = t.getDay();
|
|
1858
|
-
s = s - this.dayOrder[0], s >= 0 ? t.addDate(-s) : t.addDate(-(7 + s));
|
|
1859
|
-
const n = H(this.options.beforeDrawDate), a = n ? this.options.beforeDrawDate : !1, o = [];
|
|
1860
|
-
for (let r = 0; r < 42; r++) {
|
|
1861
|
-
let d;
|
|
1862
|
-
r == 0 ? d = t : d = t.clone().addDate(r);
|
|
1863
|
-
const h = d.format(S.date);
|
|
1864
|
-
r % 7 == 0 && o.push((r == 0 ? "" : "</tr>") + "<tr>");
|
|
1865
|
-
let u = this.isDayDisabled(d), c = k[this.dayOrder[r % 7]];
|
|
1866
|
-
const p = d.getMonth();
|
|
1867
|
-
p != i && (p < i ? c += p == 1 ? " new" : " old" : c += i == 1 && p == 12 ? " old" : " new"), c += this.todayDate == h ? " ddtp-today" : "", c += u ? " disabled" : "";
|
|
1868
|
-
let x = "";
|
|
1869
|
-
if (n && a) {
|
|
1870
|
-
const V = a({ mode: this._viewMode, item: d, date: d.format(this.dateFormat) });
|
|
1871
|
-
c += V.style ? " " + V.style : "", c += V.check ? " ddtp-event" : "", x = V.tooltip, x = x ? `title="${x}"` : "";
|
|
1872
|
-
}
|
|
1873
|
-
o.push(`<td class="ddtp-day ${c}" data-day="${d.format("M,D")}" ${x}>`), o.push(`<span>${d.format("d")}</span>`), o.push("</td>");
|
|
1874
|
-
}
|
|
1875
|
-
o.push("</tr>"), this.datetimeElement.querySelector(".ddtp-day-body").innerHTML = o.join(""), (this.initMode == m.date || this.initMode == m.datetime) && this.afterChangeDatepicker();
|
|
1876
|
-
}
|
|
1877
|
-
isDayDisabled(e) {
|
|
1878
|
-
return this.minDate != -1 && this.minDate > e.getTime() || this.maxDate != -1 && this.maxDate < e.getTime();
|
|
1879
|
-
}
|
|
1880
|
-
isYearDisabled(e) {
|
|
1881
|
-
return this.minYear != -1 && this.minYear > e || this.maxYear != -1 && this.maxYear < e;
|
|
1882
|
-
}
|
|
1883
|
-
isMonthDisabled(e, t) {
|
|
1884
|
-
if (this.isYearDisabled(e))
|
|
1885
|
-
return !0;
|
|
1886
|
-
let i = +(e + w(t, 2));
|
|
1887
|
-
return this.minMonth != -1 && this.minMonth > i || this.maxMonth != -1 && this.maxMonth < i;
|
|
1888
|
-
}
|
|
1889
|
-
static setMessage(e) {
|
|
1890
|
-
g.setDefaultMessage(e);
|
|
1891
|
-
}
|
|
1892
|
-
};
|
|
1893
|
-
ie.VERSION = "0.0.13";
|
|
1894
|
-
ie.format = qe;
|
|
1895
|
-
ie.parser = Y;
|
|
1896
|
-
let ft = ie;
|
|
1897
|
-
function mt() {
|
|
1898
|
-
return {
|
|
1899
|
-
clientHeight: Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
|
|
1900
|
-
clientWidth: Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
|
|
1901
|
-
};
|
|
1902
|
-
}
|
|
1903
|
-
class X extends f {
|
|
983
|
+
class D extends c {
|
|
1904
984
|
constructor(e, t, i) {
|
|
1905
985
|
super(i, e, t), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
1906
986
|
}
|
|
1907
987
|
mounted() {
|
|
1908
988
|
let e;
|
|
1909
|
-
this.field.rendererOptions = Object.assign({}, this.field.rendererOptions), typeof this.field.rendererOptions.onSelect < "u" && (e =
|
|
1910
|
-
e && e(t, i), this.setValue(t), this.valid();
|
|
1911
|
-
}, this.dateObj = new
|
|
989
|
+
this.field.rendererOptions = Object.assign({}, this.field.rendererOptions), typeof this.field.rendererOptions.onSelect < "u" && (e = this.field.rendererOptions.onSelect), g(this.field.rendererOptions.mode) && (this.field.renderType == "datemonth" || this.field.renderType == "datehour" ? this.field.rendererOptions.mode = this.field.renderType.replace("date", "") : this.field.rendererOptions.mode = this.field.renderType), this.field.rendererOptions.onSelect = (t, i) => {
|
|
990
|
+
ve(e) && e(t, i), this.setValue(t), this.valid();
|
|
991
|
+
}, this.dateObj = new Ee(this.element, this.field.rendererOptions, {});
|
|
1912
992
|
}
|
|
1913
993
|
createField() {
|
|
1914
994
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
@@ -1916,7 +996,7 @@ class X extends f {
|
|
|
1916
996
|
<div class="df-field">
|
|
1917
997
|
<input type="text" name="${e.$xssName}" class="df-form-field df-text df-help-icon" autocomplete="off" readonly/>
|
|
1918
998
|
</div>
|
|
1919
|
-
${
|
|
999
|
+
${c.getDescriptionTemplate(e)}
|
|
1920
1000
|
<div class="df-help-message"></div>
|
|
1921
1001
|
`, this.element = t.querySelector(`[name="${e.$xssName}"]`);
|
|
1922
1002
|
}
|
|
@@ -1931,17 +1011,17 @@ class X extends f {
|
|
|
1931
1011
|
this.field.$value = e, this.element.value = e;
|
|
1932
1012
|
}
|
|
1933
1013
|
reset() {
|
|
1934
|
-
this.setDefaultInfo(), this.setDisabled(!1),
|
|
1014
|
+
this.setDefaultInfo(), this.setDisabled(!1), $(this.rowElement);
|
|
1935
1015
|
}
|
|
1936
1016
|
getElement() {
|
|
1937
1017
|
return this.element;
|
|
1938
1018
|
}
|
|
1939
1019
|
valid() {
|
|
1940
|
-
const e =
|
|
1941
|
-
return
|
|
1020
|
+
const e = S(this.getValue(), this.field);
|
|
1021
|
+
return v(this.field, this.rowElement, e), e;
|
|
1942
1022
|
}
|
|
1943
1023
|
}
|
|
1944
|
-
class
|
|
1024
|
+
class Re extends c {
|
|
1945
1025
|
constructor(e, t, i) {
|
|
1946
1026
|
super(i, e, t), e.renderer ? this.customFunction = e.renderer : this.customFunction = {}, this.mounted();
|
|
1947
1027
|
}
|
|
@@ -1962,7 +1042,7 @@ class pt extends f {
|
|
|
1962
1042
|
this.setActive(e.getAttribute("data-tab-id") ?? "");
|
|
1963
1043
|
}
|
|
1964
1044
|
setActive(e) {
|
|
1965
|
-
var s,
|
|
1045
|
+
var s, l;
|
|
1966
1046
|
const t = this.tabContainerElement.querySelector(`[data-tab-id="${e}"]`);
|
|
1967
1047
|
if (!t) return;
|
|
1968
1048
|
if (!t.classList.contains("active")) {
|
|
@@ -1972,7 +1052,7 @@ class pt extends f {
|
|
|
1972
1052
|
}
|
|
1973
1053
|
const i = this.rowElement.querySelector(`[tab-panel-id="${e}"]`);
|
|
1974
1054
|
if (!(i != null && i.classList.contains("active"))) {
|
|
1975
|
-
for (let a of ((
|
|
1055
|
+
for (let a of ((l = i == null ? void 0 : i.parentElement) == null ? void 0 : l.children) ?? [])
|
|
1976
1056
|
a.classList.remove("active");
|
|
1977
1057
|
i == null || i.classList.add("active");
|
|
1978
1058
|
}
|
|
@@ -1992,26 +1072,26 @@ class pt extends f {
|
|
|
1992
1072
|
* @returns {string} template string
|
|
1993
1073
|
*/
|
|
1994
1074
|
createField() {
|
|
1995
|
-
var a,
|
|
1075
|
+
var a, r;
|
|
1996
1076
|
const e = this.field, t = this.daraForm.formTemplate, i = this.daraForm.getOptions(), s = this.rowElement.querySelector(".df-field-container");
|
|
1997
|
-
let
|
|
1077
|
+
let l = C(i, e);
|
|
1998
1078
|
if (s.innerHTML = `
|
|
1999
1079
|
<div class="df-field ">
|
|
2000
|
-
<div class="df-tab-header ${
|
|
1080
|
+
<div class="df-tab-header ${l.tabAlignClass}"></div>
|
|
2001
1081
|
</div>
|
|
2002
1082
|
<div class="df-tab-body"></div>
|
|
2003
1083
|
`, e.children) {
|
|
2004
|
-
let
|
|
1084
|
+
let o = !0;
|
|
2005
1085
|
const d = this.getForm().getOptions();
|
|
2006
|
-
let
|
|
2007
|
-
for (const
|
|
2008
|
-
|
|
2009
|
-
let
|
|
1086
|
+
let u = C(d, e, null, t.isLabelHide(e));
|
|
1087
|
+
for (const h of e.children) {
|
|
1088
|
+
h.$parent = e, t.addRowFieldInfo(h);
|
|
1089
|
+
let f = h.$key, m = `<span class="df-tab-item ${o ? "active" : ""}" data-tab-id="${f}"><a href="javascript:;">${h.label}</a></span>`, A = `<div class="df-tab-panel ${o ? "active" : ""}" tab-panel-id="${f}">${c.getDescriptionTemplate(h)}
|
|
2010
1090
|
<div class="df-tab-group"></div>
|
|
2011
1091
|
</div>`;
|
|
2012
|
-
const
|
|
2013
|
-
if (
|
|
2014
|
-
let
|
|
1092
|
+
const T = N(m), b = N(A);
|
|
1093
|
+
if (o = !1, T && ((a = s.querySelector(".df-tab-header")) == null || a.appendChild(T)), b && ((r = s.querySelector(".df-tab-body")) == null || r.appendChild(b), h.children)) {
|
|
1094
|
+
let R = {
|
|
2015
1095
|
style: {
|
|
2016
1096
|
width: d.style.width ?? "100%",
|
|
2017
1097
|
labelWidth: d.style.labelWidth ?? 3,
|
|
@@ -2023,7 +1103,7 @@ class pt extends f {
|
|
|
2023
1103
|
notValidMessage: "This form is not valid.",
|
|
2024
1104
|
fields: []
|
|
2025
1105
|
};
|
|
2026
|
-
|
|
1106
|
+
h.$tabForm = new z(document.createElement("div"), R), h.$instance = new h.$renderType(h, b == null ? void 0 : b.querySelector(".df-tab-group"), h.$tabForm), h.$tabForm.formTemplate.childTemplate(h, u);
|
|
2027
1107
|
}
|
|
2028
1108
|
}
|
|
2029
1109
|
this.tabContainerElement = s;
|
|
@@ -2035,12 +1115,12 @@ class pt extends f {
|
|
|
2035
1115
|
return this.customFunction.getValue.call(this, this.field, this.rowElement);
|
|
2036
1116
|
let e = {}, t = this.getForm().getOptions().useTypeValue;
|
|
2037
1117
|
for (const s of this.field.children) {
|
|
2038
|
-
const
|
|
1118
|
+
const l = (i = s.$tabForm) == null ? void 0 : i.getValue(!1);
|
|
2039
1119
|
if (t)
|
|
2040
|
-
e[s.$validName] =
|
|
1120
|
+
e[s.$validName] = l;
|
|
2041
1121
|
else
|
|
2042
|
-
for (let [a,
|
|
2043
|
-
e[a] =
|
|
1122
|
+
for (let [a, r] of Object.entries(l))
|
|
1123
|
+
e[a] = r;
|
|
2044
1124
|
}
|
|
2045
1125
|
return e;
|
|
2046
1126
|
}
|
|
@@ -2052,6 +1132,9 @@ class pt extends f {
|
|
|
2052
1132
|
}
|
|
2053
1133
|
}
|
|
2054
1134
|
reset() {
|
|
1135
|
+
var e;
|
|
1136
|
+
for (const t of this.field.children ?? [])
|
|
1137
|
+
(e = t.$tabForm) == null || e.resetForm();
|
|
2055
1138
|
}
|
|
2056
1139
|
getElement() {
|
|
2057
1140
|
return this.rowElement;
|
|
@@ -2060,16 +1143,16 @@ class pt extends f {
|
|
|
2060
1143
|
var t;
|
|
2061
1144
|
if (this.customFunction.valid) {
|
|
2062
1145
|
const i = this.customFunction.valid.call(this, this.field, this.rowElement);
|
|
2063
|
-
|
|
1146
|
+
v(this.field, this.rowElement, i);
|
|
2064
1147
|
return;
|
|
2065
1148
|
}
|
|
2066
1149
|
const e = this.field;
|
|
2067
1150
|
for (const i of e.children) {
|
|
2068
1151
|
const s = (t = i.$tabForm) == null ? void 0 : t.validForm();
|
|
2069
1152
|
if (s && s.length > 0) {
|
|
2070
|
-
const
|
|
2071
|
-
if (
|
|
2072
|
-
return
|
|
1153
|
+
const l = s[0];
|
|
1154
|
+
if (l.message)
|
|
1155
|
+
return l.message = "[" + this.field.label + "] " + l.message, l;
|
|
2073
1156
|
}
|
|
2074
1157
|
}
|
|
2075
1158
|
return !0;
|
|
@@ -2077,8 +1160,8 @@ class pt extends f {
|
|
|
2077
1160
|
focus() {
|
|
2078
1161
|
}
|
|
2079
1162
|
}
|
|
2080
|
-
let
|
|
2081
|
-
class
|
|
1163
|
+
let O = 0;
|
|
1164
|
+
class De extends c {
|
|
2082
1165
|
constructor(e, t, i) {
|
|
2083
1166
|
super(i, e, t), this.allAddRowInfo = {}, e.renderer ? this.customFunction = e.renderer : this.customFunction = {};
|
|
2084
1167
|
const s = {
|
|
@@ -2092,7 +1175,7 @@ class gt extends f {
|
|
|
2092
1175
|
notValidMessage: "This form is not valid.",
|
|
2093
1176
|
fields: []
|
|
2094
1177
|
};
|
|
2095
|
-
this.gridForm = new
|
|
1178
|
+
this.gridForm = new z(document.createElement("div"), s), this.mounted(), this.setDefaultOption(), this.setDefaultInfo();
|
|
2096
1179
|
}
|
|
2097
1180
|
mounted() {
|
|
2098
1181
|
var e;
|
|
@@ -2107,19 +1190,19 @@ class gt extends f {
|
|
|
2107
1190
|
return !1;
|
|
2108
1191
|
}
|
|
2109
1192
|
createField() {
|
|
2110
|
-
var a,
|
|
1193
|
+
var a, r, o, d;
|
|
2111
1194
|
const e = this.field, t = this.rowElement.querySelector(".df-field-container");
|
|
2112
|
-
let i = [], s = [],
|
|
2113
|
-
if (
|
|
1195
|
+
let i = [], s = [], l = [];
|
|
1196
|
+
if (l.push(""), e.children) {
|
|
2114
1197
|
s.push("<colgroup>"), i.push("<tr>"), s.push('<col style="width:38px">'), i.push("<th>"), ((a = e.rendererOptions) == null ? void 0 : a.disableAddButton) !== !0 && i.push('<button type="button" class="df-btn df-grid-add-row-btn" title="Add"><i class="df-icon df-add-icon"></i></button>'), i.push("</th>");
|
|
2115
|
-
for (const
|
|
2116
|
-
s.push(`<col style="width:${((
|
|
1198
|
+
for (const u of e.children)
|
|
1199
|
+
s.push(`<col style="width:${((r = u.style) == null ? void 0 : r.width) ?? "*"}">`), i.push(`<th class="df-grid-header">${u.label}</th>`);
|
|
2117
1200
|
s.push("</colgroup>"), i.push("</tr>");
|
|
2118
1201
|
}
|
|
2119
1202
|
t.innerHTML = `
|
|
2120
1203
|
<div class="df-grid-field">
|
|
2121
|
-
${
|
|
2122
|
-
<div class="df-grid-container ${((
|
|
1204
|
+
${l.join("")}
|
|
1205
|
+
<div class="df-grid-container ${((o = e.style) == null ? void 0 : o.position) ?? ""}" style="height:${((d = e.rendererOptions) == null ? void 0 : d.height) ?? "auto"};">
|
|
2123
1206
|
<table class="df-grid">${s.join("")}<thead>${i.join("")}</thead><tbody></tbody></table>
|
|
2124
1207
|
</div>
|
|
2125
1208
|
</div>
|
|
@@ -2129,23 +1212,23 @@ class gt extends f {
|
|
|
2129
1212
|
* add row
|
|
2130
1213
|
*/
|
|
2131
1214
|
addRow(e) {
|
|
2132
|
-
var
|
|
1215
|
+
var o, d, u;
|
|
2133
1216
|
let t = [];
|
|
2134
|
-
const i = this.daraForm.getOptions(), s = this.gridForm.formTemplate,
|
|
2135
|
-
++
|
|
1217
|
+
const i = this.daraForm.getOptions(), s = this.gridForm.formTemplate, l = this.field.$xssName;
|
|
1218
|
+
++O;
|
|
2136
1219
|
let a = [];
|
|
2137
|
-
t.push('<tr class="df-grid-row">'), t.push("<td>"), ((
|
|
2138
|
-
for (const
|
|
2139
|
-
let
|
|
2140
|
-
a.push(
|
|
1220
|
+
t.push('<tr class="df-grid-row">'), t.push("<td>"), ((o = this.field.rendererOptions) == null ? void 0 : o.disableRemoveButton) !== !0 && t.push(`<button type="button" data-row-idx="${O}" class="df-btn df-grid-row-remove"><i class="df-icon df-remove-icon"></i></button>`), t.push("</td>");
|
|
1221
|
+
for (const h of this.field.children) {
|
|
1222
|
+
let f = C(i, h, null, !0), m = X({}, h);
|
|
1223
|
+
a.push(m), m.$orgin = h, m.name = m.name + "_" + O, m.$xssName = l + "_" + he(m), s.addRowFieldInfo(m), t.push(`<td id="${m.$xssName}"><div class="df-field-container ${m.required ? "required" : ""} " style="${f.valueStyle}"></div></td>`);
|
|
2141
1224
|
}
|
|
2142
|
-
t.push("</tr>"), this.allAddRowInfo[
|
|
2143
|
-
const
|
|
2144
|
-
|
|
2145
|
-
this.removeRow(
|
|
1225
|
+
t.push("</tr>"), this.allAddRowInfo[O] = a;
|
|
1226
|
+
const r = N(t.join(""));
|
|
1227
|
+
r && ((d = this.rowElement.querySelector("tbody")) == null || d.append(r), (u = r.querySelector(".df-grid-row-remove")) == null || u.addEventListener("click", (h) => {
|
|
1228
|
+
this.removeRow(h);
|
|
2146
1229
|
})), e = e ?? {};
|
|
2147
|
-
for (let
|
|
2148
|
-
|
|
1230
|
+
for (let h of a)
|
|
1231
|
+
h.$instance = new h.$renderType(h, r == null ? void 0 : r.querySelector(`#${h.$xssName}`), this.gridForm), oe(e, h.$orgin.name) && h.$instance.setValue(e[h.$orgin.name]);
|
|
2149
1232
|
}
|
|
2150
1233
|
/**
|
|
2151
1234
|
* remove row
|
|
@@ -2156,8 +1239,8 @@ class gt extends f {
|
|
|
2156
1239
|
var s;
|
|
2157
1240
|
const i = e.target.closest("tr");
|
|
2158
1241
|
if (i) {
|
|
2159
|
-
let
|
|
2160
|
-
this.removeFieldInfo(
|
|
1242
|
+
let l = ((s = e.currentTarget) == null ? void 0 : s.getAttribute("data-row-idx")) || "-1";
|
|
1243
|
+
this.removeFieldInfo(l), i.remove();
|
|
2161
1244
|
}
|
|
2162
1245
|
}
|
|
2163
1246
|
/**
|
|
@@ -2166,7 +1249,7 @@ class gt extends f {
|
|
|
2166
1249
|
*/
|
|
2167
1250
|
removeFieldInfo(e) {
|
|
2168
1251
|
let t = [];
|
|
2169
|
-
if (
|
|
1252
|
+
if (w(e)) {
|
|
2170
1253
|
for (let i in this.allAddRowInfo)
|
|
2171
1254
|
t = t.concat(this.allAddRowInfo[i]);
|
|
2172
1255
|
this.allAddRowInfo = {};
|
|
@@ -2187,11 +1270,11 @@ class gt extends f {
|
|
|
2187
1270
|
let e = [];
|
|
2188
1271
|
const t = this.field.children, i = t.length;
|
|
2189
1272
|
for (let s in this.allAddRowInfo) {
|
|
2190
|
-
const
|
|
1273
|
+
const l = this.allAddRowInfo[s];
|
|
2191
1274
|
let a = {};
|
|
2192
|
-
for (let
|
|
2193
|
-
let
|
|
2194
|
-
a[
|
|
1275
|
+
for (let r = 0; r < i; r++) {
|
|
1276
|
+
let o = t[r];
|
|
1277
|
+
a[o.name] = this.gridForm.getFieldValue(l[r].name);
|
|
2195
1278
|
}
|
|
2196
1279
|
e.push(a);
|
|
2197
1280
|
}
|
|
@@ -2200,12 +1283,12 @@ class gt extends f {
|
|
|
2200
1283
|
setValue(e) {
|
|
2201
1284
|
this.field.$value = e;
|
|
2202
1285
|
let t = [];
|
|
2203
|
-
|
|
1286
|
+
I(e) ? t = e : re(e) && t.push(e), this.allRemoveRow();
|
|
2204
1287
|
for (let i of t)
|
|
2205
1288
|
this.addRow(i);
|
|
2206
1289
|
}
|
|
2207
1290
|
reset() {
|
|
2208
|
-
this.setDefaultInfo(),
|
|
1291
|
+
this.setDefaultInfo(), $(this.rowElement);
|
|
2209
1292
|
}
|
|
2210
1293
|
getElement() {
|
|
2211
1294
|
return this.customFunction.getElement ? this.customFunction.getElement.call(this, this.field, this.rowElement) : null;
|
|
@@ -2213,7 +1296,7 @@ class gt extends f {
|
|
|
2213
1296
|
valid() {
|
|
2214
1297
|
if (this.customFunction.valid) {
|
|
2215
1298
|
const t = this.customFunction.valid.call(this, this.field, this.rowElement);
|
|
2216
|
-
|
|
1299
|
+
v(this.field, this.rowElement, t);
|
|
2217
1300
|
return;
|
|
2218
1301
|
}
|
|
2219
1302
|
const e = this.gridForm.validForm();
|
|
@@ -2227,7 +1310,7 @@ class gt extends f {
|
|
|
2227
1310
|
focus() {
|
|
2228
1311
|
}
|
|
2229
1312
|
}
|
|
2230
|
-
const
|
|
1313
|
+
const p = {
|
|
2231
1314
|
NAN: "nan",
|
|
2232
1315
|
MIN: "minimum",
|
|
2233
1316
|
EXCLUSIVE_MIN: "exclusiveMinimum",
|
|
@@ -2240,29 +1323,29 @@ const v = {
|
|
|
2240
1323
|
BETWEEN_EXCLUSIVE_MAX: "betweenExclusiveMax",
|
|
2241
1324
|
BETWEEN_EXCLUSIVE_MINMAX: "betweenExclusiveMinMax",
|
|
2242
1325
|
REQUIRED: "required"
|
|
2243
|
-
},
|
|
2244
|
-
number:
|
|
2245
|
-
textarea:
|
|
2246
|
-
dropdown:
|
|
2247
|
-
checkbox:
|
|
2248
|
-
radio:
|
|
2249
|
-
text:
|
|
2250
|
-
password:
|
|
2251
|
-
file:
|
|
2252
|
-
custom:
|
|
2253
|
-
group:
|
|
2254
|
-
hidden:
|
|
2255
|
-
button:
|
|
2256
|
-
range:
|
|
2257
|
-
datehour:
|
|
2258
|
-
datemonth:
|
|
2259
|
-
date:
|
|
2260
|
-
datetime:
|
|
2261
|
-
tab:
|
|
2262
|
-
grid:
|
|
2263
|
-
},
|
|
1326
|
+
}, Oe = "dff", H = {
|
|
1327
|
+
number: xe,
|
|
1328
|
+
textarea: Ie,
|
|
1329
|
+
dropdown: Z,
|
|
1330
|
+
checkbox: Q,
|
|
1331
|
+
radio: G,
|
|
1332
|
+
text: Ce,
|
|
1333
|
+
password: Se,
|
|
1334
|
+
file: Le,
|
|
1335
|
+
custom: Me,
|
|
1336
|
+
group: Ne,
|
|
1337
|
+
hidden: ke,
|
|
1338
|
+
button: qe,
|
|
1339
|
+
range: Ae,
|
|
1340
|
+
datehour: D,
|
|
1341
|
+
datemonth: D,
|
|
1342
|
+
date: D,
|
|
1343
|
+
datetime: D,
|
|
1344
|
+
tab: Re,
|
|
1345
|
+
grid: De
|
|
1346
|
+
}, me = {
|
|
2264
1347
|
horizontal: "horizontal"
|
|
2265
|
-
},
|
|
1348
|
+
}, y = {
|
|
2266
1349
|
"top-left": ["top", "df-txt-left"],
|
|
2267
1350
|
"top-center": ["top", "df-txt-center"],
|
|
2268
1351
|
"top-right": ["top", "df-txt-right"],
|
|
@@ -2276,11 +1359,11 @@ const v = {
|
|
|
2276
1359
|
"bottom-center": ["bottom", "df-txt-center"],
|
|
2277
1360
|
"bottom-right": ["bottom", "df-txt-right"]
|
|
2278
1361
|
};
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
let
|
|
1362
|
+
y.top = y["top-left"];
|
|
1363
|
+
y.right = y["right-right"];
|
|
1364
|
+
y.left = y["left-left"];
|
|
1365
|
+
y.bottom = y["bottom-left"];
|
|
1366
|
+
let ie = {
|
|
2284
1367
|
required: "{label} 필수 입력사항입니다.",
|
|
2285
1368
|
fileButton: "파일찾기",
|
|
2286
1369
|
selection: "선택",
|
|
@@ -2314,9 +1397,9 @@ let Me = {
|
|
|
2314
1397
|
"upper-char-special-number": "대문자,소문자,특수문자,숫자 각각 하나 이상 포함 되어야합니다."
|
|
2315
1398
|
}
|
|
2316
1399
|
};
|
|
2317
|
-
class
|
|
1400
|
+
class He {
|
|
2318
1401
|
constructor() {
|
|
2319
|
-
this.lang =
|
|
1402
|
+
this.lang = ie;
|
|
2320
1403
|
}
|
|
2321
1404
|
/**
|
|
2322
1405
|
* 다국어 메시지 등록
|
|
@@ -2325,7 +1408,7 @@ class yt {
|
|
|
2325
1408
|
* @param {?Message} [lang] 둥록할 메시지
|
|
2326
1409
|
*/
|
|
2327
1410
|
set(e) {
|
|
2328
|
-
this.lang = Object.assign({},
|
|
1411
|
+
this.lang = Object.assign({}, ie, e);
|
|
2329
1412
|
}
|
|
2330
1413
|
/**
|
|
2331
1414
|
* 메시지 얻기
|
|
@@ -2347,25 +1430,25 @@ class yt {
|
|
|
2347
1430
|
*/
|
|
2348
1431
|
validMessage(e, t) {
|
|
2349
1432
|
let i = "", s = [];
|
|
2350
|
-
t.regexp && (i = this.lang.regexp[t.regexp], s.push(i)), (t.constraint ?? []).forEach((
|
|
2351
|
-
|
|
1433
|
+
t.regexp && (i = this.lang.regexp[t.regexp], s.push(i)), (t.constraint ?? []).forEach((r) => {
|
|
1434
|
+
r === p.REQUIRED && (i = se(this.lang.required, e), s.push(i)), e.renderType == "number" || e.renderType == "range" ? (i = this.lang.number[r], s.push(i)) : (i = this.lang.string[r], s.push(i));
|
|
2352
1435
|
});
|
|
2353
|
-
const
|
|
2354
|
-
return s.forEach((
|
|
2355
|
-
|
|
2356
|
-
}), t.validator &&
|
|
1436
|
+
const l = [], a = Object.assign({}, { name: e.name, label: e.label }, e.rule);
|
|
1437
|
+
return s.forEach((r) => {
|
|
1438
|
+
r && l.push(se(r, a));
|
|
1439
|
+
}), t.validator && l.push(t.validator.message), l;
|
|
2357
1440
|
}
|
|
2358
1441
|
}
|
|
2359
|
-
function
|
|
2360
|
-
return
|
|
1442
|
+
function se(n, e) {
|
|
1443
|
+
return n.replace(/\{{1,1}([A-Za-z0-9_.]*)\}{1,1}/g, (t, i) => typeof e[i] < "u" ? e[i] : t);
|
|
2361
1444
|
}
|
|
2362
|
-
const
|
|
1445
|
+
const V = new He(), _e = (n) => {
|
|
2363
1446
|
let e;
|
|
2364
|
-
return
|
|
1447
|
+
return n.renderType && (e = H[n.renderType]), e && (e.isDataRender() === !1 || !g(n.name)) ? e : g(n.name) ? n.children ? H.group : H.hidden : H.text;
|
|
2365
1448
|
};
|
|
2366
|
-
class
|
|
1449
|
+
class je {
|
|
2367
1450
|
constructor(e, t) {
|
|
2368
|
-
this.fieldIdx = 0, this.allFieldInfo = {}, this.keyNameMap = {}, this.conditionFields = [], this.fieldPrefix = `${
|
|
1451
|
+
this.fieldIdx = 0, this.allFieldInfo = {}, this.keyNameMap = {}, this.conditionFields = [], this.fieldPrefix = `${Oe}_${$e(e)}`, this.form = t;
|
|
2369
1452
|
}
|
|
2370
1453
|
/**
|
|
2371
1454
|
* add Field 정보
|
|
@@ -2374,7 +1457,7 @@ class $t {
|
|
|
2374
1457
|
* @param {FormField} field 폼필드 정보
|
|
2375
1458
|
*/
|
|
2376
1459
|
addField(e) {
|
|
2377
|
-
|
|
1460
|
+
ye(e), this.fieldIdx += 1, e.$key = `${this.fieldPrefix}_${this.fieldIdx}`, e.$validName = e.name ?? e.label, this.keyNameMap[e.$validName] = e.$key, this.allFieldInfo[e.$key] = e, e.$renderType = _e(e), e.conditional && this.conditionFields.push(e.$key);
|
|
2378
1461
|
}
|
|
2379
1462
|
/**
|
|
2380
1463
|
* 필드명으로 필드 정부 구하기
|
|
@@ -2423,7 +1506,7 @@ class $t {
|
|
|
2423
1506
|
*/
|
|
2424
1507
|
removeFieldInfo(e) {
|
|
2425
1508
|
const t = this.keyNameMap[e];
|
|
2426
|
-
|
|
1509
|
+
g(t) || (this.removeFieldInfoByKey(t), delete this.keyNameMap[e]);
|
|
2427
1510
|
}
|
|
2428
1511
|
/**
|
|
2429
1512
|
* 필드 키로 필드 정보 맵에서 지우기
|
|
@@ -2445,20 +1528,20 @@ class $t {
|
|
|
2445
1528
|
getAllFieldValue(e, t) {
|
|
2446
1529
|
const i = this.form.getOptions().useTypeValue;
|
|
2447
1530
|
if (t !== !0) {
|
|
2448
|
-
for (let [s,
|
|
2449
|
-
e =
|
|
1531
|
+
for (let [s, l] of Object.entries(this.allFieldInfo))
|
|
1532
|
+
e = le(e, l, i);
|
|
2450
1533
|
return e;
|
|
2451
1534
|
}
|
|
2452
|
-
return new Promise((s,
|
|
2453
|
-
for (let [a,
|
|
2454
|
-
if (!
|
|
1535
|
+
return new Promise((s, l) => {
|
|
1536
|
+
for (let [a, r] of Object.entries(this.allFieldInfo)) {
|
|
1537
|
+
if (!r.$instance.isEnableView())
|
|
2455
1538
|
continue;
|
|
2456
|
-
let
|
|
2457
|
-
if (
|
|
2458
|
-
|
|
1539
|
+
let o = this.getFieldValidation(r, !0);
|
|
1540
|
+
if (o !== !0) {
|
|
1541
|
+
l(new Error(o.message, { cause: o }));
|
|
2459
1542
|
return;
|
|
2460
1543
|
}
|
|
2461
|
-
e =
|
|
1544
|
+
e = le(e, r, i);
|
|
2462
1545
|
}
|
|
2463
1546
|
s(e);
|
|
2464
1547
|
});
|
|
@@ -2466,27 +1549,27 @@ class $t {
|
|
|
2466
1549
|
getFormDataValue(e, t) {
|
|
2467
1550
|
if (t !== !0) {
|
|
2468
1551
|
let i = new FormData();
|
|
2469
|
-
for (let [s,
|
|
2470
|
-
i.set(s,
|
|
2471
|
-
for (let [s,
|
|
2472
|
-
|
|
1552
|
+
for (let [s, l] of Object.entries(e))
|
|
1553
|
+
i.set(s, l);
|
|
1554
|
+
for (let [s, l] of Object.entries(this.allFieldInfo))
|
|
1555
|
+
ne(i, l, l.$instance.getValue());
|
|
2473
1556
|
return i;
|
|
2474
1557
|
}
|
|
2475
1558
|
return new Promise((i, s) => {
|
|
2476
|
-
let
|
|
2477
|
-
for (let [a,
|
|
2478
|
-
|
|
2479
|
-
for (let [a,
|
|
2480
|
-
if (!
|
|
1559
|
+
let l = new FormData();
|
|
1560
|
+
for (let [a, r] of Object.entries(e))
|
|
1561
|
+
l.set(a, r);
|
|
1562
|
+
for (let [a, r] of Object.entries(this.allFieldInfo)) {
|
|
1563
|
+
if (!r.$instance.isEnableView())
|
|
2481
1564
|
continue;
|
|
2482
|
-
let
|
|
2483
|
-
if (
|
|
2484
|
-
s(new Error(
|
|
1565
|
+
let o = this.getFieldValidation(r, !0);
|
|
1566
|
+
if (o !== !0) {
|
|
1567
|
+
s(new Error(o.message, { cause: o }));
|
|
2485
1568
|
return;
|
|
2486
1569
|
}
|
|
2487
|
-
|
|
1570
|
+
ne(l, r, r.$instance.getValue());
|
|
2488
1571
|
}
|
|
2489
|
-
i(
|
|
1572
|
+
i(l);
|
|
2490
1573
|
});
|
|
2491
1574
|
}
|
|
2492
1575
|
/**
|
|
@@ -2544,47 +1627,47 @@ class $t {
|
|
|
2544
1627
|
return !0;
|
|
2545
1628
|
const i = e.$instance;
|
|
2546
1629
|
let s = i.valid();
|
|
2547
|
-
return s === !0 ? !0 : (t && i.focus(), s = s,
|
|
1630
|
+
return s === !0 ? !0 : (t && i.focus(), s = s, g(s.message) && (s.message = V.validMessage(e, s)[0]), s);
|
|
2548
1631
|
}
|
|
2549
1632
|
}
|
|
2550
|
-
function
|
|
2551
|
-
if (
|
|
2552
|
-
return
|
|
1633
|
+
function le(n, e, t) {
|
|
1634
|
+
if (ue(e))
|
|
1635
|
+
return n;
|
|
2553
1636
|
const i = e.$instance.getValue();
|
|
2554
1637
|
if (e.renderType === "file") {
|
|
2555
1638
|
const s = i.uploadFile;
|
|
2556
|
-
|
|
1639
|
+
n[e.$validName] = s, n[e.$validName + "RemoveIds"] = i.removeIds;
|
|
2557
1640
|
} else if (t !== !0)
|
|
2558
|
-
if (
|
|
2559
|
-
for (let [s,
|
|
2560
|
-
|
|
1641
|
+
if (k(e))
|
|
1642
|
+
for (let [s, l] of Object.entries(i))
|
|
1643
|
+
n[s] = l;
|
|
2561
1644
|
else
|
|
2562
|
-
|
|
1645
|
+
w(e.name) || (n[e.name] = i);
|
|
2563
1646
|
else
|
|
2564
|
-
|
|
2565
|
-
return
|
|
1647
|
+
n[e.$validName] = i;
|
|
1648
|
+
return n;
|
|
2566
1649
|
}
|
|
2567
|
-
function
|
|
2568
|
-
if (
|
|
2569
|
-
return
|
|
1650
|
+
function ne(n, e, t) {
|
|
1651
|
+
if (ue(e))
|
|
1652
|
+
return n;
|
|
2570
1653
|
const i = e.$instance.getValue();
|
|
2571
1654
|
if (e.renderType === "file") {
|
|
2572
1655
|
const s = i.uploadFile;
|
|
2573
|
-
|
|
2574
|
-
for (let
|
|
2575
|
-
|
|
2576
|
-
|
|
1656
|
+
n.delete(e.$validName);
|
|
1657
|
+
for (let l of s)
|
|
1658
|
+
n.append(e.$validName, l);
|
|
1659
|
+
n.set(e.$validName + "RemoveIds", i.removeIds);
|
|
2577
1660
|
} else if (t !== !0)
|
|
2578
|
-
if (
|
|
2579
|
-
for (let [s,
|
|
2580
|
-
|
|
1661
|
+
if (k(e))
|
|
1662
|
+
for (let [s, l] of Object.entries(i))
|
|
1663
|
+
n.set(s, l);
|
|
2581
1664
|
else
|
|
2582
|
-
|
|
1665
|
+
w(e.name) || n.set(e.$validName, i);
|
|
2583
1666
|
else
|
|
2584
|
-
|
|
2585
|
-
return
|
|
1667
|
+
n.set(e.$validName, i);
|
|
1668
|
+
return n;
|
|
2586
1669
|
}
|
|
2587
|
-
class
|
|
1670
|
+
class ze {
|
|
2588
1671
|
constructor(e, t, i) {
|
|
2589
1672
|
this.addRowFields = [], this.daraform = e, this.options = e.getOptions(), this.formElement = t, this.fieldInfoMap = i;
|
|
2590
1673
|
}
|
|
@@ -2603,9 +1686,9 @@ class bt {
|
|
|
2603
1686
|
* @returns {string} row template
|
|
2604
1687
|
*/
|
|
2605
1688
|
addRowTemplate(e) {
|
|
2606
|
-
let t = this.isLabelHide(e), i =
|
|
1689
|
+
let t = this.isLabelHide(e), i = C(this.options, e, null, t);
|
|
2607
1690
|
this.addRowFieldInfo(e);
|
|
2608
|
-
const s =
|
|
1691
|
+
const s = N(`
|
|
2609
1692
|
<div class="df-row df-form-group ${i.fieldClass}" id="${e.$key}">
|
|
2610
1693
|
${t ? "" : `<div class="df-label ${i.labelClass} ${i.labelAlignClass}" title="${e.label ?? ""}" style="${i.labelStyle}">${this.getLabelTemplate(e)}</div>`}
|
|
2611
1694
|
|
|
@@ -2625,25 +1708,25 @@ class bt {
|
|
|
2625
1708
|
* @returns {*}
|
|
2626
1709
|
*/
|
|
2627
1710
|
childTemplate(e, t) {
|
|
2628
|
-
let i = null, s = !0,
|
|
1711
|
+
let i = null, s = !0, l = !1;
|
|
2629
1712
|
if (!e.$renderType.isChildrenCreate())
|
|
2630
1713
|
return;
|
|
2631
1714
|
const a = document.createElement("div");
|
|
2632
1715
|
a.classList.add("df-row", t.rowStyleClass ?? "");
|
|
2633
|
-
let
|
|
2634
|
-
for (const
|
|
2635
|
-
if (
|
|
2636
|
-
throw new Error(`parent field :[${e.$validName}], children index ${
|
|
2637
|
-
if (
|
|
1716
|
+
let r = 0;
|
|
1717
|
+
for (const o of e.children) {
|
|
1718
|
+
if (w(o))
|
|
1719
|
+
throw new Error(`parent field :[${e.$validName}], children index ${r}, empty [${o}]`);
|
|
1720
|
+
if (o.$parent = e, ++r, this.checkHiddenField(o))
|
|
2638
1721
|
continue;
|
|
2639
|
-
this.addRowFieldInfo(
|
|
2640
|
-
let d = this.isLabelHide(
|
|
2641
|
-
d ? (
|
|
2642
|
-
const
|
|
2643
|
-
${
|
|
2644
|
-
<span class="df-field-container ${
|
|
1722
|
+
this.addRowFieldInfo(o), s && (i = o);
|
|
1723
|
+
let d = this.isLabelHide(o), u, h = "";
|
|
1724
|
+
d ? (u = C(this.options, o, i, !l), h = l ? `<span class="df-label df-empty ${u.labelClass}" style="${u.labelStyle}"></span>` : "") : (u = C(this.options, o, i, !1), h = `<span class="df-label ${u.labelClass} ${u.labelAlignClass}" title="${o.label ?? ""}" style="${u.labelStyle}">${this.getLabelTemplate(o)}</span>`);
|
|
1725
|
+
const f = N(`<div class="df-form-group ${u.fieldClass}" style="${u.fieldStyle}" id="${o.$key}">
|
|
1726
|
+
${h}
|
|
1727
|
+
<span class="df-field-container ${u.valueClass} ${o.required ? "required" : ""}" style="${u.valueStyle}"></span>
|
|
2645
1728
|
</div>`);
|
|
2646
|
-
|
|
1729
|
+
f && (this.createField(o, f), a.append(f), o.children && this.childTemplate(o, o.children ? u : t)), d || (l = !0), s = !1;
|
|
2647
1730
|
}
|
|
2648
1731
|
e.$instance.addChildField(a);
|
|
2649
1732
|
}
|
|
@@ -2654,7 +1737,7 @@ class bt {
|
|
|
2654
1737
|
* @returns {string} template string
|
|
2655
1738
|
*/
|
|
2656
1739
|
getLabelTemplate(e) {
|
|
2657
|
-
const t = e.required ? '<span class="required"></span>' : "", i =
|
|
1740
|
+
const t = e.required ? '<span class="required"></span>' : "", i = F(e.tooltip) ? "" : `<span class="df-tooltip">?<span class="df-tooltip-text">${e.tooltip}</span></span>`;
|
|
2658
1741
|
return `<span class="df-label-text">${e.label ?? ""}</span> ${i} ${t}`;
|
|
2659
1742
|
}
|
|
2660
1743
|
/**
|
|
@@ -2665,10 +1748,10 @@ class bt {
|
|
|
2665
1748
|
*/
|
|
2666
1749
|
isLabelHide(e) {
|
|
2667
1750
|
var t;
|
|
2668
|
-
return ((t = e.style) == null ? void 0 : t.labelHide) ||
|
|
1751
|
+
return ((t = e.style) == null ? void 0 : t.labelHide) || g(e.label);
|
|
2669
1752
|
}
|
|
2670
1753
|
checkHiddenField(e) {
|
|
2671
|
-
return
|
|
1754
|
+
return Fe(e) ? (this.fieldInfoMap.addField(e), e.$instance = new e.$renderType(e, null, this.daraform), !0) : !1;
|
|
2672
1755
|
}
|
|
2673
1756
|
/**
|
|
2674
1757
|
* add row file map
|
|
@@ -2676,18 +1759,22 @@ class bt {
|
|
|
2676
1759
|
* @param {FormField} field
|
|
2677
1760
|
*/
|
|
2678
1761
|
addRowFieldInfo(e) {
|
|
2679
|
-
if (!
|
|
1762
|
+
if (!F(e.name) && this.fieldInfoMap.hasFieldName(e.name))
|
|
2680
1763
|
throw new Error(`Duplicate field name "${e.name}"`);
|
|
2681
1764
|
this.fieldInfoMap.addField(e), this.addRowFields.push(e.$key);
|
|
2682
1765
|
}
|
|
2683
1766
|
}
|
|
2684
|
-
function
|
|
2685
|
-
|
|
1767
|
+
function We(n) {
|
|
1768
|
+
const e = X({}, L, n);
|
|
1769
|
+
return e.fields = q(e.fields), e;
|
|
1770
|
+
}
|
|
1771
|
+
function Ke(n) {
|
|
1772
|
+
L = X({}, L, n), L.fields = q(L.fields);
|
|
2686
1773
|
}
|
|
2687
|
-
function
|
|
2688
|
-
|
|
1774
|
+
function q(n) {
|
|
1775
|
+
return (n ?? []).filter((e) => e != null).map((e) => (Array.isArray(e.children) && (e.children = q(e.children)), e));
|
|
2689
1776
|
}
|
|
2690
|
-
let
|
|
1777
|
+
let L = {
|
|
2691
1778
|
style: {
|
|
2692
1779
|
width: "100%",
|
|
2693
1780
|
labelWidth: 3,
|
|
@@ -2700,90 +1787,90 @@ let re = {
|
|
|
2700
1787
|
notValidMessage: "This form is not valid.",
|
|
2701
1788
|
fields: []
|
|
2702
1789
|
};
|
|
2703
|
-
const
|
|
2704
|
-
let
|
|
2705
|
-
const
|
|
1790
|
+
const _ = {}, ae = "data-form-uid";
|
|
1791
|
+
let Xe = 0;
|
|
1792
|
+
const M = class M {
|
|
2706
1793
|
constructor(e, t, i) {
|
|
2707
1794
|
if (this.formValue = {}, this.changeListeners = [], this.changeMode = (s) => {
|
|
2708
1795
|
this.options.mode = s, this.formElement.setAttribute("data-df-mode", s);
|
|
2709
|
-
const
|
|
2710
|
-
s == "view" ?
|
|
1796
|
+
const l = this.formElement.querySelectorAll(".df-field input, .df-field textarea, .df-field select");
|
|
1797
|
+
s == "view" ? l.forEach((a) => {
|
|
2711
1798
|
a instanceof HTMLInputElement && (a.readOnly = !0), a instanceof HTMLTextAreaElement && (a.readOnly = !0);
|
|
2712
|
-
}) :
|
|
1799
|
+
}) : l.forEach((a) => {
|
|
2713
1800
|
a instanceof HTMLInputElement && (a.readOnly = !1), a instanceof HTMLTextAreaElement && (a.readOnly = !1);
|
|
2714
1801
|
});
|
|
2715
1802
|
}, this.resetForm = () => {
|
|
2716
1803
|
const s = this.fieldInfoMap.getAllFieldInfo();
|
|
2717
|
-
for (const
|
|
2718
|
-
const
|
|
2719
|
-
|
|
1804
|
+
for (const l in s) {
|
|
1805
|
+
const r = s[l].$instance;
|
|
1806
|
+
r && typeof r.reset == "function" && r.reset();
|
|
2720
1807
|
}
|
|
2721
1808
|
this.formValue = {}, this.conditionCheck();
|
|
2722
1809
|
}, this.resetField = (s) => {
|
|
2723
1810
|
this.fieldInfoMap.getFieldName(s).$instance.reset(), this.formValue[s] = "", this.conditionCheck();
|
|
2724
1811
|
}, this.getFieldValue = (s) => {
|
|
2725
|
-
const
|
|
2726
|
-
return
|
|
2727
|
-
}, this.getValue = (s) => this.fieldInfoMap.getAllFieldValue(this.formValue, s), this.getFormDataValue = (s) => this.fieldInfoMap.getFormDataValue(this.formValue, s), this.setValue = (s,
|
|
2728
|
-
|
|
1812
|
+
const l = this.fieldInfoMap.getFieldName(s);
|
|
1813
|
+
return l ? l.$instance.getValue() : null;
|
|
1814
|
+
}, this.getValue = (s) => this.fieldInfoMap.getAllFieldValue(this.formValue, s), this.getFormDataValue = (s) => this.fieldInfoMap.getFormDataValue(this.formValue, s), this.setValue = (s, l) => {
|
|
1815
|
+
l !== !1 && this.resetForm(), Object.keys(s).forEach((a) => {
|
|
2729
1816
|
this._setFieldValue(a, s[a]);
|
|
2730
1817
|
}), this.conditionCheck();
|
|
2731
|
-
}, this.setFieldValue = (s,
|
|
2732
|
-
this._setFieldValue(s,
|
|
2733
|
-
}, this.setFieldItems = (s,
|
|
1818
|
+
}, this.setFieldValue = (s, l) => {
|
|
1819
|
+
this._setFieldValue(s, l), this.conditionCheck();
|
|
1820
|
+
}, this.setFieldItems = (s, l) => {
|
|
2734
1821
|
const a = this.fieldInfoMap.getFieldName(s);
|
|
2735
1822
|
if (a)
|
|
2736
|
-
return a.$instance.setValueItems(
|
|
1823
|
+
return a.$instance.setValueItems(l);
|
|
2737
1824
|
}, this.addField = (s) => {
|
|
2738
|
-
this.options.fields.push(s), this.formTemplate.addRow(s), this.conditionCheck();
|
|
1825
|
+
q([s]).length && (this.options.fields.push(s), this.formTemplate.addRow(s), this.conditionCheck());
|
|
2739
1826
|
}, this.removeField = (s) => {
|
|
2740
|
-
const
|
|
2741
|
-
if (!
|
|
2742
|
-
const a = this.getRemoveFields(
|
|
2743
|
-
a.forEach((
|
|
2744
|
-
this.removeFormValue(
|
|
2745
|
-
}), this.removeFieldElement(
|
|
2746
|
-
this.fieldInfoMap.removeFieldInfoByKey(
|
|
1827
|
+
const l = this.fieldInfoMap.getFieldName(s);
|
|
1828
|
+
if (!l) return;
|
|
1829
|
+
const a = this.getRemoveFields(l);
|
|
1830
|
+
a.forEach((r) => {
|
|
1831
|
+
this.removeFormValue(r);
|
|
1832
|
+
}), this.removeFieldElement(l), this.removeParentChildField(l), a.forEach((r) => {
|
|
1833
|
+
this.fieldInfoMap.removeFieldInfoByKey(r.$key);
|
|
2747
1834
|
}), this.conditionCheck();
|
|
2748
1835
|
}, this.isValidForm = () => this.validForm().length < 1, this.validForm = () => {
|
|
2749
|
-
let s = [],
|
|
2750
|
-
const
|
|
2751
|
-
for (const
|
|
2752
|
-
const d = o
|
|
2753
|
-
let
|
|
2754
|
-
|
|
1836
|
+
let s = [], l = this.options.autoFocus !== !1, a = !0;
|
|
1837
|
+
const r = this.fieldInfoMap.getAllFieldInfo();
|
|
1838
|
+
for (const o in r) {
|
|
1839
|
+
const d = r[o];
|
|
1840
|
+
let u = this.fieldInfoMap.getFieldValidation(d, l);
|
|
1841
|
+
u !== !0 && (l = !1, de(d) ? s = s.concat(u) : (a && (this.validTabCheck(d), a = !1), s.push(u)));
|
|
2755
1842
|
}
|
|
2756
1843
|
return s;
|
|
2757
1844
|
}, this.isValidField = (s) => {
|
|
2758
|
-
const
|
|
2759
|
-
if (
|
|
1845
|
+
const l = this.fieldInfoMap.getFieldName(s);
|
|
1846
|
+
if (g(l))
|
|
2760
1847
|
throw new Error(`Field name [${s}] not found`);
|
|
2761
|
-
const a =
|
|
1848
|
+
const a = l.$instance;
|
|
2762
1849
|
return a ? a.valid() === !0 : !0;
|
|
2763
1850
|
}, this.getOptions = () => this.options, this.subscribe = (s) => (this.changeListeners.push(s), () => {
|
|
2764
|
-
this.changeListeners = this.changeListeners.filter((
|
|
1851
|
+
this.changeListeners = this.changeListeners.filter((l) => l !== s);
|
|
2765
1852
|
}), this.destroy = () => {
|
|
2766
|
-
this.formElement.className = this.orginFormStyleClass, this.formElement.replaceChildren();
|
|
1853
|
+
this.formElement.className = this.orginFormStyleClass, this.formElement.replaceChildren(), delete _[this.selector];
|
|
2767
1854
|
for (const s in this)
|
|
2768
|
-
|
|
1855
|
+
oe(this, s) && delete this[s];
|
|
2769
1856
|
}, this.getFields = () => this.options.fields, this.setFields = (s) => {
|
|
2770
|
-
this.options.fields = s, this.createForm(
|
|
2771
|
-
}, this.options =
|
|
2772
|
-
this.orginFormStyleClass = e.className, e.classList.add("daracl-form"), this.selector = `df_${++
|
|
1857
|
+
this.options.fields = q(s), this.formElement.replaceChildren(), this.formValue = {}, this.createForm(this.options.fields);
|
|
1858
|
+
}, this.options = We(t), V.set(i), e)
|
|
1859
|
+
this.orginFormStyleClass = e.className, e.classList.add("daracl-form"), this.selector = `df_${++Xe}`, e.setAttribute("name", this.selector), e.setAttribute(ae, this.selector), this.options.style.width && e.setAttribute("style", `width:${this.options.style.width};`), this.formElement = e, this.changeMode(this.options.mode ?? "new"), this.createForm(this.options.fields), this.options.autoCreate !== !1 && (_[this.selector] = this);
|
|
2773
1860
|
else
|
|
2774
1861
|
throw new Error(`${e} form selector not found`);
|
|
2775
1862
|
}
|
|
2776
1863
|
static create(e, t, i) {
|
|
2777
|
-
return new
|
|
1864
|
+
return new M(e, t, i);
|
|
2778
1865
|
}
|
|
2779
1866
|
static setMessage(e) {
|
|
2780
|
-
|
|
1867
|
+
V.set(e);
|
|
2781
1868
|
}
|
|
2782
1869
|
static setDefaultOptions(e, t) {
|
|
2783
|
-
|
|
1870
|
+
Ke(e), t && V.set(t);
|
|
2784
1871
|
}
|
|
2785
1872
|
createForm(e) {
|
|
2786
|
-
this.fieldInfoMap = new
|
|
1873
|
+
this.fieldInfoMap = new je(this.selector, this), this.formTemplate = new ze(this, this.formElement, this.fieldInfoMap), this.options.autoCreate !== !1 && (e.forEach((t) => {
|
|
2787
1874
|
this.formTemplate.addRow(t);
|
|
2788
1875
|
}), this.conditionCheck(), this.options.onMounted && this.options.onMounted.call(this));
|
|
2789
1876
|
}
|
|
@@ -2825,20 +1912,20 @@ const _ = class _ {
|
|
|
2825
1912
|
* @param {FormField} fieldInfo
|
|
2826
1913
|
*/
|
|
2827
1914
|
removeFieldElement(e) {
|
|
2828
|
-
var
|
|
1915
|
+
var r, o;
|
|
2829
1916
|
const t = e.$parent;
|
|
2830
|
-
if (t &&
|
|
2831
|
-
const d = t.$instance.getElement(),
|
|
2832
|
-
|
|
2833
|
-
const
|
|
2834
|
-
|
|
1917
|
+
if (t && k(t)) {
|
|
1918
|
+
const d = t.$instance.getElement(), u = d.querySelector(`[data-tab-id="${e.$key}"]`), h = u == null ? void 0 : u.classList.contains("active");
|
|
1919
|
+
u == null || u.remove(), (r = d.querySelector(`[tab-panel-id="${e.$key}"]`)) == null || r.remove();
|
|
1920
|
+
const f = d.querySelector(".df-tab-header .df-tab-item");
|
|
1921
|
+
h && f && t.$instance.setActive(f.getAttribute("data-tab-id") ?? "");
|
|
2835
1922
|
return;
|
|
2836
1923
|
}
|
|
2837
1924
|
const i = `[id="${e.$key}"]`;
|
|
2838
|
-
let s = (
|
|
1925
|
+
let s = (o = e.$instance) == null ? void 0 : o.getElement();
|
|
2839
1926
|
(s instanceof NodeList || s instanceof HTMLCollection) && (s = s[0] ?? null);
|
|
2840
|
-
const
|
|
2841
|
-
|
|
1927
|
+
const l = (s instanceof Element ? s.closest(i) : null) ?? this.formElement.querySelector(i), a = l == null ? void 0 : l.parentElement;
|
|
1928
|
+
l == null || l.remove(), t && (a != null && a.classList.contains("df-row")) && a.childElementCount < 1 && a.remove();
|
|
2842
1929
|
}
|
|
2843
1930
|
/**
|
|
2844
1931
|
* 부모 children(최상위는 options.fields)에서 필드 제거
|
|
@@ -2857,8 +1944,8 @@ const _ = class _ {
|
|
|
2857
1944
|
*/
|
|
2858
1945
|
removeFormValue(e) {
|
|
2859
1946
|
const t = [e.name, e.$validName];
|
|
2860
|
-
e.renderType === "file" ? t.push(e.$validName + "RemoveIds") :
|
|
2861
|
-
|
|
1947
|
+
e.renderType === "file" ? t.push(e.$validName + "RemoveIds") : k(e) && t.push(...Object.keys(e.$instance.getValue() ?? {})), e.$tabForm && t.push(...Object.keys(e.$tabForm.getValue(!1) ?? {})), t.forEach((i) => {
|
|
1948
|
+
F(i) || delete this.formValue[i];
|
|
2862
1949
|
});
|
|
2863
1950
|
}
|
|
2864
1951
|
validTabCheck(e) {
|
|
@@ -2886,30 +1973,30 @@ const _ = class _ {
|
|
|
2886
1973
|
this.fieldInfoMap.getFieldName(e).$instance.setDescription(t);
|
|
2887
1974
|
}
|
|
2888
1975
|
static instance(e) {
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
let i = t.getAttribute(
|
|
2892
|
-
if (
|
|
2893
|
-
const s = Object.keys(
|
|
2894
|
-
if (s.length > 1)
|
|
2895
|
-
|
|
2896
|
-
return i = s[0], Z[i];
|
|
1976
|
+
const t = K(e) ? document.querySelector(e) : e;
|
|
1977
|
+
if (!t) return;
|
|
1978
|
+
let i = t.getAttribute(ae);
|
|
1979
|
+
if (F(i)) {
|
|
1980
|
+
const s = Object.keys(_);
|
|
1981
|
+
if (s.length > 1) throw new Error(`selector empty : [${i}]`);
|
|
1982
|
+
i = s[0];
|
|
2897
1983
|
}
|
|
1984
|
+
return i ? _[i] : void 0;
|
|
2898
1985
|
}
|
|
2899
1986
|
getFieldInfoMap() {
|
|
2900
1987
|
return this.fieldInfoMap;
|
|
2901
1988
|
}
|
|
2902
1989
|
};
|
|
2903
|
-
|
|
2904
|
-
string: (e, t) =>
|
|
2905
|
-
number: (e, t) =>
|
|
1990
|
+
M.VERSION = "0.0.22", M.validator = {
|
|
1991
|
+
string: (e, t) => S(e, t),
|
|
1992
|
+
number: (e, t) => U(e, t),
|
|
2906
1993
|
regexp: (e, t) => {
|
|
2907
1994
|
let i = { name: t.name, constraint: [] };
|
|
2908
|
-
return
|
|
1995
|
+
return ce(e, t, i);
|
|
2909
1996
|
}
|
|
2910
1997
|
};
|
|
2911
|
-
let
|
|
1998
|
+
let z = M;
|
|
2912
1999
|
export {
|
|
2913
|
-
|
|
2000
|
+
z as DaraForm
|
|
2914
2001
|
};
|
|
2915
2002
|
//# sourceMappingURL=index.min.js.map
|