@ditojs/admin 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dito-admin.es.js +23 -14
- package/dist/dito-admin.umd.js +4 -4
- package/package.json +5 -5
- package/src/components/DitoCreateButton.vue +5 -2
- package/src/mixins/DitoMixin.js +11 -6
- package/src/mixins/OptionsMixin.js +0 -5
- package/src/mixins/SourceMixin.js +17 -3
- package/src/mixins/TypeMixin.js +5 -0
- package/src/types/DitoTypeMarkup.vue +12 -3
package/dist/dito-admin.es.js
CHANGED
|
@@ -1302,6 +1302,9 @@ var ai = {
|
|
|
1302
1302
|
name() {
|
|
1303
1303
|
return this.schema.name;
|
|
1304
1304
|
},
|
|
1305
|
+
formModel() {
|
|
1306
|
+
return (this.dialogComponent ?? this.routeComponent).formModel;
|
|
1307
|
+
},
|
|
1305
1308
|
type() {
|
|
1306
1309
|
return this.schema.type;
|
|
1307
1310
|
},
|
|
@@ -1760,12 +1763,14 @@ var Di = {
|
|
|
1760
1763
|
type: [String, Object]
|
|
1761
1764
|
}) || R(t || e.name) : R(t) || "";
|
|
1762
1765
|
},
|
|
1763
|
-
getButtonAttributes(e, t = null) {
|
|
1764
|
-
let
|
|
1766
|
+
getButtonAttributes(e, t = null, n = null) {
|
|
1767
|
+
let r = n ? null : `${R(e)}${t ? ` ${t}` : ""}`;
|
|
1765
1768
|
return {
|
|
1766
1769
|
class: `dito-button--${e}`,
|
|
1767
|
-
|
|
1768
|
-
|
|
1770
|
+
...r && {
|
|
1771
|
+
title: r,
|
|
1772
|
+
"aria-label": r
|
|
1773
|
+
}
|
|
1769
1774
|
};
|
|
1770
1775
|
},
|
|
1771
1776
|
getQueryLink(e) {
|
|
@@ -7358,13 +7363,13 @@ function cc(e, n, r, i, a, o) {
|
|
|
7358
7363
|
class: "dito-button",
|
|
7359
7364
|
type: e.isInlined ? "button" : "submit",
|
|
7360
7365
|
disabled: e.disabled
|
|
7361
|
-
}, e.getButtonAttributes(e.verb, e.formLabel), { onClick: n[0] ||= (t) => e.createItem(e.creatableForm) }), E(e.text), 17, ac)) : e.creatableForms ? (x(), l(t, { key: 1 }, [u("button", v({
|
|
7366
|
+
}, e.getButtonAttributes(e.verb, e.formLabel, e.text), { onClick: n[0] ||= (t) => e.createItem(e.creatableForm) }), E(e.text), 17, ac)) : e.creatableForms ? (x(), l(t, { key: 1 }, [u("button", v({
|
|
7362
7367
|
class: "dito-button",
|
|
7363
7368
|
type: "button",
|
|
7364
7369
|
disabled: e.disabled
|
|
7365
7370
|
}, {
|
|
7366
7371
|
...e.pulldownTriggerAttributes,
|
|
7367
|
-
...e.getButtonAttributes(e.verb)
|
|
7372
|
+
...e.getButtonAttributes(e.verb, null, e.text)
|
|
7368
7373
|
}, { onMousedown: n[1] ||= A((t) => e.onPulldownMouseDown(), ["stop"]) }), E(e.text), 17, oc), u("ul", {
|
|
7369
7374
|
class: y(["dito-pulldown", { "dito-pulldown--open": e.pulldown.open }]),
|
|
7370
7375
|
role: "menu"
|
|
@@ -9191,9 +9196,6 @@ var kl = /*#__PURE__*/ X(Q.register("checkbox", { nativeField: !0 }), [["render"
|
|
|
9191
9196
|
selectedOption() {
|
|
9192
9197
|
return this.getOptionForValue(this.selectedValue);
|
|
9193
9198
|
},
|
|
9194
|
-
formModel() {
|
|
9195
|
-
return (this.dialogComponent ?? this.routeComponent).formModel;
|
|
9196
|
-
},
|
|
9197
9199
|
optionsResolver() {
|
|
9198
9200
|
return this.formModel.getOptionsResolver({
|
|
9199
9201
|
schema: this.schema,
|
|
@@ -10015,11 +10017,11 @@ var nu = {
|
|
|
10015
10017
|
this.query = this.$route.query, this.ensureData();
|
|
10016
10018
|
},
|
|
10017
10019
|
clearData() {
|
|
10018
|
-
this.total = 0, this.
|
|
10020
|
+
this.total = 0, this.setLoadedValue(null);
|
|
10019
10021
|
},
|
|
10020
10022
|
setData(e) {
|
|
10021
10023
|
if (this.isListSource && P(e)) this.setLoadedListItems(e);
|
|
10022
|
-
else if (!e || this.isObjectSource && I(e)) this.
|
|
10024
|
+
else if (!e || this.isObjectSource && I(e)) this.setLoadedValue(e);
|
|
10023
10025
|
else if (!this.unwrapListData(e) && I(e) && this.isInView) return this.viewComponent.setData(e);
|
|
10024
10026
|
return this.value;
|
|
10025
10027
|
},
|
|
@@ -10034,7 +10036,12 @@ var nu = {
|
|
|
10034
10036
|
if (this.isListResults(e)) return this.total = e.total, this.setLoadedListItems(e.results), this.value;
|
|
10035
10037
|
},
|
|
10036
10038
|
setLoadedListItems(e) {
|
|
10037
|
-
this.
|
|
10039
|
+
this.setLoadedValue(Ir(this.sourceSchema, e, this.paginationRange));
|
|
10040
|
+
},
|
|
10041
|
+
setLoadedValue(e) {
|
|
10042
|
+
this.formModel.applyCleanChanges(() => {
|
|
10043
|
+
this.value = e;
|
|
10044
|
+
}).catch(console.error);
|
|
10038
10045
|
},
|
|
10039
10046
|
createItem(e, t, n = null) {
|
|
10040
10047
|
let r = this.createData(e, t);
|
|
@@ -11814,12 +11821,14 @@ var wd = Q.register("markup", {
|
|
|
11814
11821
|
},
|
|
11815
11822
|
created() {
|
|
11816
11823
|
let e = !1, t = !1, n = () => this.onFocus(), r = () => {
|
|
11817
|
-
o(), this.onBlur();
|
|
11824
|
+
o(), this.onBlur(), s();
|
|
11818
11825
|
}, i = () => {
|
|
11819
11826
|
a(), this.onInput();
|
|
11820
11827
|
}, a = Ce(() => o(), 100), o = () => {
|
|
11821
11828
|
let n = this.editor.getHTML(), r = this.hardBreak ? n.replace(/^<p>(.*?)<\/p>$/s, "$1") : n;
|
|
11822
|
-
r !== this.value && (e = !0, t = !0, this.value = r),
|
|
11829
|
+
r !== this.value && (e = !0, t = !0, this.value = r), this.focused || s();
|
|
11830
|
+
}, s = () => {
|
|
11831
|
+
e && (e = !1, this.onChange());
|
|
11823
11832
|
};
|
|
11824
11833
|
this.$watch("value", (e) => {
|
|
11825
11834
|
if (t) t = !1;
|