@appscode/design-system 2.2.19 → 2.2.21

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "2.2.19",
3
+ "version": "2.2.21",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -1,19 +1,4 @@
1
1
  .multiselect {
2
- // margin-top: 3px;
3
- // display: flex;
4
- // align-items: center;
5
- // max-width: 350px;
6
- // &.cluster-select {
7
- // .multiselect__tags {
8
- // border: 1px solid $color-border;
9
- // background-color: $table-header;
10
-
11
- // .multiselect__input {
12
- // background-color: $table-header;
13
- // }
14
- // }
15
- // }
16
-
17
2
  .multiselect__tags {
18
3
  background-color: $white-100;
19
4
  min-height: 36px;
@@ -537,12 +522,12 @@ li {
537
522
  &.has-refresh-button {
538
523
  .multiselect__select {
539
524
  z-index: 99;
540
- right: 60px;
525
+ right: 30px;
541
526
  }
542
527
 
543
528
  .button {
544
529
  &.is-clear {
545
- right: 30px;
530
+ right: 60px;
546
531
  }
547
532
  }
548
533
  }
@@ -563,45 +548,25 @@ li {
563
548
 
564
549
  .multiselect__select {
565
550
  z-index: 99;
566
- right: 60px;
551
+ right: 30px;
567
552
  }
568
553
 
569
554
  .button {
570
555
  &.is-clear {
571
- right: 30px;
556
+ right: 60px;
572
557
  }
573
558
  }
574
559
  }
575
560
 
576
561
  .multiselect__select {
577
562
  z-index: 99;
578
- right: 30px;
563
+ right: 0px;
579
564
  }
580
565
 
581
566
  .button {
582
567
  &.is-clear {
583
- right: 0px;
584
- }
585
- }
586
- }
587
-
588
- &.has-info-button {
589
- &.has-refresh-button {
590
- &.has-clear-button {
591
- // .multiselect__select {
592
- // z-index: 99;
593
- // right: 60px;
594
- // }
568
+ right: 30px;
595
569
  }
596
-
597
-
598
-
599
-
600
- // .button {
601
- // &.is-information {
602
- // right: 0;
603
- // }
604
- // }
605
570
  }
606
571
  }
607
572
 
@@ -0,0 +1,103 @@
1
+ <script setup lang="ts">
2
+ import { defineAsyncComponent, ref, watch } from "vue";
3
+
4
+ interface prop {
5
+ name?: string;
6
+ inputType?: string;
7
+ customClass?: string;
8
+ placeholderText?: string;
9
+ isReadOnly?: boolean;
10
+ isDisabled?: boolean;
11
+ showLabel?: boolean;
12
+ errorMsg?: string;
13
+ showStar?: boolean;
14
+ }
15
+
16
+ withDefaults(defineProps<prop>(), {
17
+ name: "",
18
+ inputType: "text",
19
+ customClass: "",
20
+ placeholderText: "",
21
+ isReadOnly: false,
22
+ isDisabled: false,
23
+ showLabel: true,
24
+ errorMsg: "",
25
+ showStar: false,
26
+ });
27
+
28
+ const AcInputText = defineAsyncComponent(
29
+ () => import("@appscode/design-system/vue-components/v3/form-fields/AcSingleInput.vue")
30
+ );
31
+
32
+ const model = defineModel({ type: String });
33
+ const isLabelHoisted = ref(false);
34
+ const isValueVisible = ref(false);
35
+ const acLabel = ref<HTMLInputElement | null>(null);
36
+ const acInput = ref<HTMLInputElement | null>(null);
37
+
38
+ function onFocusInput() {
39
+ triggerInput();
40
+ }
41
+ function onFocusOutInput() {
42
+ if (!model.value) isLabelHoisted.value = false;
43
+ }
44
+
45
+ function onClickLabel() {
46
+ acInput.value?.focus();
47
+ triggerInput();
48
+ }
49
+
50
+ function triggerInput() {
51
+ isLabelHoisted.value = true;
52
+ }
53
+
54
+ watch(
55
+ model,
56
+ (n) => {
57
+ if (n) triggerInput();
58
+ },
59
+ { immediate: true }
60
+ );
61
+ </script>
62
+
63
+ <template>
64
+ <ac-input-text :modifier-classes="customClass" :class="{ 'is-disabled': isDisabled }">
65
+ <template #label>
66
+ <label
67
+ ref="acLabel"
68
+ class="ac-label"
69
+ :class="{ 'is-required': showStar, 'show-label': isLabelHoisted }"
70
+ @click="onClickLabel"
71
+ >{{ placeholderText }}
72
+ <span v-if="showStar" class="is-required"> * </span>
73
+ </label>
74
+ </template>
75
+
76
+ <input
77
+ ref="acInput"
78
+ v-model="model"
79
+ data-testid="ac-input-text"
80
+ class="ac-input"
81
+ :name="name"
82
+ :type="isValueVisible ? 'text' : inputType"
83
+ :readonly="isReadOnly"
84
+ :disabled="isDisabled"
85
+ @focus="onFocusInput"
86
+ @focusout="onFocusOutInput"
87
+ />
88
+ <template #eye-switcher>
89
+ <span
90
+ v-if="inputType === 'password'"
91
+ class="eye"
92
+ data-testid="ac-input-text-hide-value"
93
+ @click="isValueVisible = !isValueVisible"
94
+ >
95
+ <i aria-hidden="true" class="fa" :class="`fa-${isValueVisible ? 'eye-slash' : 'eye'}`" />
96
+ </span>
97
+ </template>
98
+ <div class="is-flex is-flex-direction-column">
99
+ <p v-if="errorMsg" class="is-danger">{{ errorMsg }}</p>
100
+ <slot name="message" />
101
+ </div>
102
+ </ac-input-text>
103
+ </template>