@timus-networks/theme 1.0.21 → 1.0.24

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.
Files changed (46) hide show
  1. package/components-js/ThemeAlert.vue +76 -0
  2. package/components-js/ThemeAvatar.vue +55 -0
  3. package/components-js/ThemeBadge.vue +86 -0
  4. package/components-js/ThemeButtons.vue +2 -2
  5. package/components-js/ThemeCascader.vue +337 -0
  6. package/components-js/ThemeCheckbox.d.ts +2 -0
  7. package/components-js/ThemeCheckbox.vue +143 -0
  8. package/components-js/ThemeForm.vue +50 -182
  9. package/components-js/ThemeInputs.vue +0 -51
  10. package/components-js/ThemeLink.vue +91 -0
  11. package/components-js/ThemeLogo.vue +57 -0
  12. package/components-js/ThemeRadio.d.ts +2 -0
  13. package/components-js/ThemeRadio.vue +124 -0
  14. package/components-js/ThemeSelect.vue +232 -0
  15. package/components-js/ThemeTable.vue +245 -0
  16. package/components-js/ThemeTag.vue +142 -0
  17. package/components-js/ThemeTimePicker.vue +376 -43
  18. package/components-js/ThemeToggle.vue +122 -0
  19. package/components-js/ThemeTooltip.vue +189 -0
  20. package/components-js/TimusSamples.vue +33 -20
  21. package/components-js/exporter.js +5 -5
  22. package/components-ts/ThemeAlert.vue +76 -0
  23. package/components-ts/ThemeAvatar.vue +55 -0
  24. package/components-ts/ThemeBadge.vue +86 -0
  25. package/components-ts/ThemeButtons.vue +2 -2
  26. package/components-ts/ThemeCascader.vue +337 -0
  27. package/components-ts/ThemeCheckbox.vue +146 -0
  28. package/components-ts/ThemeForm.vue +50 -183
  29. package/components-ts/ThemeInputs.vue +0 -51
  30. package/components-ts/ThemeLink.vue +91 -0
  31. package/components-ts/ThemeLogo.vue +57 -0
  32. package/components-ts/ThemeRadio.vue +127 -0
  33. package/components-ts/ThemeSelect.vue +232 -0
  34. package/components-ts/ThemeTable.vue +245 -0
  35. package/components-ts/ThemeTag.vue +142 -0
  36. package/components-ts/ThemeTimePicker.vue +376 -43
  37. package/components-ts/ThemeToggle.vue +122 -0
  38. package/components-ts/ThemeTooltip.vue +189 -0
  39. package/components-ts/TimusSamples.vue +33 -20
  40. package/components-ts/exporter.js +5 -5
  41. package/index.d.ts +3 -1
  42. package/logo/timus-icon.svg +17 -0
  43. package/logo/timus-logo.svg +22 -0
  44. package/module.js +6 -2
  45. package/output/main.css +1 -1
  46. package/package.json +40 -40
@@ -0,0 +1,337 @@
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">There are two ways to expand child option items.</p>
6
+ <div class="grid grid-flow-col auto-cols-max gap-4">
7
+ <el-cascader v-model="value" :options="options" @change="handleChange" clearable></el-cascader>
8
+ <el-cascader v-model="value" :options="options" :props="{ expandTrigger: 'hover' }" @change="handleChange"></el-cascader>
9
+ </div>
10
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
11
+ <p class="text-xs">
12
+ <code>&lt;el-cascader v-model="value" :options="options" @change="handleChange"&gt;&lt;/el-cascader&gt;</code>
13
+ </p>
14
+ </div>
15
+ </section>
16
+ <section>
17
+ <h1>Multiple Selection</h1>
18
+ <p class="p-lg my-6">
19
+ Set `props.multiple = true` to use multiple selection. When using multiple selection, all selected tags will display by default, You can set
20
+ `collapse-tags = true` to fold selected tags.
21
+ </p>
22
+ <div class="flex gap-4">
23
+ <el-cascader :options="options" :props="props" clearable></el-cascader>
24
+ <el-cascader :options="options" :props="props" collapse-tags clearable></el-cascader>
25
+ </div>
26
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
27
+ <p class="text-xs">
28
+ <code>&lt;el-cascader v-model="value" :options="options" @change="handleChange"&gt;&lt;/el-cascader&gt;</code>
29
+ </p>
30
+ </div>
31
+ </section>
32
+ <section>
33
+ <h1>Select any level of options</h1>
34
+ <p class="p-lg my-6">
35
+ In single selection, only the leaf nodes can be checked, and in multiple selection, check parent nodes will lead to leaf nodes be checked
36
+ eventually. When enable this feature, it can make parent and child nodes unlinked and you can select any level of options.
37
+ </p>
38
+ <div class="flex gap-4">
39
+ <el-cascader :options="options" :props="{ checkStrictly: true }" clearable></el-cascader>
40
+ <el-cascader :options="options" :props="{ multiple: true, checkStrictly: true }" clearable></el-cascader>
41
+ </div>
42
+ <div class="my-4 p-4 border-l-4 border-blue-600 bg-blue-100">
43
+ <p class="text-xs">
44
+ <code>&lt;el-cascader v-model="value" :options="options" @change="handleChange"&gt;&lt;/el-cascader&gt;</code>
45
+ </p>
46
+ </div>
47
+ </section>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ import Vue from 'vue';
53
+
54
+ export default Vue.extend({
55
+ name: 'TimusCascader',
56
+ data() {
57
+ return {
58
+ props: { multiple: true },
59
+ value: [],
60
+ options: [
61
+ {
62
+ value: 'guide',
63
+ label: 'Guide',
64
+ disabled: true,
65
+ children: [
66
+ {
67
+ value: 'disciplines',
68
+ label: 'Disciplines',
69
+ children: [
70
+ {
71
+ value: 'consistency',
72
+ label: 'Consistency',
73
+ },
74
+ {
75
+ value: 'feedback',
76
+ label: 'Feedback',
77
+ },
78
+ {
79
+ value: 'efficiency',
80
+ label: 'Efficiency',
81
+ },
82
+ {
83
+ value: 'controllability',
84
+ label: 'Controllability',
85
+ },
86
+ ],
87
+ },
88
+ {
89
+ value: 'navigation',
90
+ label: 'Navigation',
91
+ children: [
92
+ {
93
+ value: 'side nav',
94
+ label: 'Side Navigation',
95
+ },
96
+ {
97
+ value: 'top nav',
98
+ label: 'Top Navigation',
99
+ },
100
+ ],
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ value: 'component',
106
+ label: 'Component',
107
+ children: [
108
+ {
109
+ value: 'basic',
110
+ label: 'Basic',
111
+ children: [
112
+ {
113
+ value: 'layout',
114
+ label: 'Layout',
115
+ },
116
+ {
117
+ value: 'color',
118
+ label: 'Color',
119
+ },
120
+ {
121
+ value: 'typography',
122
+ label: 'Typography',
123
+ },
124
+ {
125
+ value: 'icon',
126
+ label: 'Icon',
127
+ },
128
+ {
129
+ value: 'button',
130
+ label: 'Button',
131
+ },
132
+ ],
133
+ },
134
+ {
135
+ value: 'form',
136
+ label: 'Form',
137
+ children: [
138
+ {
139
+ value: 'radio',
140
+ label: 'Radio',
141
+ },
142
+ {
143
+ value: 'checkbox',
144
+ label: 'Checkbox',
145
+ },
146
+ {
147
+ value: 'input',
148
+ label: 'Input',
149
+ },
150
+ {
151
+ value: 'input-number',
152
+ label: 'InputNumber',
153
+ },
154
+ {
155
+ value: 'select',
156
+ label: 'Select',
157
+ },
158
+ {
159
+ value: 'cascader',
160
+ label: 'Cascader',
161
+ },
162
+ {
163
+ value: 'switch',
164
+ label: 'Switch',
165
+ },
166
+ {
167
+ value: 'slider',
168
+ label: 'Slider',
169
+ },
170
+ {
171
+ value: 'time-picker',
172
+ label: 'TimePicker',
173
+ },
174
+ {
175
+ value: 'date-picker',
176
+ label: 'DatePicker',
177
+ },
178
+ {
179
+ value: 'datetime-picker',
180
+ label: 'DateTimePicker',
181
+ },
182
+ {
183
+ value: 'upload',
184
+ label: 'Upload',
185
+ },
186
+ {
187
+ value: 'rate',
188
+ label: 'Rate',
189
+ },
190
+ {
191
+ value: 'form',
192
+ label: 'Form',
193
+ },
194
+ ],
195
+ },
196
+ {
197
+ value: 'data',
198
+ label: 'Data',
199
+ children: [
200
+ {
201
+ value: 'table',
202
+ label: 'Table',
203
+ },
204
+ {
205
+ value: 'tag',
206
+ label: 'Tag',
207
+ },
208
+ {
209
+ value: 'progress',
210
+ label: 'Progress',
211
+ },
212
+ {
213
+ value: 'tree',
214
+ label: 'Tree',
215
+ },
216
+ {
217
+ value: 'pagination',
218
+ label: 'Pagination',
219
+ },
220
+ {
221
+ value: 'badge',
222
+ label: 'Badge',
223
+ },
224
+ ],
225
+ },
226
+ {
227
+ value: 'notice',
228
+ label: 'Notice',
229
+ children: [
230
+ {
231
+ value: 'alert',
232
+ label: 'Alert',
233
+ },
234
+ {
235
+ value: 'loading',
236
+ label: 'Loading',
237
+ },
238
+ {
239
+ value: 'message',
240
+ label: 'Message',
241
+ },
242
+ {
243
+ value: 'message-box',
244
+ label: 'MessageBox',
245
+ },
246
+ {
247
+ value: 'notification',
248
+ label: 'Notification',
249
+ },
250
+ ],
251
+ },
252
+ {
253
+ value: 'navigation',
254
+ label: 'Navigation',
255
+ children: [
256
+ {
257
+ value: 'menu',
258
+ label: 'NavMenu',
259
+ },
260
+ {
261
+ value: 'tabs',
262
+ label: 'Tabs',
263
+ },
264
+ {
265
+ value: 'breadcrumb',
266
+ label: 'Breadcrumb',
267
+ },
268
+ {
269
+ value: 'dropdown',
270
+ label: 'Dropdown',
271
+ },
272
+ {
273
+ value: 'steps',
274
+ label: 'Steps',
275
+ },
276
+ ],
277
+ },
278
+ {
279
+ value: 'others',
280
+ label: 'Others',
281
+ children: [
282
+ {
283
+ value: 'dialog',
284
+ label: 'Dialog',
285
+ },
286
+ {
287
+ value: 'tooltip',
288
+ label: 'Tooltip',
289
+ },
290
+ {
291
+ value: 'popover',
292
+ label: 'Popover',
293
+ },
294
+ {
295
+ value: 'card',
296
+ label: 'Card',
297
+ },
298
+ {
299
+ value: 'carousel',
300
+ label: 'Carousel',
301
+ },
302
+ {
303
+ value: 'collapse',
304
+ label: 'Collapse',
305
+ },
306
+ ],
307
+ },
308
+ ],
309
+ },
310
+ {
311
+ value: 'resource',
312
+ label: 'Resource',
313
+ children: [
314
+ {
315
+ value: 'axure',
316
+ label: 'Axure Components',
317
+ },
318
+ {
319
+ value: 'sketch',
320
+ label: 'Sketch Templates',
321
+ },
322
+ {
323
+ value: 'docs',
324
+ label: 'Design Documentation',
325
+ },
326
+ ],
327
+ },
328
+ ],
329
+ };
330
+ },
331
+ methods: {
332
+ handleChange(value) {
333
+ console.log(value);
334
+ },
335
+ },
336
+ });
337
+ </script>
@@ -0,0 +1,146 @@
1
+ <template>
2
+ <div class="pt-8 pb-16 flex gap-12 flex-col">
3
+ <h1>Checkbox</h1>
4
+
5
+ <section>
6
+ <h2>Basic Usage</h2>
7
+ <p class="p-lg-c my-6">Checkbox, iki durum arasında geçiş yapmak için kullanılır. Checkbox için devre dışı bırakılmış durum da mevcuttur.</p>
8
+ <div class="grid grid-flow-col auto-cols-max gap-4">
9
+ <el-checkbox v-model="checked">Option</el-checkbox>
10
+ <el-checkbox :value="true" disabled>selected & disabled</el-checkbox>
11
+ <el-checkbox :value="false" disabled>unselected & disabled</el-checkbox>
12
+ </div>
13
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
14
+ <p class="text-xs">
15
+ <code> &lt;el-checkbox :value="true" disabled&gt;Seçili & Devre Dışı&lt;/el-checkbox&gt; </code>
16
+ </p>
17
+ </div>
18
+ </section>
19
+
20
+ <section>
21
+ <h2>Checkbox group</h2>
22
+ <p class="p-lg-c my-6">
23
+ Checkbox grubu, birden fazla seçeneği bir arada sunarak kullanıcının birden çok seçim yapmasına olanak tanır. Bu grup içerisindeki
24
+ seçeneklerden bazıları devre dışı bırakılabilir veya önceden seçilmiş ve devre dışı bırakılmış olabilir.
25
+ </p>
26
+ <div class="grid grid-flow-col auto-cols-max gap-4">
27
+ <el-checkbox-group v-model="checkList" class="mb-6">
28
+ <el-checkbox label="Option A"></el-checkbox>
29
+ <el-checkbox label="Option B"></el-checkbox>
30
+ <el-checkbox label="Option C"></el-checkbox>
31
+ <el-checkbox label="disabled" disabled></el-checkbox>
32
+ <el-checkbox label="selected and disabled" disabled></el-checkbox>
33
+ </el-checkbox-group>
34
+ </div>
35
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
36
+ <p class="text-xs">
37
+ <code>
38
+ &lt;el-checkbox-group v-model="checkList"&gt; &lt;el-checkbox label="Seçenek A"&gt;&lt;/el-checkbox&gt; &lt;el-checkbox label="Seçenek
39
+ B"&gt;&lt;/el-checkbox&gt; &lt;/el-checkbox-group&gt;
40
+ </code>
41
+ </p>
42
+ </div>
43
+ </section>
44
+
45
+ <section>
46
+ <h2>Indeterminate</h2>
47
+ <p class="p-lg-c my-6">
48
+ Belirsiz durum (indeterminate) checkbox, tüm seçeneklerin seçili olup olmadığını belirsiz bırakır. Bu durum, özellikle kullanıcının bir grup
49
+ içerisindeki tüm seçenekleri aynı anda kontrol etmesini sağlamak için kullanışlıdır.
50
+ </p>
51
+ <div class="grid grid-flow-col auto-cols-max gap-4">
52
+ <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange">Check all</el-checkbox>
53
+ <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange">
54
+ <el-checkbox v-for="city in cities" :label="city" :key="city">{{ city }}</el-checkbox>
55
+ </el-checkbox-group>
56
+ </div>
57
+ <div class="my-4 p-4 border-l-4 border-info-600 bg-info-100">
58
+ <p class="text-xs">
59
+ <code>
60
+ &lt;el-date-picker v-model="input" type="daterange" align="left" start-placeholder="Start" end-placeholder="End"
61
+ default-value=""&gt;&lt;/el-date-picker&gt;
62
+ </code>
63
+ </p>
64
+ </div>
65
+ </section>
66
+ </div>
67
+ </template>
68
+ <script lang="ts">
69
+ import Vue from 'vue';
70
+ const cityOptions = ['Shanghai', 'Beijing', 'Guangzhou', 'Shenzhen'];
71
+
72
+ export default Vue.extend({
73
+ data() {
74
+ return {
75
+ checked: true,
76
+ checkboxGroup1: ['Shanghai'],
77
+ cities: cityOptions,
78
+ checkList: ['selected and disabled', 'Option A'],
79
+ checkAll: false,
80
+ checkedCities: ['Shanghai', 'Beijing'],
81
+ isIndeterminate: true,
82
+ time: '',
83
+ sizeForm: {
84
+ name: '',
85
+ region: '',
86
+ date1: '',
87
+ date2: '',
88
+ delivery: false,
89
+ type: [],
90
+ resource: '',
91
+ desc: '',
92
+ },
93
+ loading: false,
94
+
95
+ form: {
96
+ email: '',
97
+ password: '',
98
+ remember: false,
99
+ token: null,
100
+ correlation_id: null,
101
+ action: null,
102
+ platform: 'manager',
103
+ version: '1.0.10',
104
+ },
105
+ rules: {
106
+ email: [
107
+ {
108
+ validator: 'validateEmail',
109
+ trigger: 'submit',
110
+ message: this.$t('messages.please_provide_valid_email'),
111
+ },
112
+ ],
113
+ password: [
114
+ {
115
+ required: true,
116
+ trigger: 'submit',
117
+ message: this.$t('messages.please_fill', {
118
+ field: this.$t('login.password'),
119
+ }),
120
+ },
121
+ ],
122
+ },
123
+ };
124
+ },
125
+ methods: {
126
+ handleCheckAllChange(val: string) {
127
+ this.checkedCities = val ? cityOptions : [];
128
+ this.isIndeterminate = false;
129
+ },
130
+ handleCheckedCitiesChange(value: string[]) {
131
+ let checkedCount = value.length;
132
+ this.checkAll = checkedCount === this.cities.length;
133
+ this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
134
+ },
135
+ showAgreementDialog(type: string) {
136
+ console.log('agreement: ', type);
137
+ },
138
+ submit() {
139
+ this.$emit('submit', this.form);
140
+ },
141
+ onSubmit() {
142
+ console.log('submit!');
143
+ },
144
+ },
145
+ });
146
+ </script>