srcdev-nuxt-forms 0.0.19 → 0.0.20

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,15 @@
1
+ :where(html) {
2
+ --blue-0: #e7f5ff;
3
+ --blue-1: #d0ebff;
4
+ --blue-2: #a5d8ff;
5
+ --blue-3: #74c0fc;
6
+ --blue-4: #4dabf7;
7
+ --blue-5: #339af0;
8
+ --blue-6: #228be6;
9
+ --blue-7: #1c7ed6;
10
+ --blue-8: #1971c2;
11
+ --blue-9: #1864ab;
12
+ --blue-10: #145591;
13
+ --blue-11: #114678;
14
+ --blue-12: #0d375e;
15
+ }
@@ -0,0 +1,15 @@
1
+ :where(html) {
2
+ --green-0: #ebfbee;
3
+ --green-1: #d3f9d8;
4
+ --green-2: #b2f2bb;
5
+ --green-3: #8ce99a;
6
+ --green-4: #69db7c;
7
+ --green-5: #51cf66;
8
+ --green-6: #40c057;
9
+ --green-7: #37b24d;
10
+ --green-8: #2f9e44;
11
+ --green-9: #2b8a3e;
12
+ --green-10: #237032;
13
+ --green-11: #1b5727;
14
+ --green-12: #133d1b;
15
+ }
@@ -0,0 +1,15 @@
1
+ :where(html) {
2
+ --gray-0: #f8f9fa;
3
+ --gray-1: #f1f3f5;
4
+ --gray-2: #e9ecef;
5
+ --gray-3: #dee2e6;
6
+ --gray-4: #ced4da;
7
+ --gray-5: #adb5bd;
8
+ --gray-6: #868e96;
9
+ --gray-7: #495057;
10
+ --gray-8: #343a40;
11
+ --gray-9: #212529;
12
+ --gray-10: #16191d;
13
+ --gray-11: #0d0f12;
14
+ --gray-12: #030507;
15
+ }
@@ -0,0 +1,15 @@
1
+ :where(html) {
2
+ --orange-0: #fff4e6;
3
+ --orange-1: #ffe8cc;
4
+ --orange-2: #ffd8a8;
5
+ --orange-3: #ffc078;
6
+ --orange-4: #ffa94d;
7
+ --orange-5: #ff922b;
8
+ --orange-6: #fd7e14;
9
+ --orange-7: #f76707;
10
+ --orange-8: #e8590c;
11
+ --orange-9: #d9480f;
12
+ --orange-10: #bf400d;
13
+ --orange-11: #99330b;
14
+ --orange-12: #802b09;
15
+ }
@@ -0,0 +1,15 @@
1
+ :where(html) {
2
+ --red-0: #fff5f5;
3
+ --red-1: #ffe3e3;
4
+ --red-2: #ffc9c9;
5
+ --red-3: #ffa8a8;
6
+ --red-4: #ff8787;
7
+ --red-5: #ff6b6b;
8
+ --red-6: #fa5252;
9
+ --red-7: #f03e3e;
10
+ --red-8: #e03131;
11
+ --red-9: #c92a2a;
12
+ --red-10: #b02525;
13
+ --red-11: #962020;
14
+ --red-12: #7d1a1a;
15
+ }
@@ -0,0 +1,15 @@
1
+ :where(html) {
2
+ --yellow-0: #fff9db;
3
+ --yellow-1: #fff3bf;
4
+ --yellow-2: #ffec99;
5
+ --yellow-3: #ffe066;
6
+ --yellow-4: #ffd43b;
7
+ --yellow-5: #fcc419;
8
+ --yellow-6: #fab005;
9
+ --yellow-7: #f59f00;
10
+ --yellow-8: #f08c00;
11
+ --yellow-9: #e67700;
12
+ --yellow-10: #b35c00;
13
+ --yellow-11: #804200;
14
+ --yellow-12: #663500;
15
+ }
@@ -0,0 +1,6 @@
1
+ @import './_red.css';
2
+ @import './_green.css';
3
+ @import './_blue.css';
4
+ @import './_orange.css';
5
+ @import './_gray.css';
6
+ @import './_yellow.css';
@@ -1 +1 @@
1
- @import "./_colours.css";
1
+ @import './_colours/index.css';
@@ -85,9 +85,12 @@ const fieldHasError = () => {
85
85
  return false;
86
86
  };
87
87
 
88
- // watchEffect(() => {
89
- // console.log('Form value changed to: ', modelValue.value.data[name.value]);
90
- // });
88
+ watchEffect(() => {
89
+ console.log(
90
+ 'InputTextCore >> Form value changed to: ',
91
+ modelValue.value.data[name.value]
92
+ );
93
+ });
91
94
 
92
95
  const isValid = () => {
93
96
  setTimeout(() => {
@@ -115,9 +118,7 @@ onMounted(() => {
115
118
  </script>
116
119
 
117
120
  <style lang="css">
118
- .input-text {
121
+ /* .input-text {
119
122
  transition: all linear 200ms;
120
- padding-left: 4px;
121
- width: 100%;
122
- }
123
+ } */
123
124
  </style>
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <div class="input-text-material">
3
+ <label :for="id">{{ c12.label }}</label>
4
+ <InputTextCore
5
+ :id
6
+ :name
7
+ :type
8
+ :validation
9
+ :required
10
+ v-model="modelValue"
11
+ v-model:isFocused="isFocused"
12
+ :c12
13
+ />
14
+ </div>
15
+ </template>
16
+
17
+ <script setup lang="ts">
18
+ import type { InpuTextC12, IFormData } from '@/types/types.forms';
19
+ import { validationConfig } from '@/components/forms/c12/validation-patterns';
20
+
21
+ const props = defineProps({
22
+ type: {
23
+ // type: String as PropType<"text" | "password" | "tel" | "number" | "email" | "url">, // This breaks props setup in unit tests
24
+ type: String,
25
+ validator(value: string) {
26
+ return ['text', 'password', 'tel', 'number', 'email', 'url'].includes(
27
+ value
28
+ );
29
+ },
30
+ },
31
+ id: {
32
+ // type: String as PropType<string>,
33
+ type: String,
34
+ required: true,
35
+ },
36
+ name: {
37
+ type: String,
38
+ default: null,
39
+ },
40
+ validation: {
41
+ type: String,
42
+ default: '',
43
+ },
44
+ required: {
45
+ type: Boolean,
46
+ value: false,
47
+ },
48
+ isPending: {
49
+ type: Boolean,
50
+ value: false,
51
+ },
52
+ c12: {
53
+ type: Object as PropType<InpuTextC12>,
54
+ required: true,
55
+ },
56
+ });
57
+
58
+ const name = computed(() => {
59
+ return props.name !== null ? props.name : props.id;
60
+ });
61
+
62
+ const modelValue = defineModel() as Ref<IFormData>;
63
+ const isFocused = ref(false);
64
+ </script>
65
+
66
+ <style lang="css">
67
+ .input-text-material {
68
+ display: flex;
69
+ flex-direction: column;
70
+
71
+ border: 1px solid black;
72
+ border-radius: 2px;
73
+
74
+ margin-bottom: 20px;
75
+
76
+ .input-text {
77
+ border: 1px solid red;
78
+ margin: 5px;
79
+
80
+ /* &::placeholder,
81
+ &:-ms-input-placeholder,
82
+ &::-moz-placeholder, */
83
+ &::-webkit-input-placeholder {
84
+ color: rgb(128, 0, 117);
85
+ font-size: 30px;
86
+ }
87
+ }
88
+ }
89
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "srcdev-nuxt-forms",
3
3
  "type": "module",
4
- "version": "0.0.19",
4
+ "version": "0.0.20",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "reinstall": "rm -rf node_modules && npm install",
package/pages/index.vue CHANGED
@@ -12,17 +12,18 @@
12
12
  <FormField width="wide" :has-gutter="true">
13
13
  <template #default>
14
14
  <p>Input text</p>
15
- <InputTextCore
15
+ <InputTextMaterial
16
16
  id="username"
17
+ name="username"
17
18
  type="text"
18
19
  validation="username"
19
20
  :required="true"
20
- v-model="formData"
21
21
  :c12="{
22
22
  label: 'Choose Username',
23
23
  placeholder: 'eg. YourUserName',
24
24
  errorMessage: 'Please enter a valid username',
25
25
  }"
26
+ v-model="formData"
26
27
  />
27
28
  </template>
28
29
  </FormField>