@timus-networks/theme 1.0.21 → 1.0.23

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,232 @@
1
+ <template>
2
+ <div class="pt-8 pb-16 flex gap-12 flex-col">
3
+ <section>
4
+ <h1>Basic usage</h1>
5
+ <p class="p-lg my-6">v-model is the value of el-option that is currently selected.</p>
6
+ <div class="grid grid-flow-col auto-cols-max gap-4">
7
+ <el-select v-model="value" placeholder="Select">
8
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
9
+ </el-select>
10
+ </div>
11
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
12
+ <p class="text-xs">
13
+ <code>&lt;el-button :type="'primary'"&gt;Primary&lt;/el-button&gt;</code>
14
+ </p>
15
+ </div>
16
+ </section>
17
+
18
+ <section>
19
+ <h1>Disabled option</h1>
20
+ <p class="p-lg my-6">Set the value of disabled in el-option to true to disable this option.</p>
21
+ <div class="grid grid-flow-col auto-cols-max gap-4">
22
+ <el-select v-model="value" placeholder="Select">
23
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled"> </el-option>
24
+ </el-select>
25
+ </div>
26
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
27
+ <p class="text-xs">
28
+ Outline görünümü için, buton elementinize <code>class="outline"</code> ekleyin. Örnek:
29
+ <code>&lt;el-button class="outline"&gt;Button&lt;/el-button&gt;</code>
30
+ </p>
31
+ </div>
32
+ </section>
33
+
34
+ <section>
35
+ <h1>Disabled select</h1>
36
+ <p class="p-lg my-6">Set disabled of el-select to make it disabled.</p>
37
+ <div class="grid grid-flow-col auto-cols-max gap-4">
38
+ <el-select v-model="value" disabled placeholder="Select">
39
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
40
+ </el-select>
41
+ </div>
42
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
43
+ <p class="text-xs">
44
+ Ghost görünümü için, buton elementinize <code>class="ghost"</code> ekleyin. Örnek:
45
+ <code>&lt;el-button class="ghost"&gt;Button&lt;/el-button&gt;</code>
46
+ </p>
47
+ </div>
48
+ </section>
49
+
50
+ <section>
51
+ <h1>Clearable single select</h1>
52
+ <p class="p-lg my-6">Farklı boyutlardaki butonlarımız, çeşitli arayüz ihtiyaçlarına yanıt vermek için tasarlanmıştır.</p>
53
+ <div class="grid grid-flow-col auto-cols-max items-center gap-4">
54
+ <el-select v-model="value" clearable placeholder="Select">
55
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
56
+ </el-select>
57
+ </div>
58
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
59
+ <p class="text-xs">
60
+ Örnekler:
61
+ <code>&lt;el-button :size="'large'"&gt;Button&lt;/el-button&gt;</code>
62
+ </p>
63
+ </div>
64
+ </section>
65
+
66
+ <section>
67
+ <h1>Basic multiple select</h1>
68
+ <p class="p-lg my-6">Etkileşime kapalı 'disabled' butonlarımız, kullanılamaz durumları göstermek için kullanılır.</p>
69
+ <div class="grid grid-flow-col auto-cols-max gap-4 items-center">
70
+ <el-select v-model="value1" multiple placeholder="Select">
71
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
72
+ </el-select>
73
+ <el-select v-model="value2" multiple collapse-tags placeholder="Select" type="primary">
74
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
75
+ </el-select>
76
+ </div>
77
+ <div class="my-4 p-4 border-l-4 border-red-600 bg-red-100">
78
+ <p class="text-xs">
79
+ Butonu devre dışı bırakmak için, <code>disabled</code> özelliğini ekleyin. Örnek:
80
+ <code>&lt;el-button disabled&gt;Button&lt;/el-button&gt;</code>
81
+ </p>
82
+ </div>
83
+ </section>
84
+
85
+ <section>
86
+ <h1>Custom template</h1>
87
+ <p class="p-lg my-6">
88
+ İkonlarla zenginleştirilmiş butonlarımız, görsel bir ipucu sunar ve kullanıcı deneyimini artırır. Tüm ikonlarımızın listesini görmek için
89
+ <nuxt-link to="/icons" class="text-blue-600 hover:underline">buraya tıklayın</nuxt-link>.
90
+ </p>
91
+ <div class="grid grid-flow-col auto-cols-max gap-4">
92
+ <el-select v-model="value" placeholder="Select">
93
+ <el-option v-for="item in cities" :key="item.value" :label="item.label" :value="item.value">
94
+ <span style="float: left">{{ item.label }}</span>
95
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
96
+ </el-option>
97
+ </el-select>
98
+ </div>
99
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
100
+ <p class="text-xs">
101
+ Örnekler:
102
+ <code>&lt;el-button type="primary" class="isax-trash"&gt;&lt;/el-button&gt;</code>. Sağda ikon için <code>class="icon-right"</code> ekleyin.
103
+ </p>
104
+ </div>
105
+ </section>
106
+
107
+ <section>
108
+ <h1>Grouping</h1>
109
+ <p class="p-lg my-6">Display options in groups.</p>
110
+ <div class="grid grid-flow-col auto-cols-max gap-4">
111
+ <el-select v-model="value" placeholder="Select">
112
+ <el-option-group v-for="group in groups" :key="group.label" :label="group.label">
113
+ <el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
114
+ </el-option-group>
115
+ </el-select>
116
+ </div>
117
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
118
+ <p class="text-xs">Buton grupları için <code>&lt;el-button-group&gt;</code> kullanın.</p>
119
+ </div>
120
+ </section>
121
+ </div>
122
+ </template>
123
+ <script>
124
+ import Vue from 'vue';
125
+
126
+ export default Vue.extend({
127
+ name: 'TimusButtonSample',
128
+ data() {
129
+ return {
130
+ cities: [
131
+ {
132
+ value: 'Beijing',
133
+ label: 'Beijing',
134
+ },
135
+ {
136
+ value: 'Shanghai',
137
+ label: 'Shanghai',
138
+ },
139
+ {
140
+ value: 'Nanjing',
141
+ label: 'Nanjing',
142
+ },
143
+ {
144
+ value: 'Chengdu',
145
+ label: 'Chengdu',
146
+ },
147
+ {
148
+ value: 'Shenzhen',
149
+ label: 'Shenzhen',
150
+ },
151
+ {
152
+ value: 'Guangzhou',
153
+ label: 'Guangzhou',
154
+ },
155
+ ],
156
+ groups: [
157
+ {
158
+ label: 'Popular cities',
159
+ options: [
160
+ {
161
+ value: 'Shanghai',
162
+ label: 'Shanghai',
163
+ },
164
+ {
165
+ value: 'Beijing',
166
+ label: 'Beijing',
167
+ },
168
+ ],
169
+ },
170
+ {
171
+ label: 'City name',
172
+ options: [
173
+ {
174
+ value: 'Chengdu',
175
+ label: 'Chengdu',
176
+ },
177
+ {
178
+ value: 'Shenzhen',
179
+ label: 'Shenzhen',
180
+ },
181
+ {
182
+ value: 'Guangzhou',
183
+ label: 'Guangzhou',
184
+ },
185
+ {
186
+ value: 'Dalian',
187
+ label: 'Dalian',
188
+ },
189
+ ],
190
+ },
191
+ ],
192
+ options: [
193
+ {
194
+ value: 'Option1',
195
+ label: 'Option1',
196
+ },
197
+ {
198
+ value: 'Option2',
199
+ label: 'Option2',
200
+ disabled: true,
201
+ },
202
+ {
203
+ value: 'Option3',
204
+ label: 'Option3',
205
+ },
206
+ {
207
+ value: 'Option4',
208
+ label: 'Option4',
209
+ },
210
+ {
211
+ value: 'Option5',
212
+ label: 'Option5',
213
+ },
214
+ ],
215
+ value: '',
216
+ value1: [],
217
+ value2: [],
218
+ };
219
+ },
220
+ computed: {
221
+ gridSize() {
222
+ const grids = {
223
+ 5: 'grid-cols-5',
224
+ 6: 'grid-cols-6',
225
+ 7: 'grid-cols-7',
226
+ 8: 'grid-cols-8',
227
+ };
228
+ return grids;
229
+ },
230
+ },
231
+ });
232
+ </script>
@@ -0,0 +1,211 @@
1
+ <template>
2
+ <div class="pt-8 pb-16 flex gap-12 flex-col">
3
+ <section>
4
+ <h1>Fixed Height</h1>
5
+ <p class="p-lg-c my-6">
6
+ Bu örnek, Element UI tarafından sağlanan <code>el-table</code> bileşenini kullanarak bir veri tablosu oluşturmanın temel bir örneğini
7
+ göstermektedir. `table-container` ile dışarıya border verildiğini unutmamanızı tavsiye ediyoruz.
8
+ </p>
9
+ <div class="grid flex-column">
10
+ <div class="table-container mb-4">
11
+ <el-table
12
+ :data="tableData"
13
+ :default-sort="{ prop: 'date', order: 'descending' }"
14
+ @selection-change="handleSelectionChange"
15
+ ref="multipleTable"
16
+ height="360px"
17
+ style="width: 100%"
18
+ >
19
+ <el-table-column type="selection" width="55"> </el-table-column>
20
+ <el-table-column
21
+ fixed
22
+ prop="date"
23
+ label="Date"
24
+ sortable
25
+ column-key="date"
26
+ :filters="[
27
+ { text: '2016-05-01', value: '2016-05-01' },
28
+ { text: '2016-05-02', value: '2016-05-02' },
29
+ { text: '2016-05-03', value: '2016-05-03' },
30
+ { text: '2016-05-04', value: '2016-05-04' },
31
+ ]"
32
+ :filter-method="filterHandler"
33
+ >
34
+ </el-table-column>
35
+ <el-table-column prop="name" label="Name" width="180"> </el-table-column>
36
+ <el-table-column prop="address" label="Address" :formatter="formatter"> </el-table-column>
37
+ <el-table-column
38
+ prop="tag"
39
+ label="Tag"
40
+ :filters="[
41
+ { text: 'Home', value: 'Home' },
42
+ { text: 'Office', value: 'Office' },
43
+ { text: 'Patates', value: 'Patates' },
44
+ ]"
45
+ :filter-method="filterTag"
46
+ filter-placement="top-start"
47
+ >
48
+ </el-table-column>
49
+ <el-table-column prop="name" label="Name" width="120"> </el-table-column>
50
+ <el-table-column prop="state" label="State" width="120"> </el-table-column>
51
+ <el-table-column prop="city" label="City" width="120"> </el-table-column>
52
+ <el-table-column prop="address" label="Address" width="300"> </el-table-column>
53
+ <el-table-column prop="zip" label="Zip" width="120"> </el-table-column>
54
+ <el-table-column fixed="right" label="Operations" width="120">
55
+ <template slot-scope="scope">
56
+ <el-button @click.native.prevent="deleteRow(scope.$index, tableData)" type="text" size="small"> Remove </el-button>
57
+ </template>
58
+ </el-table-column>
59
+ </el-table>
60
+ </div>
61
+ <el-pagination
62
+ @size-change="handleSizeChange"
63
+ @current-change="handleCurrentChange"
64
+ :current-page.sync="currentPage4"
65
+ :page-sizes="[100, 200, 300, 400]"
66
+ :page-size="100"
67
+ layout="total, prev, pager, next, jumper, sizes"
68
+ :total="400"
69
+ >
70
+ </el-pagination>
71
+ </div>
72
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
73
+ <p class="text-xs">
74
+ <code>
75
+ &lt;div class="table-container">&lt;el-table :data="tableData" :default-sort="{ prop: 'date', order: 'descending'
76
+ }"&gt;&lt;/el-table&gt;&lt;/div&gt;
77
+ </code>
78
+ </p>
79
+ </div>
80
+ </section>
81
+ </div>
82
+ </template>
83
+ <script>
84
+ import Vue from 'vue';
85
+
86
+ export default Vue.extend({
87
+ name: 'ThemeTable',
88
+ computed: {
89
+ gridSize() {
90
+ const grids = {
91
+ 5: 'grid-cols-5',
92
+ 6: 'grid-cols-6',
93
+ 7: 'grid-cols-7',
94
+ 8: 'grid-cols-8',
95
+ };
96
+ return grids;
97
+ },
98
+ },
99
+ data() {
100
+ return {
101
+ multipleSelection: [],
102
+ currentPage1: 5,
103
+ currentPage2: 5,
104
+ currentPage3: 5,
105
+ currentPage4: 4,
106
+ tableData: [
107
+ {
108
+ date: '2016-05-03',
109
+ name: 'Tom',
110
+ state: 'California',
111
+ city: 'Los Angeles',
112
+ address: 'No. 189, Grove St, Los Angeles',
113
+ zip: 'CA 90036',
114
+ tag: 'Home',
115
+ },
116
+ {
117
+ date: '2016-05-02',
118
+ name: 'Tom',
119
+ state: 'California',
120
+ city: 'Los Angeles',
121
+ address: 'No. 189, Grove St, Los Angeles',
122
+ zip: 'CA 90036',
123
+ tag: 'Office',
124
+ },
125
+ {
126
+ date: '2016-05-04',
127
+ name: 'Tom',
128
+ state: 'California',
129
+ city: 'Los Angeles',
130
+ address: 'No. 189, Grove St, Los Angeles',
131
+ zip: 'CA 90036',
132
+ tag: 'Home',
133
+ },
134
+ {
135
+ date: '2016-05-01',
136
+ name: 'Tom',
137
+ state: 'California',
138
+ city: 'Los Angeles',
139
+ address: 'No. 189, Grove St, Los Angeles',
140
+ zip: 'CA 90036',
141
+ tag: 'Office',
142
+ },
143
+ {
144
+ date: '2016-05-08',
145
+ name: 'Tom',
146
+ state: 'California',
147
+ city: 'Los Angeles',
148
+ address: 'No. 189, Grove St, Los Angeles',
149
+ zip: 'CA 90036',
150
+ tag: 'Office',
151
+ },
152
+ {
153
+ date: '2016-05-06',
154
+ name: 'Tom',
155
+ state: 'California',
156
+ city: 'Los Angeles',
157
+ address: 'No. 189, Grove St, Los Angeles',
158
+ zip: 'CA 90036',
159
+ tag: 'Home',
160
+ },
161
+ {
162
+ date: '2016-05-07',
163
+ name: 'Tom',
164
+ state: 'California',
165
+ city: 'Los Angeles',
166
+ address: 'No. 189, Grove St, Los Angeles',
167
+ zip: 'CA 90036',
168
+ tag: 'Office',
169
+ },
170
+ ],
171
+ };
172
+ },
173
+ methods: {
174
+ toggleSelection(rows) {
175
+ if (rows) {
176
+ rows.forEach((row) => {
177
+ this.$refs.multipleTable.toggleRowSelection(row);
178
+ });
179
+ } else {
180
+ this.$refs.multipleTable.clearSelection();
181
+ }
182
+ },
183
+ handleSelectionChange(val) {
184
+ this.multipleSelection = val;
185
+ },
186
+ resetDateFilter() {
187
+ this.$refs.filterTable.clearFilter('date');
188
+ },
189
+ clearFilter() {
190
+ this.$refs.filterTable.clearFilter();
191
+ },
192
+ formatter(row, column) {
193
+ return row.address;
194
+ },
195
+ filterTag(value, row) {
196
+ return row.tag === value;
197
+ },
198
+ filterHandler(value, row, column) {
199
+ console.log(row, column, value);
200
+ const property = column['property'];
201
+ return row[property] === value;
202
+ },
203
+ handleSizeChange(val) {
204
+ console.log(`${val} items per page`);
205
+ },
206
+ handleCurrentChange(val) {
207
+ console.log(`current page: ${val}`);
208
+ },
209
+ },
210
+ });
211
+ </script>
@@ -0,0 +1,142 @@
1
+ <template>
2
+ <div class="pt-8 pb-16 flex gap-12 flex-col">
3
+ <section>
4
+ <h1>Basic</h1>
5
+ <p class="p-lg my-6">
6
+ Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.
7
+ </p>
8
+ <div class="grid grid-flow-col auto-cols-max gap-4">
9
+ <el-tag :disable-transitions="true">Tag 1</el-tag>
10
+ <el-tag type="success">Tag 2</el-tag>
11
+ <el-tag type="info">Tag 3</el-tag>
12
+ <el-tag type="warning">Tag 4</el-tag>
13
+ <el-tag type="danger">Tag 5</el-tag>
14
+ </div>
15
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
16
+ <p class="text-xs">
17
+ <code>&lt;el-input placeholder="Please input" v-model="input"&gt;&lt;/el-input&gt;</code>
18
+ </p>
19
+ </div>
20
+ </section>
21
+
22
+ <section>
23
+ <h1>Removable</h1>
24
+ <p class="p-lg my-6">
25
+ Use the type attribute to define Tag's type. In addition, the color attribute can be used to set the background color of the Tag.
26
+ </p>
27
+ <div class="grid grid-flow-col auto-cols-max gap-4">
28
+ <el-tag v-for="tag in tags" :key="tag.name" closable :type="tag.type">
29
+ {{ tag.name }}
30
+ </el-tag>
31
+ </div>
32
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
33
+ <p class="text-xs">
34
+ <code>&lt;el-input placeholder="Please input" v-model="input"&gt;&lt;/el-input&gt;</code>
35
+ </p>
36
+ </div>
37
+ </section>
38
+
39
+ <section>
40
+ <h1>Sizes</h1>
41
+ <p class="p-lg my-6">Besides default size, Tag component provides three additional sizes for you to choose among different scenarios.</p>
42
+ <div class="grid grid-flow-col auto-cols-max gap-4">
43
+ <el-tag>Default</el-tag>
44
+ <el-tag size="large">Large</el-tag>
45
+ <el-tag size="medium">Medium</el-tag>
46
+ <el-tag size="small">Small</el-tag>
47
+ <el-tag size="mini">Mini</el-tag>
48
+ </div>
49
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
50
+ <p class="text-xs">
51
+ <code>&lt;el-input placeholder="Please input" v-model="input"&gt;&lt;/el-input&gt;</code>
52
+ </p>
53
+ </div>
54
+ </section>
55
+
56
+ <section>
57
+ <h1>Edit Dynamically</h1>
58
+ <p class="p-lg my-6">You can use the close event to add and remove tag dynamically.</p>
59
+ <div class="grid grid-flow-col auto-cols-max gap-4">
60
+ <el-tag :key="tag" v-for="tag in dynamicTags" closable :disable-transitions="true" @close="handleClose(tag)">
61
+ {{ tag }}
62
+ </el-tag>
63
+ <el-input
64
+ class="input-new-tag"
65
+ v-if="inputVisible"
66
+ v-model="inputValue"
67
+ ref="saveTagInput"
68
+ size="mini"
69
+ @keyup.enter.native="handleInputConfirm"
70
+ @blur="handleInputConfirm"
71
+ >
72
+ </el-input>
73
+ <el-button v-else class="button-new-tag" size="small" @click="showInput">+ New Tag</el-button>
74
+ </div>
75
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
76
+ <p class="text-xs">
77
+ <code>&lt;el-input placeholder="Please input" v-model="input"&gt;&lt;/el-input&gt;</code>
78
+ </p>
79
+ </div>
80
+ </section>
81
+ </div>
82
+ </template>
83
+ <script>
84
+ import Vue from 'vue';
85
+
86
+ export default Vue.extend({
87
+ name: 'TimusButtonSample',
88
+ computed: {
89
+ gridSize() {
90
+ const grids = {
91
+ 5: 'grid-cols-5',
92
+ 6: 'grid-cols-6',
93
+ 7: 'grid-cols-7',
94
+ 8: 'grid-cols-8',
95
+ };
96
+ return grids;
97
+ },
98
+ },
99
+ data() {
100
+ return {
101
+ dynamicTags: ['Tag 1', 'Tag 2', 'Tag 3'],
102
+ inputVisible: false,
103
+ inputValue: '',
104
+ tags: [
105
+ { name: 'Tag 1', type: '' },
106
+ { name: 'Tag 2', type: 'success' },
107
+ { name: 'Tag 3', type: 'info' },
108
+ { name: 'Tag 4', type: 'warning' },
109
+ { name: 'Tag 5', type: 'danger' },
110
+ ],
111
+ items: [
112
+ { type: '', label: 'Tag 1' },
113
+ { type: 'success', label: 'Tag 2' },
114
+ { type: 'info', label: 'Tag 3' },
115
+ { type: 'danger', label: 'Tag 4' },
116
+ { type: 'warning', label: 'Tag 5' },
117
+ ],
118
+ };
119
+ },
120
+ methods: {
121
+ handleClose(tag) {
122
+ this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
123
+ },
124
+
125
+ showInput() {
126
+ this.inputVisible = true;
127
+ this.$nextTick((_) => {
128
+ this.$refs.saveTagInput.$refs.input.focus();
129
+ });
130
+ },
131
+
132
+ handleInputConfirm() {
133
+ let inputValue = this.inputValue;
134
+ if (inputValue) {
135
+ this.dynamicTags.push(inputValue);
136
+ }
137
+ this.inputVisible = false;
138
+ this.inputValue = '';
139
+ },
140
+ },
141
+ });
142
+ </script>