@appscode/design-system 1.0.43-alpha.151 → 1.0.43-alpha.154

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.
@@ -719,7 +719,7 @@ input#captcha {
719
719
  .ac-single-switch.button.ac-button
720
720
  .switch[type="checkbox"]
721
721
  + label {
722
- height: 20px;
722
+ height: 19px;
723
723
  }
724
724
 
725
725
  // transparent input
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.151",
3
+ "version": "1.0.43-alpha.154",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -8,14 +8,27 @@
8
8
  </div>
9
9
  </button>
10
10
  <navbar-item-content class="navbar-dropdown-wrapper">
11
- <div v-if="user.username" class="user-profile-wrapper" @mouseleave="onMouseLeave()">
11
+ <div
12
+ v-if="user.username"
13
+ class="user-profile-wrapper"
14
+ @mouseleave="onMouseLeave()"
15
+ >
12
16
  <div class="profile-area">
13
17
  <div class="profile-photo">
14
- <img :src="user.avatar_url" alt="User Photo" class="width-50 height-50" />
18
+ <img
19
+ :src="user.avatar_url"
20
+ alt="User Photo"
21
+ class="width-50 height-50"
22
+ />
15
23
  <button class="camera-icon"></button>
16
24
  </div>
17
- <div class="profile-info" style="width: calc(100% - 60px);">
18
- <p :title="user.username.toUpperCase()" class="line-break-anywhere is-ellipsis-1">{{ user.username.toUpperCase() }}</p>
25
+ <div class="profile-info" style="width: calc(100% - 60px)">
26
+ <a
27
+ :href="`/${user.username}`"
28
+ :title="user.username.toUpperCase()"
29
+ class="line-break-anywhere is-ellipsis-1"
30
+ >{{ user.username.toUpperCase() }}</a
31
+ >
19
32
  <a :href="`mailto:${user.email}`"> {{ user.email }}</a>
20
33
  </div>
21
34
  </div>
@@ -24,10 +37,15 @@
24
37
  <a :href="`${serverDomain}/user/settings/`">Settings</a>
25
38
  </li>
26
39
  <li v-if="user.is_admin" key="site-admin">
27
- <a :href="`${serverDomain}/admin`">Site Administration</a>
40
+ <a :href="`${accountsDomain}/admin`">Site Administration</a>
28
41
  </li>
29
- <li v-if="showAccountSwitcher" :class="`is-${dropDownStatus}`" key="switcher">
30
- <a class="
42
+ <li
43
+ v-if="showAccountSwitcher"
44
+ :class="`is-${dropDownStatus}`"
45
+ key="switcher"
46
+ >
47
+ <a
48
+ class="
31
49
  ac-dropdown-button
32
50
  is-fullwidth
33
51
  is-flex
@@ -45,7 +63,9 @@
45
63
  ></i
46
64
  ></span>
47
65
  </a>
48
- <transition-group name="list" tag="ul"
66
+ <transition-group
67
+ name="list"
68
+ tag="ul"
49
69
  class="ac-vscrollbar"
50
70
  ref="dropdownItems"
51
71
  :style="{ maxHeight: dropDownSectionHeight }"
@@ -75,7 +95,11 @@
75
95
  "
76
96
  >
77
97
  <div class="org-info">
78
- <strong :title="org.username" class="line-break-anywhere is-ellipsis-1">{{ org.username }}</strong>
98
+ <strong
99
+ :title="org.username"
100
+ class="line-break-anywhere is-ellipsis-1"
101
+ >{{ org.username }}</strong
102
+ >
79
103
  <p>
80
104
  {{
81
105
  org.isPersonalAccount
@@ -104,7 +128,7 @@
104
128
  <a :href="`${serverDomain}/dashboard`"> Dashboard </a>
105
129
  </li>
106
130
  <li key="signout">
107
- <a :href="`${serverDomain}/user/logout`"> Sign out </a>
131
+ <a :href="`${accountsDomain}/user/logout`"> Sign out </a>
108
132
  </li>
109
133
  </transition-group>
110
134
  </div>
@@ -124,6 +148,10 @@ export default {
124
148
  type: String,
125
149
  default: "",
126
150
  },
151
+ accountsDomain: {
152
+ type: String,
153
+ default: "",
154
+ },
127
155
  showAccountSwitcher: {
128
156
  type: Boolean,
129
157
  default: false,
@@ -178,7 +206,7 @@ export default {
178
206
  },
179
207
  onMouseLeave() {
180
208
  this.dropDownStatus = "close";
181
- }
209
+ },
182
210
  },
183
211
 
184
212
  watch: {
@@ -206,4 +234,4 @@ export default {
206
234
  .line-break-anywhere {
207
235
  line-break: anywhere;
208
236
  }
209
- </style>
237
+ </style>
@@ -3,69 +3,76 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- import { defineComponent, computed, toRefs } from 'vue'
7
- import * as monaco from 'monaco-editor'
6
+ import { defineComponent, computed, toRefs } from "vue";
7
+ import * as monaco from "monaco-editor";
8
8
 
9
9
  export default defineComponent({
10
10
  name: "MonacoEditor",
11
11
  props: {
12
12
  diffEditor: { type: Boolean, default: false },
13
- width: {type: [String, Number], default: '100%'},
14
- height: {type: [String, Number], default: '100%'},
15
- original: String,
13
+ width: { type: [String, Number], default: "100%" },
14
+ height: { type: [String, Number], default: "100%" },
15
+ original: String,
16
16
  value: String,
17
- language: {type: String, default: 'javascript'},
18
- theme: {type: String, default: 'vs'},
19
- options: {type: Object, default() {return {};}},
17
+ language: { type: String, default: "javascript" },
18
+ theme: { type: String, default: "vs" },
19
+ options: {
20
+ type: Object,
21
+ default() {
22
+ return {};
23
+ },
24
+ },
20
25
  },
21
- emits: [
22
- 'editorWillMount',
23
- 'editorDidMount',
24
- 'change'
25
- ],
26
- setup(props){
27
- const { width, height } = toRefs(props)
28
- const style = computed(()=>{
29
- const fixedWidth = width.value.toString().includes('%') ? width.value : `${width.value}px`
30
- const fixedHeight = height.value.toString().includes('%')? height.value : `${height.value}px`
26
+ emits: ["editorWillMount", "editorDidMount", "change"],
27
+ setup(props) {
28
+ const { width, height } = toRefs(props);
29
+ const style = computed(() => {
30
+ const fixedWidth = width.value.toString().includes("%")
31
+ ? width.value
32
+ : `${width.value}px`;
33
+ const fixedHeight = height.value.toString().includes("%")
34
+ ? height.value
35
+ : `${height.value}px`;
31
36
  return {
32
37
  width: fixedWidth,
33
38
  height: fixedHeight,
34
- 'text-align': 'left'
35
- }
36
- })
39
+ "text-align": "left",
40
+ };
41
+ });
37
42
  return {
38
- style
39
- }
43
+ style,
44
+ };
40
45
  },
41
46
  mounted() {
42
- this.initMonaco()
47
+ this.initMonaco();
43
48
  },
44
- beforeDestroy() {
49
+ beforeUnmount() {
45
50
  this.editor && this.editor.dispose();
46
51
  },
47
52
  methods: {
48
- initMonaco(){
49
- this.$emit('editorWillMount', this.monaco)
53
+ initMonaco() {
54
+ this.$emit("editorWillMount", this.monaco);
50
55
  const { value, language, theme, options } = this;
51
- this.editor = monaco.editor[this.diffEditor ? 'createDiffEditor' : 'create'](this.$el, {
56
+ this.editor = monaco.editor[
57
+ this.diffEditor ? "createDiffEditor" : "create"
58
+ ](this.$el, {
52
59
  value: value,
53
60
  language: language,
54
61
  theme: theme,
55
- ...options
62
+ ...options,
56
63
  });
57
64
  this.diffEditor && this._setModel(this.value, this.original);
58
65
 
59
66
  // @event `change`
60
- const editor = this._getEditor()
61
- editor.onDidChangeModelContent(event => {
62
- const value = editor.getValue()
67
+ const editor = this._getEditor();
68
+ editor.onDidChangeModelContent((event) => {
69
+ const value = editor.getValue();
63
70
  if (this.value !== value) {
64
- this.$emit('change', value, event)
71
+ this.$emit("change", value, event);
65
72
  }
66
- })
73
+ });
67
74
 
68
- this.$emit('editorDidMount', this.editor)
75
+ this.$emit("editorDidMount", this.editor);
69
76
  },
70
77
  _setModel(value, original) {
71
78
  const { language } = this;
@@ -73,52 +80,52 @@ export default defineComponent({
73
80
  const modifiedModel = monaco.editor.createModel(value, language);
74
81
  this.editor.setModel({
75
82
  original: originalModel,
76
- modified: modifiedModel
83
+ modified: modifiedModel,
77
84
  });
78
85
  },
79
86
  _setValue(value) {
80
87
  let editor = this._getEditor();
81
- if(editor) return editor.setValue(value);
88
+ if (editor) return editor.setValue(value);
82
89
  },
83
90
  _getValue() {
84
91
  let editor = this._getEditor();
85
- if(!editor) return '';
92
+ if (!editor) return "";
86
93
  return editor.getValue();
87
94
  },
88
95
  _getEditor() {
89
- if(!this.editor) return null;
96
+ if (!this.editor) return null;
90
97
  return this.diffEditor ? this.editor.getModifiedEditor() : this.editor;
91
98
  },
92
- _setOriginal(){
93
- const { original } = this.editor.getModel()
94
- original.setValue(this.original)
95
- }
99
+ _setOriginal() {
100
+ const { original } = this.editor.getModel();
101
+ original.setValue(this.original);
102
+ },
96
103
  },
97
104
  watch: {
98
105
  options: {
99
106
  deep: true,
100
107
  handler(options) {
101
108
  this.editor.updateOptions(options);
102
- }
109
+ },
103
110
  },
104
111
  value() {
105
112
  this.value !== this._getValue() && this._setValue(this.value);
106
113
  },
107
114
  original() {
108
- this._setOriginal()
115
+ this._setOriginal();
109
116
  },
110
117
  language() {
111
- if(!this.editor) return;
112
- if(this.diffEditor){
118
+ if (!this.editor) return;
119
+ if (this.diffEditor) {
113
120
  const { original, modified } = this.editor.getModel();
114
121
  monaco.editor.setModelLanguage(original, this.language);
115
122
  monaco.editor.setModelLanguage(modified, this.language);
116
- }else
123
+ } else
117
124
  monaco.editor.setModelLanguage(this.editor.getModel(), this.language);
118
125
  },
119
126
  theme() {
120
127
  monaco.editor.setTheme(this.theme);
121
128
  },
122
- }
129
+ },
123
130
  });
124
131
  </script>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <div class="form-wrapper">
3
+ <div
4
+ :class="{
5
+ 'pt-20': !reducePaddingTop,
6
+ 'pt-10': reducePaddingTop,
7
+ 'pl-20': !isContainer,
8
+ 'form-content': !isContainer,
9
+ container: isContainer,
10
+ }"
11
+ >
12
+ <slot />
13
+ </div>
14
+ <div
15
+ class="form-footer b-t-1 pt-10 pb-10 pl-20 pr-20 mt-15"
16
+ v-if="hasFooter"
17
+ >
18
+ <div
19
+ class="ac-vcentered"
20
+ :class="{
21
+ 'form-content': !isContainer,
22
+ container: isContainer,
23
+ }"
24
+ >
25
+ <form-footer-controls>
26
+ <slot name="form-left-controls" />
27
+ </form-footer-controls>
28
+ <form-footer-controls>
29
+ <slot name="form-right-controls" />
30
+ </form-footer-controls>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ import { defineComponent, defineAsyncComponent, h } from "vue";
38
+
39
+ export default defineComponent({
40
+ props: {
41
+ isContainer: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ hasFooter: {
46
+ type: Boolean,
47
+ default: true,
48
+ },
49
+ reducePaddingTop: {
50
+ type: Boolean,
51
+ default: false,
52
+ },
53
+ },
54
+
55
+ components: {
56
+ FormFooterControls: defineAsyncComponent(() =>
57
+ import("../../v2/form/FormFooterControl.vue").then(
58
+ (module) => module.default
59
+ )
60
+ ),
61
+ },
62
+ });
63
+ </script>
@@ -1,21 +1,21 @@
1
1
  <template>
2
- <input class="ac-input" v-bind="inputListeners" />
2
+ <input
3
+ class="ac-input"
4
+ :value="modelValue"
5
+ @input="$emit('update:modelValue', $event.target.value)"
6
+ />
3
7
  </template>
4
8
 
5
9
  <script>
6
10
  import { defineComponent } from "vue";
7
11
 
8
12
  export default defineComponent({
9
- inheritAttrs: false,
10
- emits: ["update:modelValue"],
11
- computed: {
12
- inputListeners() {
13
- return Object.assign({}, this.$attrs, {
14
- onInput: (event) => {
15
- this.$emit("update:modelValue", event.target.value);
16
- },
17
- });
13
+ props: {
14
+ modelValue: {
15
+ type: null,
16
+ default: "",
18
17
  },
19
18
  },
19
+ emits: ["update:modelValue"],
20
20
  });
21
21
  </script>