@bildvitta/quasar-ui-asteroid 3.0.0-beta.17 → 3.0.0-beta.18
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/api/QasFormGenerator.json +33 -2
- package/dist/api/QasSelect.json +4 -2
- package/dist/asteroid.cjs.js +138 -61
- package/dist/asteroid.cjs.min.js +2 -2
- package/dist/asteroid.esm.js +138 -61
- package/dist/asteroid.esm.min.js +2 -2
- package/dist/asteroid.umd.css +1 -1
- package/dist/asteroid.umd.js +138 -61
- package/dist/asteroid.umd.min.js +2 -2
- package/dist/vetur/asteroid-attributes.json +10 -2
- package/dist/vetur/asteroid-tags.json +2 -0
- package/package.json +1 -1
- package/src/components/form-generator/QasFormGenerator.vue +85 -12
- package/src/components/form-generator/QasFormGenerator.yml +16 -2
- package/src/components/form-view/QasFormView.vue +10 -25
- package/src/components/select/QasSelect.vue +1 -2
- package/src/components/select/QasSelect.yml +2 -2
- package/src/components/uploader/QasUploader.vue +1 -1
- package/src/mixins/generator.js +10 -2
|
@@ -38,16 +38,44 @@
|
|
|
38
38
|
"{ email: { name: 'email', type: 'email', label: 'E-mail' } }"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
|
+
"fieldset": {
|
|
42
|
+
"desc": "Lista para agrupar elementos por rótulo (label).",
|
|
43
|
+
"default": {},
|
|
44
|
+
"type": "Object",
|
|
45
|
+
"examples": [
|
|
46
|
+
"{ personalInformation: { label: 'Informações pessoais', fields: [name, email] } }"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"fieldset-gutter": {
|
|
50
|
+
"desc": "Espaçamento entre rótulos (label).",
|
|
51
|
+
"default": "lg",
|
|
52
|
+
"type": [
|
|
53
|
+
"String",
|
|
54
|
+
"Boolean"
|
|
55
|
+
],
|
|
56
|
+
"examples": [
|
|
57
|
+
"xs",
|
|
58
|
+
"sm",
|
|
59
|
+
"md",
|
|
60
|
+
"lg",
|
|
61
|
+
"xl",
|
|
62
|
+
false
|
|
63
|
+
]
|
|
64
|
+
},
|
|
41
65
|
"gutter": {
|
|
42
66
|
"desc": "Espaçamento entre colunas.",
|
|
43
67
|
"default": "md",
|
|
44
|
-
"type":
|
|
68
|
+
"type": [
|
|
69
|
+
"String",
|
|
70
|
+
"Boolean"
|
|
71
|
+
],
|
|
45
72
|
"examples": [
|
|
46
73
|
"xs",
|
|
47
74
|
"sm",
|
|
48
75
|
"md",
|
|
49
76
|
"lg",
|
|
50
|
-
"xl"
|
|
77
|
+
"xl",
|
|
78
|
+
false
|
|
51
79
|
]
|
|
52
80
|
},
|
|
53
81
|
"model-value": {
|
|
@@ -78,6 +106,9 @@
|
|
|
78
106
|
}
|
|
79
107
|
}
|
|
80
108
|
},
|
|
109
|
+
"legend-[nome-da-chave]": {
|
|
110
|
+
"desc": "Acessa o slot de um rótulo (label)."
|
|
111
|
+
},
|
|
81
112
|
"events": {
|
|
82
113
|
"@update:model-value -> function(value)": {
|
|
83
114
|
"desc": "Dispara quando o model-value altera, também usado para v-model.",
|
package/dist/api/QasSelect.json
CHANGED
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"Array",
|
|
64
64
|
"Object",
|
|
65
65
|
"String",
|
|
66
|
-
"Number"
|
|
66
|
+
"Number",
|
|
67
|
+
"Boolean"
|
|
67
68
|
],
|
|
68
69
|
"examples": [
|
|
69
70
|
"v-model=\"value\""
|
|
@@ -114,7 +115,8 @@
|
|
|
114
115
|
"Array",
|
|
115
116
|
"Object",
|
|
116
117
|
"String",
|
|
117
|
-
"Number"
|
|
118
|
+
"Number",
|
|
119
|
+
"Boolean"
|
|
118
120
|
]
|
|
119
121
|
}
|
|
120
122
|
}
|
package/dist/asteroid.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @bildvitta/quasar-ui-asteroid v3.0.0-beta.
|
|
2
|
+
* @bildvitta/quasar-ui-asteroid v3.0.0-beta.18
|
|
3
3
|
* (c) 2022 Bild & Vitta <systemteam@bild.com.br>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -3894,7 +3894,7 @@ const _hoisted_4$7 = {
|
|
|
3894
3894
|
key: 1,
|
|
3895
3895
|
class: "q-uploader__subtitle"
|
|
3896
3896
|
};
|
|
3897
|
-
const _hoisted_5$5 = ["multiple"];
|
|
3897
|
+
const _hoisted_5$5 = ["accept", "multiple"];
|
|
3898
3898
|
const _hoisted_6$3 = { class: "col-12 q-col-gutter-md row" };
|
|
3899
3899
|
const _hoisted_7$3 = { class: "col items-center no-wrap row" };
|
|
3900
3900
|
const _hoisted_8$2 = {
|
|
@@ -3966,6 +3966,7 @@ function render$q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3966
3966
|
: vue.createCommentVNode("v-if", true),
|
|
3967
3967
|
vue.createElementVNode("input", {
|
|
3968
3968
|
ref: "hiddenInput",
|
|
3969
|
+
accept: $options.attributes.accept,
|
|
3969
3970
|
class: "qas-uploader__input",
|
|
3970
3971
|
multiple: $options.isMultiple,
|
|
3971
3972
|
type: "file"
|
|
@@ -5151,7 +5152,9 @@ var generatorMixin = {
|
|
|
5151
5152
|
gutter: {
|
|
5152
5153
|
default: 'md',
|
|
5153
5154
|
type: [String, Boolean],
|
|
5154
|
-
validator: value =>
|
|
5155
|
+
validator: value => {
|
|
5156
|
+
return typeof value === 'boolean' || ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
|
5157
|
+
}
|
|
5155
5158
|
}
|
|
5156
5159
|
},
|
|
5157
5160
|
|
|
@@ -5200,7 +5203,13 @@ var generatorMixin = {
|
|
|
5200
5203
|
},
|
|
5201
5204
|
|
|
5202
5205
|
mx_handleColumnsByIndex (index, isGridGenerator) {
|
|
5203
|
-
const fields = isGridGenerator ? this.fields :
|
|
5206
|
+
const fields = isGridGenerator ? this.fields : {};
|
|
5207
|
+
|
|
5208
|
+
if (!isGridGenerator) {
|
|
5209
|
+
for (const key in this.normalizedFields) {
|
|
5210
|
+
Object.assign(fields, this.normalizedFields[key].fields.visible);
|
|
5211
|
+
}
|
|
5212
|
+
}
|
|
5204
5213
|
|
|
5205
5214
|
if (!Array.isArray(fields)) {
|
|
5206
5215
|
index = Object.keys(fields).findIndex(field => field === index);
|
|
@@ -5250,6 +5259,19 @@ var script$l = {
|
|
|
5250
5259
|
default: () => ({}),
|
|
5251
5260
|
required: true,
|
|
5252
5261
|
type: Object
|
|
5262
|
+
},
|
|
5263
|
+
|
|
5264
|
+
fieldset: {
|
|
5265
|
+
default: () => ({}),
|
|
5266
|
+
type: Object
|
|
5267
|
+
},
|
|
5268
|
+
|
|
5269
|
+
fieldsetGutter: {
|
|
5270
|
+
default: 'lg',
|
|
5271
|
+
type: [String, Boolean],
|
|
5272
|
+
validator: value => {
|
|
5273
|
+
return typeof value === 'boolean' || ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
|
5274
|
+
}
|
|
5253
5275
|
}
|
|
5254
5276
|
},
|
|
5255
5277
|
|
|
@@ -5259,6 +5281,8 @@ var script$l = {
|
|
|
5259
5281
|
groupedFields () {
|
|
5260
5282
|
const fields = { hidden: {}, visible: {} };
|
|
5261
5283
|
|
|
5284
|
+
if (this.hasFieldset) return fields
|
|
5285
|
+
|
|
5262
5286
|
for (const key in this.fields) {
|
|
5263
5287
|
const field = this.fields[key];
|
|
5264
5288
|
fields[field.type === 'hidden' ? 'hidden' : 'visible'][key] = field;
|
|
@@ -5275,6 +5299,56 @@ var script$l = {
|
|
|
5275
5299
|
}
|
|
5276
5300
|
|
|
5277
5301
|
return fields
|
|
5302
|
+
},
|
|
5303
|
+
|
|
5304
|
+
normalizedFields () {
|
|
5305
|
+
if (!this.hasFieldset) {
|
|
5306
|
+
return {
|
|
5307
|
+
default: {
|
|
5308
|
+
fields: this.groupedFields
|
|
5309
|
+
}
|
|
5310
|
+
}
|
|
5311
|
+
}
|
|
5312
|
+
|
|
5313
|
+
const fields = {};
|
|
5314
|
+
|
|
5315
|
+
for (const fieldsetKey in this.fieldset) {
|
|
5316
|
+
const fieldsetItem = this.fieldset[fieldsetKey];
|
|
5317
|
+
|
|
5318
|
+
fields[fieldsetKey] = {
|
|
5319
|
+
label: fieldsetItem.label,
|
|
5320
|
+
fields: { hidden: {}, visible: {} }
|
|
5321
|
+
};
|
|
5322
|
+
|
|
5323
|
+
for (const fieldName of fieldsetItem.fields) {
|
|
5324
|
+
const field = this.fields[fieldName];
|
|
5325
|
+
|
|
5326
|
+
Object.assign(
|
|
5327
|
+
fields[fieldsetKey].fields[
|
|
5328
|
+
field.type === 'hidden' ? 'hidden' : 'visible'
|
|
5329
|
+
],
|
|
5330
|
+
{
|
|
5331
|
+
[fieldName]: field
|
|
5332
|
+
}
|
|
5333
|
+
);
|
|
5334
|
+
}
|
|
5335
|
+
}
|
|
5336
|
+
|
|
5337
|
+
return fields
|
|
5338
|
+
},
|
|
5339
|
+
|
|
5340
|
+
hasFieldset () {
|
|
5341
|
+
return !!Object.keys(this.fieldset).length
|
|
5342
|
+
},
|
|
5343
|
+
|
|
5344
|
+
fieldsetClasses () {
|
|
5345
|
+
const classes = ['row'];
|
|
5346
|
+
|
|
5347
|
+
if (this.fieldsetGutter) {
|
|
5348
|
+
classes.push(`q-col-gutter-${this.fieldsetGutter}`);
|
|
5349
|
+
}
|
|
5350
|
+
|
|
5351
|
+
return classes
|
|
5278
5352
|
}
|
|
5279
5353
|
},
|
|
5280
5354
|
|
|
@@ -5289,40 +5363,59 @@ var script$l = {
|
|
|
5289
5363
|
};
|
|
5290
5364
|
|
|
5291
5365
|
function render$l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5366
|
+
const _component_qas_label = vue.resolveComponent("qas-label");
|
|
5292
5367
|
const _component_qas_field = vue.resolveComponent("qas-field");
|
|
5293
5368
|
|
|
5294
|
-
return (vue.openBlock(), vue.createElementBlock("div",
|
|
5295
|
-
vue.
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
(vue.openBlock(
|
|
5299
|
-
|
|
5300
|
-
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
vue.renderSlot(_ctx.$slots, `
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5369
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5370
|
+
class: vue.normalizeClass($options.fieldsetClasses)
|
|
5371
|
+
}, [
|
|
5372
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.normalizedFields, (fieldsetItem, fieldsetItemKey) => {
|
|
5373
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5374
|
+
key: fieldsetItemKey,
|
|
5375
|
+
class: "full-width"
|
|
5376
|
+
}, [
|
|
5377
|
+
(fieldsetItem.label)
|
|
5378
|
+
? vue.renderSlot(_ctx.$slots, `legend-${fieldsetItemKey}`, { key: 0 }, () => [
|
|
5379
|
+
vue.createVNode(_component_qas_label, {
|
|
5380
|
+
label: fieldsetItem.label
|
|
5381
|
+
}, null, 8 /* PROPS */, ["label"])
|
|
5382
|
+
])
|
|
5383
|
+
: vue.createCommentVNode("v-if", true),
|
|
5384
|
+
vue.createElementVNode("div", null, [
|
|
5385
|
+
vue.createElementVNode("div", {
|
|
5386
|
+
class: vue.normalizeClass(_ctx.mx_classes)
|
|
5387
|
+
}, [
|
|
5388
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fieldsetItem.fields.visible, (field, key) => {
|
|
5389
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
5390
|
+
key: key,
|
|
5391
|
+
class: vue.normalizeClass(_ctx.mx_getFieldClass(key))
|
|
5392
|
+
}, [
|
|
5393
|
+
vue.renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
|
|
5394
|
+
vue.createVNode(_component_qas_field, vue.mergeProps($props.fieldsProps[field.name], {
|
|
5395
|
+
error: $props.errors[key],
|
|
5396
|
+
field: field,
|
|
5397
|
+
"model-value": $props.modelValue[field.name],
|
|
5398
|
+
"onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
|
|
5399
|
+
}), null, 16 /* FULL_PROPS */, ["error", "field", "model-value", "onUpdate:modelValue"])
|
|
5400
|
+
])
|
|
5401
|
+
], 2 /* CLASS */))
|
|
5402
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
5403
|
+
], 2 /* CLASS */),
|
|
5404
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(fieldsetItem.fields.hidden, (field, key) => {
|
|
5405
|
+
return (vue.openBlock(), vue.createElementBlock("div", { key: key }, [
|
|
5406
|
+
vue.renderSlot(_ctx.$slots, `field-${field.name}`, { field: field }, () => [
|
|
5407
|
+
vue.createVNode(_component_qas_field, vue.mergeProps($props.fieldsProps[field.name], {
|
|
5408
|
+
field: field,
|
|
5409
|
+
"model-value": $props.modelValue[field.name],
|
|
5410
|
+
"onUpdate:modelValue": $event => ($options.updateModelValue(field.name, $event))
|
|
5411
|
+
}), null, 16 /* FULL_PROPS */, ["field", "model-value", "onUpdate:modelValue"])
|
|
5412
|
+
])
|
|
5413
|
+
]))
|
|
5414
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
5322
5415
|
])
|
|
5323
5416
|
]))
|
|
5324
5417
|
}), 128 /* KEYED_FRAGMENT */))
|
|
5325
|
-
]))
|
|
5418
|
+
], 2 /* CLASS */))
|
|
5326
5419
|
}
|
|
5327
5420
|
|
|
5328
5421
|
script$l.render = render$l;
|
|
@@ -5790,7 +5883,6 @@ var script$k = {
|
|
|
5790
5883
|
data () {
|
|
5791
5884
|
return {
|
|
5792
5885
|
cachedResult: {},
|
|
5793
|
-
hasResult: false,
|
|
5794
5886
|
isSubmitting: false,
|
|
5795
5887
|
showDialog: false,
|
|
5796
5888
|
ignoreRouterGuard: false,
|
|
@@ -5847,16 +5939,6 @@ var script$k = {
|
|
|
5847
5939
|
},
|
|
5848
5940
|
|
|
5849
5941
|
watch: {
|
|
5850
|
-
mx_fields (fields) {
|
|
5851
|
-
const models = { ...this.getModelsByFields(fields), ...this.modelValue };
|
|
5852
|
-
|
|
5853
|
-
this.$emit('update:modelValue', models);
|
|
5854
|
-
|
|
5855
|
-
if (!this.hasResult && this.useDialogOnUnsavedChanges) {
|
|
5856
|
-
this.cachedResult = quasar.extend(true, {}, models);
|
|
5857
|
-
}
|
|
5858
|
-
},
|
|
5859
|
-
|
|
5860
5942
|
isSubmitting (value) {
|
|
5861
5943
|
this.$emit('update:submitting', value);
|
|
5862
5944
|
}
|
|
@@ -5926,37 +6008,33 @@ var script$k = {
|
|
|
5926
6008
|
|
|
5927
6009
|
const { errors, fields, metadata, result } = response.data;
|
|
5928
6010
|
|
|
6011
|
+
const modelValue = { ...this.getModelsByFields(fields), ...this.modelValue };
|
|
6012
|
+
|
|
5929
6013
|
this.mx_setErrors(errors);
|
|
5930
6014
|
this.mx_setFields(fields);
|
|
5931
6015
|
this.mx_setMetadata(metadata);
|
|
5932
6016
|
|
|
5933
6017
|
this.mx_updateModels({
|
|
5934
|
-
errors
|
|
6018
|
+
errors,
|
|
5935
6019
|
fields: this.mx_fields,
|
|
5936
6020
|
metadata
|
|
5937
6021
|
});
|
|
5938
6022
|
|
|
6023
|
+
result && Object.assign(modelValue, result);
|
|
6024
|
+
|
|
5939
6025
|
this.$qas.logger.group(
|
|
5940
6026
|
`QasFormView - fetch -> resposta da action ${this.entity}/fetchSingle`, [response]
|
|
5941
6027
|
);
|
|
5942
6028
|
|
|
5943
|
-
if (
|
|
5944
|
-
this.
|
|
5945
|
-
|
|
5946
|
-
this.$nextTick(() => {
|
|
5947
|
-
const modelValue = { ...this.modelValue, ...result };
|
|
5948
|
-
|
|
5949
|
-
this.$emit('update:modelValue', modelValue);
|
|
5950
|
-
|
|
5951
|
-
this.$qas.logger.group('QasFormView - fetch -> modelValue', [modelValue]);
|
|
5952
|
-
});
|
|
5953
|
-
|
|
5954
|
-
this.cachedResult = this.useDialogOnUnsavedChanges && quasar.extend(true, {}, result);
|
|
5955
|
-
|
|
6029
|
+
if (this.useDialogOnUnsavedChanges) {
|
|
6030
|
+
this.cachedResult = quasar.extend(true, {}, result || modelValue);
|
|
5956
6031
|
this.$qas.logger.group('QasFormView - fetch -> cachedResult', [this.cachedResult]);
|
|
5957
6032
|
}
|
|
5958
6033
|
|
|
6034
|
+
this.$emit('update:modelValue', modelValue);
|
|
5959
6035
|
this.$emit('fetch-success', response, this.modelValue);
|
|
6036
|
+
|
|
6037
|
+
this.$qas.logger.group('QasFormView - fetch -> modelValue', [modelValue]);
|
|
5960
6038
|
} catch (error) {
|
|
5961
6039
|
this.mx_fetchError(error);
|
|
5962
6040
|
this.$emit('fetch-error', error);
|
|
@@ -8367,7 +8445,7 @@ var script$7 = {
|
|
|
8367
8445
|
|
|
8368
8446
|
modelValue: {
|
|
8369
8447
|
default: () => [],
|
|
8370
|
-
type: [Array, Object, String, Number]
|
|
8448
|
+
type: [Array, Object, String, Number, Boolean]
|
|
8371
8449
|
},
|
|
8372
8450
|
|
|
8373
8451
|
noOptionLabel: {
|
|
@@ -8401,7 +8479,6 @@ var script$7 = {
|
|
|
8401
8479
|
computed: {
|
|
8402
8480
|
attributes () {
|
|
8403
8481
|
return {
|
|
8404
|
-
bottomSlots: true,
|
|
8405
8482
|
clearable: this.isSearchable,
|
|
8406
8483
|
emitValue: true,
|
|
8407
8484
|
mapOptions: true,
|
|
@@ -9935,7 +10012,7 @@ script.__file = "src/components/transfer/QasTransfer.vue";
|
|
|
9935
10012
|
|
|
9936
10013
|
var name = "@bildvitta/quasar-ui-asteroid";
|
|
9937
10014
|
var description = "Asteroid";
|
|
9938
|
-
var version$1 = "3.0.0-beta.
|
|
10015
|
+
var version$1 = "3.0.0-beta.18";
|
|
9939
10016
|
var author = "Bild & Vitta <systemteam@bild.com.br>";
|
|
9940
10017
|
var license = "MIT";
|
|
9941
10018
|
var main = "dist/asteroid.cjs.min.js";
|