@qikdev/vue-ui 0.1.2 → 0.1.8
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/README.md +4 -89
- package/dist/favicon.ico +0 -0
- package/dist/index.css +1 -0
- package/dist/lib.es.js +17802 -0
- package/dist/lib.es.js.map +1 -0
- package/dist/lib.umd.js +9 -0
- package/dist/lib.umd.js.map +1 -0
- package/package.json +31 -24
- package/.gitlab-ci.yml +0 -13
- package/jsdoc.conf +0 -10
- package/src/components.js +0 -255
- package/src/content/browser.vue +0 -842
- package/src/content/item.vue +0 -48
- package/src/content/render/field.vue +0 -431
- package/src/content/render/group.vue +0 -65
- package/src/content/render/render-mixin.js +0 -101
- package/src/content/render/render.vue +0 -86
- package/src/filter/FilterBuilder.vue +0 -145
- package/src/filter/FilterCondition.vue +0 -373
- package/src/filter/FilterRule.vue +0 -259
- package/src/form/expressions/index.js +0 -83
- package/src/form/field.vue +0 -640
- package/src/form/form.vue +0 -280
- package/src/form/getDefaultValue.js +0 -226
- package/src/form/inputs/button-select.vue +0 -208
- package/src/form/inputs/checkbox.vue +0 -91
- package/src/form/inputs/content-select.vue +0 -187
- package/src/form/inputs/currency.vue +0 -205
- package/src/form/inputs/datefield.vue +0 -132
- package/src/form/inputs/group.vue +0 -155
- package/src/form/inputs/html.vue +0 -39
- package/src/form/inputs/input-mixin.js +0 -440
- package/src/form/inputs/native-select-old.vue +0 -43
- package/src/form/inputs/object-field.vue +0 -50
- package/src/form/inputs/option.vue +0 -19
- package/src/form/inputs/options-manager.vue +0 -244
- package/src/form/inputs/phone-number-input.vue +0 -235
- package/src/form/inputs/search.vue +0 -117
- package/src/form/inputs/select.vue +0 -229
- package/src/form/inputs/switch.vue +0 -87
- package/src/form/inputs/textarea.vue +0 -80
- package/src/form/inputs/textfield.vue +0 -185
- package/src/form/inputs/timezone.vue +0 -642
- package/src/form/inputs/type-select.vue +0 -247
- package/src/form/inputs/upload/filedrop.vue +0 -72
- package/src/form/inputs/upload/upload.vue +0 -323
- package/src/form/parseBoolean.js +0 -24
- package/src/layout/flex-body.vue +0 -23
- package/src/layout/flex-cell.vue +0 -45
- package/src/layout/flex-column.vue +0 -31
- package/src/layout/flex-footer.vue +0 -14
- package/src/layout/flex-header.vue +0 -14
- package/src/layout/flex-row.vue +0 -39
- package/src/layout/flex-spacer.vue +0 -18
- package/src/layout/panel-body.vue +0 -13
- package/src/layout/panel-footer.vue +0 -20
- package/src/layout/panel-header.vue +0 -20
- package/src/layout/panel.vue +0 -23
- package/src/layout/tab.vue +0 -34
- package/src/layout/tabset.vue +0 -72
- package/src/mixins/RememberScroll.js +0 -30
- package/src/modal/ConfirmModal.vue +0 -50
- package/src/modal/ContentModal.vue +0 -107
- package/src/modal/Modal.vue +0 -86
- package/src/modal/ModalMixin.js +0 -21
- package/src/modal/OptionsModal.vue +0 -31
- package/src/modal/PromptModal.vue +0 -31
- package/src/services/device.js +0 -211
- package/src/services/selection.js +0 -165
- package/src/table/Table.vue +0 -316
- package/src/table/TableCell.vue +0 -113
- package/src/table/TableRow.vue +0 -82
- package/src/table/cells/Button.vue +0 -56
- package/src/table/cells/TableCellMixin.js +0 -15
- package/src/table/cells/Thumbnail.vue +0 -39
- package/src/table/cells/Value.vue +0 -46
- package/src/ui/button.vue +0 -255
- package/src/ui/checkbox.vue +0 -79
- package/src/ui/icon.vue +0 -57
- package/src/ui/image.vue +0 -158
- package/src/ui/link.vue +0 -62
- package/src/ui/list-item.vue +0 -22
- package/src/ui/list.vue +0 -26
- package/src/ui/menu.vue +0 -147
- package/src/ui/pager.vue +0 -156
- package/src/ui/progressbar.vue +0 -77
- package/src/ui/spinner.vue +0 -26
- package/src/ui/switch.vue +0 -89
- package/src/version.js +0 -1
- package/test/index.spec.js +0 -42
- package/test/mocha.opts +0 -0
- package/yarn-error.log +0 -2923
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="filter-rule">
|
|
3
|
-
<div class="top">
|
|
4
|
-
<flex-row>
|
|
5
|
-
<flex-cell>
|
|
6
|
-
<div class="summary">
|
|
7
|
-
Match <native-select v-model="model.operator" :field="operatorField">
|
|
8
|
-
{{summary}}
|
|
9
|
-
</native-select> of the following conditions
|
|
10
|
-
</div>
|
|
11
|
-
</flex-cell>
|
|
12
|
-
<flex-cell @click="$emit('remove')" shrink v-if="enableRemove">
|
|
13
|
-
<ux-button size="sm" icon>
|
|
14
|
-
<ux-icon icon="fa-trash" />
|
|
15
|
-
</ux-button>
|
|
16
|
-
</flex-cell>
|
|
17
|
-
</flex-row>
|
|
18
|
-
</div>
|
|
19
|
-
<flex-row :key="`condition-${index}`" v-for="(filter, index) in model.filters">
|
|
20
|
-
<flex-cell class="operator-cell" :class="[model.operator, {last:index == model.filters.length}]" vcenter shrink v-if="index != 0">
|
|
21
|
-
<span class="line" />
|
|
22
|
-
<div class="operator">{{model.operator}}</div>
|
|
23
|
-
</flex-cell>
|
|
24
|
-
<flex-cell>
|
|
25
|
-
<filter-condition :enableRemove="model.filters.length > 1" :fields="fields" @remove="removeCondition(index)" v-model="model.filters[index]" />
|
|
26
|
-
</flex-cell>
|
|
27
|
-
</flex-row>
|
|
28
|
-
<ux-button @click="addCondition">Add Condition</ux-button>
|
|
29
|
-
</div>
|
|
30
|
-
</template>
|
|
31
|
-
<script>
|
|
32
|
-
import NativeSelect from '../form/inputs/select.vue';
|
|
33
|
-
import FilterCondition from './FilterCondition.vue';
|
|
34
|
-
|
|
35
|
-
import _debounce from 'lodash/debounce';
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
props: {
|
|
39
|
-
enableRemove: {
|
|
40
|
-
type: Boolean,
|
|
41
|
-
},
|
|
42
|
-
definition: {
|
|
43
|
-
type: Object,
|
|
44
|
-
default () {
|
|
45
|
-
return {}
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
modelValue: {
|
|
49
|
-
type: Object,
|
|
50
|
-
default () {
|
|
51
|
-
return {
|
|
52
|
-
operator: 'and',
|
|
53
|
-
filters: [],
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
methods: {
|
|
59
|
-
addCondition() {
|
|
60
|
-
this.model.filters.push({
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
removeCondition(index) {
|
|
65
|
-
console.log('remove index', index)
|
|
66
|
-
this.model.filters.splice(index, 1);
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
data() {
|
|
70
|
-
|
|
71
|
-
if (!this.modelValue.operator) {
|
|
72
|
-
this.modelValue.operator = 'and';
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (!this.modelValue.filters) {
|
|
76
|
-
this.modelValue.filters = [];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
model: JSON.parse(JSON.stringify(this.modelValue)),
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
watch: {
|
|
86
|
-
modelValue(m) {
|
|
87
|
-
if (m != this.model) {
|
|
88
|
-
this.model = m; //JSON.parse(JSON.stringify(m));
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
model: {
|
|
92
|
-
handler: _debounce(function(v) {
|
|
93
|
-
this.$emit('update:modelValue', v);
|
|
94
|
-
}, 200),
|
|
95
|
-
deep: true,
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
computed: {
|
|
99
|
-
summary() {
|
|
100
|
-
switch (this.model.operator) {
|
|
101
|
-
case 'or':
|
|
102
|
-
return `any`;
|
|
103
|
-
break;
|
|
104
|
-
case 'nor':
|
|
105
|
-
return `none`;
|
|
106
|
-
break;
|
|
107
|
-
default:
|
|
108
|
-
return `all`;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
fields() {
|
|
115
|
-
var allFields = [...this.definition.fields];
|
|
116
|
-
var definedFields = this.definition.definedFields || [];
|
|
117
|
-
if (definedFields.length) {
|
|
118
|
-
var customFields = {
|
|
119
|
-
title: `${this.definition.title}`,
|
|
120
|
-
minimum: 1,
|
|
121
|
-
maximum: 1,
|
|
122
|
-
key: 'data',
|
|
123
|
-
asObject: true,
|
|
124
|
-
type: 'group',
|
|
125
|
-
fields: definedFields,
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
allFields.push(customFields);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
var mapped = this.$qik.utils.mapFields(allFields);
|
|
132
|
-
return mapped;
|
|
133
|
-
},
|
|
134
|
-
operatorField() {
|
|
135
|
-
return {
|
|
136
|
-
minimum: 1,
|
|
137
|
-
maximum: 1,
|
|
138
|
-
options: [{
|
|
139
|
-
title: 'All',
|
|
140
|
-
value: 'and',
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
title: 'Any',
|
|
145
|
-
value: 'or',
|
|
146
|
-
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
title: 'None',
|
|
150
|
-
value: 'nor',
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
components: {
|
|
160
|
-
FilterCondition,
|
|
161
|
-
NativeSelect,
|
|
162
|
-
},
|
|
163
|
-
}
|
|
164
|
-
</script>
|
|
165
|
-
<style lang="scss">
|
|
166
|
-
.filter-rule {
|
|
167
|
-
padding: 0.5em;
|
|
168
|
-
background: #fff;
|
|
169
|
-
border: 1px solid rgba(#000, 0.1);
|
|
170
|
-
border-radius: 0.5em;
|
|
171
|
-
box-shadow: 0 0.1em 0.5em rgba(#000, 0.05);
|
|
172
|
-
margin-bottom: 0.5em;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
.operator-cell {
|
|
176
|
-
position:relative;
|
|
177
|
-
|
|
178
|
-
&.and {
|
|
179
|
-
.line {
|
|
180
|
-
background: green;
|
|
181
|
-
}
|
|
182
|
-
.operator {
|
|
183
|
-
background: green;
|
|
184
|
-
color: #fff;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
&.or {
|
|
189
|
-
.line {
|
|
190
|
-
background: orange;
|
|
191
|
-
}
|
|
192
|
-
.operator {
|
|
193
|
-
background: orange;
|
|
194
|
-
color: #fff;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
&.nor {
|
|
199
|
-
.line {
|
|
200
|
-
background: #000;
|
|
201
|
-
}
|
|
202
|
-
.operator {
|
|
203
|
-
background: #000;
|
|
204
|
-
color: #fff;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&.last {
|
|
209
|
-
.line {
|
|
210
|
-
background: #ff0066;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
.line {
|
|
216
|
-
position: absolute;
|
|
217
|
-
width: 0.1em;
|
|
218
|
-
display: block;
|
|
219
|
-
height: 100%;
|
|
220
|
-
left: 0.5em;
|
|
221
|
-
top: 0;
|
|
222
|
-
bottom: 0;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.operator {
|
|
226
|
-
border-radius: 50%;
|
|
227
|
-
position: relative;
|
|
228
|
-
width: 3em;
|
|
229
|
-
height: 0;
|
|
230
|
-
overflow: hidden;
|
|
231
|
-
padding: 0 0 3em;
|
|
232
|
-
text-align: center;
|
|
233
|
-
line-height: 3em;
|
|
234
|
-
background: #111;
|
|
235
|
-
color: #fff;
|
|
236
|
-
font-size: 0.4em;
|
|
237
|
-
text-transform: uppercase;
|
|
238
|
-
font-weight: 600;
|
|
239
|
-
display: block;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.summary {
|
|
243
|
-
font-size: 0.8em;
|
|
244
|
-
opacity: 0.5;
|
|
245
|
-
|
|
246
|
-
.native-select {
|
|
247
|
-
display: inline-block;
|
|
248
|
-
border: 1px solid transparent;
|
|
249
|
-
border-radius: 0.3em;
|
|
250
|
-
padding: 0.2em;
|
|
251
|
-
|
|
252
|
-
&:hover {
|
|
253
|
-
background: #fff;
|
|
254
|
-
border-color: $primary;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
</style>
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { parse as exprParse } from "expression-eval";
|
|
2
|
-
import { eval as exprEval } from "expression-eval";
|
|
3
|
-
|
|
4
|
-
////////////////////////////
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const service = {}
|
|
8
|
-
|
|
9
|
-
////////////////////////////
|
|
10
|
-
|
|
11
|
-
service.evaluateExpression = function(expression, context) {
|
|
12
|
-
|
|
13
|
-
//////////////////////////////
|
|
14
|
-
|
|
15
|
-
//Its a direct function so just run it
|
|
16
|
-
if (typeof expression == 'function') {
|
|
17
|
-
return expression(context);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//////////////////////////////
|
|
21
|
-
|
|
22
|
-
const contextDefaults = {
|
|
23
|
-
Math:Math,
|
|
24
|
-
String:String,
|
|
25
|
-
Array:Array,
|
|
26
|
-
Date:Date,
|
|
27
|
-
Boolean:Boolean,
|
|
28
|
-
parseInt:parseInt,
|
|
29
|
-
parseFloat:parseFloat,
|
|
30
|
-
create(Class, ...rest) {
|
|
31
|
-
return new Class(...rest);
|
|
32
|
-
},
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
context = Object.assign({}, contextDefaults, context);
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//////////////////////////////
|
|
41
|
-
|
|
42
|
-
//evaluate the string input
|
|
43
|
-
var ast;
|
|
44
|
-
var result;
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
ast = exprParse(expression);
|
|
48
|
-
result = exprEval(ast, context);
|
|
49
|
-
} catch (err) {
|
|
50
|
-
// console.log('error evaluating expression', err);
|
|
51
|
-
} finally {
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
////////////////////////////
|
|
58
|
-
|
|
59
|
-
// function testExpression(expression, context) {
|
|
60
|
-
// service.evaluateExpression(expression, context).then(function(result) {
|
|
61
|
-
// console.log('Expression', expression, context, result)
|
|
62
|
-
// })
|
|
63
|
-
// }
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
// var testModel = {
|
|
67
|
-
// data: {
|
|
68
|
-
// firstName: 'Cade',
|
|
69
|
-
// lastName: 'Embery',
|
|
70
|
-
// age: 33,
|
|
71
|
-
// nested: {
|
|
72
|
-
// deep: 10,
|
|
73
|
-
// }
|
|
74
|
-
// }
|
|
75
|
-
// }
|
|
76
|
-
|
|
77
|
-
// testExpression(`data.firstName == 'Cade'`, testModel)
|
|
78
|
-
// testExpression(`data.nested.deep * data.age / 2.3`, testModel)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
////////////////////////////
|
|
82
|
-
|
|
83
|
-
export default service;
|