glib-web 1.0.0 → 2.1.0

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 (42) hide show
  1. package/LICENSE +0 -0
  2. package/actions/auth/restart.js +0 -0
  3. package/actions/dialogs/oauth.js +0 -0
  4. package/actions/dialogs/options.js +0 -0
  5. package/actions/forms/submit.js +3 -1
  6. package/actions/windows/openWeb.js +0 -0
  7. package/components/_message.vue +0 -0
  8. package/components/datetime.vue +0 -0
  9. package/components/fab.vue +0 -0
  10. package/components/fields/_patternText.vue +1 -0
  11. package/components/fields/country/countries.js +0 -0
  12. package/components/fields/country/field.vue +0 -0
  13. package/components/fields/country/regions.js +0 -0
  14. package/components/fields/datetime.vue +0 -0
  15. package/components/fields/dynamicSelect.vue +0 -0
  16. package/components/fields/richText.vue +17 -1
  17. package/components/fields/select.vue +0 -0
  18. package/components/fields/timeZone.vue +0 -0
  19. package/components/hr.vue +0 -0
  20. package/components/html.vue +0 -0
  21. package/components/map.vue +24 -7
  22. package/components/mixins/longClick.js +0 -0
  23. package/components/mixins/scrolling.js +0 -0
  24. package/components/mixins/styles.js +4 -1
  25. package/components/mixins/table/export.js +0 -0
  26. package/components/mixins/table/import.js +0 -0
  27. package/components/p.vue +0 -0
  28. package/components/panels/form.vue +9 -5
  29. package/components/panels/timeline.vue +37 -54
  30. package/keys.js +0 -0
  31. package/nav/drawerButton.vue +0 -0
  32. package/package.json +2 -1
  33. package/settings.json.example +0 -0
  34. package/styles/test.sass +0 -0
  35. package/styles/test.scss +0 -0
  36. package/templates/unsupported.vue +0 -0
  37. package/utils/dom.js +0 -0
  38. package/utils/form.js +2 -2
  39. package/utils/public.js +0 -0
  40. package/utils/settings.js +0 -0
  41. package/utils/storage.js +0 -0
  42. package/utils/url.js +0 -0
package/LICENSE CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,7 @@
1
1
  export default class {
2
2
  execute(properties, component) {
3
- component.$dispatchEvent("forms/directSubmit");
3
+ component.$dispatchEvent("forms/directSubmit", {
4
+ url: properties.overrideUrl
5
+ });
4
6
  }
5
7
  }
File without changes
File without changes
File without changes
File without changes
@@ -13,6 +13,7 @@
13
13
  :min="$sanitizeValue(spec.min)"
14
14
  :max="$sanitizeValue(spec.max)"
15
15
  :pattern="pattern"
16
+ :rules="$validation()"
16
17
  :outlined="$classes().includes('outlined')"
17
18
  :style="$styles()"
18
19
  clearable
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,7 +5,7 @@
5
5
  v-model="rawValue"
6
6
  :editor-toolbar="customToolbar"
7
7
  use-custom-image-handler
8
- @text-change="separateOutImages"
8
+ @text-change="onChange"
9
9
  @image-added="uploadImage"
10
10
  />
11
11
  <input type="hidden" :name="spec.name" :value="produceValue" />
@@ -127,6 +127,22 @@ export default {
127
127
  });
128
128
  }
129
129
  },
130
+ onChange() {
131
+ this.separateOutImages();
132
+
133
+ Utils.type.ifObject(this.spec.onChange, onChange => {
134
+ this.$nextTick(() => {
135
+ const params = {
136
+ [this.spec.paramNameForFormData || "formData"]: {
137
+ [this.fieldName]: this.fieldModel
138
+ }
139
+ };
140
+
141
+ const data = Object.assign({}, onChange, params);
142
+ GLib.action.execute(data, this);
143
+ });
144
+ });
145
+ },
130
146
  separateOutImages: function() {
131
147
  const vm = this;
132
148
  var index = 0;
File without changes
File without changes
package/components/hr.vue CHANGED
File without changes
File without changes
@@ -39,26 +39,35 @@
39
39
  :clickable="true"
40
40
  :title="String(marker.clusterSize || 1)"
41
41
  @click="onMarkerClick(marker, index)"
42
- ></gmap-marker>
42
+ >
43
+ </gmap-marker>
43
44
  </gmap-cluster>
44
45
  <template v-else>
45
- <gmap-marker
46
+ <gmap-custom-marker
46
47
  v-for="(marker, index) in markers"
47
48
  :key="index"
48
- :position="{ lat: marker.latitude, lng: marker.longitude }"
49
- :clickable="true"
50
- @click="onMarkerClick(marker, index)"
51
- ></gmap-marker>
49
+ :marker="{ lat: marker.latitude, lng: marker.longitude }"
50
+ @click.native="onMarkerClick(marker, index)"
51
+ >
52
+ <img v-if="marker.imageUrl" :src="marker.imageUrl" class="marker" />
53
+ <common-icon
54
+ v-else
55
+ class="marker"
56
+ :spec="{ material: { name: 'place', size: 40 }, color: '#c92b2a' }"
57
+ />
58
+ </gmap-custom-marker>
52
59
  </template>
53
60
  </gmap-map>
54
61
  </template>
55
62
 
56
63
  <script>
57
64
  import GmapCluster from "vue2-google-maps/dist/components/cluster";
65
+ import GmapCustomMarker from "vue2-gmap-custom-marker";
58
66
 
59
67
  export default {
60
68
  components: {
61
- "gmap-cluster": GmapCluster
69
+ "gmap-cluster": GmapCluster,
70
+ "gmap-custom-marker": GmapCustomMarker
62
71
  },
63
72
  props: {
64
73
  spec: { type: Object, required: true }
@@ -204,3 +213,11 @@ export default {
204
213
  // }
205
214
  };
206
215
  </script>
216
+
217
+ <style lang="scss" scoped>
218
+ .marker {
219
+ width: 40px;
220
+ height: 40px;
221
+ cursor: pointer;
222
+ }
223
+ </style>
File without changes
File without changes
@@ -202,7 +202,10 @@ export default {
202
202
  // Has to be executed before $ready(). This executes regardless of whether a form is found because fields
203
203
  // may be used without a form.
204
204
  this.fieldName = this.spec.name;
205
- this.fieldModel = this._sanitizeValue(this.spec.value);
205
+ // Don't initialize fieldModel unnecessarily because this will trigger validations on page load
206
+ if (this.spec.value) {
207
+ this.fieldModel = this._sanitizeValue(this.spec.value);
208
+ }
206
209
  }
207
210
  },
208
211
  $classes(spec) {
File without changes
File without changes
package/components/p.vue CHANGED
File without changes
@@ -64,7 +64,7 @@ export default {
64
64
  });
65
65
 
66
66
  this.$onEvent("forms/directSubmit", e => {
67
- this.directSubmit();
67
+ this.directSubmit(e.data.url);
68
68
  });
69
69
  },
70
70
  $ready() {
@@ -117,10 +117,14 @@ export default {
117
117
  );
118
118
  });
119
119
  },
120
- directSubmit() {
121
- this.validate(() => {
122
- GLib.form.submitData(this.formElement, this);
123
- });
120
+ directSubmit(overrideUrl = null) {
121
+ if (overrideUrl) {
122
+ GLib.form.submitData(this.formElement, this, overrideUrl);
123
+ } else {
124
+ this.validate(() => {
125
+ GLib.form.submitData(this.formElement, this);
126
+ });
127
+ }
124
128
  },
125
129
  validate(onPassed) {
126
130
  if (this.$refs.form.validate()) {
@@ -1,42 +1,32 @@
1
1
  <template>
2
2
  <v-container :class="$classes()">
3
- <v-timeline v-if="items" dense align-top>
3
+ <v-timeline v-if="events" dense align-top>
4
4
  <v-timeline-item
5
- v-for="(item, item_key) in items"
6
- :key="item_key"
5
+ v-for="(item, index) in events"
6
+ :key="index"
7
7
  color="white"
8
8
  fill-dot
9
9
  :small="$classes().includes('small')"
10
10
  :large="$classes().includes('large')"
11
- :class="timelineItemClasses(item)"
11
+ class="my-6"
12
12
  :hide-dot="item.hide_dot"
13
13
  >
14
14
  <template v-slot:icon>
15
- <div
16
- :class="$classes().includes('outlined') ? 'outlined-dots' : ''"
17
- :style="`border-color: ${dotColor(item)};`"
18
- >
19
- <div v-if="item.left_label" class="number-circle">
20
- {{ item.left_label }}
15
+ <div :class="$classes().includes('outlined') ? 'outlined-dots' : ''">
16
+ <div v-if="item.label" class="number-circle">
17
+ {{ item.label }}
18
+ </div>
19
+ <div v-else class="icon">
20
+ <common-icon
21
+ :spec="{
22
+ material: { name: item.icon, size: iconSize() },
23
+ color: item.color
24
+ }"
25
+ />
21
26
  </div>
22
- <!-- TODO: Use common-icon -->
23
- <v-icon v-else size="24" :color="dotColor(item)">
24
- {{ dotIcon(item) }}
25
- </v-icon>
26
27
  </div>
27
28
  </template>
28
-
29
- <div :class="item.subtitle ? 'mt-5' : 'mt-2'" class="content">
30
- <div
31
- :class="item.active ? 'font-weight-bold' : 'font-weight-regular'"
32
- >
33
- {{ item.label }}
34
- </div>
35
- <div class="font-weight-regular">
36
- {{ item.subtitle }}
37
- </div>
38
- <panels-responsive v-if="item.active" :spec="spec" />
39
- </div>
29
+ <panels-responsive :spec="{ childViews: [childViews[index]] }" />
40
30
  </v-timeline-item>
41
31
  </v-timeline>
42
32
  </v-container>
@@ -49,32 +39,17 @@ export default {
49
39
  },
50
40
  data() {
51
41
  return {
52
- items: this.spec.items,
53
- uncompletedIcon: this.spec.uncompletedIcon || "check_circle",
54
- completedIcon: this.spec.completedIcon || "radio_button_unchecked",
55
- completedColor: this.spec.completedColor || "blue",
56
- uncompletedColor: this.spec.uncompletedColor || "grey"
42
+ events: null,
43
+ childViews: null
57
44
  };
58
45
  },
59
46
  methods: {
60
- timelineItemClasses(item) {
61
- let classes = !item.completed && !item.active ? "uncompleted" : "";
62
-
63
- if (!this.$classes().includes("small")) {
64
- classes += " my-6";
65
- }
66
-
67
- return classes;
68
- },
69
- dotColor(item) {
70
- return !item.completed && !item.active
71
- ? this.uncompletedColor
72
- : this.completedColor;
47
+ $ready() {
48
+ this.events = this.spec.events;
49
+ this.childViews = this.spec.childViews;
73
50
  },
74
- dotIcon(item) {
75
- return item.active || item.completed
76
- ? item.uncompletedIcon || this.uncompletedIcon
77
- : item.completedIcon || this.completedIcon
51
+ iconSize() {
52
+ return this.$classes().includes("small") ? 16 : 24;
78
53
  }
79
54
  }
80
55
  };
@@ -84,18 +59,12 @@ export default {
84
59
  .v-timeline {
85
60
  padding-top: 0px;
86
61
  }
87
-
88
62
  .v-timeline-item {
89
63
  padding-bottom: 0px !important;
90
64
  }
91
65
  .container {
92
66
  padding-top: 0px;
93
67
  }
94
- .small {
95
- > .number-circle {
96
- font-size: 14px;
97
- }
98
- }
99
68
  .outlined-dots {
100
69
  border-radius: 50%;
101
70
  width: 100%;
@@ -111,4 +80,18 @@ export default {
111
80
  box-shadow: none;
112
81
  }
113
82
  }
83
+ .icon {
84
+ display: inline-flex;
85
+ vertical-align: middle;
86
+ }
87
+
88
+ // Size variations
89
+ .number-circle {
90
+ font-size: 16px;
91
+ }
92
+ .small {
93
+ .number-circle {
94
+ font-size: 14px;
95
+ }
96
+ }
114
97
  </style>
package/keys.js CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "1.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,6 +30,7 @@
30
30
  "vue-youtube": "^1.4.0",
31
31
  "vue2-editor": "^2.9.1",
32
32
  "vue2-google-maps": "^0.10.6",
33
+ "vue2-gmap-custom-marker": "^6.1.1",
33
34
  "vuedraggable": "^2.24.1",
34
35
  "vuetify": "2.3.9"
35
36
  },
File without changes
package/styles/test.sass CHANGED
File without changes
package/styles/test.scss CHANGED
File without changes
File without changes
package/utils/dom.js CHANGED
File without changes
package/utils/form.js CHANGED
@@ -3,14 +3,14 @@ export default class {
3
3
  // Button -> Button.onClick() -> Utils.http.execute() -- doesn't save autofill values
4
4
  // Button -> Button.onClick() -> form.submit() -- doesn't execute Form.onSubmit(), so cannot call Utils.http.execute() there
5
5
  // Submit -> Form.onSubmit() -> Utils.http.execute() -- save autofill values and auto-submit when ENTER is pressed
6
- static submitData(form, component) {
6
+ static submitData(form, component, overrideUrl = null) {
7
7
  // Analogous to Rails' form_with's `local: true`
8
8
  if (form.dataset.local) {
9
9
  // Prevent onUnload dirty prompt.
10
10
  Utils.http.clearDirtyState();
11
11
  form.submit();
12
12
  } else {
13
- const url = form.getAttribute("action");
13
+ const url = overrideUrl ? overrideUrl : form.getAttribute("action");
14
14
  const formData = new FormData(form);
15
15
  const method = form.getAttribute("method");
16
16
  if (method.toUpperCase() === "GET") {
package/utils/public.js CHANGED
File without changes
package/utils/settings.js CHANGED
File without changes
package/utils/storage.js CHANGED
File without changes
package/utils/url.js CHANGED
File without changes