jedison 0.3.5 → 0.3.7
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/CHANGELOG.md +8 -0
- package/dist/cjs/jedison.cjs +1 -1
- package/dist/cjs/jedison.cjs.map +1 -1
- package/dist/esm/jedison.js +34 -18
- package/dist/esm/jedison.js.map +1 -1
- package/dist/umd/jedison.umd.js +1 -1
- package/dist/umd/jedison.umd.js.map +1 -1
- package/package.json +4 -3
package/dist/esm/jedison.js
CHANGED
|
@@ -3079,7 +3079,8 @@ class EditorStringTextarea extends EditorString {
|
|
|
3079
3079
|
}
|
|
3080
3080
|
class EditorStringAwesomplete extends EditorString {
|
|
3081
3081
|
static resolves(schema) {
|
|
3082
|
-
|
|
3082
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
3083
|
+
return isSet(format2) && format2 === "awesomplete" && window.Awesomplete && getSchemaType(schema) === "string";
|
|
3083
3084
|
}
|
|
3084
3085
|
build() {
|
|
3085
3086
|
this.control = this.theme.getInputControl({
|
|
@@ -3092,7 +3093,8 @@ class EditorStringAwesomplete extends EditorString {
|
|
|
3092
3093
|
info: this.getInfo()
|
|
3093
3094
|
});
|
|
3094
3095
|
try {
|
|
3095
|
-
|
|
3096
|
+
const awesompleteOptions = getSchemaXOption(this.instance.schema, "awesomplete") ?? {};
|
|
3097
|
+
this.awesomplete = new window.Awesomplete(this.control.input, awesompleteOptions);
|
|
3096
3098
|
this.control.container.querySelector(".awesomplete").style.display = "block";
|
|
3097
3099
|
} catch (e) {
|
|
3098
3100
|
console.error("Awesomplete is not available or not loaded correctly.", e);
|
|
@@ -3114,7 +3116,8 @@ class EditorStringAwesomplete extends EditorString {
|
|
|
3114
3116
|
}
|
|
3115
3117
|
class EditorStringEmojiButton extends EditorString {
|
|
3116
3118
|
static resolves(schema) {
|
|
3117
|
-
|
|
3119
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
3120
|
+
return isSet(format2) && format2 === "emojiButton" && window.EmojiButton && getSchemaType(schema) === "string";
|
|
3118
3121
|
}
|
|
3119
3122
|
build() {
|
|
3120
3123
|
this.control = this.theme.getInputControl({
|
|
@@ -3128,13 +3131,15 @@ class EditorStringEmojiButton extends EditorString {
|
|
|
3128
3131
|
});
|
|
3129
3132
|
this.control.input.classList.add("jedi-emoji-button");
|
|
3130
3133
|
this.control.input.value = "😀";
|
|
3134
|
+
const emojiButtonOptions = getSchemaXOption(this.instance.schema, "emojiButton") ?? {};
|
|
3131
3135
|
const options = Object.assign({
|
|
3132
3136
|
theme: "auto",
|
|
3133
3137
|
autoHide: true,
|
|
3134
3138
|
showPreview: false,
|
|
3135
3139
|
showSearch: true,
|
|
3136
|
-
zIndex: 1e4
|
|
3137
|
-
|
|
3140
|
+
zIndex: 1e4,
|
|
3141
|
+
position: "auto"
|
|
3142
|
+
}, emojiButtonOptions);
|
|
3138
3143
|
this.emojiButton = new window.EmojiButton(options);
|
|
3139
3144
|
}
|
|
3140
3145
|
addEventListeners() {
|
|
@@ -3337,8 +3342,8 @@ class EditorNumberInput extends EditorNumber {
|
|
|
3337
3342
|
class EditorNumberInputNullable extends EditorNumberInput {
|
|
3338
3343
|
static resolves(schema) {
|
|
3339
3344
|
const schemaType = getSchemaType(schema);
|
|
3340
|
-
const
|
|
3341
|
-
return isSet(
|
|
3345
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
3346
|
+
return isSet(format2) && format2 === "number-nullable" && isSet(schemaType) && isArray(schemaType) && schemaType.length === 2 && schemaType.includes("null") && (schemaType.includes("number") || schemaType.includes("integer"));
|
|
3342
3347
|
}
|
|
3343
3348
|
addEventListeners() {
|
|
3344
3349
|
this.control.input.addEventListener("change", () => {
|
|
@@ -3767,6 +3772,9 @@ class EditorArray extends Editor {
|
|
|
3767
3772
|
});
|
|
3768
3773
|
this.refreshDisabledState();
|
|
3769
3774
|
this.refreshSortable(this.control.childrenSlot);
|
|
3775
|
+
this.instance.children.forEach((child) => {
|
|
3776
|
+
child.ui.refreshUI();
|
|
3777
|
+
});
|
|
3770
3778
|
if (isSet(maxItems2) && maxItems2 === this.instance.value.length) {
|
|
3771
3779
|
this.control.addBtn.setAttribute("disabled", "");
|
|
3772
3780
|
}
|
|
@@ -4239,7 +4247,8 @@ class EditorNull extends Editor {
|
|
|
4239
4247
|
}
|
|
4240
4248
|
class EditorStringQuill extends EditorString {
|
|
4241
4249
|
static resolves(schema) {
|
|
4242
|
-
|
|
4250
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
4251
|
+
return isSet(format2) && format2 === "quill" && window.Quill && getSchemaType(schema) === "string";
|
|
4243
4252
|
}
|
|
4244
4253
|
build() {
|
|
4245
4254
|
this.control = this.theme.getPlaceholderControl({
|
|
@@ -4251,7 +4260,8 @@ class EditorStringQuill extends EditorString {
|
|
|
4251
4260
|
info: this.getInfo()
|
|
4252
4261
|
});
|
|
4253
4262
|
try {
|
|
4254
|
-
|
|
4263
|
+
const quillOptions = getSchemaXOption(this.instance.schema, "quill") ?? {};
|
|
4264
|
+
this.quill = new window.Quill(this.control.placeholder, quillOptions);
|
|
4255
4265
|
} catch (e) {
|
|
4256
4266
|
console.error("Quill is not available or not loaded correctly.", e);
|
|
4257
4267
|
}
|
|
@@ -4278,7 +4288,8 @@ class EditorStringQuill extends EditorString {
|
|
|
4278
4288
|
}
|
|
4279
4289
|
class EditorStringJodit extends EditorString {
|
|
4280
4290
|
static resolves(schema) {
|
|
4281
|
-
|
|
4291
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
4292
|
+
return isSet(format2) && format2 === "jodit" && window.Jodit && getSchemaType(schema) === "string";
|
|
4282
4293
|
}
|
|
4283
4294
|
build() {
|
|
4284
4295
|
this.control = this.theme.getTextareaControl({
|
|
@@ -4290,7 +4301,8 @@ class EditorStringJodit extends EditorString {
|
|
|
4290
4301
|
info: this.getInfo()
|
|
4291
4302
|
});
|
|
4292
4303
|
try {
|
|
4293
|
-
|
|
4304
|
+
const joditOptions = getSchemaXOption(this.instance.schema, "jodit") ?? {};
|
|
4305
|
+
this.jodit = window.Jodit.make(this.control.input, joditOptions);
|
|
4294
4306
|
} catch (e) {
|
|
4295
4307
|
console.error("Jodit is not available or not loaded correctly.", e);
|
|
4296
4308
|
}
|
|
@@ -4321,7 +4333,8 @@ class EditorStringJodit extends EditorString {
|
|
|
4321
4333
|
}
|
|
4322
4334
|
class EditorStringFlatpickr extends EditorString {
|
|
4323
4335
|
static resolves(schema) {
|
|
4324
|
-
|
|
4336
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
4337
|
+
return isSet(format2) && format2 === "flatpickr" && window.flatpickr && getSchemaType(schema) === "string";
|
|
4325
4338
|
}
|
|
4326
4339
|
build() {
|
|
4327
4340
|
this.control = this.theme.getInputControl({
|
|
@@ -4334,7 +4347,8 @@ class EditorStringFlatpickr extends EditorString {
|
|
|
4334
4347
|
info: this.getInfo()
|
|
4335
4348
|
});
|
|
4336
4349
|
try {
|
|
4337
|
-
|
|
4350
|
+
const flatpickrOptions = getSchemaXOption(this.instance.schema, "flatpickr") ?? {};
|
|
4351
|
+
this.flatpickr = window.flatpickr(this.control.input, flatpickrOptions);
|
|
4338
4352
|
} catch (e) {
|
|
4339
4353
|
console.error("Flatpickr is not available or not loaded correctly.", e);
|
|
4340
4354
|
}
|
|
@@ -4357,8 +4371,8 @@ class EditorStringIMask extends EditorString {
|
|
|
4357
4371
|
static resolves(schema) {
|
|
4358
4372
|
const hasSchemaTypeString = getSchemaType(schema) === "string";
|
|
4359
4373
|
const imaskAvailable = window.IMask;
|
|
4360
|
-
const
|
|
4361
|
-
return
|
|
4374
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
4375
|
+
return isSet(format2) && format2 === "imask" && hasSchemaTypeString && imaskAvailable;
|
|
4362
4376
|
}
|
|
4363
4377
|
build() {
|
|
4364
4378
|
this.control = this.theme.getInputControl({
|
|
@@ -4398,7 +4412,8 @@ class EditorStringIMask extends EditorString {
|
|
|
4398
4412
|
}
|
|
4399
4413
|
class EditorNumberRaty extends EditorNumber {
|
|
4400
4414
|
static resolves(schema) {
|
|
4401
|
-
|
|
4415
|
+
const format2 = getSchemaXOption(schema, "format");
|
|
4416
|
+
return isSet(format2) && format2 === "raty" && typeof Raty !== "undefined" && getSchemaType(schema) === "number";
|
|
4402
4417
|
}
|
|
4403
4418
|
build() {
|
|
4404
4419
|
this.control = this.theme.getPlaceholderControl({
|
|
@@ -4410,11 +4425,12 @@ class EditorNumberRaty extends EditorNumber {
|
|
|
4410
4425
|
info: this.getInfo()
|
|
4411
4426
|
});
|
|
4412
4427
|
try {
|
|
4413
|
-
|
|
4428
|
+
const ratyOptions = getSchemaXOption(this.instance.schema, "raty") ?? {};
|
|
4429
|
+
this.raty = new Raty(this.control.placeholder, Object.assign({}, ratyOptions), {
|
|
4414
4430
|
click: (score) => {
|
|
4415
4431
|
this.instance.setValue(score, true, "user");
|
|
4416
4432
|
}
|
|
4417
|
-
})
|
|
4433
|
+
});
|
|
4418
4434
|
this.raty.init();
|
|
4419
4435
|
} catch (e) {
|
|
4420
4436
|
console.error("Raty is not available or not loaded correctly.", e);
|