glib-web 3.1.1 → 3.3.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 (113) hide show
  1. package/LICENSE +0 -0
  2. package/actions/auth/creditCard.js +0 -0
  3. package/actions/auth/restart.js +0 -0
  4. package/actions/commands/copy.js +0 -0
  5. package/actions/dialogs/alert.js +0 -0
  6. package/actions/dialogs/close.js +0 -0
  7. package/actions/dialogs/notification.js +0 -0
  8. package/actions/dialogs/oauth.js +0 -0
  9. package/actions/dialogs/open.js +0 -0
  10. package/actions/dialogs/options.js +0 -0
  11. package/actions/dialogs/reload.js +0 -0
  12. package/actions/dialogs/show.js +0 -0
  13. package/actions/http/delete.js +0 -0
  14. package/actions/http/patch.js +0 -0
  15. package/actions/http/post.js +0 -0
  16. package/actions/http/put.js +0 -0
  17. package/actions/panels/scrollTo.js +8 -1
  18. package/actions/runMultiple.js +0 -0
  19. package/actions/sheets/select.js +0 -0
  20. package/actions/snackbars/alert.js +0 -0
  21. package/actions/snackbars/select.js +0 -0
  22. package/actions/timeouts/set.js +0 -0
  23. package/actions/windows/close.js +0 -0
  24. package/actions/windows/closeAll.js +0 -0
  25. package/actions/windows/open.js +0 -0
  26. package/actions/windows/openWeb.js +0 -0
  27. package/actions/windows/print.js +0 -0
  28. package/actions/windows/reload.js +0 -0
  29. package/components/_message.vue +0 -0
  30. package/components/calendar.vue +0 -0
  31. package/components/charts/area.vue +4 -2
  32. package/components/charts/column.vue +2 -1
  33. package/components/charts/line.vue +2 -1
  34. package/components/charts/pie.vue +2 -1
  35. package/components/fab.vue +0 -0
  36. package/components/fields/_otp.vue +160 -0
  37. package/components/fields/_select.vue +10 -10
  38. package/components/fields/country/countries.js +0 -0
  39. package/components/fields/country/regions.js +0 -0
  40. package/components/fields/creditCard.vue +0 -0
  41. package/components/fields/googlePlace.vue +0 -0
  42. package/components/fields/location.vue +0 -0
  43. package/components/fields/otpField.vue +9 -104
  44. package/components/fields/phone/countries.js +0 -0
  45. package/components/fields/phone/sprite.css +0 -0
  46. package/components/fields/stripeToken.vue +0 -0
  47. package/components/h1.vue +0 -0
  48. package/components/h2.vue +0 -0
  49. package/components/h3.vue +0 -0
  50. package/components/h5.vue +0 -0
  51. package/components/h6.vue +0 -0
  52. package/components/hr.vue +0 -0
  53. package/components/html.vue +0 -0
  54. package/components/icon.vue +0 -0
  55. package/components/mixins/chart/annotation.js +0 -0
  56. package/components/mixins/chart/tooltip.js +0 -0
  57. package/components/mixins/dataset.js +0 -0
  58. package/components/mixins/extension.js +0 -0
  59. package/components/mixins/inputVariant.js +6 -9
  60. package/components/mixins/longClick.js +0 -0
  61. package/components/mixins/scrolling.js +0 -0
  62. package/components/mixins/table/export.js +0 -0
  63. package/components/mixins/table/import.js +0 -0
  64. package/components/mixins/text.js +0 -0
  65. package/components/multimedia/video.vue +0 -0
  66. package/components/panels/carousel.vue +0 -0
  67. package/components/panels/web.vue +0 -0
  68. package/components/spacer.vue +0 -0
  69. package/keys.js +0 -0
  70. package/package.json +1 -1
  71. package/static/plugins/alignment/alignment.js +0 -0
  72. package/static/plugins/alignment/alignment.min.js +0 -0
  73. package/static/plugins/beyondgrammar/beyondgrammar.js +0 -0
  74. package/static/plugins/beyondgrammar/beyondgrammar.min.js +0 -0
  75. package/static/plugins/blockcode/blockcode.js +0 -0
  76. package/static/plugins/blockcode/blockcode.min.js +0 -0
  77. package/static/plugins/clips/clips.js +0 -0
  78. package/static/plugins/clips/clips.min.js +0 -0
  79. package/static/plugins/counter/counter.js +0 -0
  80. package/static/plugins/counter/counter.min.js +0 -0
  81. package/static/plugins/definedlinks/definedlinks.js +0 -0
  82. package/static/plugins/definedlinks/definedlinks.min.js +0 -0
  83. package/static/plugins/handle/handle.js +0 -0
  84. package/static/plugins/handle/handle.min.js +0 -0
  85. package/static/plugins/icons/icons.js +0 -0
  86. package/static/plugins/icons/icons.min.js +0 -0
  87. package/static/plugins/imageposition/imageposition.js +0 -0
  88. package/static/plugins/imageposition/imageposition.min.js +0 -0
  89. package/static/plugins/inlineformat/inlineformat.js +0 -0
  90. package/static/plugins/inlineformat/inlineformat.min.js +0 -0
  91. package/static/plugins/removeformat/removeformat.js +0 -0
  92. package/static/plugins/removeformat/removeformat.min.js +0 -0
  93. package/static/plugins/selector/selector.js +0 -0
  94. package/static/plugins/selector/selector.min.js +0 -0
  95. package/static/plugins/specialchars/specialchars.js +0 -0
  96. package/static/plugins/specialchars/specialchars.min.js +0 -0
  97. package/static/plugins/textdirection/textdirection.js +0 -0
  98. package/static/plugins/textdirection/textdirection.min.js +0 -0
  99. package/static/plugins/textexpander/textexpander.js +0 -0
  100. package/static/plugins/textexpander/textexpander.min.js +0 -0
  101. package/static/plugins/underline/underline.js +0 -0
  102. package/static/plugins/underline/underline.min.js +0 -0
  103. package/static/redactorx.css +0 -0
  104. package/static/redactorx.min.css +0 -0
  105. package/static/redactorx.min.js +0 -0
  106. package/static/redactorx.usm.min.js +0 -0
  107. package/styles/test.sass +0 -0
  108. package/styles/test.scss +0 -0
  109. package/templates/_menu.vue +0 -0
  110. package/templates/unsupported.vue +0 -0
  111. package/utils/dom.js +0 -0
  112. package/utils/helper.js +0 -0
  113. package/utils/type.js +0 -0
package/LICENSE CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -35,6 +35,7 @@ export default class {
35
35
  };
36
36
  new IntersectionObserver(function([entry]) {
37
37
  const ratio = entry.intersectionRatio;
38
+
38
39
  if (ratio < 1) {
39
40
  // const place = ratio <= 0 && centerIfNeeded ? "center" : "nearest";
40
41
  const place = ratio <= 0 ? alignment : "nearest";
@@ -42,9 +43,15 @@ export default class {
42
43
  block: place,
43
44
  inline: place,
44
45
  behavior: spec["animate"] ? "smooth" : "auto",
45
-
46
46
  });
47
47
  } else {
48
+ if (spec.force) {
49
+ element.scrollIntoView({
50
+ block: alignment,
51
+ inline: alignment,
52
+ behavior: spec["animate"] ? "smooth" : "auto",
53
+ });
54
+ }
48
55
  vm.onScrollEnd(element, spec, component);
49
56
  this.disconnect();
50
57
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,5 +1,7 @@
1
1
  <template>
2
- <area-chart :style="genericStyles()" :class="$classes()" :data="series"></area-chart>
2
+ <div>
3
+ <area-chart :style="genericStyles()" :class="$classes()" :data="series" :colors="color">></area-chart>
4
+ </div>
3
5
  </template>
4
6
 
5
7
  <script setup>
@@ -7,6 +9,6 @@ import { computed } from 'vue';
7
9
  import { singleDataSeries } from './series';
8
10
 
9
11
  const { spec } = defineProps({ spec: Object })
10
-
12
+ const color = spec.colors == null ? '' : [spec.colors]
11
13
  const series = computed(() => singleDataSeries(spec.dataSeries))
12
14
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <column-chart :data="series" :stacked="spec.stacked"></column-chart>
2
+ <column-chart :data="series" :stacked="spec.stacked" :colors="color"></column-chart>
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -8,6 +8,7 @@ import { computed } from 'vue';
8
8
  import { multipleDataSeries } from './series';
9
9
 
10
10
  const { spec } = defineProps({ spec: Object })
11
+ const color = spec.colors == null ? '' : spec.colors
11
12
  const series = computed(() => multipleDataSeries(spec.dataGroups))
12
13
 
13
14
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <line-chart :style="genericStyles()" :class="$classes()" :data="series"></line-chart>
2
+ <line-chart :style="genericStyles()" :class="$classes()" :data="series" :colors="color"></line-chart>
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -7,6 +7,7 @@ import { computed } from 'vue';
7
7
  import { multipleDataSeries } from './series';
8
8
 
9
9
  const { spec } = defineProps({ spec: Object })
10
+ const color = spec.colors == null ? '' : spec.colors
10
11
 
11
12
  const series = computed(() => multipleDataSeries(spec.dataSeries))
12
13
  </script>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <pie-chart :style="genericStyles()" :class="$classes()" :data="series"></pie-chart>
2
+ <pie-chart :style="genericStyles()" :class="$classes()" :data="series" :colors="color"></pie-chart>
3
3
  </template>
4
4
 
5
5
  <script setup>
@@ -7,6 +7,7 @@ import { computed } from 'vue';
7
7
  import { singleDataSeries } from './series';
8
8
 
9
9
  const { spec } = defineProps({ spec: Object })
10
+ const color = spec.colors == null ? '' : spec.colors
10
11
  const series = computed(() => singleDataSeries(spec.dataSeries))
11
12
 
12
13
  </script>
File without changes
@@ -0,0 +1,160 @@
1
+ <template>
2
+ <div :style="$styles()" :class="$classes()">
3
+ <div v-if="spec.type === 'text'">
4
+ <input v-for="(digit, index) in digits" ref="input" :key="index" v-model="val[index]" type="text" maxlength="1"
5
+ class="otp-input" @input="handleInput($event, index)" @keydown="handleKeydown($event, index)"
6
+ @paste="handlePaste($event, index)" @focus="handleFocus($event, index)" @blur="handleBlur($event, index)"
7
+ @click="handleClick($event)" />
8
+ <label class="hint">{{ spec.hint }}</label>
9
+ </div>
10
+ <div v-else>
11
+ <input v-for="(digit, index) in digits" ref="input" :key="index" v-model="val[index]" type="number"
12
+ oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
13
+ maxlength="1" class="otp-input" @input="handleInput($event, index)" @keydown="handleKeydown($event, index)"
14
+ @paste="handlePaste($event, index)" @focus="handleFocus($event, index)" @blur="handleBlur($event, index)"
15
+ @click="handleClick($event)" />
16
+ <label class="hint">{{ spec.hint }}</label>
17
+ </div>
18
+ <input type="hidden" :name="fieldName" v-model="fieldModel" />
19
+ </div>
20
+ </template>
21
+
22
+ <script>
23
+ import bus from '../../utils/eventBus'
24
+
25
+ export default {
26
+ props: {
27
+ spec: { type: Object, required: true }
28
+ },
29
+ data() {
30
+ return {
31
+ otp: (this.spec.value || '').toString().split(""),
32
+ alignment: this.spec.align === null ? 'left' : this.spec.align
33
+ }
34
+ },
35
+ computed: {
36
+ otpValue() {
37
+ if (!this.otp) return ''
38
+
39
+ // concatenate the digits into a single string
40
+ return this.otp.join("");
41
+ },
42
+ digits() {
43
+ return this.spec.length
44
+ },
45
+ val() {
46
+ const field = this.fieldModel == null ? [] : this.fieldModel.toString().split("")
47
+
48
+ if (this.alignment === 'right') {
49
+ if (this.spec.valueIf == null) {
50
+ if (this.digits > this.otp.length && this.otp.length != 0) {
51
+ const results = []
52
+ for (let i = 0; i < (this.digits - this.otp.length); i++) {
53
+ results.push('')
54
+ }
55
+ return Reflect.apply(Array.prototype.concat, results, this.otp)
56
+ } else {
57
+ return field
58
+ }
59
+ } else {
60
+ return field
61
+ }
62
+ } else {
63
+ if (this.spec.valueIf == null) {
64
+ return this.otp
65
+ } else {
66
+ return field
67
+ }
68
+ }
69
+ },
70
+ },
71
+ methods: {
72
+ created() {
73
+ this.fieldModel = this.otpValue;
74
+ },
75
+ handleInput(event, index) {
76
+ if (event.target.value.length === 1) {
77
+ this.focusNext(index);
78
+ }
79
+ this.fieldModel = this.otp.join("");
80
+ },
81
+ handleKeydown(event, index) {
82
+ if (event.key === "Backspace") {
83
+ event.preventDefault();
84
+ if (this.otp[index] !== "") {
85
+ this.otp[index] = ""
86
+ } else {
87
+ this.focusPrevious(index);
88
+ this.otp[index - 1] = ""
89
+ }
90
+ }
91
+ },
92
+ handlePaste(event, index) {
93
+ event.preventDefault();
94
+ const pasted = event.clipboardData
95
+ .getData("text")
96
+ .slice(0, this.digits - index);
97
+ for (let i = 0; i < pasted.length; i++) {
98
+ this.$set(this.otp, index + i, pasted[i]);
99
+ }
100
+ this.focusNext(index + pasted.length - 1);
101
+ },
102
+ handleFocus(event, index) {
103
+ if (index > 0 && this.otp[index - 1] === "") {
104
+ this.focusPrevious(index);
105
+ }
106
+ },
107
+ handleBlur(event, index) {
108
+ if (this.otp.filter(digit => digit === "").length === 0) {
109
+ bus.$emit("complete", this.otp.join(""));
110
+ }
111
+ },
112
+ focusNext(index) {
113
+ if (index < this.digits - 1) {
114
+ this.$refs.input[index + 1].focus();
115
+ }
116
+ },
117
+ focusPrevious(index) {
118
+ if (index > 0) {
119
+ this.$refs.input[index - 1].focus();
120
+ }
121
+ },
122
+ handleClick(event) {
123
+ event.target.select();
124
+ }
125
+ }
126
+ };
127
+ </script>
128
+ <style scoped>
129
+ .otp-input {
130
+ border: 1px solid #47495f;
131
+ text-align: center;
132
+ width: 50px;
133
+ height: 50px;
134
+ border-radius: 4px;
135
+ font-size: 24px;
136
+ margin: 8px;
137
+ }
138
+
139
+ /* Chrome, Safari, Edge, Opera */
140
+ input::-webkit-outer-spin-button,
141
+ input::-webkit-inner-spin-button {
142
+ -webkit-appearance: none;
143
+ margin: 0;
144
+ }
145
+
146
+ /* Firefox */
147
+ input[type="number"] {
148
+ -moz-appearance: textfield;
149
+ }
150
+
151
+ .hint {
152
+ display: none;
153
+ }
154
+
155
+ input:focus~.hint,
156
+ input:focus-visible~.hint {
157
+ display: block;
158
+ padding: 8px 16px;
159
+ }
160
+ </style>
@@ -20,7 +20,7 @@ export default {
20
20
  spec: { type: Object, required: true },
21
21
  defaultValue: { type: String, default: null }
22
22
  },
23
- data () {
23
+ data() {
24
24
  return {
25
25
  options: null,
26
26
  append: {},
@@ -28,7 +28,7 @@ export default {
28
28
  };
29
29
  },
30
30
  computed: {
31
- values () {
31
+ values() {
32
32
  // Depends on whether the field is single or multiple
33
33
  if (this.$type.isArray(this.fieldModel)) {
34
34
  return this.fieldModel.length > 0 ? this.fieldModel : this.emptyValue;
@@ -38,18 +38,18 @@ export default {
38
38
  // return this.emptyValue;
39
39
  },
40
40
  // To avoid empty param error
41
- emptyValue () {
41
+ emptyValue() {
42
42
  return [null];
43
43
  },
44
- density () {
44
+ density() {
45
45
  return determineDensity(this.spec.styleClasses)
46
46
  }
47
47
  },
48
48
  methods: {
49
- $ready () {
49
+ $ready() {
50
50
  this.updateData(false);
51
51
  },
52
- normalizedOptions () {
52
+ normalizedOptions() {
53
53
  return this.spec.options.map(i => {
54
54
  switch (i.type) {
55
55
  case "label":
@@ -61,13 +61,13 @@ export default {
61
61
  }
62
62
  });
63
63
  },
64
- classes () {
64
+ classes() {
65
65
  return this.$classes().concat("g-text-field--hintless");
66
66
  },
67
- onChange () {
67
+ onChange() {
68
68
  this.$executeOnChange();
69
69
  },
70
- updateData (reinitValue) {
70
+ updateData(reinitValue) {
71
71
  this.options = this.normalizedOptions();
72
72
  this.append = this.spec.append || {};
73
73
  this.rules = this.$validation();
@@ -80,7 +80,7 @@ export default {
80
80
  this.fieldModel = this.defaultValue;
81
81
  }
82
82
  },
83
- $registryEnabled () {
83
+ $registryEnabled() {
84
84
  return false;
85
85
  }
86
86
  }
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,119 +1,24 @@
1
1
  <template>
2
- <div>
3
- <div v-if="spec.type === 'text'">
4
- <input v-for="(digit, index) in digits" ref="input" :key="index" v-model="otp[index]" type="text" maxlength="1"
5
- class="otp-input" @input="handleInput($event, index)" @keydown="handleKeydown($event, index)"
6
- @paste="handlePaste($event, index)" @focus="handleFocus($event, index)" @blur="handleBlur($event, index)"
7
- @click="handleClick($event)" />
8
- </div>
9
- <div v-else>
10
- <input v-for="(digit, index) in digits" ref="input" :key="index" v-model="otp[index]" type="number"
11
- oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);"
12
- maxlength="1" class="otp-input" @input="handleInput($event, index)" @keydown="handleKeydown($event, index)"
13
- @paste="handlePaste($event, index)" @focus="handleFocus($event, index)" @blur="handleBlur($event, index)"
14
- @click="handleClick($event)" />
15
- </div>
16
- <input type="hidden" :name="spec.name" :value="otpValue" />
17
- </div>
2
+ <fields-otp :spec="spec" />
18
3
  </template>
19
4
 
20
5
  <script>
21
- import bus from '../../utils/eventBus'
6
+ import OtpField from "./_otp.vue";
22
7
 
23
8
  export default {
9
+ components: {
10
+ // Need to start with `fields-` to enable jsonlogic in `styles.js#_linkFieldModels`
11
+ "fields-otp": OtpField,
12
+ },
24
13
  props: {
25
- spec: { type: Object, required: true }
14
+ spec: { type: Object, required: true },
26
15
  },
27
16
  data() {
28
17
  return {
29
- digits: 0,
30
- otp: []
18
+ value: null,
31
19
  };
32
20
  },
33
-
34
- computed: {
35
- otpValue() {
36
- // concatenate the digits into a single string
37
- return this.otp.join("");
38
- }
39
- },
40
- methods: {
41
- $ready() {
42
- this.digits = this.spec.length;
43
- this.otp = Array(this.spec.length).fill("");
44
- },
45
- handleInput(event, index) {
46
- if (event.target.value.length === 1) {
47
- this.focusNext(index);
48
- }
49
- },
50
- handleKeydown(event, index) {
51
- if (event.key === "Backspace") {
52
- event.preventDefault();
53
- if (this.otp[index] !== "") {
54
- this.$set(this.otp, index, "");
55
- } else {
56
- this.focusPrevious(index);
57
- this.$set(this.otp, index - 1, "");
58
- }
59
- }
60
- },
61
- handlePaste(event, index) {
62
- event.preventDefault();
63
- const pasted = event.clipboardData
64
- .getData("text")
65
- .slice(0, this.digits - index);
66
- for (let i = 0; i < pasted.length; i++) {
67
- this.$set(this.otp, index + i, pasted[i]);
68
- }
69
- this.focusNext(index + pasted.length - 1);
70
- },
71
- handleFocus(event, index) {
72
- if (index > 0 && this.otp[index - 1] === "") {
73
- this.focusPrevious(index);
74
- }
75
- },
76
- handleBlur(event, index) {
77
- if (this.otp.filter(digit => digit === "").length === 0) {
78
- bus.$emit("complete", this.otp.join(""));
79
- }
80
- },
81
- focusNext(index) {
82
- if (index < this.digits - 1) {
83
- this.$refs.input[index + 1].focus();
84
- }
85
- },
86
- focusPrevious(index) {
87
- if (index > 0) {
88
- this.$refs.input[index - 1].focus();
89
- }
90
- },
91
- handleClick(event) {
92
- event.target.select();
93
- }
94
- }
95
21
  };
96
22
  </script>
97
- <style scoped>
98
- .otp-input {
99
- border: 1px solid #47495f;
100
- text-align: center;
101
- width: 50px;
102
- height: 50px;
103
- border-radius: 4px;
104
- font-size: 24px;
105
- margin: 8px;
106
- }
107
-
108
- /* Chrome, Safari, Edge, Opera */
109
- input::-webkit-outer-spin-button,
110
- input::-webkit-inner-spin-button {
111
- -webkit-appearance: none;
112
- margin: 0;
113
- }
114
23
 
115
- /* Firefox */
116
- input[type="number"] {
117
- -moz-appearance: textfield;
118
- }
119
- </style>
24
+ <style scoped></style>
File without changes
File without changes
File without changes
package/components/h1.vue CHANGED
File without changes
package/components/h2.vue CHANGED
File without changes
package/components/h3.vue CHANGED
File without changes
package/components/h5.vue CHANGED
File without changes
package/components/h6.vue CHANGED
File without changes
package/components/hr.vue CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,16 +1,13 @@
1
1
  const variants = ['outlined', 'plain', 'underlined', 'filled', 'solo', 'solo-inverted', 'solo-filled']
2
2
 
3
3
  export default {
4
- data: function () {
5
- return {
6
- variant: 'outlined'
7
- }
8
- },
9
- methods: {
10
- $ready() {
11
- variants.forEach((value) => {
12
- if (this.$classes().includes(value)) this.variant = value
4
+ computed: {
5
+ variant() {
6
+ let val = null
7
+ variants.forEach((vari) => {
8
+ if (this.$classes().includes(vari)) val = vari
13
9
  })
10
+ return val || 'outlined'
14
11
  }
15
12
  }
16
13
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/keys.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glib-web",
3
- "version": "3.1.1",
3
+ "version": "3.3.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/styles/test.sass CHANGED
File without changes
package/styles/test.scss CHANGED
File without changes
File without changes
File without changes
package/utils/dom.js CHANGED
File without changes
package/utils/helper.js CHANGED
File without changes
package/utils/type.js CHANGED
File without changes