@dative-gpi/foundation-shared-components 0.0.32 → 0.0.33

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.
@@ -25,10 +25,10 @@
25
25
  />
26
26
  </template>
27
27
  </button>
28
- <a
28
+ <router-link
29
29
  v-else
30
30
  :class="wrapperClasses"
31
- :href="href"
31
+ :to="href"
32
32
  >
33
33
  <FSCard
34
34
  :border="$props.border"
@@ -49,7 +49,7 @@
49
49
  :color="loadColor"
50
50
  />
51
51
  </template>
52
- </a>
52
+ </router-link>
53
53
  </template>
54
54
 
55
55
  <script lang="ts">
@@ -1,6 +1,7 @@
1
1
  <template>
2
2
  <v-icon
3
3
  :class="classes"
4
+ :color="color"
4
5
  v-bind="$attrs"
5
6
  >
6
7
  <slot />
@@ -10,6 +11,9 @@
10
11
  <script lang="ts">
11
12
  import { computed, defineComponent, PropType } from "vue";
12
13
 
14
+ import { useColors } from "@dative-gpi/foundation-shared-components/composables";
15
+ import { ColorBase } from "@dative-gpi/foundation-shared-components/models";
16
+
13
17
  export default defineComponent({
14
18
  name: "FSIcon",
15
19
  props: {
@@ -17,15 +21,35 @@ export default defineComponent({
17
21
  type: String as PropType<"s" | "m" | "l">,
18
22
  required: false,
19
23
  default: "m"
24
+ },
25
+ color: {
26
+ type: String as PropType<ColorBase>,
27
+ required: false,
28
+ default: null
29
+ },
30
+ variant: {
31
+ type: String as PropType<"base" | "light" | "dark">,
32
+ required: false,
33
+ default: "base"
20
34
  }
21
35
  },
22
36
  setup(props) {
37
+ const { getColors } = useColors();
38
+
39
+ const color = computed((): string | null => {
40
+ if (props.color) {
41
+ return getColors(props.color)[props.variant];
42
+ }
43
+ return null;
44
+ });
45
+
23
46
  const classes = computed((): string[] => {
24
47
  return [`fs-icon-${props.size}`];
25
48
  });
26
49
 
27
50
  return {
28
- classes
51
+ classes,
52
+ color
29
53
  };
30
54
  }
31
55
  });
@@ -1,14 +1,14 @@
1
1
  <template>
2
- <a
2
+ <router-link
3
3
  :class="classes"
4
4
  :style="style"
5
- :href="href"
5
+ :to="href"
6
6
  v-bind="$attrs"
7
7
  >
8
8
  <slot>
9
9
  {{ $props.label }}
10
10
  </slot>
11
- </a>
11
+ </router-link>
12
12
  </template>
13
13
 
14
14
  <script lang="ts">
package/models/rules.ts CHANGED
@@ -12,6 +12,7 @@ export const TextRules = {
12
12
  min: (min: number, message: string) => (value: string) => value.length >= min || (message ?? $tr("ui.rules.text-min", "Must be at least {0} characters", min.toString())),
13
13
  max: (max: number, message: string) => (value: string) => value.length <= max || (message ?? $tr("ui.rules.text-max", "Must be at most {0} characters", max.toString())),
14
14
  email: (message: string) => (value: string) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value) || (message ?? $tr("ui.rules.text-email", "Must be a valid email")),
15
+ phone: (message: string) => (value: string) => /^[\+]?([0-9]+[ -]?)+$/.test(value) || (message ?? $tr("ui.rules.text-phone", "Must be a valid phone number")),
15
16
  digit: (message: string) => (value: string) => /(?=.*\d)/.test(value) || (message ?? $tr("ui.rules.text-digit", "Must contain a digit")),
16
17
  uppercase: (message: string) => (value: string) => /(?=.*[A-Z])/.test(value) || (message ?? $tr("ui.rules.text-uppercase", "Must contain an uppercase letter")),
17
18
  lowercase: (message: string) => (value: string) => /(?=.*[a-z])/.test(value) || (message ?? $tr("ui.rules.text-lowercase", "Must contain a lowercase letter")),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "0.0.32",
14
- "@dative-gpi/foundation-shared-services": "0.0.32",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.33",
14
+ "@dative-gpi/foundation-shared-services": "0.0.33",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "fb1907786fd6f71a31c4e294a1f6bd92a016b6ae"
35
+ "gitHead": "c00c4149541805edb49a824ad08bf277e5b7752b"
36
36
  }