@timus-networks/theme 2.0.16 → 2.1.3

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 (214) hide show
  1. package/README.md +113 -0
  2. package/dist/module.cjs +5 -0
  3. package/dist/module.d.mts +11 -0
  4. package/dist/module.d.ts +11 -0
  5. package/dist/module.json +9 -0
  6. package/dist/module.mjs +187 -0
  7. package/dist/runtime/components/development/example.alert.vue +29 -0
  8. package/dist/runtime/components/development/example.avatar.vue +85 -0
  9. package/dist/runtime/components/development/example.badge.vue +93 -0
  10. package/dist/runtime/components/development/example.breadcrumb.vue +54 -0
  11. package/dist/runtime/components/development/example.button.vue +235 -0
  12. package/dist/runtime/components/development/example.button.vue.d.ts +11 -0
  13. package/dist/runtime/components/development/example.card.vue +68 -0
  14. package/dist/runtime/components/development/example.checkbox.vue +176 -0
  15. package/dist/runtime/components/development/example.checkbox.vue.d.ts +24 -0
  16. package/dist/runtime/components/development/example.collapse.vue +38 -0
  17. package/dist/runtime/components/development/example.datepicker.vue +193 -0
  18. package/dist/runtime/components/development/example.description.vue +94 -0
  19. package/dist/runtime/components/development/example.dialog.vue +79 -0
  20. package/dist/runtime/components/development/example.dropdown.vue +166 -0
  21. package/dist/runtime/components/development/example.form.vue +488 -0
  22. package/dist/runtime/components/development/example.input.vue +270 -0
  23. package/dist/runtime/components/development/example.input.vue.d.ts +23 -0
  24. package/dist/runtime/components/development/example.link.vue +68 -0
  25. package/dist/runtime/components/development/example.message.vue +64 -0
  26. package/dist/runtime/components/development/example.notification.vue +75 -0
  27. package/dist/runtime/components/development/example.number.vue +70 -0
  28. package/dist/runtime/components/development/example.pagination.vue +89 -0
  29. package/dist/runtime/components/development/example.popover.vue +151 -0
  30. package/dist/runtime/components/development/example.radio.vue +163 -0
  31. package/dist/runtime/components/development/example.radio.vue.d.ts +25 -0
  32. package/dist/runtime/components/development/example.select.vue +588 -0
  33. package/dist/runtime/components/development/example.select.vue.d.ts +70 -0
  34. package/dist/runtime/components/development/example.sidebar.vue +101 -0
  35. package/dist/runtime/components/development/example.static.vue +50 -0
  36. package/dist/runtime/components/development/example.switch.vue +101 -0
  37. package/dist/runtime/components/development/example.table.vue +112 -0
  38. package/dist/runtime/components/development/example.tag.vue +255 -0
  39. package/dist/runtime/components/development/example.timepicker.vue +89 -0
  40. package/dist/runtime/components/development/example.tooltip.vue +104 -0
  41. package/dist/runtime/components/development/example.upload.vue +84 -0
  42. package/dist/runtime/components/production/html-encode.vue +96 -0
  43. package/dist/runtime/components/production/timus-breadcrumb.d.ts +36 -0
  44. package/dist/runtime/components/production/timus-breadcrumb.js +224 -0
  45. package/dist/runtime/components/production/timus-breadcrumb.mjs +224 -0
  46. package/dist/runtime/components/production/timus-breadcrumb.vue +83 -0
  47. package/dist/runtime/components/production/timus-breadcrumb.vue.d.ts +340 -0
  48. package/dist/runtime/composables/useBreadcrumb.d.ts +8 -0
  49. package/dist/runtime/composables/useBreadcrumb.js +53 -0
  50. package/dist/runtime/composables/useBreadcrumb.mjs +53 -0
  51. package/dist/runtime/pages/theme.vue +61 -0
  52. package/dist/runtime/plugins/disable-warnings-plugin.d.ts +2 -0
  53. package/dist/runtime/plugins/disable-warnings-plugin.js +18 -0
  54. package/dist/runtime/plugins/disable-warnings-plugin.mjs +18 -0
  55. package/dist/runtime/plugins/sample-plugin.d.ts +20 -0
  56. package/dist/runtime/plugins/sample-plugin.js +5 -0
  57. package/dist/runtime/plugins/sample-plugin.mjs +5 -0
  58. package/dist/runtime/plugins/theme-provider-plugin.d.ts +30 -0
  59. package/dist/runtime/plugins/theme-provider-plugin.js +46 -0
  60. package/dist/runtime/plugins/theme-provider-plugin.mjs +46 -0
  61. package/dist/runtime/public/scss/element-plus/affix.css +305 -0
  62. package/dist/runtime/public/scss/element-plus/alert.css +516 -0
  63. package/dist/runtime/public/scss/element-plus/anchor-link.css +332 -0
  64. package/dist/runtime/public/scss/element-plus/anchor.css +376 -0
  65. package/dist/runtime/public/scss/element-plus/aside.css +308 -0
  66. package/dist/runtime/public/scss/element-plus/autocomplete.css +411 -0
  67. package/dist/runtime/public/scss/element-plus/avatar.css +370 -0
  68. package/dist/runtime/public/scss/element-plus/backtop.css +326 -0
  69. package/dist/runtime/public/scss/element-plus/badge.css +376 -0
  70. package/dist/runtime/public/scss/element-plus/base.css +550 -0
  71. package/dist/runtime/public/scss/element-plus/breadcrumb-item.css +0 -0
  72. package/dist/runtime/public/scss/element-plus/breadcrumb.css +370 -0
  73. package/dist/runtime/public/scss/element-plus/button-group.css +535 -0
  74. package/dist/runtime/public/scss/element-plus/button.css +1089 -0
  75. package/dist/runtime/public/scss/element-plus/calendar.css +370 -0
  76. package/dist/runtime/public/scss/element-plus/card.css +347 -0
  77. package/dist/runtime/public/scss/element-plus/carousel-item.css +350 -0
  78. package/dist/runtime/public/scss/element-plus/carousel.css +475 -0
  79. package/dist/runtime/public/scss/element-plus/cascader-panel.css +428 -0
  80. package/dist/runtime/public/scss/element-plus/cascader.css +560 -0
  81. package/dist/runtime/public/scss/element-plus/check-tag.css +386 -0
  82. package/dist/runtime/public/scss/element-plus/checkbox-button.css +451 -0
  83. package/dist/runtime/public/scss/element-plus/checkbox-group.css +307 -0
  84. package/dist/runtime/public/scss/element-plus/checkbox.css +588 -0
  85. package/dist/runtime/public/scss/element-plus/col.css +3270 -0
  86. package/dist/runtime/public/scss/element-plus/collapse-item.css +0 -0
  87. package/dist/runtime/public/scss/element-plus/collapse-transition.css +0 -0
  88. package/dist/runtime/public/scss/element-plus/collapse.css +490 -0
  89. package/dist/runtime/public/scss/element-plus/color/index.css +0 -0
  90. package/dist/runtime/public/scss/element-plus/color-picker.css +650 -0
  91. package/dist/runtime/public/scss/element-plus/common/popup.css +338 -0
  92. package/dist/runtime/public/scss/element-plus/common/transition.css +420 -0
  93. package/dist/runtime/public/scss/element-plus/common/var.css +302 -0
  94. package/dist/runtime/public/scss/element-plus/config-provider.css +0 -0
  95. package/dist/runtime/public/scss/element-plus/container.css +313 -0
  96. package/dist/runtime/public/scss/element-plus/dark/css-vars.css +353 -0
  97. package/dist/runtime/public/scss/element-plus/dark/var.css +302 -0
  98. package/dist/runtime/public/scss/element-plus/date-picker/date-picker.css +558 -0
  99. package/dist/runtime/public/scss/element-plus/date-picker/date-range-picker.css +410 -0
  100. package/dist/runtime/public/scss/element-plus/date-picker/date-table.css +426 -0
  101. package/dist/runtime/public/scss/element-plus/date-picker/month-table.css +388 -0
  102. package/dist/runtime/public/scss/element-plus/date-picker/picker-panel.css +454 -0
  103. package/dist/runtime/public/scss/element-plus/date-picker/picker.css +662 -0
  104. package/dist/runtime/public/scss/element-plus/date-picker/time-picker.css +384 -0
  105. package/dist/runtime/public/scss/element-plus/date-picker/time-range-picker.css +338 -0
  106. package/dist/runtime/public/scss/element-plus/date-picker/time-spinner.css +389 -0
  107. package/dist/runtime/public/scss/element-plus/date-picker/year-table.css +384 -0
  108. package/dist/runtime/public/scss/element-plus/date-picker.css +1531 -0
  109. package/dist/runtime/public/scss/element-plus/descriptions-item.css +347 -0
  110. package/dist/runtime/public/scss/element-plus/descriptions.css +435 -0
  111. package/dist/runtime/public/scss/element-plus/dialog.css +512 -0
  112. package/dist/runtime/public/scss/element-plus/display.css +357 -0
  113. package/dist/runtime/public/scss/element-plus/divider.css +345 -0
  114. package/dist/runtime/public/scss/element-plus/drawer.css +419 -0
  115. package/dist/runtime/public/scss/element-plus/dropdown-item.css +0 -0
  116. package/dist/runtime/public/scss/element-plus/dropdown-menu.css +0 -0
  117. package/dist/runtime/public/scss/element-plus/dropdown.css +495 -0
  118. package/dist/runtime/public/scss/element-plus/empty.css +355 -0
  119. package/dist/runtime/public/scss/element-plus/footer.css +310 -0
  120. package/dist/runtime/public/scss/element-plus/form-item.css +0 -0
  121. package/dist/runtime/public/scss/element-plus/form.css +527 -0
  122. package/dist/runtime/public/scss/element-plus/header.css +310 -0
  123. package/dist/runtime/public/scss/element-plus/icon.css +343 -0
  124. package/dist/runtime/public/scss/element-plus/image-viewer.css +439 -0
  125. package/dist/runtime/public/scss/element-plus/image.css +343 -0
  126. package/dist/runtime/public/scss/element-plus/index.css +17293 -0
  127. package/dist/runtime/public/scss/element-plus/infinite-scroll.css +0 -0
  128. package/dist/runtime/public/scss/element-plus/input-number.css +494 -0
  129. package/dist/runtime/public/scss/element-plus/input.css +770 -0
  130. package/dist/runtime/public/scss/element-plus/link.css +453 -0
  131. package/dist/runtime/public/scss/element-plus/loading.css +391 -0
  132. package/dist/runtime/public/scss/element-plus/main.css +311 -0
  133. package/dist/runtime/public/scss/element-plus/mention.css +413 -0
  134. package/dist/runtime/public/scss/element-plus/menu-item-group.css +0 -0
  135. package/dist/runtime/public/scss/element-plus/menu-item.css +0 -0
  136. package/dist/runtime/public/scss/element-plus/menu.css +737 -0
  137. package/dist/runtime/public/scss/element-plus/message-box.css +533 -0
  138. package/dist/runtime/public/scss/element-plus/message.css +528 -0
  139. package/dist/runtime/public/scss/element-plus/mixins/config.css +0 -0
  140. package/dist/runtime/public/scss/element-plus/mixins/function.css +0 -0
  141. package/dist/runtime/public/scss/element-plus/mixins/mixins.css +302 -0
  142. package/dist/runtime/public/scss/element-plus/mixins/utils.css +0 -0
  143. package/dist/runtime/public/scss/element-plus/notification.css +413 -0
  144. package/dist/runtime/public/scss/element-plus/option-group.css +331 -0
  145. package/dist/runtime/public/scss/element-plus/option.css +354 -0
  146. package/dist/runtime/public/scss/element-plus/overlay.css +317 -0
  147. package/dist/runtime/public/scss/element-plus/page-header.css +351 -0
  148. package/dist/runtime/public/scss/element-plus/pagination.css +586 -0
  149. package/dist/runtime/public/scss/element-plus/popconfirm.css +315 -0
  150. package/dist/runtime/public/scss/element-plus/popover.css +352 -0
  151. package/dist/runtime/public/scss/element-plus/popper.css +400 -0
  152. package/dist/runtime/public/scss/element-plus/progress.css +449 -0
  153. package/dist/runtime/public/scss/element-plus/radio-button.css +436 -0
  154. package/dist/runtime/public/scss/element-plus/radio-group.css +308 -0
  155. package/dist/runtime/public/scss/element-plus/radio.css +561 -0
  156. package/dist/runtime/public/scss/element-plus/rate.css +384 -0
  157. package/dist/runtime/public/scss/element-plus/reset.css +399 -0
  158. package/dist/runtime/public/scss/element-plus/result.css +381 -0
  159. package/dist/runtime/public/scss/element-plus/row.css +339 -0
  160. package/dist/runtime/public/scss/element-plus/scrollbar.css +373 -0
  161. package/dist/runtime/public/scss/element-plus/segmented.css +460 -0
  162. package/dist/runtime/public/scss/element-plus/select-dropdown-v2.css +351 -0
  163. package/dist/runtime/public/scss/element-plus/select-dropdown.css +351 -0
  164. package/dist/runtime/public/scss/element-plus/select-v2.css +765 -0
  165. package/dist/runtime/public/scss/element-plus/select.css +765 -0
  166. package/dist/runtime/public/scss/element-plus/skeleton-item.css +372 -0
  167. package/dist/runtime/public/scss/element-plus/skeleton.css +335 -0
  168. package/dist/runtime/public/scss/element-plus/slider.css +480 -0
  169. package/dist/runtime/public/scss/element-plus/space.css +317 -0
  170. package/dist/runtime/public/scss/element-plus/spinner.css +342 -0
  171. package/dist/runtime/public/scss/element-plus/statistic.css +336 -0
  172. package/dist/runtime/public/scss/element-plus/step.css +586 -0
  173. package/dist/runtime/public/scss/element-plus/steps.css +319 -0
  174. package/dist/runtime/public/scss/element-plus/sub-menu.css +0 -0
  175. package/dist/runtime/public/scss/element-plus/switch.css +594 -0
  176. package/dist/runtime/public/scss/element-plus/tab-pane.css +0 -0
  177. package/dist/runtime/public/scss/element-plus/table-column.css +382 -0
  178. package/dist/runtime/public/scss/element-plus/table-v2.css +520 -0
  179. package/dist/runtime/public/scss/element-plus/table.css +893 -0
  180. package/dist/runtime/public/scss/element-plus/tabs.css +892 -0
  181. package/dist/runtime/public/scss/element-plus/tag.css +624 -0
  182. package/dist/runtime/public/scss/element-plus/text.css +378 -0
  183. package/dist/runtime/public/scss/element-plus/time-picker.css +1023 -0
  184. package/dist/runtime/public/scss/element-plus/time-select.css +946 -0
  185. package/dist/runtime/public/scss/element-plus/timeline-item.css +415 -0
  186. package/dist/runtime/public/scss/element-plus/timeline.css +334 -0
  187. package/dist/runtime/public/scss/element-plus/tooltip-v2.css +410 -0
  188. package/dist/runtime/public/scss/element-plus/tooltip.css +0 -0
  189. package/dist/runtime/public/scss/element-plus/tour.css +461 -0
  190. package/dist/runtime/public/scss/element-plus/transfer.css +497 -0
  191. package/dist/runtime/public/scss/element-plus/tree-select.css +325 -0
  192. package/dist/runtime/public/scss/element-plus/tree.css +538 -0
  193. package/dist/runtime/public/scss/element-plus/upload.css +862 -0
  194. package/dist/runtime/public/scss/element-plus/var.css +389 -0
  195. package/dist/runtime/public/scss/element-plus/virtual-list.css +330 -0
  196. package/dist/runtime/public/scss/theme.css +1268 -0
  197. package/dist/runtime/server/tsconfig.json +6 -0
  198. package/dist/runtime/types.d.ts +31 -0
  199. package/dist/types.d.mts +7 -0
  200. package/dist/types.d.ts +7 -0
  201. package/package.json +35 -12
  202. package/components/TimusIcons.vue +0 -54
  203. package/generate-icon.js +0 -22
  204. package/module.ts +0 -84
  205. package/pages/icons.vue +0 -37
  206. package/plugins/sample-plugin.ts +0 -5
  207. package/public/isax/fonts/iconsax.svg +0 -927
  208. package/public/isax/fonts/iconsax.ttf +0 -0
  209. package/public/isax/fonts/iconsax.woff +0 -0
  210. package/public/isax/icons.json +0 -899
  211. package/public/isax/selection.json +0 -1
  212. package/public/isax/style.css +0 -1
  213. package/public/isax/style.scss +0 -5435
  214. package/public/isax/variables.scss +0 -900
@@ -0,0 +1,588 @@
1
+ <template>
2
+ <div class="flex flex-col gap-8 mb-16">
3
+ <h1 class="">Select</h1>
4
+ <p>When there are plenty of options, use a drop-down menu to display and select desired ones.</p>
5
+
6
+ <el-card>
7
+ <template #header> Sizes </template>
8
+ <div class="flex flex-col gap-3 items-start">
9
+ <p>
10
+ Default size is Large. Input component provides {{ sizes.length }} additional sizes for you to choose among different scenarios. Use attribute size to set additional
11
+ sizes <el-text tag="mark">{{ sizes.join(', ') }}</el-text>
12
+ </p>
13
+ <div class="flex gap-4 items-start">
14
+ <el-select v-for="(size, index) of sizes" :key="size + index" v-model="value" :size="size" placeholder="Select" style="width: 140px">
15
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
16
+ </el-select>
17
+ </div>
18
+ </div>
19
+ <template #footer>
20
+ <html-encode :tag="snippets.sizes" />
21
+ </template>
22
+ </el-card>
23
+
24
+ <el-card>
25
+ <template #header> Disabled option </template>
26
+ <div class="flex flex-col gap-3 items-start">
27
+ <p>Set the value of <el-text tag="mark">disabled</el-text> in <el-text tag="mark">el-option</el-text> to <el-text tag="mark">true</el-text> to disable this option.</p>
28
+ <div class="flex gap-4 items-start">
29
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
30
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled" />
31
+ </el-select>
32
+ </div>
33
+ </div>
34
+ <template #footer>
35
+ <html-encode :tag="snippets.disableOptions" />
36
+ </template>
37
+ </el-card>
38
+
39
+ <el-card>
40
+ <template #header> Disabled select </template>
41
+ <div class="flex flex-col gap-3 items-start">
42
+ <p>Disable the whole component. Set <el-text tag="mark">disabled</el-text> of <el-text tag="mark">el-select</el-text> to make it disabled.</p>
43
+ <div class="flex gap-4 flex-col items-start">
44
+ <el-select v-model="value" disabled placeholder="Select" style="width: 184px">
45
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
46
+ </el-select>
47
+ </div>
48
+ </div>
49
+ <template #footer>
50
+ <html-encode :tag="snippets.disableSelect" />
51
+ </template>
52
+ </el-card>
53
+
54
+ <el-card>
55
+ <template #header> Clearable single select </template>
56
+ <div class="flex flex-col gap-3 items-start">
57
+ <p>
58
+ You can clear Select using a clear icon. Set <el-text tag="mark">clearable</el-text> attribute for <el-text tag="mark">el-select</el-text> and a clear icon will appear.
59
+ Note that <el-text tag="mark">clearable</el-text> is only for single select.
60
+ </p>
61
+ <div class="flex gap-4 flex-col items-start">
62
+ <el-select v-model="value" clearable placeholder="Select" style="width: 184px">
63
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
64
+ </el-select>
65
+ </div>
66
+ </div>
67
+ <template #footer>
68
+ <html-encode :tag="snippets.clearable" />
69
+ </template>
70
+ </el-card>
71
+
72
+ <el-card>
73
+ <template #header> Basic multiple select </template>
74
+ <div class="flex flex-col gap-3 items-start">
75
+ <p>
76
+ Multiple select uses tags to display selected options. Set <el-text tag="mark">multiple</el-text> attribute for el-select to enable multiple mode. In this case, the value
77
+ of v-model will be an array of selected options. By default the selected options will be displayed as Tags. You can collapse them to a text by using
78
+ <el-text tag="mark">collapse-tags</el-text> attribute. You can check them when mouse hover collapse text by using
79
+ <el-text tag="mark">collapse-tags-tooltip</el-text> attribute.
80
+ </p>
81
+ <div v-for="(size, index) of sizes" :key="index + 'multiple'" class="flex flex-col items-start justify-start mb-4">
82
+ <h3>{{ capitalize(size) }}</h3>
83
+ <div class="flex gap-4">
84
+ <div class="flex gap-4 flex-col">
85
+ <p>default</p>
86
+ <el-select v-model="multiple.one" multiple placeholder="Select" style="width: 184px" :size="size" disabled>
87
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
88
+ </el-select>
89
+ </div>
90
+ <div class="flex gap-4 flex-col">
91
+ <p>use collapse-tags</p>
92
+ <el-select v-model="multiple.two" multiple collapse-tags placeholder="Select" style="width: 184px" :size="size">
93
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
94
+ </el-select>
95
+ </div>
96
+ <div class="flex gap-4 flex-col">
97
+ <p>use collapse-tags-tooltip</p>
98
+ <el-select v-model="multiple.three" multiple collapse-tags collapse-tags-tooltip placeholder="Select" style="width: 184px" :size="size">
99
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
100
+ </el-select>
101
+ </div>
102
+ <div class="flex gap-4 flex-col">
103
+ <p>use max-collapse-tags</p>
104
+ <el-select v-model="multiple.four" multiple collapse-tags collapse-tags-tooltip :max-collapse-tags="3" placeholder="Select" style="width: 184px" :size="size">
105
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
106
+ </el-select>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+ <template #footer>
112
+ <html-encode :tag="snippets.multiple" />
113
+ </template>
114
+ </el-card>
115
+
116
+ <el-card>
117
+ <template #header> Custom template </template>
118
+ <div class="flex flex-col gap-3 items-start">
119
+ <p>You can customize HTML templates for options. Insert customized HTML templates into the slot of <el-text tag="mark">el-option</el-text>.</p>
120
+ <div class="flex gap-4 flex-col items-start">
121
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
122
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
123
+ <span style="float: left">{{ item.label }}</span>
124
+ <span style="color: var(--el-color-neutral-light-4); float: right; font-size: 13px">
125
+ {{ item.value }}
126
+ </span>
127
+ </el-option>
128
+ </el-select>
129
+ </div>
130
+ </div>
131
+ <template #footer>
132
+ <html-encode :tag="snippets.custom" />
133
+ </template>
134
+ </el-card>
135
+
136
+ <el-card>
137
+ <template #header> Header of the dropdown </template>
138
+ <div class="flex flex-col gap-3 items-start">
139
+ <p>You can customize the header of the dropdown. Use slot to customize the content.</p>
140
+ <div class="flex gap-4 flex-col items-start">
141
+ <el-select v-model="valueChecboxed" multiple clearable collapse-tags placeholder="Select" popper-class="custom-header" :max-collapse-tags="1" style="width: 184px">
142
+ <template #header>
143
+ <el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAll"> All </el-checkbox>
144
+ </template>
145
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
146
+ </el-select>
147
+ </div>
148
+ </div>
149
+ <template #footer>
150
+ <html-encode :tag="snippets.withHeader" />
151
+ </template>
152
+ </el-card>
153
+
154
+ <el-card>
155
+ <template #header>Footer of the dropdow</template>
156
+ <div class="flex flex-col gap-3 items-start">
157
+ <p>You can customize the footer of the dropdown. Use slot to customize the content.</p>
158
+ <div class="flex gap-4 flex-col items-start">
159
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
160
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
161
+ <template #footer>
162
+ <el-button v-if="!footer.isAdding" plain size="small" @click="onAddOption"> Add an option </el-button>
163
+ <template v-else>
164
+ <el-input v-model="footer.optionName" class="option-input" placeholder="input option name" size="small" />
165
+ <el-button type="primary" size="small" @click="onConfirm"> confirm </el-button>
166
+ <el-button size="small" @click="clear">cancel</el-button>
167
+ </template>
168
+ </template>
169
+ </el-select>
170
+ </div>
171
+ </div>
172
+ <template #footer>
173
+ <html-encode :tag="snippets.withFooter" />
174
+ </template>
175
+ </el-card>
176
+
177
+ <el-card>
178
+ <template #header> Grouping </template>
179
+ <div class="flex flex-col gap-3 items-start">
180
+ <p>
181
+ Display options in groups. Use <el-text tag="mark">el-option-group</el-text> to group the options, and its <span class="font-medium">label</span> attribute stands for the
182
+ name of the group.
183
+ </p>
184
+ <div class="flex gap-4 flex-col items-start">
185
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
186
+ <el-option-group v-for="group in groupOptions" :key="group.label" :label="group.label">
187
+ <el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value" />
188
+ </el-option-group>
189
+ </el-select>
190
+ </div>
191
+ </div>
192
+ <template #footer>
193
+ <html-encode :tag="snippets.withGroup" />
194
+ </template>
195
+ </el-card>
196
+
197
+ <el-card>
198
+ <template #header> Option filtering </template>
199
+ <div class="flex flex-col gap-3 items-start">
200
+ <p>
201
+ You can filter options for your desired ones. Adding <el-text tag="mark">filterable</el-text> to <span class="font-medium">el-select</span> enables filtering. By default,
202
+ Select will find all the options whose label attribute contains the input value. If you prefer other filtering strategies, you can pass the
203
+ <el-text tag="mark">filter-method</el-text>. filter-method is a <span class="font-medium">Function</span> that gets called when the input value changes, and its parameter
204
+ is the current input value.
205
+ </p>
206
+ <div class="flex gap-4 flex-col items-start">
207
+ <el-select v-model="value" filterable placeholder="Select" style="width: 184px" clearable>
208
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
209
+ </el-select>
210
+ </div>
211
+ </div>
212
+ <template #footer> <html-encode :tag="snippets.filter" /> </template>
213
+ </el-card>
214
+
215
+ <el-card>
216
+ <template #header> Create new items </template>
217
+ <div class="flex flex-col gap-3 items-start">
218
+ <p>
219
+ Create and select new items that are not included in select options By using the <el-text tag="mark">allow-create</el-text> attribute, users can create new items by
220
+ typing in the input box. Note that for allow-create to work, <el-text tag="mark">filterable</el-text> must be <span class="font-medium">true</span>. This example also
221
+ demonstrates <el-text tag="mark">default-first-option</el-text>. When this attribute is set to <span class="font-medium">true</span>, you can select the first option in
222
+ the current option list by hitting enter without having to navigate with mouse or arrow keys.
223
+ </p>
224
+ <div class="flex gap-4 items-start w-full">
225
+ <el-select
226
+ v-model="newItemsValues"
227
+ multiple
228
+ filterable
229
+ allow-create
230
+ default-first-option
231
+ :reserve-keyword="false"
232
+ placeholder="Choose tags for your article"
233
+ class="grow"
234
+ >
235
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
236
+ </el-select>
237
+
238
+ <el-select
239
+ v-model="newItemsValues"
240
+ multiple
241
+ filterable
242
+ allow-create
243
+ default-first-option
244
+ :reserve-keyword="false"
245
+ placeholder="Choose tags for your article"
246
+ class="grow"
247
+ disabled
248
+ >
249
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
250
+ </el-select>
251
+ </div>
252
+ </div>
253
+
254
+ <template #footer>
255
+ <html-encode :tag="snippets.filter" />
256
+ </template>
257
+ </el-card>
258
+
259
+ <el-card>
260
+ <template #header> Option filtering </template>
261
+ <div class="flex flex-col gap-3 items-start">
262
+ <p>
263
+ If the binding value of Select is an object, make sure to assign <el-text tag="mark">value-key</el-text> as its unique identity key name. By using the value-key
264
+ attribute, data with duplicate labels can be properly handled. The value of the <span class="font-medium">label</span> property is duplicated, but the option can be
265
+ identified through the <span class="font-medium">id</span>.
266
+ </p>
267
+ <div class="flex gap-4 flex-col items-start">
268
+ <el-select v-model="objectSelected" value-key="id" placeholder="Select" style="width: 184px">
269
+ <el-option v-for="item in objectOptions" :key="item.id" :label="item.label" :value="item" />
270
+ </el-select>
271
+ <p>
272
+ Selected option's:
273
+ {{ objectSelected ? objectSelected : 'no select' }}
274
+ </p>
275
+ </div>
276
+ </div>
277
+ <template #footer>
278
+ <html-encode :tag="snippets.filter" />
279
+ </template>
280
+ </el-card>
281
+
282
+ <el-card>
283
+ <template #header> Custom Tag </template>
284
+ <div class="flex flex-col gap-3 items-start">
285
+ <p>
286
+ You can customize tags. Insert customized <el-text tag="mark">tags</el-text> into the <span class="font-medium">slot</span> of el-select.
287
+ <span class="font-medium">collapse-tags, collapse-tags-tooltip, max-collapse-tags</span> will not work.
288
+ </p>
289
+ <div class="flex gap-4 flex-col items-start">
290
+ <el-select v-model="colorSelected" multiple placeholder="Select" style="width: 184px">
291
+ <el-option v-for="tag in coloredOptions" :key="tag.value" :label="tag.label" :value="tag.value">
292
+ <div class="flex items-center">
293
+ <el-tag :type="tag.label" style="margin-right: 8px" size="small" />
294
+ <span :style="{ color: tag.value }">{{ tag.label }}</span>
295
+ </div>
296
+ </el-option>
297
+ <template #tag>
298
+ <div
299
+ v-for="color in colorSelected"
300
+ :key="color"
301
+ class="px-2 w-[18px] h-[18px]"
302
+ :style="{ backgroundColor: `var(--el-color-${color}-light-2)`, border: `1px solid var(--el-color-${color}-light-4)` }"
303
+ />
304
+ <el-tag v-for="color in colorSelected" :key="color" :type="color">
305
+ {{ color }}
306
+ </el-tag>
307
+ </template>
308
+ </el-select>
309
+ <p>
310
+ Selected option's:
311
+ {{ colorSelected ? colorSelected : 'no select' }}
312
+ </p>
313
+ </div>
314
+ </div>
315
+ <template #footer> <html-encode :tag="snippets.customTag" /> </template>
316
+ </el-card>
317
+
318
+ <el-card>
319
+ <template #header>Custom Label</template>
320
+ <div class="flex flex-col gap-3 items-start">
321
+ <p>
322
+ You can customize label. Insert customized <el-text tag="mark">label</el-text> into the <span class="font-medium">slot</span> of el-select.
323
+ <span class="font-medium">collapse-tags, collapse-tags-tooltip, max-collapse-tags</span> will not work.
324
+ </p>
325
+ <div class="flex gap-4 flex-col items-start">
326
+ <el-select v-model="colorSelected" multiple placeholder="Select" style="width: 184px">
327
+ <el-option v-for="tag in coloredOptions" :key="tag.value" :label="tag.label" :value="tag.value">
328
+ <div class="flex items-center">
329
+ <el-tag :type="tag.label" style="margin-right: 8px" size="small" />
330
+ <span :style="{ color: tag.value }">{{ tag.label }}</span>
331
+ </div>
332
+ </el-option>
333
+ <template #label="{ label, value: val }">
334
+ {{ label }}
335
+ <span>{{ label }}: </span>
336
+ <span style="font-weight: bold">{{ val }}</span>
337
+ </template>
338
+ </el-select>
339
+ <p>
340
+ Selected option's:
341
+ {{ colorSelected ? colorSelected : 'no select' }}
342
+ </p>
343
+ </div>
344
+ </div>
345
+ <template #footer> <html-encode :tag="snippets.customLabel" /> </template>
346
+ </el-card>
347
+
348
+ <el-card>
349
+ <template #header>Fatih's Request Sample</template>
350
+ <div class="flex flex-col gap-3 items-start">
351
+ <p>
352
+ You can customize label. Insert customized <el-text tag="mark">label</el-text> into the <span class="font-medium">slot</span> of el-select.
353
+ <span class="font-medium">collapse-tags, collapse-tags-tooltip, max-collapse-tags</span> will not work.
354
+ </p>
355
+ <div class="flex gap-4 flex-col items-start">
356
+ <el-select v-model="model" multiple placeholder="Select">
357
+ <el-option v-for="item in coloredOptions" :key="item.value" :label="item.label" :value="item.value">
358
+ <div class="flex items-center">
359
+ <el-tag style="margin-right: 8px" size="small" :type="item.label">
360
+ <span :style="{ color: item.value }">{{ item.label }}</span>
361
+ </el-tag>
362
+ </div>
363
+ </el-option>
364
+ <template #tag>
365
+ <el-tag v-for="color in model" :key="color" :type="color">{{ color }}</el-tag>
366
+ </template>
367
+ </el-select>
368
+ </div>
369
+ </div>
370
+ <template #footer> <html-encode :tag="snippets.customLabel" /> </template>
371
+ </el-card>
372
+ </div>
373
+ </template>
374
+
375
+ <script>
376
+ import { defineComponent } from "vue";
377
+ export default defineComponent({
378
+ name: "TimusSelect",
379
+ data() {
380
+ return {
381
+ sizes: ["default", "large", "medium", "small", "mini"],
382
+ colors: ["primary", "secondary", "neutral", "success", "warning", "info", "danger"],
383
+ value: "",
384
+ model: [],
385
+ multiple: { one: [], two: [], three: [], four: [] },
386
+ options: [
387
+ { value: "Option 1", label: "Option 1" },
388
+ { value: "Option 2", label: "Option 2", disabled: true },
389
+ { value: "Option 3", label: "Option 3 uzun" },
390
+ { value: "Option 4", label: "Option 4" },
391
+ { value: "Option 5", label: "Option 5" },
392
+ { value: "Option 6", label: "Option 6", disabled: true },
393
+ { value: "Option 7", label: "Option 7" },
394
+ { value: "Option 8", label: "Option 8" },
395
+ { value: "Beijing", label: "Beijing" },
396
+ { value: "Shanghai", label: "Shanghai" },
397
+ { value: "Nanjing", label: "Nanjing" },
398
+ { value: "Chengdu", label: "Chengdu" },
399
+ { value: "Shenzhen", label: "Shenzhen" },
400
+ { value: "Guangzhou", label: "Guangzhou" }
401
+ ],
402
+ snippets: {
403
+ sizes: `
404
+ <el-select v-for="(size, index) of sizes" :key="size + index" v-model="value" :size="size" placeholder="Select" style="width: 184px">
405
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
406
+ </el-select>
407
+ `,
408
+ disableOptions: `
409
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
410
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" :disabled="item.disabled" />
411
+ </el-select>`,
412
+ disableSelect: `
413
+ <el-select v-model="value" disabled placeholder="Select" style="width: 184px">
414
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
415
+ </el-select>`,
416
+ clearable: `
417
+ <el-select v-model="value" clearable placeholder="Select" style="width: 184px">
418
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
419
+ </el-select>`,
420
+ multiple: `
421
+ <el-select v-model="multiple.four" multiple collapse-tags collapse-tags-tooltip :max-collapse-tags="3" placeholder="Select" style="width: 184px" :size="size">
422
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
423
+ </el-select>
424
+ `,
425
+ custom: `
426
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
427
+ <span style="float: left">{{ item.label }}</span>
428
+ <span style="color: var(--el-text-color-secondary); float: right; font-size: 13px">
429
+ {{ item.value }}
430
+ </span>
431
+ </el-option>
432
+ `,
433
+ withHeader: `
434
+ <el-select v-model="valueChecboxed" multiple clearable collapse-tags placeholder="Select" popper-class="custom-header" :max-collapse-tags="1" style="width: 184px">
435
+ <template #header>
436
+ <el-checkbox v-model="checkAll" :indeterminate="indeterminate" @change="handleCheckAll"> All </el-checkbox>
437
+ </template>
438
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
439
+ </el-select>
440
+ `,
441
+ withFooter: `
442
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
443
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
444
+ <template #footer>
445
+ <el-button v-if="!footer.isAdding" plain size="small" @click="onAddOption"> Add an option </el-button>
446
+ <template v-else>
447
+ <el-input v-model="footer.optionName" class="option-input" placeholder="input option name" size="small" />
448
+ <el-button type="primary" size="small" @click="onConfirm"> confirm </el-button>
449
+ <el-button size="small" @click="clear">cancel</el-button>
450
+ </template>
451
+ </template>
452
+ </el-select>
453
+ `,
454
+ withGroup: `
455
+ <el-select v-model="value" placeholder="Select" style="width: 184px">
456
+ <el-option-group v-for="group in groupOptions" :key="group.label" :label="group.label">
457
+ <el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value" />
458
+ </el-option-group>
459
+ </el-select>
460
+ `,
461
+ filter: `
462
+ <el-select v-model="value" filterable placeholder="Select" style="width: 184px">
463
+ <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
464
+ </el-select>
465
+ `,
466
+ customTag: `
467
+ <el-select v-model="colorSelected" multiple placeholder="Select" style="width: 184px">
468
+ <el-option v-for="tag in coloredOptions" :key="tag.value" :label="tag.label" :value="tag.value">
469
+ <div class="flex items-center">
470
+ <el-tag :type="tag.label" style="margin-right: 8px" size="small" />
471
+ <span :style="{ color: tag.value }">{{ tag.label }}</span>
472
+ </div>
473
+ </el-option>
474
+ <template #tag>
475
+ <div
476
+ v-for="color in colorSelected"
477
+ :key="color"
478
+ class="px-2 w-[18px] h-[18px]"
479
+ :style="{ backgroundColor: 'red', border: 'blue' }"
480
+ />
481
+ </template>
482
+ </el-select>
483
+ `,
484
+ customLabel: `
485
+ <el-select v-model="colorSelected" multiple placeholder="Select" style="width: 184px">
486
+ <el-option v-for="tag in coloredOptions" :key="tag.value" :label="tag.label" :value="tag.value">
487
+ <div class="flex items-center">
488
+ <el-tag :type="tag.label" style="margin-right: 8px" size="small" />
489
+ <span :style="{ color: tag.value }">{{ tag.label }}</span>
490
+ </div>
491
+ </el-option>
492
+ <template #label="{ label, value }">
493
+ <span>{{ label }}: </span>
494
+ <span style="font-weight: bold">{{ value }}</span>
495
+ </template>
496
+ </el-select>
497
+ `
498
+ },
499
+ checkAll: false,
500
+ indeterminate: false,
501
+ valueChecboxed: [],
502
+ footer: {
503
+ isAdding: false,
504
+ optionName: ""
505
+ },
506
+ groupOptions: [
507
+ {
508
+ label: "Popular cities",
509
+ options: [
510
+ { value: "Shanghai", label: "Shanghai" },
511
+ { value: "Beijing", label: "Beijing" }
512
+ ]
513
+ },
514
+ {
515
+ label: "City name",
516
+ options: [
517
+ { value: "Chengdu", label: "Chengdu" },
518
+ { value: "Shenzhen", label: "Shenzhen" },
519
+ { value: "Guangzhou", label: "Guangzhou" },
520
+ { value: "Dalian", label: "Dalian" }
521
+ ]
522
+ }
523
+ ],
524
+ newItemsValues: [],
525
+ objectOptions: [
526
+ { id: 1, label: "Option A", desc: "Option A - 230506" },
527
+ { id: 2, label: "Option B", desc: "Option B - 230506" },
528
+ { id: 3, label: "Option C", desc: "Option C - 230506" },
529
+ { id: 4, label: "Option A", desc: "Option A - 230507" }
530
+ ],
531
+ objectSelected: {},
532
+ coloredOptions: [
533
+ { value: "primary", label: "primary" },
534
+ { value: "secondary", label: "secondary" },
535
+ { value: "neutral", label: "neutral" },
536
+ { value: "success", label: "success" },
537
+ { value: "warning", label: "warning" },
538
+ { value: "danger", label: "danger" },
539
+ { value: "info", label: "info" }
540
+ ],
541
+ colorSelected: []
542
+ };
543
+ },
544
+ watch: {
545
+ valueChecboxed(val) {
546
+ if (val.length === 0) {
547
+ this.checkAll = false;
548
+ this.indeterminate = false;
549
+ } else if (val.length === this.options.length) {
550
+ this.checkAll = true;
551
+ this.indeterminate = false;
552
+ } else {
553
+ this.indeterminate = true;
554
+ }
555
+ }
556
+ },
557
+ methods: {
558
+ capitalize(value) {
559
+ const text = String(value);
560
+ return text.charAt(0).toUpperCase() + text.slice(1);
561
+ },
562
+ handleCheckAll(val) {
563
+ this.indeterminate = false;
564
+ if (val) {
565
+ this.valueChecboxed = this.options.map((_) => _.value);
566
+ } else {
567
+ this.valueChecboxed = [];
568
+ }
569
+ },
570
+ onAddOption() {
571
+ this.footer.isAdding = true;
572
+ },
573
+ onConfirm() {
574
+ if (this.footer.optionName) {
575
+ this.options.push({
576
+ label: this.footer.optionName,
577
+ value: this.footer.optionName
578
+ });
579
+ this.clear();
580
+ }
581
+ },
582
+ clear() {
583
+ this.footer.optionName = "";
584
+ this.footer.isAdding = false;
585
+ }
586
+ }
587
+ });
588
+ </script>
@@ -0,0 +1,70 @@
1
+ import type { CheckboxValueType } from 'element-plus';
2
+ type Option = {
3
+ id: number;
4
+ label: string;
5
+ desc: string;
6
+ };
7
+ declare const _default: import("vue").DefineComponent<{}, {}, {
8
+ sizes: string[];
9
+ colors: string[];
10
+ value: string;
11
+ model: never[];
12
+ multiple: {
13
+ one: never[];
14
+ two: never[];
15
+ three: never[];
16
+ four: never[];
17
+ };
18
+ options: ({
19
+ value: string;
20
+ label: string;
21
+ disabled?: undefined;
22
+ } | {
23
+ value: string;
24
+ label: string;
25
+ disabled: boolean;
26
+ })[];
27
+ snippets: {
28
+ sizes: string;
29
+ disableOptions: string;
30
+ disableSelect: string;
31
+ clearable: string;
32
+ multiple: string;
33
+ custom: string;
34
+ withHeader: string;
35
+ withFooter: string;
36
+ withGroup: string;
37
+ filter: string;
38
+ customTag: string;
39
+ customLabel: string;
40
+ };
41
+ checkAll: boolean;
42
+ indeterminate: boolean;
43
+ valueChecboxed: CheckboxValueType[];
44
+ footer: {
45
+ isAdding: boolean;
46
+ optionName: string;
47
+ };
48
+ groupOptions: {
49
+ label: string;
50
+ options: {
51
+ value: string;
52
+ label: string;
53
+ }[];
54
+ }[];
55
+ newItemsValues: string[];
56
+ objectOptions: Option[];
57
+ objectSelected: Option;
58
+ coloredOptions: {
59
+ value: string;
60
+ label: string;
61
+ }[];
62
+ colorSelected: never[];
63
+ }, {}, {
64
+ capitalize(value: string): string;
65
+ handleCheckAll(val: CheckboxValueType): void;
66
+ onAddOption(): void;
67
+ onConfirm(): void;
68
+ clear(): void;
69
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
70
+ export default _default;