pui9-components 1.16.4

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.
Files changed (60) hide show
  1. package/README.md +43 -0
  2. package/dist/demo.html +10 -0
  3. package/dist/pui9-components.common.js +81953 -0
  4. package/dist/pui9-components.common.js.map +1 -0
  5. package/dist/pui9-components.css +5 -0
  6. package/dist/pui9-components.umd.js +81963 -0
  7. package/dist/pui9-components.umd.js.map +1 -0
  8. package/dist/pui9-components.umd.min.js +308 -0
  9. package/dist/pui9-components.umd.min.js.map +1 -0
  10. package/package-lock.json +15945 -0
  11. package/package.json +78 -0
  12. package/src/App.vue +117 -0
  13. package/src/components/PuiCheckbox.vue +105 -0
  14. package/src/components/PuiCodeEditor.vue +123 -0
  15. package/src/components/PuiDateField.vue +1004 -0
  16. package/src/components/PuiField.vue +30 -0
  17. package/src/components/PuiFieldSet.vue +27 -0
  18. package/src/components/PuiFormFooter.vue +64 -0
  19. package/src/components/PuiFormFooterBtns.vue +118 -0
  20. package/src/components/PuiFormHeader.vue +25 -0
  21. package/src/components/PuiFormLoading.vue +12 -0
  22. package/src/components/PuiFormMiniAudit.vue +53 -0
  23. package/src/components/PuiMasterDetail.vue +96 -0
  24. package/src/components/PuiModalDialog.vue +87 -0
  25. package/src/components/PuiModalDialogForm.vue +205 -0
  26. package/src/components/PuiMultiSelect.vue +499 -0
  27. package/src/components/PuiNumberField.vue +503 -0
  28. package/src/components/PuiPasswordField.vue +105 -0
  29. package/src/components/PuiRadioGroup.vue +105 -0
  30. package/src/components/PuiRichTextEditor.vue +117 -0
  31. package/src/components/PuiSelect.vue +1638 -0
  32. package/src/components/PuiSelectDetailDialog.vue +106 -0
  33. package/src/components/PuiSelectTextService.vue +61 -0
  34. package/src/components/PuiSpinnerField.vue +484 -0
  35. package/src/components/PuiSwitch.vue +104 -0
  36. package/src/components/PuiTextArea.vue +203 -0
  37. package/src/components/PuiTextField.vue +272 -0
  38. package/src/dateTimeUtils.js +78 -0
  39. package/src/index.js +73 -0
  40. package/src/main.js +33 -0
  41. package/src/mixins/PuiFormComponentMixin.js +81 -0
  42. package/src/mixins/PuiMultiSelectMixin.js +106 -0
  43. package/src/mixins/PuiUtilsNumberMixin.js +19 -0
  44. package/src/plugins/vuetify.js +32 -0
  45. package/src/tests/TestAutocomplete.vue +138 -0
  46. package/src/tests/TestCodeEditor.vue +48 -0
  47. package/src/tests/TestField.vue +22 -0
  48. package/src/tests/TestFieldSet.vue +30 -0
  49. package/src/tests/TestInputCheckbox.vue +53 -0
  50. package/src/tests/TestInputDate.vue +146 -0
  51. package/src/tests/TestInputNumber.vue +77 -0
  52. package/src/tests/TestInputRadioGroup.vue +86 -0
  53. package/src/tests/TestInputSpinner.vue +77 -0
  54. package/src/tests/TestInputSwitch.vue +52 -0
  55. package/src/tests/TestInputText.vue +120 -0
  56. package/src/tests/TestInputTextArea.vue +73 -0
  57. package/src/tests/TestMultiSelect.vue +127 -0
  58. package/src/tests/TestPuiForm.vue +68 -0
  59. package/src/tests/TestRichTextEditor.vue +54 -0
  60. package/src/utils.js +148 -0
@@ -0,0 +1,30 @@
1
+ <template>
2
+ <div>
3
+ <v-layout>
4
+ <v-flex xs12>
5
+ <span style="font-weight: 500">{{ label }}</span>
6
+ </v-flex>
7
+ </v-layout>
8
+ <v-layout>
9
+ <v-flex xs12>{{ value }}</v-flex>
10
+ </v-layout>
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ name: 'PuiField',
17
+ props: {
18
+ label: {
19
+ type: String,
20
+ required: true,
21
+ default: ''
22
+ },
23
+ value: {
24
+ type: [String, Number],
25
+ required: true,
26
+ default: ''
27
+ }
28
+ }
29
+ };
30
+ </script>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <fieldset class="pt-1 pb-1 pl-2 pr-2 ml-1 mr-1 mb-1" :class="getStyleComp">
3
+ <legend>{{ title }}</legend>
4
+ <slot></slot>
5
+ </fieldset>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ name: 'PuiFieldSet',
11
+ props: {
12
+ title: {
13
+ type: String,
14
+ default: ''
15
+ },
16
+ highlighted: {
17
+ type: Boolean,
18
+ default: false
19
+ }
20
+ },
21
+ computed: {
22
+ getStyleComp() {
23
+ return { highlighted: this.highlighted };
24
+ }
25
+ }
26
+ };
27
+ </script>
@@ -0,0 +1,64 @@
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
+ data: () => ({
14
+ isMobile: false,
15
+ desktopMenuOpened: false,
16
+ secondMenuOpened: false
17
+ }),
18
+ computed: {
19
+ getComp() {
20
+ return {
21
+ 'pui-formFooter--menuexpanded': this.desktopMenuOpened || this.secondMenuOpened,
22
+ 'pui-formFooter--menuhidden': !this.desktopMenuOpened && !this.secondMenuOpened
23
+ };
24
+ },
25
+ onPuiExpandMenu() {
26
+ return this.$store.state.menu.expandMenuForce;
27
+ },
28
+ onPuiHideMenu() {
29
+ return this.$store.state.menu.hideMenuForce;
30
+ },
31
+ onPuiSecondMenuShowed() {
32
+ return this.$store.state.menu.secondMenuShowedForce;
33
+ },
34
+ onPuiMenuMustColapseMenu() {
35
+ return this.$store.state.menu.mustColapseMenu;
36
+ }
37
+ },
38
+ watch: {
39
+ onPuiExpandMenu() {
40
+ this.desktopMenuOpened = this.$store.state.menu.expandMenu;
41
+ this.secondMenuOpened = false;
42
+ },
43
+ onPuiHideMenu() {
44
+ this.desktopMenuOpened = !this.$store.state.menu.hideMenu;
45
+ },
46
+ onPuiSecondMenuShowed() {
47
+ this.secondMenuOpened = this.$store.state.menu.secondMenuShowed;
48
+ },
49
+ onPuiMenuMustColapseMenu() {
50
+ this.desktopMenuOpened = false;
51
+ }
52
+ },
53
+ created() {
54
+ this.isMobile = this.$store.getters.isMobile;
55
+ this.desktopMenuOpened = this.$store.state.menu.expanded || this.$store.state.menu.expandMenu;
56
+ },
57
+ mounted() {
58
+ this.$store.dispatch('puiFormShowFooter', true);
59
+ },
60
+ destroyed() {
61
+ this.$store.dispatch('puiFormShowFooter', false);
62
+ }
63
+ };
64
+ </script>
@@ -0,0 +1,118 @@
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>
@@ -0,0 +1,25 @@
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>
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <v-row align="center" justify="center">
3
+ <v-progress-circular indeterminate color="primary"></v-progress-circular>
4
+ <span class="ml-3">{{ $t('form.loading') }}</span>
5
+ </v-row>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ name: 'PuiFormLoading'
11
+ };
12
+ </script>
@@ -0,0 +1,53 @@
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>
@@ -0,0 +1,96 @@
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
+ :masterDetail="masterDetail"
11
+ :showCreateBtn="showCreateBtn"
12
+ :showDeleteBtn="showDeleteBtn"
13
+ :showFilterListBtn="showFilterListBtn"
14
+ :showMasterDetailFilterListBtn="showMasterDetailFilterListBtn"
15
+ :showMasterDetailFilterBtn="showMasterDetailFilterBtn"
16
+ :showMasterDetailSortBtn="showMasterDetailSortBtn"
17
+ :showMasterDetailConfBtn="showMasterDetailConfBtn"
18
+ :readOnly="formDisabled"
19
+ :modalDialog="modalDialog"
20
+ />
21
+ <br />
22
+ </div>
23
+ </template>
24
+
25
+ <script>
26
+ export default {
27
+ name: 'PuiMasterDetail',
28
+ data() {
29
+ return {
30
+ component: null,
31
+ masterDetail: true
32
+ };
33
+ },
34
+ props: {
35
+ componentName: {
36
+ type: String,
37
+ required: true
38
+ },
39
+ parentModelName: {
40
+ type: String,
41
+ required: true
42
+ },
43
+ parentModel: {
44
+ type: Object
45
+ },
46
+ parentPk: {
47
+ type: String,
48
+ required: true
49
+ },
50
+ parentPkChildFk: {
51
+ type: Object,
52
+ required: false
53
+ },
54
+ showCreateBtn: {
55
+ type: Boolean,
56
+ default: true
57
+ },
58
+ showDeleteBtn: {
59
+ type: Boolean,
60
+ default: true
61
+ },
62
+ showFilterListBtn: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ showMasterDetailFilterListBtn: {
67
+ type: Boolean,
68
+ default: false
69
+ },
70
+ showMasterDetailFilterBtn: {
71
+ type: Boolean,
72
+ default: false
73
+ },
74
+ showMasterDetailSortBtn: {
75
+ type: Boolean,
76
+ default: false
77
+ },
78
+ showMasterDetailConfBtn: {
79
+ type: Boolean,
80
+ default: false
81
+ },
82
+ formDisabled: {
83
+ type: Boolean,
84
+ default: false,
85
+ required: false
86
+ },
87
+ modalDialog: {
88
+ type: Boolean,
89
+ default: false
90
+ }
91
+ },
92
+ mounted() {
93
+ this.component = this.componentName;
94
+ }
95
+ };
96
+ </script>
@@ -0,0 +1,87 @@
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">
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
+ <v-btn
13
+ v-if="cancelText"
14
+ :id="`${dialogName}-btn-cancel`"
15
+ depressed
16
+ @click="
17
+ showDialog = false;
18
+ publishCancel();
19
+ "
20
+ >{{ cancelText }}</v-btn
21
+ >
22
+ <v-btn :id="`${dialogName}-btn-ok`" color="primary" depressed @click="publishOk()" :disabled="disableOk">{{
23
+ okText
24
+ }}</v-btn>
25
+ </v-card-actions>
26
+ </v-card>
27
+ </v-dialog>
28
+ </div>
29
+ </v-flex>
30
+ </v-layout>
31
+ </template>
32
+
33
+ <script>
34
+ export default {
35
+ name: 'PuiModalDialog',
36
+ props: {
37
+ titleText: {
38
+ type: String,
39
+ required: true
40
+ },
41
+ messageText: {
42
+ type: String,
43
+ required: true
44
+ },
45
+ okText: {
46
+ type: String,
47
+ required: true
48
+ },
49
+ cancelText: {
50
+ type: String
51
+ },
52
+ dialogName: {
53
+ type: String,
54
+ required: true
55
+ },
56
+ disableOk: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ widthDialog: {
61
+ type: Number,
62
+ default: 500
63
+ },
64
+ onShow: {
65
+ type: Function,
66
+ default: null
67
+ }
68
+ },
69
+ data() {
70
+ return {
71
+ disabled: false,
72
+ showDialog: true
73
+ };
74
+ },
75
+ mounted() {
76
+ this.onShow && this.onShow();
77
+ },
78
+ methods: {
79
+ publishOk() {
80
+ this.$puiEvents.$emit(`pui-modalDialog-${this.dialogName}-ok`);
81
+ },
82
+ publishCancel() {
83
+ this.$puiEvents.$emit(`pui-modalDialog-${this.dialogName}-cancel`);
84
+ }
85
+ }
86
+ };
87
+ </script>