@timus-networks/theme 2.0.0 → 2.0.1

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