@qikdev/vue-ui 0.0.1 → 0.0.2

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 (72) hide show
  1. package/package.json +6 -2
  2. package/src/components.js +209 -6
  3. package/src/content/browser.vue +477 -0
  4. package/src/content/item.vue +48 -0
  5. package/src/content/render/field.vue +423 -0
  6. package/src/content/render/group.vue +65 -0
  7. package/src/content/render/render-mixin.js +101 -0
  8. package/src/content/render/render.vue +86 -0
  9. package/src/filter/FilterBuilder.vue +147 -0
  10. package/src/filter/FilterCondition.vue +335 -0
  11. package/src/filter/FilterRule.vue +257 -0
  12. package/src/form/expressions/index.js +83 -0
  13. package/src/form/field.vue +624 -0
  14. package/src/form/form.vue +280 -0
  15. package/src/form/getDefaultValue.js +224 -0
  16. package/src/form/inputs/button-select.vue +208 -0
  17. package/src/form/inputs/checkbox.vue +91 -0
  18. package/src/form/inputs/content-select.vue +187 -0
  19. package/src/form/inputs/currency.vue +205 -0
  20. package/src/form/inputs/datefield.vue +132 -0
  21. package/src/form/inputs/group.vue +155 -0
  22. package/src/form/inputs/input-mixin.js +440 -0
  23. package/src/form/inputs/native-select-old.vue +43 -0
  24. package/src/form/inputs/object-field.vue +50 -0
  25. package/src/form/inputs/option.vue +19 -0
  26. package/src/form/inputs/options-manager.vue +244 -0
  27. package/src/form/inputs/phone-number-input.vue +235 -0
  28. package/src/form/inputs/search.vue +117 -0
  29. package/src/form/inputs/select.vue +211 -0
  30. package/src/form/inputs/switch.vue +87 -0
  31. package/src/form/inputs/textarea.vue +80 -0
  32. package/src/form/inputs/textfield.vue +165 -0
  33. package/src/form/inputs/timezone.vue +642 -0
  34. package/src/form/inputs/upload/filedrop.vue +72 -0
  35. package/src/form/inputs/upload/upload.vue +323 -0
  36. package/src/form/parseBoolean.js +24 -0
  37. package/src/layout/flex-body.vue +3 -2
  38. package/src/layout/flex-cell.vue +45 -0
  39. package/src/layout/flex-column.vue +1 -1
  40. package/src/layout/flex-footer.vue +3 -2
  41. package/src/layout/flex-header.vue +3 -2
  42. package/src/layout/flex-row.vue +35 -0
  43. package/src/layout/flex-spacer.vue +17 -0
  44. package/src/layout/panel-body.vue +13 -0
  45. package/src/layout/panel-footer.vue +20 -0
  46. package/src/layout/panel-header.vue +20 -0
  47. package/src/layout/panel.vue +23 -0
  48. package/src/modal/ConfirmModal.vue +50 -0
  49. package/src/modal/ContentModal.vue +99 -0
  50. package/src/modal/Modal.vue +85 -0
  51. package/src/modal/ModalMixin.js +21 -0
  52. package/src/modal/OptionsModal.vue +31 -0
  53. package/src/modal/PromptModal.vue +31 -0
  54. package/src/services/selection.js +140 -0
  55. package/src/table/Table.vue +269 -0
  56. package/src/table/TableCell.vue +64 -0
  57. package/src/table/TableRow.vue +94 -0
  58. package/src/table/cells/TableCellMixin.js +15 -0
  59. package/src/table/cells/Thumbnail.vue +38 -0
  60. package/src/ui/button.vue +254 -0
  61. package/src/ui/checkbox.vue +79 -0
  62. package/src/ui/icon.vue +57 -0
  63. package/src/ui/image.vue +158 -0
  64. package/src/ui/link.vue +62 -0
  65. package/src/ui/list-item.vue +16 -0
  66. package/src/ui/list.vue +26 -0
  67. package/src/ui/menu.vue +135 -0
  68. package/src/ui/progressbar.vue +77 -0
  69. package/src/ui/spinner.vue +26 -0
  70. package/src/ui/switch.vue +89 -0
  71. package/yarn-error.log +2923 -0
  72. package/index.js +0 -14
@@ -0,0 +1,254 @@
1
+ <template>
2
+ <!-- :type="nativeType" -->
3
+ <component :is="element" :loading="loading" :to="to" :href="href" :target="target" :style="style" :class="classes" :disabled="disabled" class="ux-btn">
4
+ <spinner v-if="loading" />
5
+ <span class="ux-btn-text">
6
+ <slot />
7
+ </span>
8
+ </component>
9
+ </template>
10
+ <script>
11
+ import Spinner from './spinner.vue';
12
+ export default {
13
+ components: {
14
+ Spinner,
15
+ },
16
+ props: {
17
+ to: {
18
+ type: [Object, String],
19
+ },
20
+ icon: {
21
+ type: Boolean,
22
+ },
23
+ color: {
24
+ type: String,
25
+ default: 'default',
26
+ },
27
+ bgColor: {
28
+ type: String,
29
+ },
30
+ fgColor: {
31
+ type: String,
32
+ },
33
+ tag: {
34
+ type: String,
35
+ },
36
+ href: {
37
+ type: String,
38
+ },
39
+ target: {
40
+ type: String,
41
+ },
42
+ loading: {
43
+ type: Boolean,
44
+ },
45
+ disabled: {
46
+ type: Boolean,
47
+ },
48
+ block:{
49
+ type:Boolean,
50
+ },
51
+ size: {
52
+ type: String,
53
+ default: 'md',
54
+ },
55
+ },
56
+ computed: {
57
+ style() {
58
+ var object = {};
59
+
60
+
61
+ if (this.bgColor) {
62
+ object['backgroundColor'] = this.bgColor
63
+ }
64
+
65
+ if (this.fgColor) {
66
+ object['color'] = this.fgColor
67
+ }
68
+
69
+ return object;
70
+ },
71
+ classes() {
72
+
73
+ var array = [];
74
+
75
+
76
+ array.push(`ux-btn-${this.size}`);
77
+
78
+ if (this.block) {
79
+ array.push(`ux-btn-block`);
80
+ }
81
+
82
+ if (this.loading) {
83
+ array.push(`ux-btn-loading`);
84
+ }
85
+
86
+ if (this.icon) {
87
+ array.push(`ux-btn-icon`);
88
+ }
89
+
90
+
91
+
92
+ if (this.color == 'default') {
93
+ array.push('ux-btn-color-default')
94
+ }
95
+
96
+ if (this.color == 'primary') {
97
+ array.push('ux-btn-color-primary')
98
+ }
99
+
100
+ if (this.disabled) {
101
+ array.push(`ux-btn-disabled`);
102
+ }
103
+
104
+ return array;
105
+ },
106
+ element() {
107
+ switch (this.tag) {
108
+ case 'span':
109
+ return this.tag;
110
+ break;
111
+ case 'submit':
112
+ return 'button';
113
+ break;
114
+ default:
115
+ if (this.to || this.href) {
116
+ return 'ux-link';
117
+ }
118
+
119
+ return this.tag || 'button';
120
+ break;
121
+ }
122
+
123
+
124
+ },
125
+ },
126
+ }
127
+ </script>
128
+ <style lang="scss" scoped>
129
+ .ux-btn {
130
+ padding: 0.5em 1em;
131
+ background: rgba(#000, 0.1);
132
+ border-radius: 2em;
133
+ text-decoration: none;
134
+ color: inherit;
135
+ display: inline-block;
136
+ position: relative;
137
+ border: 1px solid transparent;
138
+ flex: none;
139
+ margin-right: 0.5em;
140
+ text-align: center;
141
+ line-height: 1;
142
+ cursor: pointer;
143
+ overflow: hidden;
144
+ vertical-align: top;
145
+
146
+ &:hover {
147
+ opacity: 0.9;
148
+ }
149
+
150
+
151
+ .ux-spinner {
152
+ position: absolute;
153
+ left: 50%;
154
+ top: 50%;
155
+ transform: translateX(-50%) translateY(-50%);
156
+ }
157
+
158
+ &:last-child {
159
+ margin-right: 0;
160
+ }
161
+
162
+ &.ux-btn-block {
163
+ display: block;
164
+ width: 100%;
165
+ text-align: center;
166
+ }
167
+ }
168
+
169
+ .ux-btn-color-primary {
170
+ background: $primary;
171
+ color: #fff;
172
+ }
173
+
174
+
175
+ .ux-btn-color-default {
176
+ background: rgba(#000,0.05);
177
+ color: #555;
178
+
179
+ &:hover {
180
+ background: rgba(#000, 0.1);
181
+ }
182
+ }
183
+
184
+ .ux-btn-loading {
185
+ cursor: none;
186
+ pointer-events: none;
187
+
188
+ .ux-btn-text {
189
+ opacity: 0 !important;
190
+ }
191
+ }
192
+
193
+
194
+
195
+ .ux-btn-xxs {
196
+ font-size: 0.6em;
197
+ }
198
+
199
+ .ux-btn-xs {
200
+ font-size: 0.7em;
201
+ }
202
+
203
+ .ux-btn-sm {
204
+ font-size: 0.8em;
205
+ }
206
+
207
+ .ux-btn-md {
208
+ font-size: 1em;
209
+ }
210
+
211
+ .ux-btn-lg {
212
+ font-size: 1.2em;
213
+ }
214
+
215
+ .ux-btn-xl {
216
+ font-size: 1.3em;
217
+ }
218
+
219
+ .ux-btn-xxl {
220
+ font-size: 1.5em;
221
+ }
222
+
223
+ .ux-btn-icon {
224
+ border-radius: 50%;
225
+
226
+
227
+ position:relative;
228
+ width:2em;
229
+ height:0;
230
+ overflow: hidden;
231
+ padding: 0 0 2em;
232
+ text-align: center;
233
+ line-height: 2em;
234
+
235
+ .ux-button-text {
236
+ position: absolute;
237
+ left: 50%;
238
+ top: 50%;
239
+ transform: translateX(-50%) translateY(-50%);
240
+ }
241
+ }
242
+
243
+ .ux-btn-disabled {
244
+ cursor: none;
245
+ pointer-events: none;
246
+ opacity: 0.3;
247
+ filter: grayscale(100%);
248
+
249
+ .ux-btn-text {
250
+ opacity: 0.3;
251
+ }
252
+
253
+ }
254
+ </style>
@@ -0,0 +1,79 @@
1
+ <template>
2
+ <button class="ux-checkbox" :class="classes">
3
+ <ux-icon class="icon" icon="fa-check" />
4
+ </button>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ props: {
9
+ value: {
10
+ type: Boolean,
11
+ default() {
12
+ return false;
13
+ }
14
+ },
15
+ },
16
+ computed: {
17
+ classes() {
18
+ var array = [];
19
+ if (this.value) {
20
+ array.push(`ux-checkbox-true`);
21
+ } else {
22
+ array.push(`ux-checkbox-false`);
23
+ }
24
+ return array;
25
+ },
26
+ },
27
+ }
28
+ </script>
29
+ <style lang="scss" scoped>
30
+ .ux-checkbox {
31
+
32
+ $size: 1.2em;
33
+ padding: 0.5em 1em;
34
+ border-radius:0.3em;
35
+ display: inline-block;
36
+ position: relative;
37
+ cursor: pointer;
38
+ overflow: hidden;
39
+ border: 1px solid rgba(#000, 0.2);
40
+ background: #fff;
41
+ height:0;
42
+ overflow: hidden;
43
+ width:$size;
44
+ padding: 0 0 $size;
45
+ text-align: center;
46
+ line-height: 2em;
47
+ appearance:none;
48
+ font-size: inherit;
49
+ vertical-align: top;
50
+
51
+ .icon {
52
+ opacity: 0;
53
+ position:absolute;
54
+ top:50%;
55
+ left:50%;
56
+ transform: scale(0) translate(-50%, -50%);
57
+ transition: all 0.2s;
58
+ }
59
+
60
+ &.ux-checkbox-true {
61
+ background: $primary;
62
+
63
+ .icon {
64
+ color: #fff;
65
+ opacity: 1;
66
+ transform: scale(1) translate(-50%, -50%);
67
+ }
68
+ }
69
+
70
+ &:hover {
71
+ border-color: $primary;
72
+ .icon {
73
+ opacity: 0.5 !important;
74
+ transform: scale(1) translate(-50%, -50%);
75
+ }
76
+ }
77
+ }
78
+
79
+ </style>
@@ -0,0 +1,57 @@
1
+ <template>
2
+ <component :is="element" class="ux-icon fa" :class="classes"/>
3
+ </template>
4
+ <script>
5
+
6
+ export default {
7
+ props: {
8
+ icon: {
9
+ type: [Object, String],
10
+ },
11
+ spin: {
12
+ type: Boolean,
13
+ },
14
+ left: {
15
+ type: Boolean,
16
+ },
17
+ right: {
18
+ type: Boolean,
19
+ },
20
+ },
21
+ computed: {
22
+ classes() {
23
+
24
+ var array = [];
25
+
26
+ array.push(this.icon);
27
+
28
+ if(this.spin) {
29
+ array.push(`fa-spin`);
30
+ }
31
+
32
+ if(this.left) {
33
+ array.push('ux-icon-left')
34
+ }
35
+ if(this.right) {
36
+ array.push('ux-icon-right')
37
+ }
38
+ return array;
39
+ },
40
+ element() {
41
+ return 'i'
42
+ },
43
+ },
44
+ }
45
+ </script>
46
+ <style lang="scss" scoped>
47
+ .ux-icon {
48
+
49
+ &.ux-icon-left {
50
+ margin-right:0.4em
51
+ }
52
+
53
+ &.ux-icon-right {
54
+ margin-left:0.4em
55
+ }
56
+ }
57
+ </style>
@@ -0,0 +1,158 @@
1
+ <template>
2
+ <div class="ux-image" :style="style">
3
+ <img :src="src" />
4
+ </div>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ props: {
9
+ modelValue: {
10
+ type: Object,
11
+ },
12
+ width: {
13
+ type: [Number, String]
14
+ },
15
+ height: {
16
+ type: [Number, String]
17
+ },
18
+ quality: {
19
+ type: Number,
20
+ },
21
+ crop: {
22
+ type: Boolean,
23
+ },
24
+ format: {
25
+ type: String,
26
+ },
27
+ upscale: {
28
+ type: Boolean,
29
+ default: true,
30
+ },
31
+ type: {
32
+ type: String,
33
+ default: 'image',
34
+ },
35
+ },
36
+ data() {
37
+ return {
38
+ model: this.modelValue,
39
+ }
40
+ },
41
+ computed: {
42
+ defaultWidth() {
43
+ return;
44
+ },
45
+ defaultHeight() {
46
+ return;
47
+ },
48
+ imageWidth() {
49
+ return parseInt(this.width);
50
+ },
51
+ imageHeight() {
52
+ return parseInt(this.height);
53
+ },
54
+ id() {
55
+ return this.$qik.utils.id(this.model);
56
+ },
57
+ params() {
58
+
59
+ var params = {};
60
+ params.access_token = this.$qik.auth.getCurrentToken();
61
+
62
+ /////////////////////////////////
63
+
64
+
65
+ if (this.imageWidth) {
66
+ params.w = this.imageWidth ? this.imageWidth : this.defaultWidth;
67
+ }
68
+
69
+ if (this.imageHeight) {
70
+ params.h = this.imageHeight ? this.imageHeight : this.defaultHeight;
71
+ }
72
+
73
+ if (this.crop) {
74
+ params.c = true;
75
+ } else {
76
+ params.c = (this.imageWidth && this.imageHeight);
77
+ }
78
+
79
+ if (this.quality) {
80
+ params.q = parseInt(this.quality);
81
+ }
82
+
83
+ if (this.upscale) {
84
+ params.u = true;
85
+ }
86
+
87
+ if (this.format) {
88
+ params.f = this.format;
89
+ }
90
+
91
+ return params;
92
+ },
93
+ src() {
94
+ return this.$qik.api.generateEndpointURL(`/${this.type}/${this.id}`, this.params);
95
+ },
96
+ previewSrc() {
97
+
98
+ var params = Object.assign({}, this.params);
99
+ params.w = 50;
100
+ delete params.h;
101
+ return this.$qik.api.generateEndpointURL(`/${this.type}/${this.id}`, params);
102
+ },
103
+ style() {
104
+
105
+ var style = {};
106
+
107
+ var colors = this.model?.fileMeta?.colors?.colors;
108
+ if (colors && colors.length) {
109
+ style.backgroundColor = colors[0];
110
+ }
111
+
112
+ var dimensionWidth = this.model.width;
113
+ var dimensionHeight = this.model.height;
114
+
115
+ ///////////////////////////////////////////
116
+
117
+ if (this.width && this.height) {
118
+ dimensionWidth = this.width;
119
+ dimensionHeight = this.height;
120
+ }
121
+ ///////////////////////////////////////////
122
+
123
+ if (dimensionHeight && dimensionWidth) {
124
+ style.height = 0;
125
+ style.paddingBottom = `${(dimensionHeight / dimensionWidth) * 100}%`;
126
+ }
127
+
128
+ ///////////////////////////////////////////
129
+
130
+ style.backgroundImage = `url(${this.previewSrc})`
131
+
132
+ ///////////////////////////////////////////
133
+
134
+ return style;
135
+ }
136
+ },
137
+ }
138
+ </script>
139
+ <style lang="scss" scoped>
140
+ .ux-image {
141
+ display: block;
142
+ background-size: cover;
143
+ background-position: center center;
144
+ background-repeat: no-repeat;
145
+ background-color: rgba(#000, 0.1);
146
+ width: 100%;
147
+ height: auto;
148
+ overflow: hidden;
149
+
150
+ img {
151
+ width: 100%;
152
+ display: block;
153
+ height: auto;
154
+ margin: 0;
155
+ padding: 0;
156
+ }
157
+ }
158
+ </style>
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <component :is="element" :to="to" :href="href" :target="target" :class="class" class="ux-link">
3
+ <slot />
4
+ </component>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ props: {
9
+ to: {
10
+ type: [Object, String],
11
+ },
12
+ href: {
13
+ type: String,
14
+ },
15
+ target: {
16
+ type: String,
17
+ },
18
+ disabled: {
19
+ type: Boolean,
20
+ }
21
+ },
22
+ computed: {
23
+ class() {
24
+
25
+ var array = [];
26
+
27
+ if(this.disabled) {
28
+ array.push('disabled');
29
+ }
30
+
31
+ if(this.href || this.to) {
32
+ array.push('haslink')
33
+ }
34
+
35
+ return array;
36
+ },
37
+ element() {
38
+ if (this.to) {
39
+ return `router-link`;
40
+ } else {
41
+ return 'a';
42
+ }
43
+ }
44
+ },
45
+ }
46
+ </script>
47
+ <style lang="scss" scoped>
48
+
49
+
50
+ a {
51
+ cursor: pointer;
52
+
53
+
54
+
55
+ &.disabled {
56
+ cursor: none;
57
+ pointer-events:none;
58
+ }
59
+ }
60
+
61
+
62
+ </style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div class="ux-list-item">
3
+ <slot/>
4
+ </div>
5
+ </template>
6
+ <style lang="scss" scoped>
7
+
8
+ .ux-list-item {
9
+ background:#fff;
10
+ cursor: pointer;
11
+
12
+ &:hover {
13
+ background: darken(#fff, 5%);
14
+ }
15
+ }
16
+ </style>
@@ -0,0 +1,26 @@
1
+ <template>
2
+ <ul class="ux-list">
3
+ <slot/>
4
+ </ul>
5
+ </template>
6
+ <style lang="scss" scoped>
7
+
8
+ .ux-list {
9
+ background:#fff;
10
+ padding:0;
11
+ margin: 0;
12
+ list-style-type: none;
13
+ box-shadow: 0 0.3em 0.5em rgba(#000, 0.1);
14
+
15
+ :deep(.ux-list-item) {
16
+ list-style-type: none;
17
+ padding: 0.5em 1em;
18
+ display: block;
19
+ border-bottom: 1px solid rgba(#000, 0.1);
20
+
21
+ &:last-child {
22
+ border-bottom:none;
23
+ }
24
+ }
25
+ }
26
+ </style>