bfg-common 1.3.182 → 1.3.183

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.
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <atoms-tooltip-error :has-error="!isValid">
3
+ <template #elem>
4
+ <input v-model="model" type="text" :class="{ invalid: !isValid }" />
5
+ </template>
6
+ <template #content>{{ props.errorText }}</template>
7
+ </atoms-tooltip-error>
8
+ </template>
9
+
10
+ <script lang="ts" setup>
11
+ const props = defineProps<{
12
+ errorText: string
13
+ }>()
14
+ const emits = defineEmits<{
15
+ (event: 'invalid', value: boolean): void
16
+ }>()
17
+
18
+ const model = defineModel<string>({ default: '' })
19
+
20
+ const isValid = computed<boolean>(() => {
21
+ return /^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])|\*\/([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])) (\*|([0-9]|1[0-9]|2[0-3])|\*\/([0-9]|1[0-9]|2[0-3])) (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])|\*\/([1-9]|1[0-9]|2[0-9]|3[0-1])) (\*|([1-9]|1[0-2])|\*\/([1-9]|1[0-2])) (\*|([0-6])|\*\/([0-6]))$/.test(
22
+ model.value
23
+ )
24
+ })
25
+
26
+ watch(isValid, (newValue: boolean) => {
27
+ emits('invalid', !newValue)
28
+ })
29
+ </script>
30
+
31
+ <style lang="scss" scoped>
32
+ input {
33
+ width: 100px;
34
+
35
+ &.invalid {
36
+ border-color: red;
37
+ }
38
+ }
39
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.182",
4
+ "version": "1.3.183",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",