@nixweb/nixloc-ui 0.0.93 → 0.0.94

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 (25) hide show
  1. package/package.json +4 -2
  2. package/src/component/forms/EscolherEstatico.vue +0 -3
  3. package/src/component/layout/BarraRolagem.vue +9 -2
  4. package/src/component/layout/Menu.vue +16 -9
  5. package/src/component/layout/Tag.vue +66 -0
  6. package/src/component/shared/FiltroHorizontal.vue +8 -2
  7. package/src/component/shared/Progresso.vue +14 -1
  8. package/src/component/shared/Tabela.vue +2 -12
  9. package/src/component/shared/query-builder/Campo.vue +116 -0
  10. package/src/component/shared/query-builder/ConverteParaOdata.js +73 -0
  11. package/src/component/shared/query-builder/Filtro.vue +85 -0
  12. package/src/component/shared/query-builder/QueryBuilder.vue +164 -0
  13. package/src/component/shared/query-builder/Rodape.vue +38 -0
  14. package/src/component/shared/query-builder/Tags.vue +84 -0
  15. package/src/component/shared/query-builder/components/CustomSelect.vue +115 -0
  16. package/src/component/shared/query-builder/components/QueryBuilderChildren.vue +46 -0
  17. package/src/component/shared/query-builder/components/QueryBuilderGroup.vue +151 -0
  18. package/src/component/shared/query-builder/components/QueryBuilderRule.vue +81 -0
  19. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapGroup.vue +120 -0
  20. package/src/component/shared/query-builder/layouts/Bootstrap/BootstrapRule.vue +171 -0
  21. package/src/component/shared/query-builder/main.js +81 -0
  22. package/src/component/shared/query-builder/utilities.js +22 -0
  23. package/src/component/template/ModeloRelatorioView.vue +455 -0
  24. package/src/store/modulos/generic.js +11 -0
  25. package/src/store/modulos/relatorio.js +149 -0
@@ -0,0 +1,171 @@
1
+ <template>
2
+ <!-- eslint-disable vue/no-v-html -->
3
+ <div class="vqb-rule card">
4
+ <div class="form-inline">
5
+ <label :class="rule.classeCss" class="mr-5">
6
+ <i :class="rule.icone"></i>
7
+ <span style="margin-left: 10px">{{ rule.label }} </span>
8
+ </label>
9
+
10
+ <!-- List of operands (optional) -->
11
+ <select
12
+ v-if="typeof rule.operands !== 'undefined'"
13
+ v-model="query.operand"
14
+ class="form-control mr-2"
15
+ >
16
+ <option v-for="operand in rule.operands" :key="operand">
17
+ {{ operand }}
18
+ </option>
19
+ </select>
20
+
21
+ <!-- List of operators (e.g. =, !=, >, <) -->
22
+ <select
23
+ v-if="typeof rule.operators !== 'undefined' && rule.operators.length > 1"
24
+ v-model="query.operator"
25
+ class="form-control mr-2"
26
+ >
27
+ <option v-for="operator in rule.operators" :key="operator" :value="operator">
28
+ {{ operator }}
29
+ </option>
30
+ </select>
31
+
32
+ <!-- Basic text input -->
33
+ <input
34
+ v-if="rule.inputType === 'text'"
35
+ v-model="query.value"
36
+ class="form-control"
37
+ type="text"
38
+ :placeholder="labels.textInputPlaceholder"
39
+ />
40
+
41
+ <!-- Basic number input -->
42
+ <input
43
+ v-if="rule.inputType === 'number'"
44
+ v-model="query.value"
45
+ class="form-control"
46
+ type="number"
47
+ />
48
+
49
+ <!-- Datepicker -->
50
+ <input
51
+ v-if="rule.inputType === 'date'"
52
+ v-model="query.value"
53
+ class="form-control"
54
+ type="date"
55
+ />
56
+
57
+ <!-- Custom component input -->
58
+ <div v-if="isCustomComponent" class="vqb-custom-component-wrap">
59
+ <DateTime
60
+ v-if="rule.component == 'datetime'"
61
+ :format="rule.props.format"
62
+ :type="rule.props.type"
63
+ :range="rule.props.range"
64
+ :value="query.value"
65
+ @input="updateQuery"
66
+ />
67
+ </div>
68
+
69
+ <!-- Checkbox input -->
70
+ <template v-if="rule.inputType === 'checkbox'">
71
+ <div
72
+ v-for="choice in rule.choices"
73
+ :key="choice.value"
74
+ class="form-check form-check-inline"
75
+ >
76
+ <input
77
+ :id="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
78
+ v-model="query.value"
79
+ type="checkbox"
80
+ :value="choice.value"
81
+ class="form-check-input"
82
+ />
83
+ <label
84
+ class="form-check-label"
85
+ :for="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
86
+ >
87
+ {{ choice.label }}
88
+ </label>
89
+ </div>
90
+ </template>
91
+
92
+ <!-- Radio input -->
93
+ <template v-if="rule.inputType === 'radio'">
94
+ <div
95
+ v-for="choice in rule.choices"
96
+ :key="choice.value"
97
+ class="form-check form-check-inline"
98
+ >
99
+ <input
100
+ :id="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
101
+ v-model="query.value"
102
+ :name="'depth' + depth + '-' + rule.id + '-' + index"
103
+ type="radio"
104
+ :value="choice.value"
105
+ class="form-check-input"
106
+ />
107
+ <label
108
+ class="form-check-label"
109
+ :for="'depth' + depth + '-' + rule.id + '-' + index + '-' + choice.value"
110
+ >
111
+ {{ choice.label }}
112
+ </label>
113
+ </div>
114
+ </template>
115
+
116
+ <!-- Select without groups -->
117
+ <select
118
+ v-if="rule.inputType === 'select' && !hasOptionGroups"
119
+ v-model="query.value"
120
+ class="form-control"
121
+ :multiple="rule.type === 'multi-select'"
122
+ >
123
+ <option v-for="option in selectOptions" :key="option.value" :value="option.value">
124
+ {{ option.label }}
125
+ </option>
126
+ </select>
127
+
128
+ <!-- Select with groups -->
129
+ <select
130
+ v-if="rule.inputType === 'select' && hasOptionGroups"
131
+ v-model="query.value"
132
+ class="form-control"
133
+ :multiple="rule.type === 'multi-select'"
134
+ >
135
+ <optgroup
136
+ v-for="(option, option_key) in selectOptions"
137
+ :key="option_key"
138
+ :label="option_key"
139
+ >
140
+ <option
141
+ v-for="sub_option in option"
142
+ :key="sub_option.value"
143
+ :value="sub_option.value"
144
+ >
145
+ {{ sub_option.label }}
146
+ </option>
147
+ </optgroup>
148
+ </select>
149
+
150
+ <!-- Remove rule button -->
151
+ <button
152
+ type="button"
153
+ class="close ml-auto"
154
+ @click="remove"
155
+ v-html="labels.removeRule"
156
+ ></button>
157
+ </div>
158
+ </div>
159
+ </template>
160
+
161
+ <script>
162
+ import QueryBuilderRule from "../../components/QueryBuilderRule";
163
+ import DateTime from "@nixweb/nixloc-ui/src/component/forms/DateTime";
164
+
165
+ export default {
166
+ extends: QueryBuilderRule,
167
+ components: {
168
+ DateTime,
169
+ },
170
+ };
171
+ </script>
@@ -0,0 +1,81 @@
1
+ import Vue from 'vue'
2
+ import VueQueryBuilder from '@nixweb/nixloc-ui/src/component/shared/QueryBuilder/VueQueryBuilder.vue'
3
+
4
+ Vue.config.productionTip = false
5
+
6
+ let rules = [
7
+ {
8
+ type: "text",
9
+ id: "first-name",
10
+ label: "First Name",
11
+ },
12
+ {
13
+ type: "text",
14
+ id: "last-name",
15
+ label: "Last Name",
16
+ },
17
+ {
18
+ type: "radio",
19
+ id: "plan-type",
20
+ label: "Plan Type",
21
+ choices: [
22
+ {label: "Standard", value: "standard"},
23
+ {label: "Premium", value: "premium"}
24
+ ]
25
+ },
26
+ {
27
+ type: "checkbox",
28
+ id: "sizes",
29
+ label: "Sizes",
30
+ choices: [
31
+ {label: "Small", value: "small"},
32
+ {label: "Medium", value: "medium"},
33
+ {label: "Large", value: "large"}
34
+ ]
35
+ },
36
+ {
37
+ type: "text",
38
+ id: "date",
39
+ inputType:"date",
40
+ label: "Date",
41
+ operands: ['Start Date', 'End Date']
42
+ },
43
+ {
44
+ type: "select",
45
+ id: 'select',
46
+ label: 'Color',
47
+ operators: ['=', '<>'],
48
+ choices: [
49
+ {label: "red", value: 'Red'},
50
+ {label: "orange", value: 'Orange'},
51
+ {label: "yellow", value: 'Yellow'},
52
+ {label: "green", value: 'Green'},
53
+ {label: "blue", value: 'Blue'},
54
+ {label: "indigo", value: 'Indigo'},
55
+ {label: "violet", value: 'Violet'},
56
+ ]
57
+ },
58
+ ];
59
+
60
+ new Vue({
61
+ el: '#app',
62
+
63
+ components: { VueQueryBuilder },
64
+
65
+ data: {
66
+ rules: rules,
67
+ output: {},
68
+ },
69
+
70
+ computed: {
71
+ outputFormatted: function() {
72
+ return JSON.stringify(this.output, null, 2);
73
+ }
74
+ },
75
+
76
+ methods: {
77
+ updateQuery: function(value){
78
+ this.output = value;
79
+ }
80
+ }
81
+ });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Returns a depply cloned object without reference.
3
+ * Copied from Vue MultiSelect and Vuex.
4
+ * @type {Object}
5
+ */
6
+ const deepClone = function (obj) {
7
+ if (Array.isArray(obj)) {
8
+ return obj.map(deepClone)
9
+ } else if (obj && typeof obj === 'object') {
10
+ var cloned = {}
11
+ var keys = Object.keys(obj)
12
+ for (var i = 0, l = keys.length; i < l; i++) {
13
+ var key = keys[i]
14
+ cloned[key] = deepClone(obj[key])
15
+ }
16
+ return cloned
17
+ } else {
18
+ return obj
19
+ }
20
+ }
21
+
22
+ export default deepClone;