@coreui/vue-pro 4.4.2 → 4.6.0

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 (27) hide show
  1. package/dist/components/calendar/CCalendar.d.ts +41 -3
  2. package/dist/components/date-picker/CDatePicker.d.ts +41 -3
  3. package/dist/components/date-range-picker/CDateRangePicker.d.ts +160 -3
  4. package/dist/components/multi-select/CMultiSelect copy.d.ts +305 -0
  5. package/dist/components/multi-select/CMultiSelect.d.ts +168 -0
  6. package/dist/components/smart-table/CSmartTable.d.ts +2 -2
  7. package/dist/components/smart-table/CSmartTableHead.d.ts +15 -3
  8. package/dist/components/smart-table/CSmartTableInterface.d.ts +1 -1
  9. package/dist/components/table/CTable.d.ts +170 -8
  10. package/dist/components/table/CTableDataCell.d.ts +14 -0
  11. package/dist/index.es.js +1006 -474
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/index.js +1006 -474
  14. package/dist/index.js.map +1 -1
  15. package/package.json +2 -2
  16. package/src/components/calendar/CCalendar.ts +46 -4
  17. package/src/components/date-picker/CDatePicker.ts +33 -1
  18. package/src/components/date-range-picker/CDateRangePicker.ts +286 -170
  19. package/src/components/form/CFormInput.ts +1 -1
  20. package/src/components/multi-select/CMultiSelect.ts +204 -93
  21. package/src/components/smart-table/CSmartTable.ts +22 -21
  22. package/src/components/smart-table/CSmartTableHead.ts +45 -24
  23. package/src/components/smart-table/CSmartTableInterface.ts +1 -1
  24. package/src/components/smart-table/CSmartTableItemsPerPageSelector.ts +1 -1
  25. package/src/components/table/CTable.ts +243 -9
  26. package/src/components/table/CTableDataCell.ts +9 -1
  27. package/src/components/time-picker/CTimePicker.ts +125 -44
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coreui/vue-pro",
3
- "version": "4.4.2",
3
+ "version": "4.6.0",
4
4
  "description": "UI Components Library for Vue.js",
5
5
  "keywords": [
6
6
  "vue",
@@ -35,7 +35,7 @@
35
35
  "watch": "rollup -c -w"
36
36
  },
37
37
  "config": {
38
- "version_short": "4.4"
38
+ "version_short": "4.6"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@popperjs/core": "^2.11.6",
@@ -34,6 +34,29 @@ const CCalendar = defineComponent({
34
34
  type: Number,
35
35
  default: 1,
36
36
  },
37
+ /**
38
+ * Set the format of day name.
39
+ *
40
+ * @default 'numeric'
41
+ * @since 4.6.0
42
+ */
43
+ dayFormat: {
44
+ type: [Function, String],
45
+ default: 'numeric',
46
+ required: false,
47
+ validator: (value: string) => {
48
+ if (typeof value === 'string') {
49
+ return ['numeric', '2-digit'].includes(value)
50
+ }
51
+ if (typeof value === 'function') {
52
+ return true
53
+ }
54
+ if (typeof value === 'function') {
55
+ return true
56
+ }
57
+ return false
58
+ },
59
+ },
37
60
  /**
38
61
  * Specify the list of dates that cannot be selected.
39
62
  */
@@ -86,6 +109,12 @@ const CCalendar = defineComponent({
86
109
  type: Boolean,
87
110
  default: true,
88
111
  },
112
+ /**
113
+ * Reorder year-month navigation, and render year first.
114
+ *
115
+ * @since 4.6.0
116
+ */
117
+ navYearFirst: Boolean,
89
118
  /**
90
119
  * Allow range selection.
91
120
  */
@@ -106,7 +135,7 @@ const CCalendar = defineComponent({
106
135
  * @type number | 'long' | 'narrow' | 'short'
107
136
  */
108
137
  weekdayFormat: {
109
- type: [Number, String],
138
+ type: [Function, Number, String],
110
139
  default: 2,
111
140
  validator: (value: string | number) => {
112
141
  if (typeof value === 'string') {
@@ -115,6 +144,9 @@ const CCalendar = defineComponent({
115
144
  if (typeof value === 'number') {
116
145
  return true
117
146
  }
147
+ if (typeof value === 'function') {
148
+ return true
149
+ }
118
150
  return false
119
151
  },
120
152
  },
@@ -359,8 +391,12 @@ const CCalendar = defineComponent({
359
391
  {
360
392
  class: 'calendar-header-cell-inner',
361
393
  },
362
- props.weekdayFormat === 'string'
363
- ? date.toLocaleDateString(props.locale, { weekday: props.weekdayFormat })
394
+ typeof props.weekdayFormat === 'function'
395
+ ? props.weekdayFormat(date)
396
+ : typeof props.weekdayFormat === 'string'
397
+ ? date.toLocaleDateString(props.locale, {
398
+ weekday: <'long' | 'narrow' | 'short'>props.weekdayFormat,
399
+ })
364
400
  : date
365
401
  .toLocaleDateString(props.locale, { weekday: 'long' })
366
402
  .slice(0, props.weekdayFormat),
@@ -416,7 +452,11 @@ const CCalendar = defineComponent({
416
452
  {
417
453
  class: 'calendar-cell-inner',
418
454
  },
419
- date.toLocaleDateString(props.locale, { day: 'numeric' }),
455
+ typeof props.dayFormat === 'function'
456
+ ? props.dayFormat(date)
457
+ : date.toLocaleDateString(props.locale, {
458
+ day: <'numeric' | '2-digit'>props.dayFormat,
459
+ }),
420
460
  ),
421
461
  )
422
462
  }),
@@ -530,6 +570,7 @@ const CCalendar = defineComponent({
530
570
  'div',
531
571
  {
532
572
  class: 'calendar-nav-date',
573
+ ...(props.navYearFirst && { style: { display: 'flex', justifyContent: 'center' } }),
533
574
  },
534
575
  [
535
576
  view.value === 'days' &&
@@ -552,6 +593,7 @@ const CCalendar = defineComponent({
552
593
  onClick: () => {
553
594
  if (props.navigation) view.value = 'years'
554
595
  },
596
+ ...(props.navYearFirst && { style: { order: '-1' } }),
555
597
  },
556
598
  () => date.toLocaleDateString(props.locale, { year: 'numeric' }),
557
599
  ),
@@ -99,6 +99,29 @@ const CDatePicker = defineComponent({
99
99
  return ['ghost', 'outline'].includes(value)
100
100
  },
101
101
  },
102
+ /**
103
+ * Set the format of day name.
104
+ *
105
+ * @default 'numeric'
106
+ * @since 4.6.0
107
+ */
108
+ dayFormat: {
109
+ type: [Function, String],
110
+ default: 'numeric',
111
+ required: false,
112
+ validator: (value: string) => {
113
+ if (typeof value === 'string') {
114
+ return ['numeric', '2-digit'].includes(value)
115
+ }
116
+ if (typeof value === 'function') {
117
+ return true
118
+ }
119
+ if (typeof value === 'function') {
120
+ return true
121
+ }
122
+ return false
123
+ },
124
+ },
102
125
  /**
103
126
  * Toggle the disabled state for the component.
104
127
  */
@@ -183,6 +206,12 @@ const CDatePicker = defineComponent({
183
206
  type: Boolean,
184
207
  default: true,
185
208
  },
209
+ /**
210
+ * Reorder year-month navigation, and render year first.
211
+ *
212
+ * @since 4.6.0
213
+ */
214
+ navYearFirst: Boolean,
186
215
  /**
187
216
  * Specifies a short hint that is visible in the input.
188
217
  */
@@ -212,7 +241,7 @@ const CDatePicker = defineComponent({
212
241
  * @type number | 'long' | 'narrow' | 'short'
213
242
  */
214
243
  weekdayFormat: {
215
- type: [Number, String],
244
+ type: [Function, Number, String],
216
245
  default: 2,
217
246
  validator: (value: string | number) => {
218
247
  if (typeof value === 'string') {
@@ -221,6 +250,9 @@ const CDatePicker = defineComponent({
221
250
  if (typeof value === 'number') {
222
251
  return true
223
252
  }
253
+ if (typeof value === 'function') {
254
+ return true
255
+ }
224
256
  return false
225
257
  },
226
258
  },