pui9-components 2.0.8 → 3.0.1
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/pui9-components.common.js +5050 -22036
- package/dist/pui9-components.css +3 -6
- package/package-lock.json +81 -221
- package/package.json +1 -5
- package/src/App.vue +0 -117
- package/src/components/PuiAutocomplete.vue +0 -196
- package/src/components/PuiCauDialog.vue +0 -192
- package/src/components/PuiCheckbox.vue +0 -126
- package/src/components/PuiCodeEditor.vue +0 -124
- package/src/components/PuiDateField.vue +0 -1043
- package/src/components/PuiField.vue +0 -30
- package/src/components/PuiFieldSet.vue +0 -27
- package/src/components/PuiFileUpload.vue +0 -275
- package/src/components/PuiFileUploadGroup.vue +0 -241
- package/src/components/PuiFilter.vue +0 -104
- package/src/components/PuiFilterGroup.vue +0 -291
- package/src/components/PuiFilterRule.vue +0 -683
- package/src/components/PuiFormFooter.vue +0 -48
- package/src/components/PuiFormFooterBtns.vue +0 -118
- package/src/components/PuiFormHeader.vue +0 -25
- package/src/components/PuiFormLoading.vue +0 -14
- package/src/components/PuiFormMiniAudit.vue +0 -53
- package/src/components/PuiFormTooltip.vue +0 -50
- package/src/components/PuiMasterDetail.vue +0 -103
- package/src/components/PuiModalDialog.vue +0 -91
- package/src/components/PuiModalDialogForm.vue +0 -209
- package/src/components/PuiMultiSelect.vue +0 -636
- package/src/components/PuiNumberField.vue +0 -434
- package/src/components/PuiPasswordField.vue +0 -105
- package/src/components/PuiRadioGroup.vue +0 -105
- package/src/components/PuiRichTextEditor.vue +0 -116
- package/src/components/PuiSelect.vue +0 -1675
- package/src/components/PuiSelectDetailDialog.vue +0 -113
- package/src/components/PuiSelectTextService.vue +0 -61
- package/src/components/PuiSelectorList.vue +0 -169
- package/src/components/PuiSort.vue +0 -98
- package/src/components/PuiSpinnerField.vue +0 -464
- package/src/components/PuiSwitch.vue +0 -104
- package/src/components/PuiTextArea.vue +0 -204
- package/src/components/PuiTextField.vue +0 -389
- package/src/dateTimeUtils.js +0 -78
- package/src/index.js +0 -89
- package/src/main.js +0 -34
- package/src/mixins/PuiFormComponentMixin.js +0 -77
- package/src/mixins/PuiSortMixin.js +0 -136
- package/src/mixins/PuiUtilsNumberMixin.js +0 -29
- package/src/plugins/vuetify.js +0 -33
- package/src/tests/TestAutocomplete.vue +0 -138
- package/src/tests/TestCodeEditor.vue +0 -48
- package/src/tests/TestField.vue +0 -22
- package/src/tests/TestFieldSet.vue +0 -30
- package/src/tests/TestInputCheckbox.vue +0 -53
- package/src/tests/TestInputDate.vue +0 -146
- package/src/tests/TestInputNumber.vue +0 -77
- package/src/tests/TestInputRadioGroup.vue +0 -86
- package/src/tests/TestInputSpinner.vue +0 -77
- package/src/tests/TestInputSwitch.vue +0 -52
- package/src/tests/TestInputText.vue +0 -120
- package/src/tests/TestInputTextArea.vue +0 -73
- package/src/tests/TestMultiSelect.vue +0 -127
- package/src/tests/TestPuiForm.vue +0 -68
- package/src/tests/TestRichTextEditor.vue +0 -54
- package/src/tests/unit/PuiCheckbox.spec.js +0 -86
- package/src/tests/unit/PuiTextArea.spec.js +0 -62
- package/src/tests/unit/PuiTextField.spec.js +0 -119
- package/src/tests/unit/index.js +0 -5
- package/src/utils.js +0 -158
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="!isMobile" class="pui-formFooter pa-1 pl-3 pr-3 elevation-2" :class="getComp" ref="puiFormFooter">
|
|
3
|
-
<slot></slot>
|
|
4
|
-
</div>
|
|
5
|
-
<div v-else class="pa-1 pl-3 pr-3 elevation-2" :class="getComp">
|
|
6
|
-
<slot></slot>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'PuiFormFooter',
|
|
13
|
-
computed: {
|
|
14
|
-
isMobile() { return this.$store.getters.isMobile; },
|
|
15
|
-
menuConf() { return this.$store.getters.getMenuConf; },
|
|
16
|
-
getComp() {
|
|
17
|
-
return {
|
|
18
|
-
'pui-formFooter--menu-opened': this.menuConf.expandMenu,
|
|
19
|
-
'pui-formFooter--menu-secondary-opened': this.menuConf.secondMenuShowed,
|
|
20
|
-
'pui-formFooter--menu-hidden': this.menuConf.hideMenu,
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
methods: {
|
|
25
|
-
checkFooterIsOnScreen() {
|
|
26
|
-
const intervalTimeCheck = 50;
|
|
27
|
-
let timeWatching = 0;
|
|
28
|
-
var watchFooterInterval = setInterval(() => {
|
|
29
|
-
const isFooterOnScreen = this.$refs?.puiFormFooter?.getBoundingClientRect().y != 0;
|
|
30
|
-
timeWatching += intervalTimeCheck;
|
|
31
|
-
if (timeWatching > 1000 || this.$store.state.form.showFooter != isFooterOnScreen) {
|
|
32
|
-
this.$store.dispatch('puiFormShowFooter', isFooterOnScreen || false);
|
|
33
|
-
clearInterval(watchFooterInterval);
|
|
34
|
-
}
|
|
35
|
-
}, intervalTimeCheck);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
mounted() {
|
|
39
|
-
this.$store.dispatch('puiFormShowFooter', true);
|
|
40
|
-
},
|
|
41
|
-
updated() {
|
|
42
|
-
this.checkFooterIsOnScreen();
|
|
43
|
-
},
|
|
44
|
-
destroyed() {
|
|
45
|
-
this.$store.dispatch('puiFormShowFooter', false);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
</script>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-layout v-if="!isMobile" justify-space-between class="pui-form-footer-btns">
|
|
3
|
-
<v-btn text outlined @click.native="back()">{{ $t('form.cancel') }}</v-btn>
|
|
4
|
-
|
|
5
|
-
<div>
|
|
6
|
-
<slot></slot>
|
|
7
|
-
<v-btn
|
|
8
|
-
v-if="!formDisabled && enableSaveAndNew"
|
|
9
|
-
color="secondary"
|
|
10
|
-
class="pui-form-footer-btns__desktop"
|
|
11
|
-
@click.native="saveAndNew()"
|
|
12
|
-
:disabled="saveDisabled"
|
|
13
|
-
>{{ $t('form.save&new') }}</v-btn
|
|
14
|
-
>
|
|
15
|
-
<v-btn
|
|
16
|
-
v-if="!formDisabled && enableSaveAndUpdate"
|
|
17
|
-
color="secondary"
|
|
18
|
-
class="pui-form-footer-btns__desktop"
|
|
19
|
-
@click.native="saveAndUpdate()"
|
|
20
|
-
:disabled="saveDisabled"
|
|
21
|
-
>{{ $t('form.save&update') }}</v-btn
|
|
22
|
-
>
|
|
23
|
-
<v-btn v-if="!formDisabled" color="secondary" class="pui-form-footer-btns__desktop" @click.native="save(false)" :disabled="saveDisabled">
|
|
24
|
-
{{ enableSaveAndNew || enableSaveAndUpdate ? $t('form.save&back') : $t('form.save') }}
|
|
25
|
-
</v-btn>
|
|
26
|
-
</div>
|
|
27
|
-
</v-layout>
|
|
28
|
-
<v-speed-dial
|
|
29
|
-
v-else-if="!formDisabled && (enableSaveAndNew || enableSaveAndUpdate)"
|
|
30
|
-
v-model="fab"
|
|
31
|
-
:top="top"
|
|
32
|
-
:bottom="bottom"
|
|
33
|
-
:right="right"
|
|
34
|
-
:left="left"
|
|
35
|
-
:direction="direction"
|
|
36
|
-
:transition="transition"
|
|
37
|
-
class="pui-form-footer-btns"
|
|
38
|
-
fixed
|
|
39
|
-
>
|
|
40
|
-
<template v-slot:activator>
|
|
41
|
-
<v-btn v-model="fab" fab dark class="white--text primary">
|
|
42
|
-
<v-icon v-if="fab">far fa-times-circle</v-icon>
|
|
43
|
-
<v-icon v-else>far fa-save</v-icon>
|
|
44
|
-
</v-btn>
|
|
45
|
-
</template>
|
|
46
|
-
<v-btn fab dark small class="white--text primary" @click.native="save(false)" :disabled="saveDisabled">
|
|
47
|
-
<v-icon>far fa-save</v-icon>
|
|
48
|
-
</v-btn>
|
|
49
|
-
<v-btn fab dark small icon class="white--text secondary" @click.native="saveAndUpdate()" :disabled="saveDisabled">
|
|
50
|
-
<v-icon>far fa-edit</v-icon>
|
|
51
|
-
</v-btn>
|
|
52
|
-
<v-btn fab dark small icon class="white--text secondary" @click.native="saveAndNew()" :disabled="saveDisabled">
|
|
53
|
-
<v-icon>far fa-plus-circle</v-icon>
|
|
54
|
-
</v-btn>
|
|
55
|
-
<slot></slot>
|
|
56
|
-
</v-speed-dial>
|
|
57
|
-
<v-btn v-else-if="!formDisabled" fab dark bottom right fixed class="white--text primary" @click.native="save(false)" :disabled="saveDisabled">
|
|
58
|
-
<v-icon>far fa-save</v-icon>
|
|
59
|
-
</v-btn>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<script>
|
|
63
|
-
export default {
|
|
64
|
-
name: 'PuiFormFooterBtns',
|
|
65
|
-
data() {
|
|
66
|
-
return {
|
|
67
|
-
isMobile: false,
|
|
68
|
-
fab: false,
|
|
69
|
-
top: false,
|
|
70
|
-
bottom: true,
|
|
71
|
-
left: false,
|
|
72
|
-
right: true,
|
|
73
|
-
direction: 'top',
|
|
74
|
-
transition: 'slide-y-reverse-transition'
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
props: {
|
|
78
|
-
formDisabled: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
required: true
|
|
81
|
-
},
|
|
82
|
-
saveDisabled: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: false,
|
|
85
|
-
required: false
|
|
86
|
-
},
|
|
87
|
-
saveAndNew: {
|
|
88
|
-
type: Function,
|
|
89
|
-
default: null,
|
|
90
|
-
required: false
|
|
91
|
-
},
|
|
92
|
-
saveAndUpdate: {
|
|
93
|
-
type: Function,
|
|
94
|
-
default: null,
|
|
95
|
-
required: false
|
|
96
|
-
},
|
|
97
|
-
save: {
|
|
98
|
-
type: Function,
|
|
99
|
-
required: true
|
|
100
|
-
},
|
|
101
|
-
back: {
|
|
102
|
-
type: Function,
|
|
103
|
-
required: true
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
computed: {
|
|
107
|
-
enableSaveAndNew() {
|
|
108
|
-
return this.$store.state.form.showSaveAndNew && this.saveAndNew;
|
|
109
|
-
},
|
|
110
|
-
enableSaveAndUpdate() {
|
|
111
|
-
return this.$store.state.form.showSaveAndUpdate && this.saveAndUpdate;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
created() {
|
|
115
|
-
this.isMobile = this.$store.getters.isMobile;
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
</script>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-layout v-if="showHeader" class="pui-form-header mt-1 ml-3 mr-3 mb-3">
|
|
3
|
-
<v-flex xs12 class="pa-2">
|
|
4
|
-
<slot></slot>
|
|
5
|
-
</v-flex>
|
|
6
|
-
</v-layout>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
export default {
|
|
11
|
-
name: 'PuiFormHeader',
|
|
12
|
-
data: () => ({
|
|
13
|
-
isMobile: false
|
|
14
|
-
}),
|
|
15
|
-
props: {
|
|
16
|
-
showHeader: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: false
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
created() {
|
|
22
|
-
this.isMobile = this.$store.getters.isMobile;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
</script>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-container>
|
|
3
|
-
<v-row align="center" justify="center">
|
|
4
|
-
<v-progress-circular indeterminate color="primary"></v-progress-circular>
|
|
5
|
-
<span class="ml-3">{{ $t('form.loading') }}</span>
|
|
6
|
-
</v-row>
|
|
7
|
-
</v-container>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
export default {
|
|
12
|
-
name: 'PuiFormLoading'
|
|
13
|
-
};
|
|
14
|
-
</script>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-layout wrap class="puiminiaudit mt-2 mb-4">
|
|
3
|
-
<v-flex xs12>
|
|
4
|
-
<label>{{ $t('form.miniaudit.created') }}</label>
|
|
5
|
-
<label>{{ returnData(internalValue.usralta) }}{{ $t('form.miniaudit.at') }}</label>
|
|
6
|
-
<label>{{ returnData(internalValue.fecalta) }}</label>
|
|
7
|
-
</v-flex>
|
|
8
|
-
<v-flex xs12>
|
|
9
|
-
<label>{{ $t('form.miniaudit.modified') }}</label>
|
|
10
|
-
<label>{{ returnData(internalValue.usrmodif) }}{{ $t('form.miniaudit.at') }}</label>
|
|
11
|
-
<label>{{ returnData(internalValue.fecmodif) }}</label>
|
|
12
|
-
</v-flex>
|
|
13
|
-
</v-layout>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import dateTimeUtils from '../dateTimeUtils';
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
name: 'PuiFormMiniAudit',
|
|
21
|
-
props: {
|
|
22
|
-
model: {
|
|
23
|
-
type: Object,
|
|
24
|
-
required: true
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
data() {
|
|
28
|
-
return {
|
|
29
|
-
internalValue: {}
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
created() {
|
|
33
|
-
this.internalValue = Object.assign({}, this.model);
|
|
34
|
-
const dateFormat = this.$store.getters.dateFormat;
|
|
35
|
-
const timeFormat = this.$store.getters.timeFormat;
|
|
36
|
-
|
|
37
|
-
if (this.model.fecmodif !== null && this.model.fecmodif !== undefined) {
|
|
38
|
-
this.internalValue.fecmodif = dateTimeUtils.getLocalFormattedDate(this.model.fecmodif, `${dateFormat} ${timeFormat}`);
|
|
39
|
-
}
|
|
40
|
-
if (this.model.fecalta !== null && this.model.fecalta !== undefined) {
|
|
41
|
-
this.internalValue.fecalta = dateTimeUtils.getLocalFormattedDate(this.model.fecalta, `${dateFormat} ${timeFormat}`);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
methods: {
|
|
45
|
-
returnData(value) {
|
|
46
|
-
if (!value) {
|
|
47
|
-
return '#####';
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
</script>
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-tooltip right color="primary" v-if="showTooltip">
|
|
3
|
-
<template v-slot:activator="{ on }">
|
|
4
|
-
<v-icon color="secondary" class="info-tooltip pl-1" size="14" v-on="on">{{ getIcon }}</v-icon>
|
|
5
|
-
</template>
|
|
6
|
-
<span>
|
|
7
|
-
<span v-if="this.tooltipDescription" v-html="this.tooltipDescription"></span>
|
|
8
|
-
<ul>
|
|
9
|
-
<li v-for="(message, index) in this.tooltipMessages" :key="index">{{ message }}</li>
|
|
10
|
-
</ul>
|
|
11
|
-
</span>
|
|
12
|
-
</v-tooltip>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script>
|
|
16
|
-
export default {
|
|
17
|
-
name: 'PuiFormTooltip',
|
|
18
|
-
data: () => ({
|
|
19
|
-
tooltipMessages: []
|
|
20
|
-
}),
|
|
21
|
-
props: {
|
|
22
|
-
tooltipDescription: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: false,
|
|
25
|
-
default: null
|
|
26
|
-
},
|
|
27
|
-
tooltipIcon: {
|
|
28
|
-
type: String,
|
|
29
|
-
required: false,
|
|
30
|
-
default: 'fas fa-info-circle info-tooltip'
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
computed: {
|
|
34
|
-
showTooltip() {
|
|
35
|
-
return (this.tooltipDescription || this.tooltipMessages.length > 0);
|
|
36
|
-
},
|
|
37
|
-
getIcon() {
|
|
38
|
-
return this.tooltipIcon ? this.tooltipIcon : this.tooltipIcon.default;
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
methods: {
|
|
42
|
-
pushMessage(text) {
|
|
43
|
-
this.tooltipMessages.push(text);
|
|
44
|
-
},
|
|
45
|
-
clearMessages() {
|
|
46
|
-
this.tooltipMessages = [];
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
</script>
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="pui-masterdetail">
|
|
3
|
-
<component
|
|
4
|
-
:is="component"
|
|
5
|
-
v-if="component"
|
|
6
|
-
:parentModelName="parentModelName"
|
|
7
|
-
:parentModel="parentModel"
|
|
8
|
-
:parentPk="parentPk"
|
|
9
|
-
:parentPkChildFk="parentPkChildFk"
|
|
10
|
-
:readOnly="formDisabled"
|
|
11
|
-
:modalDialog="modalDialog"
|
|
12
|
-
:masterDetail="masterDetail"
|
|
13
|
-
:navigableDetail="navigableDetail"
|
|
14
|
-
:showCreateBtn="showCreateBtn"
|
|
15
|
-
:showDeleteBtn="showDeleteBtn"
|
|
16
|
-
:showFilterListBtn="showFilterListBtn"
|
|
17
|
-
:showMasterDetailFilterListBtn="showMasterDetailFilterListBtn"
|
|
18
|
-
:showMasterDetailFilterBtn="showMasterDetailFilterBtn"
|
|
19
|
-
:showMasterDetailSortBtn="showMasterDetailSortBtn"
|
|
20
|
-
:showMasterDetailConfBtn="showMasterDetailConfBtn"
|
|
21
|
-
|
|
22
|
-
/>
|
|
23
|
-
<br />
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
export default {
|
|
29
|
-
name: 'PuiMasterDetail',
|
|
30
|
-
data() {
|
|
31
|
-
return {
|
|
32
|
-
component: null,
|
|
33
|
-
masterDetail: true
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
props: {
|
|
37
|
-
componentName: {
|
|
38
|
-
type: String,
|
|
39
|
-
required: true
|
|
40
|
-
},
|
|
41
|
-
parentModelName: {
|
|
42
|
-
type: String,
|
|
43
|
-
required: true
|
|
44
|
-
},
|
|
45
|
-
parentModel: {
|
|
46
|
-
type: Object
|
|
47
|
-
},
|
|
48
|
-
parentPk: {
|
|
49
|
-
type: String,
|
|
50
|
-
required: true
|
|
51
|
-
},
|
|
52
|
-
parentPkChildFk: {
|
|
53
|
-
type: Object,
|
|
54
|
-
required: false
|
|
55
|
-
},
|
|
56
|
-
formDisabled: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false,
|
|
59
|
-
required: false
|
|
60
|
-
},
|
|
61
|
-
modalDialog: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: false
|
|
64
|
-
},
|
|
65
|
-
// Manual Grid Settings
|
|
66
|
-
navigableDetail: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: true
|
|
69
|
-
},
|
|
70
|
-
showCreateBtn: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: true
|
|
73
|
-
},
|
|
74
|
-
showDeleteBtn: {
|
|
75
|
-
type: Boolean,
|
|
76
|
-
default: true
|
|
77
|
-
},
|
|
78
|
-
showFilterListBtn: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: false
|
|
81
|
-
},
|
|
82
|
-
showMasterDetailFilterListBtn: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: false
|
|
85
|
-
},
|
|
86
|
-
showMasterDetailFilterBtn: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false
|
|
89
|
-
},
|
|
90
|
-
showMasterDetailSortBtn: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: false
|
|
93
|
-
},
|
|
94
|
-
showMasterDetailConfBtn: {
|
|
95
|
-
type: Boolean,
|
|
96
|
-
default: false
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
mounted() {
|
|
100
|
-
this.component = this.componentName;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
</script>
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-layout wrap>
|
|
3
|
-
<v-flex xs10 md8 lg6 xl4>
|
|
4
|
-
<div class="text-center">
|
|
5
|
-
<v-dialog :id="`${dialogName}-modal-container`" persistent eager v-model="showDialog" :width="widthDialog">
|
|
6
|
-
<v-card class="pa-2" :height="heightDialog">
|
|
7
|
-
<v-card-title class="pl-3 headline lighten-2" primary-title>{{ titleText }}</v-card-title>
|
|
8
|
-
<v-card-text class="pl-3" v-if="messageText">{{ messageText }}</v-card-text>
|
|
9
|
-
<slot name="message"></slot>
|
|
10
|
-
<v-card-actions ref="actions">
|
|
11
|
-
<v-spacer></v-spacer>
|
|
12
|
-
<slot name="additionalBtns"></slot>
|
|
13
|
-
<v-btn
|
|
14
|
-
v-if="cancelText"
|
|
15
|
-
:id="`${dialogName}-btn-cancel`"
|
|
16
|
-
depressed
|
|
17
|
-
@click="
|
|
18
|
-
showDialog = false;
|
|
19
|
-
publishCancel();
|
|
20
|
-
"
|
|
21
|
-
>{{ cancelText }}</v-btn
|
|
22
|
-
>
|
|
23
|
-
<v-btn :id="`${dialogName}-btn-ok`" color="primary" depressed @click="publishOk()" :disabled="disableOk">{{
|
|
24
|
-
okText
|
|
25
|
-
}}</v-btn>
|
|
26
|
-
</v-card-actions>
|
|
27
|
-
</v-card>
|
|
28
|
-
</v-dialog>
|
|
29
|
-
</div>
|
|
30
|
-
</v-flex>
|
|
31
|
-
</v-layout>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
export default {
|
|
36
|
-
name: 'PuiModalDialog',
|
|
37
|
-
props: {
|
|
38
|
-
titleText: {
|
|
39
|
-
type: String,
|
|
40
|
-
required: true
|
|
41
|
-
},
|
|
42
|
-
messageText: {
|
|
43
|
-
type: String,
|
|
44
|
-
required: true
|
|
45
|
-
},
|
|
46
|
-
okText: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: true
|
|
49
|
-
},
|
|
50
|
-
cancelText: {
|
|
51
|
-
type: String
|
|
52
|
-
},
|
|
53
|
-
dialogName: {
|
|
54
|
-
type: String,
|
|
55
|
-
required: true
|
|
56
|
-
},
|
|
57
|
-
disableOk: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: false
|
|
60
|
-
},
|
|
61
|
-
widthDialog: {
|
|
62
|
-
type: Number,
|
|
63
|
-
default: 500
|
|
64
|
-
},
|
|
65
|
-
heightDialog: {
|
|
66
|
-
type: Number
|
|
67
|
-
},
|
|
68
|
-
onShow: {
|
|
69
|
-
type: Function,
|
|
70
|
-
default: null
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
data() {
|
|
74
|
-
return {
|
|
75
|
-
disabled: false,
|
|
76
|
-
showDialog: true
|
|
77
|
-
};
|
|
78
|
-
},
|
|
79
|
-
mounted() {
|
|
80
|
-
this.onShow && this.onShow();
|
|
81
|
-
},
|
|
82
|
-
methods: {
|
|
83
|
-
publishOk() {
|
|
84
|
-
this.$puiEvents.$emit(`pui-modalDialog-${this.dialogName}-ok`);
|
|
85
|
-
},
|
|
86
|
-
publishCancel() {
|
|
87
|
-
this.$puiEvents.$emit(`pui-modalDialog-${this.dialogName}-cancel`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
</script>
|