adata-ui 0.1.52 → 0.1.55

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": "adata-ui",
3
- "version": "0.1.52",
3
+ "version": "0.1.55",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div id="app"></div>
2
+ <div id="app"><a-header active-tab-key="" login-url="" mode="" is-authenticated request-count="199" days-remaining="18 часов 44 минуты"/></div>
3
3
  </template>
4
4
 
5
5
  <script>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <label :for="fakeHash" class="a-checkbox">
3
+ <input
4
+ type="checkbox"
5
+ :id="fakeHash"
6
+ :value="inputValue"
7
+ v-model="model"
8
+ class="a-checkbox__input"
9
+ :disabled="disabled"
10
+ />
11
+ <span class="checkmark" />
12
+ <span class="a-checkbox__label">{{ label }}</span>
13
+ </label>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ props: {
19
+ id: {
20
+ type: [String, Number],
21
+ default: null,
22
+ },
23
+ inputValue: {
24
+ type: [String, Boolean],
25
+ default: null,
26
+ },
27
+ value: {
28
+ type: Array,
29
+ default: () => [],
30
+ },
31
+ label: {
32
+ type: String,
33
+ default: "",
34
+ },
35
+ disabled: {
36
+ type: Boolean,
37
+ default: false,
38
+ },
39
+ },
40
+ computed: {
41
+ fakeHash: function () {
42
+ return `${this.id}_${this.label}_checkbox`;
43
+ },
44
+ model: {
45
+ get() {
46
+ return this.value;
47
+ },
48
+ set(value) {
49
+ this.$emit("input", value);
50
+ },
51
+ },
52
+ },
53
+ };
54
+ </script>
55
+
56
+ <style lang="scss" scoped>
57
+ .a-checkbox {
58
+ padding: 8px 0;
59
+ display: flex;
60
+ align-items: center;
61
+ position: relative;
62
+ cursor: pointer;
63
+ -webkit-user-select: none;
64
+ -moz-user-select: none;
65
+ -ms-user-select: none;
66
+ user-select: none;
67
+
68
+ &__input {
69
+ opacity: 0;
70
+ cursor: pointer;
71
+ height: 0;
72
+ width: 0;
73
+ &:checked ~ .checkmark {
74
+ position: relative;
75
+ background: #007aff;
76
+ border: 1px solid transparent;
77
+ }
78
+ &:checked ~ .checkmark:after {
79
+ display: block;
80
+ background-image: url("data:image/svg+xml,%3Csvg%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2012%22%3E%0A%20%20%20%20%3Cpath%20d%3D%22M1%206.556L5.308%2011%2015%201%22%20stroke%3D%22%23fff%22%20stroke-width%3D%221.5%22%20stroke-miterlimit%3D%2210%22%20stroke-linecap%3D%22round%22%0A%20%20%20%20%20%20%20%20stroke-linejoin%3D%22round%22%3E%3C%2Fpath%3E%0A%3C%2Fsvg%3E");
81
+ background-position: center center;
82
+ background-repeat: no-repeat;
83
+ }
84
+ }
85
+
86
+ &__label {
87
+ font-size: 14px;
88
+ line-height: 22px;
89
+ color: var(--newGray);
90
+ }
91
+ }
92
+
93
+ .checkmark {
94
+ border: 1px solid #9da3ac;
95
+ border-radius: 2px;
96
+ width: 16px;
97
+ height: 16px;
98
+ cursor: pointer;
99
+ margin-right: 8px;
100
+ display: flex;
101
+ justify-content: center;
102
+ align-items: center;
103
+ flex-shrink: 0;
104
+ background: #fff;
105
+ &:after {
106
+ content: "";
107
+ position: absolute;
108
+ left: -1px;
109
+ top: -1px;
110
+ width: 16px;
111
+ height: 16px;
112
+ }
113
+ }
114
+ </style>
@@ -0,0 +1,15 @@
1
+ import ACheckbox from "./ACheckbox.vue";
2
+
3
+ export default {
4
+ title: "Checkbox",
5
+ component: ACheckbox,
6
+ template: "<a-checkbox></a-checkbox>",
7
+ };
8
+
9
+ const Template = (args, { argTypes }) => ({
10
+ components: { ACheckbox },
11
+ props: Object.keys(argTypes),
12
+ template: "<a-checkbox v-bind='$props'></a-checkbox>",
13
+ });
14
+
15
+ export const BaseCheckbox = Template.bind({});