@coreui/vue-pro 5.0.0 → 5.1.0-alpha.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.
- package/README.md +1 -1
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +26 -22
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/rating/CRating.d.ts +132 -0
- package/dist/cjs/components/rating/CRating.js +240 -0
- package/dist/cjs/components/rating/CRating.js.map +1 -0
- package/dist/cjs/components/rating/index.d.ts +6 -0
- package/dist/cjs/components/rating/index.js +13 -0
- package/dist/cjs/components/rating/index.js.map +1 -0
- package/dist/cjs/components/smart-table/CSmartTableBody.js +2 -1
- package/dist/cjs/components/smart-table/CSmartTableBody.js.map +1 -1
- package/dist/cjs/index.js +32 -28
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/rating/CRating.d.ts +132 -0
- package/dist/esm/components/rating/CRating.js +238 -0
- package/dist/esm/components/rating/CRating.js.map +1 -0
- package/dist/esm/components/rating/index.d.ts +6 -0
- package/dist/esm/components/rating/index.js +10 -0
- package/dist/esm/components/rating/index.js.map +1 -0
- package/dist/esm/components/smart-table/CSmartTableBody.js +3 -2
- package/dist/esm/components/smart-table/CSmartTableBody.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/index.ts +1 -0
- package/src/components/rating/CRating.ts +288 -0
- package/src/components/rating/index.ts +10 -0
- package/src/components/smart-table/CSmartTableBody.ts +3 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index$
|
|
6
|
-
var index$
|
|
5
|
+
var index$N = require('./components/index.js');
|
|
6
|
+
var index$O = require('./directives/index.js');
|
|
7
7
|
var useColorModes = require('./composables/useColorModes.js');
|
|
8
8
|
var useDebouncedCallback = require('./composables/useDebouncedCallback.js');
|
|
9
9
|
var useIsVisible = require('./composables/useIsVisible.js');
|
|
@@ -146,20 +146,22 @@ var CProgressBar = require('./components/progress/CProgressBar.js');
|
|
|
146
146
|
var CProgressStacked = require('./components/progress/CProgressStacked.js');
|
|
147
147
|
var index$A = require('./components/popover/index.js');
|
|
148
148
|
var CPopover = require('./components/popover/CPopover.js');
|
|
149
|
-
var
|
|
149
|
+
var CRating = require('./components/rating/CRating.js');
|
|
150
|
+
var index$B = require('./components/rating/index.js');
|
|
151
|
+
var index$C = require('./components/sidebar/index.js');
|
|
150
152
|
var CSidebar = require('./components/sidebar/CSidebar.js');
|
|
151
153
|
var CSidebarBrand = require('./components/sidebar/CSidebarBrand.js');
|
|
152
154
|
var CSidebarFooter = require('./components/sidebar/CSidebarFooter.js');
|
|
153
155
|
var CSidebarHeader = require('./components/sidebar/CSidebarHeader.js');
|
|
154
156
|
var CSidebarNav = require('./components/sidebar/CSidebarNav.js');
|
|
155
157
|
var CSidebarToggler = require('./components/sidebar/CSidebarToggler.js');
|
|
156
|
-
var index$
|
|
158
|
+
var index$D = require('./components/smart-pagination/index.js');
|
|
157
159
|
var CSmartPagination = require('./components/smart-pagination/CSmartPagination.js');
|
|
158
|
-
var index$
|
|
160
|
+
var index$E = require('./components/smart-table/index.js');
|
|
159
161
|
var CSmartTable = require('./components/smart-table/CSmartTable.js');
|
|
160
|
-
var index$
|
|
162
|
+
var index$F = require('./components/spinner/index.js');
|
|
161
163
|
var CSpinner = require('./components/spinner/CSpinner.js');
|
|
162
|
-
var index$
|
|
164
|
+
var index$G = require('./components/table/index.js');
|
|
163
165
|
var CTable = require('./components/table/CTable.js');
|
|
164
166
|
var CTableBody = require('./components/table/CTableBody.js');
|
|
165
167
|
var CTableCaption = require('./components/table/CTableCaption.js');
|
|
@@ -168,22 +170,22 @@ var CTableFoot = require('./components/table/CTableFoot.js');
|
|
|
168
170
|
var CTableHead = require('./components/table/CTableHead.js');
|
|
169
171
|
var CTableHeaderCell = require('./components/table/CTableHeaderCell.js');
|
|
170
172
|
var CTableRow = require('./components/table/CTableRow.js');
|
|
171
|
-
var index$
|
|
173
|
+
var index$H = require('./components/tabs/index.js');
|
|
172
174
|
var CTabContent = require('./components/tabs/CTabContent.js');
|
|
173
175
|
var CTabPane = require('./components/tabs/CTabPane.js');
|
|
174
176
|
var CTimePicker = require('./components/time-picker/CTimePicker.js');
|
|
175
|
-
var index$
|
|
176
|
-
var index$
|
|
177
|
+
var index$I = require('./components/time-picker/index.js');
|
|
178
|
+
var index$J = require('./components/toast/index.js');
|
|
177
179
|
var CToast = require('./components/toast/CToast.js');
|
|
178
180
|
var CToastBody = require('./components/toast/CToastBody.js');
|
|
179
181
|
var CToastClose = require('./components/toast/CToastClose.js');
|
|
180
182
|
var CToaster = require('./components/toast/CToaster.js');
|
|
181
183
|
var CToastHeader = require('./components/toast/CToastHeader.js');
|
|
182
|
-
var index$
|
|
184
|
+
var index$K = require('./components/tooltip/index.js');
|
|
183
185
|
var CTooltip = require('./components/tooltip/CTooltip.js');
|
|
184
186
|
var CVirtualScroller = require('./components/virtual-scroller/CVirtualScroller.js');
|
|
185
|
-
var index$
|
|
186
|
-
var index$
|
|
187
|
+
var index$L = require('./components/virtual-scroller/index.js');
|
|
188
|
+
var index$M = require('./components/widgets/index.js');
|
|
187
189
|
var CWidgetStatsA = require('./components/widgets/CWidgetStatsA.js');
|
|
188
190
|
var CWidgetStatsB = require('./components/widgets/CWidgetStatsB.js');
|
|
189
191
|
var CWidgetStatsC = require('./components/widgets/CWidgetStatsC.js');
|
|
@@ -196,11 +198,11 @@ var vCTooltip = require('./directives/v-c-tooltip.js');
|
|
|
196
198
|
|
|
197
199
|
const CoreuiVue = {
|
|
198
200
|
install: (app) => {
|
|
199
|
-
for (const key in index$M) {
|
|
200
|
-
app.component(key, index$M[key]);
|
|
201
|
-
}
|
|
202
201
|
for (const key in index$N) {
|
|
203
|
-
app.
|
|
202
|
+
app.component(key, index$N[key]);
|
|
203
|
+
}
|
|
204
|
+
for (const key in index$O) {
|
|
205
|
+
app.directive(index$O[key]['name'], index$O[key]);
|
|
204
206
|
}
|
|
205
207
|
},
|
|
206
208
|
};
|
|
@@ -347,20 +349,22 @@ exports.CProgressBar = CProgressBar.CProgressBar;
|
|
|
347
349
|
exports.CProgressStacked = CProgressStacked.CProgressStacked;
|
|
348
350
|
exports.CPopoverPlugin = index$A.CPopoverPlugin;
|
|
349
351
|
exports.CPopover = CPopover.CPopover;
|
|
350
|
-
exports.
|
|
352
|
+
exports.CRating = CRating.CRating;
|
|
353
|
+
exports.CRatingPlugin = index$B.CRatingPlugin;
|
|
354
|
+
exports.CSidebarPlugin = index$C.CSidebarPlugin;
|
|
351
355
|
exports.CSidebar = CSidebar.CSidebar;
|
|
352
356
|
exports.CSidebarBrand = CSidebarBrand.CSidebarBrand;
|
|
353
357
|
exports.CSidebarFooter = CSidebarFooter.CSidebarFooter;
|
|
354
358
|
exports.CSidebarHeader = CSidebarHeader.CSidebarHeader;
|
|
355
359
|
exports.CSidebarNav = CSidebarNav.CSidebarNav;
|
|
356
360
|
exports.CSidebarToggler = CSidebarToggler.CSidebarToggler;
|
|
357
|
-
exports.CSmartPaginationPlugin = index$
|
|
361
|
+
exports.CSmartPaginationPlugin = index$D.CSmartPaginationPlugin;
|
|
358
362
|
exports.CSmartPagination = CSmartPagination.CSmartPagination;
|
|
359
|
-
exports.CSmartTablePlugin = index$
|
|
363
|
+
exports.CSmartTablePlugin = index$E.CSmartTablePlugin;
|
|
360
364
|
exports.CSmartTable = CSmartTable.CSmartTable;
|
|
361
|
-
exports.CSpinnerPlugin = index$
|
|
365
|
+
exports.CSpinnerPlugin = index$F.CSpinnerPlugin;
|
|
362
366
|
exports.CSpinner = CSpinner.CSpinner;
|
|
363
|
-
exports.CTablePlugin = index$
|
|
367
|
+
exports.CTablePlugin = index$G.CTablePlugin;
|
|
364
368
|
exports.CTable = CTable.CTable;
|
|
365
369
|
exports.CTableBody = CTableBody.CTableBody;
|
|
366
370
|
exports.CTableCaption = CTableCaption.CTableCaption;
|
|
@@ -369,22 +373,22 @@ exports.CTableFoot = CTableFoot.CTableFoot;
|
|
|
369
373
|
exports.CTableHead = CTableHead.CTableHead;
|
|
370
374
|
exports.CTableHeaderCell = CTableHeaderCell.CTableHeaderCell;
|
|
371
375
|
exports.CTableRow = CTableRow.CTableRow;
|
|
372
|
-
exports.CTabsPlugin = index$
|
|
376
|
+
exports.CTabsPlugin = index$H.CTabsPlugin;
|
|
373
377
|
exports.CTabContent = CTabContent.CTabContent;
|
|
374
378
|
exports.CTabPane = CTabPane.CTabPane;
|
|
375
379
|
exports.CTimePicker = CTimePicker.CTimePicker;
|
|
376
|
-
exports.CTimePickerPlugin = index$
|
|
377
|
-
exports.CToastPlugin = index$
|
|
380
|
+
exports.CTimePickerPlugin = index$I.CTimePickerPlugin;
|
|
381
|
+
exports.CToastPlugin = index$J.CToastPlugin;
|
|
378
382
|
exports.CToast = CToast.CToast;
|
|
379
383
|
exports.CToastBody = CToastBody.CToastBody;
|
|
380
384
|
exports.CToastClose = CToastClose.CToastClose;
|
|
381
385
|
exports.CToaster = CToaster.CToaster;
|
|
382
386
|
exports.CToastHeader = CToastHeader.CToastHeader;
|
|
383
|
-
exports.CTooltipPlugin = index$
|
|
387
|
+
exports.CTooltipPlugin = index$K.CTooltipPlugin;
|
|
384
388
|
exports.CTooltip = CTooltip.CTooltip;
|
|
385
389
|
exports.CVirtualScroller = CVirtualScroller.CVirtualScroller;
|
|
386
|
-
exports.CVirtualScrollerPlugin = index$
|
|
387
|
-
exports.CWidgetsStatsPlugin = index$
|
|
390
|
+
exports.CVirtualScrollerPlugin = index$L.CVirtualScrollerPlugin;
|
|
391
|
+
exports.CWidgetsStatsPlugin = index$M.CWidgetsStatsPlugin;
|
|
388
392
|
exports.CWidgetStatsA = CWidgetStatsA.CWidgetStatsA;
|
|
389
393
|
exports.CWidgetStatsB = CWidgetStatsB.CWidgetStatsB;
|
|
390
394
|
exports.CWidgetStatsC = CWidgetStatsC.CWidgetStatsC;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Components","Directives"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Components","Directives"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,SAAS,GAAG;AAChB,IAAA,OAAO,EAAE,CAAC,GAAQ,KAAU;AAC1B,QAAA,KAAK,MAAM,GAAG,IAAIA,OAAU,EAAE;YAC5B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAGA,OAAqC,CAAC,GAAG,CAAC,CAAC,CAAA;SAChE;AAED,QAAA,KAAK,MAAM,GAAG,IAAIC,OAAU,EAAE;AAC5B,YAAA,GAAG,CAAC,SAAS,CACVA,OAAqC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAClDA,OAAqC,CAAC,GAAG,CAAC,CAC5C,CAAA;SACF;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -35,6 +35,7 @@ export { CPickerPlugin } from './picker/index.js';
|
|
|
35
35
|
export { CPlaceholderPlugin } from './placeholder/index.js';
|
|
36
36
|
export { CProgressPlugin } from './progress/index.js';
|
|
37
37
|
export { CPopoverPlugin } from './popover/index.js';
|
|
38
|
+
export { CRatingPlugin } from './rating/index.js';
|
|
38
39
|
export { CSidebarPlugin } from './sidebar/index.js';
|
|
39
40
|
export { CSmartPaginationPlugin } from './smart-pagination/index.js';
|
|
40
41
|
export { CSmartTablePlugin } from './smart-table/index.js';
|
|
@@ -147,6 +148,7 @@ export { CProgress } from './progress/CProgress.js';
|
|
|
147
148
|
export { CProgressBar } from './progress/CProgressBar.js';
|
|
148
149
|
export { CProgressStacked } from './progress/CProgressStacked.js';
|
|
149
150
|
export { CPopover } from './popover/CPopover.js';
|
|
151
|
+
export { CRating } from './rating/CRating.js';
|
|
150
152
|
export { CSidebar } from './sidebar/CSidebar.js';
|
|
151
153
|
export { CSidebarBrand } from './sidebar/CSidebarBrand.js';
|
|
152
154
|
export { CSidebarFooter } from './sidebar/CSidebarFooter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
declare const CRating: import("vue").DefineComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* Enables the clearing upon clicking the selected item again.
|
|
5
|
+
*/
|
|
6
|
+
allowClear: BooleanConstructor;
|
|
7
|
+
/**
|
|
8
|
+
* Toggle the disabled state for the component.
|
|
9
|
+
*/
|
|
10
|
+
disabled: BooleanConstructor;
|
|
11
|
+
/**
|
|
12
|
+
* If enabled, only the currently selected icon will be visibly highlighted.
|
|
13
|
+
*/
|
|
14
|
+
highlightOnlySelected: BooleanConstructor;
|
|
15
|
+
/**
|
|
16
|
+
* Specifies the total number of stars to be displayed in the star rating component. This property determines the scale of the rating, such as out of 5 stars, 10 stars, etc.
|
|
17
|
+
*/
|
|
18
|
+
itemCount: {
|
|
19
|
+
type: NumberConstructor;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The default name for a value passed using v-model.
|
|
24
|
+
*/
|
|
25
|
+
modelValue: NumberConstructor;
|
|
26
|
+
/**
|
|
27
|
+
* The name attribute of the radio input elements.
|
|
28
|
+
*/
|
|
29
|
+
name: StringConstructor;
|
|
30
|
+
/**
|
|
31
|
+
* Minimum increment value change allowed.
|
|
32
|
+
*/
|
|
33
|
+
precision: {
|
|
34
|
+
type: NumberConstructor;
|
|
35
|
+
default: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Toggle the readonly state for the component.
|
|
39
|
+
*/
|
|
40
|
+
readOnly: BooleanConstructor;
|
|
41
|
+
/**
|
|
42
|
+
* Size the component small, large, or custom if you define custom icons with custom height.
|
|
43
|
+
*
|
|
44
|
+
* @values 'sm', 'lg', 'custom'
|
|
45
|
+
*/
|
|
46
|
+
size: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
validator: (value: string) => boolean;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Enable tooltips with default values or set specific labels for each icon.
|
|
52
|
+
*/
|
|
53
|
+
tooltips: {
|
|
54
|
+
type: PropType<boolean | string[]>;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* The `value` attribute of component.
|
|
58
|
+
* */
|
|
59
|
+
value: NumberConstructor;
|
|
60
|
+
}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "hover" | "update:modelValue")[], "change" | "hover" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
63
|
+
/**
|
|
64
|
+
* Enables the clearing upon clicking the selected item again.
|
|
65
|
+
*/
|
|
66
|
+
allowClear: BooleanConstructor;
|
|
67
|
+
/**
|
|
68
|
+
* Toggle the disabled state for the component.
|
|
69
|
+
*/
|
|
70
|
+
disabled: BooleanConstructor;
|
|
71
|
+
/**
|
|
72
|
+
* If enabled, only the currently selected icon will be visibly highlighted.
|
|
73
|
+
*/
|
|
74
|
+
highlightOnlySelected: BooleanConstructor;
|
|
75
|
+
/**
|
|
76
|
+
* Specifies the total number of stars to be displayed in the star rating component. This property determines the scale of the rating, such as out of 5 stars, 10 stars, etc.
|
|
77
|
+
*/
|
|
78
|
+
itemCount: {
|
|
79
|
+
type: NumberConstructor;
|
|
80
|
+
default: number;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* The default name for a value passed using v-model.
|
|
84
|
+
*/
|
|
85
|
+
modelValue: NumberConstructor;
|
|
86
|
+
/**
|
|
87
|
+
* The name attribute of the radio input elements.
|
|
88
|
+
*/
|
|
89
|
+
name: StringConstructor;
|
|
90
|
+
/**
|
|
91
|
+
* Minimum increment value change allowed.
|
|
92
|
+
*/
|
|
93
|
+
precision: {
|
|
94
|
+
type: NumberConstructor;
|
|
95
|
+
default: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Toggle the readonly state for the component.
|
|
99
|
+
*/
|
|
100
|
+
readOnly: BooleanConstructor;
|
|
101
|
+
/**
|
|
102
|
+
* Size the component small, large, or custom if you define custom icons with custom height.
|
|
103
|
+
*
|
|
104
|
+
* @values 'sm', 'lg', 'custom'
|
|
105
|
+
*/
|
|
106
|
+
size: {
|
|
107
|
+
type: StringConstructor;
|
|
108
|
+
validator: (value: string) => boolean;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Enable tooltips with default values or set specific labels for each icon.
|
|
112
|
+
*/
|
|
113
|
+
tooltips: {
|
|
114
|
+
type: PropType<boolean | string[]>;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The `value` attribute of component.
|
|
118
|
+
* */
|
|
119
|
+
value: NumberConstructor;
|
|
120
|
+
}>> & {
|
|
121
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
122
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
123
|
+
onHover?: ((...args: any[]) => any) | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
disabled: boolean;
|
|
126
|
+
allowClear: boolean;
|
|
127
|
+
highlightOnlySelected: boolean;
|
|
128
|
+
itemCount: number;
|
|
129
|
+
precision: number;
|
|
130
|
+
readOnly: boolean;
|
|
131
|
+
}, {}>;
|
|
132
|
+
export { CRating };
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { defineComponent, ref, watch, h, withDirectives } from 'vue';
|
|
2
|
+
import vCTooltip from '../../directives/v-c-tooltip.js';
|
|
3
|
+
|
|
4
|
+
const CRating = defineComponent({
|
|
5
|
+
name: 'CRating',
|
|
6
|
+
props: {
|
|
7
|
+
/**
|
|
8
|
+
* Enables the clearing upon clicking the selected item again.
|
|
9
|
+
*/
|
|
10
|
+
allowClear: Boolean,
|
|
11
|
+
/**
|
|
12
|
+
* Toggle the disabled state for the component.
|
|
13
|
+
*/
|
|
14
|
+
disabled: Boolean,
|
|
15
|
+
/**
|
|
16
|
+
* If enabled, only the currently selected icon will be visibly highlighted.
|
|
17
|
+
*/
|
|
18
|
+
highlightOnlySelected: Boolean,
|
|
19
|
+
/**
|
|
20
|
+
* Specifies the total number of stars to be displayed in the star rating component. This property determines the scale of the rating, such as out of 5 stars, 10 stars, etc.
|
|
21
|
+
*/
|
|
22
|
+
itemCount: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 5,
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* The default name for a value passed using v-model.
|
|
28
|
+
*/
|
|
29
|
+
modelValue: Number,
|
|
30
|
+
/**
|
|
31
|
+
* The name attribute of the radio input elements.
|
|
32
|
+
*/
|
|
33
|
+
name: String,
|
|
34
|
+
/**
|
|
35
|
+
* Minimum increment value change allowed.
|
|
36
|
+
*/
|
|
37
|
+
precision: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 1,
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Toggle the readonly state for the component.
|
|
43
|
+
*/
|
|
44
|
+
readOnly: Boolean,
|
|
45
|
+
/**
|
|
46
|
+
* Size the component small, large, or custom if you define custom icons with custom height.
|
|
47
|
+
*
|
|
48
|
+
* @values 'sm', 'lg', 'custom'
|
|
49
|
+
*/
|
|
50
|
+
size: {
|
|
51
|
+
type: String,
|
|
52
|
+
validator: (value) => {
|
|
53
|
+
return ['sm', 'lg', 'custom'].includes(value);
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Enable tooltips with default values or set specific labels for each icon.
|
|
58
|
+
*/
|
|
59
|
+
tooltips: {
|
|
60
|
+
type: [Boolean, Array],
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* The `value` attribute of component.
|
|
64
|
+
* */
|
|
65
|
+
value: Number,
|
|
66
|
+
},
|
|
67
|
+
emits: [
|
|
68
|
+
/**
|
|
69
|
+
* Execute a function when a user changes the selected element.
|
|
70
|
+
*
|
|
71
|
+
* @property {number | null} value
|
|
72
|
+
*/
|
|
73
|
+
'change',
|
|
74
|
+
/**
|
|
75
|
+
* Execute a function when a user hover the element.
|
|
76
|
+
*
|
|
77
|
+
* @property {number | null} value
|
|
78
|
+
*/
|
|
79
|
+
'hover',
|
|
80
|
+
/**
|
|
81
|
+
* Emit the new value whenever there’s a change event.
|
|
82
|
+
*/
|
|
83
|
+
'update:modelValue',
|
|
84
|
+
],
|
|
85
|
+
setup(props, { slots, emit }) {
|
|
86
|
+
const cleared = ref(false);
|
|
87
|
+
const currentValue = ref((props.modelValue || props.value) ?? null);
|
|
88
|
+
const hoverValue = ref(null);
|
|
89
|
+
const tooltipValue = ref(null);
|
|
90
|
+
const name = props.name || `name${Math.floor(Math.random() * 1_000_000)}`;
|
|
91
|
+
const uid = `id${Math.floor(Math.random() * 1_000_000)}`;
|
|
92
|
+
watch(() => props.value, () => {
|
|
93
|
+
if (props.value !== undefined) {
|
|
94
|
+
currentValue.value = props.value;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
watch(() => props.modelValue, () => {
|
|
98
|
+
if (props.modelValue !== undefined) {
|
|
99
|
+
currentValue.value = props.modelValue;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
const handleMouseEnter = (value) => {
|
|
103
|
+
if (props.disabled || props.readOnly) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
emit('hover', value);
|
|
107
|
+
hoverValue.value = value;
|
|
108
|
+
tooltipValue.value = value;
|
|
109
|
+
};
|
|
110
|
+
const handleMouseLeave = () => {
|
|
111
|
+
if (props.disabled || props.readOnly) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
emit('hover', null);
|
|
115
|
+
hoverValue.value = null;
|
|
116
|
+
};
|
|
117
|
+
const handleOnChange = (value) => {
|
|
118
|
+
if (props.disabled || props.readOnly) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (cleared.value) {
|
|
122
|
+
cleared.value = false;
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
currentValue.value = value;
|
|
126
|
+
emit('change', value);
|
|
127
|
+
emit('update:modelValue', value);
|
|
128
|
+
};
|
|
129
|
+
const handleOnClick = (value) => {
|
|
130
|
+
if (props.disabled || props.readOnly) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (props.allowClear && value === currentValue.value) {
|
|
134
|
+
emit('change', value);
|
|
135
|
+
cleared.value = true;
|
|
136
|
+
currentValue.value = null;
|
|
137
|
+
hoverValue.value = null;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
return () => h('div', {
|
|
141
|
+
class: [
|
|
142
|
+
'rating',
|
|
143
|
+
{
|
|
144
|
+
[`rating-${props.size}`]: props.size,
|
|
145
|
+
disabled: props.disabled,
|
|
146
|
+
readonly: props.readOnly,
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
role: 'radiogroup',
|
|
150
|
+
}, [
|
|
151
|
+
Array.from({ length: props.itemCount }, (_, index) => {
|
|
152
|
+
const numberOfRadios = 1 / props.precision;
|
|
153
|
+
return withDirectives(h('div', {
|
|
154
|
+
class: 'rating-item',
|
|
155
|
+
}, [
|
|
156
|
+
Array.from({ length: numberOfRadios }, (_, _index) => {
|
|
157
|
+
const isNotLastItem = _index + 1 < numberOfRadios;
|
|
158
|
+
const value = numberOfRadios === 1
|
|
159
|
+
? index + 1
|
|
160
|
+
: index + (_index + 1) * (1 * props.precision);
|
|
161
|
+
const id = `${uid}${value}`;
|
|
162
|
+
const isItemChecked = () => value === currentValue.value;
|
|
163
|
+
const isItemActive = () => {
|
|
164
|
+
if (props.highlightOnlySelected
|
|
165
|
+
? hoverValue.value === value
|
|
166
|
+
: hoverValue.value && hoverValue.value >= value) {
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
if (hoverValue.value === null &&
|
|
170
|
+
(props.highlightOnlySelected
|
|
171
|
+
? isItemChecked()
|
|
172
|
+
: currentValue.value && currentValue.value >= value)) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
};
|
|
177
|
+
return [
|
|
178
|
+
h('label', {
|
|
179
|
+
class: [
|
|
180
|
+
'rating-item-label',
|
|
181
|
+
{
|
|
182
|
+
active: isItemActive(),
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
for: id,
|
|
186
|
+
onClick: () => handleOnClick(value),
|
|
187
|
+
onMouseenter: () => handleMouseEnter(value),
|
|
188
|
+
onMouseleave: () => handleMouseLeave(),
|
|
189
|
+
...(isNotLastItem && {
|
|
190
|
+
style: {
|
|
191
|
+
zIndex: 1 / props.precision - _index,
|
|
192
|
+
position: 'absolute',
|
|
193
|
+
width: `${props.precision * (_index + 1) * 100}%`,
|
|
194
|
+
overflow: 'hidden',
|
|
195
|
+
opacity: 0,
|
|
196
|
+
},
|
|
197
|
+
}),
|
|
198
|
+
}, {
|
|
199
|
+
default: () => [
|
|
200
|
+
slots.icon
|
|
201
|
+
? h('div', { class: 'rating-item-custom-icon' }, slots.icon({ value: index + 1 }))
|
|
202
|
+
: h('div', { class: 'rating-item-icon' }),
|
|
203
|
+
slots.activeIcon &&
|
|
204
|
+
h('div', { class: 'rating-item-custom-icon-active' }, slots.activeIcon({ value: index + 1 })),
|
|
205
|
+
],
|
|
206
|
+
}),
|
|
207
|
+
h('input', {
|
|
208
|
+
checked: isItemChecked(),
|
|
209
|
+
class: 'rating-item-input',
|
|
210
|
+
disabled: props.disabled || props.readOnly,
|
|
211
|
+
id: id,
|
|
212
|
+
name: name,
|
|
213
|
+
onBlur: () => handleMouseLeave(),
|
|
214
|
+
onChange: () => handleOnChange(value),
|
|
215
|
+
onFocus: () => handleMouseEnter(value),
|
|
216
|
+
type: 'radio',
|
|
217
|
+
value: value,
|
|
218
|
+
}),
|
|
219
|
+
];
|
|
220
|
+
}),
|
|
221
|
+
]), props.tooltips
|
|
222
|
+
? [
|
|
223
|
+
[
|
|
224
|
+
vCTooltip,
|
|
225
|
+
{
|
|
226
|
+
content: Array.isArray(props.tooltips) ? props.tooltips[index] : index + 1,
|
|
227
|
+
placement: 'top',
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
]
|
|
231
|
+
: []);
|
|
232
|
+
}),
|
|
233
|
+
]);
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export { CRating };
|
|
238
|
+
//# sourceMappingURL=CRating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CRating.js","sources":["../../../../src/components/rating/CRating.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAGM,MAAA,OAAO,GAAG,eAAe,CAAC;AAC9B,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,KAAK,EAAE;AACL;;AAEG;AACH,QAAA,UAAU,EAAE,OAAO;AACnB;;AAEG;AACH,QAAA,QAAQ,EAAE,OAAO;AACjB;;AAEG;AACH,QAAA,qBAAqB,EAAE,OAAO;AAC9B;;AAEG;AACH,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACD;;AAEG;AACH,QAAA,UAAU,EAAE,MAAM;AAClB;;AAEG;AACH,QAAA,IAAI,EAAE,MAAM;AACZ;;AAEG;AACH,QAAA,SAAS,EAAE;AACT,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACD;;AAEG;AACH,QAAA,QAAQ,EAAE,OAAO;AACjB;;;;AAIG;AACH,QAAA,IAAI,EAAE;AACJ,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,SAAS,EAAE,CAAC,KAAa,KAAI;AAC3B,gBAAA,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;aAC9C;AACF,SAAA;AACD;;AAEG;AACH,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAiC;AACvD,SAAA;AACD;;AAEK;AACL,QAAA,KAAK,EAAE,MAAM;AACd,KAAA;AACD,IAAA,KAAK,EAAE;AACL;;;;AAIG;QACH,QAAQ;AACR;;;;AAIG;QACH,OAAO;AACP;;AAEG;QACH,mBAAmB;AACpB,KAAA;AACD,IAAA,KAAK,CAAC,KAAK,EAAE,EAAE,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AAE,KAAK,EAAE,gCAAgC,EAAE,EAC3C,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC,CACvC;AACJ,iCAAA;6BACF,CACF;4BACD,CAAC,CAAC,OAAO,EAAE;gCACT,OAAO,EAAE,aAAa,EAAE;AACxB,gCAAA,KAAK,EAAE,mBAAmB;AAC1B,gCAAA,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ;AAC1C,gCAAA,EAAE,EAAE,EAAE;AACN,gCAAA,IAAI,EAAE,IAAI;AACV,gCAAA,MAAM,EAAE,MAAM,gBAAgB,EAAE;AAChC,gCAAA,QAAQ,EAAE,MAAM,cAAc,CAAC,KAAK,CAAC;AACrC,gCAAA,OAAO,EAAE,MAAM,gBAAgB,CAAC,KAAK,CAAC;AACtC,gCAAA,IAAI,EAAE,OAAO;AACb,gCAAA,KAAK,EAAE,KAAK;6BACb,CAAC;yBACH,CAAA;AACH,qBAAC,CAAC;iBACH,CACF,EACD,KAAK,CAAC,QAAQ;AACZ,sBAAE;AACE,wBAAA;4BACE,SAAS;AACT,4BAAA;gCACE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC;AAC1E,gCAAA,SAAS,EAAE,KAAK;AACjB,6BAAA;AACF,yBAAA;AACF,qBAAA;sBACD,EAAE,CACP,CAAA;AACH,aAAC,CAAC;AACH,SAAA,CACF,CAAA;KACJ;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/rating/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA,MAAM,aAAa,GAAG;AACpB,IAAA,OAAO,EAAE,CAAC,GAAQ,KAAU;QAC1B,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAc,EAAE,OAAO,CAAC,CAAA;KAC/C;;;;;"}
|
|
@@ -22,7 +22,7 @@ import '../table/CTableHeaderCell.js';
|
|
|
22
22
|
import { CTableRow } from '../table/CTableRow.js';
|
|
23
23
|
import isObjectInArray from '../../utils/isObjectInArray.js';
|
|
24
24
|
import { ITEM_INTERNAL_KEYS } from './consts.js';
|
|
25
|
-
import { getClickedColumnName, getColumnName, getTableDataCellProps, getTableDataCellStyles } from './utils.js';
|
|
25
|
+
import { getColumns, getClickedColumnName, getColumnName, getTableDataCellProps, getTableDataCellStyles } from './utils.js';
|
|
26
26
|
|
|
27
27
|
const CSmartTableBody = defineComponent({
|
|
28
28
|
name: 'CSmartTableBody',
|
|
@@ -55,6 +55,7 @@ const CSmartTableBody = defineComponent({
|
|
|
55
55
|
emits: ['rowChecked', 'rowClick'],
|
|
56
56
|
setup(props, { emit }) {
|
|
57
57
|
const colspan = props.selectable ? props.columns.length + 1 : props.columns.length;
|
|
58
|
+
const columns = getColumns(props.columns);
|
|
58
59
|
return () => h(CTableBody, {
|
|
59
60
|
...(props.clickableRows && { style: 'cursor:pointer;' }),
|
|
60
61
|
}, {
|
|
@@ -77,7 +78,7 @@ const CSmartTableBody = defineComponent({
|
|
|
77
78
|
emit('rowChecked', item, event.target.checked);
|
|
78
79
|
},
|
|
79
80
|
})),
|
|
80
|
-
|
|
81
|
+
columns.map((column) => {
|
|
81
82
|
const colName = getColumnName(column);
|
|
82
83
|
return props.scopedSlots &&
|
|
83
84
|
props.scopedSlots[colName] &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CSmartTableBody.js","sources":["../../../../src/components/smart-table/CSmartTableBody.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CSmartTableBody.js","sources":["../../../../src/components/smart-table/CSmartTableBody.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBM,MAAA,e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MAAM,EAAE,CAAC,EAAE;6BACrB,EACD;AACE,gCAAA,OAAO,EAAE,MACP,KAAK,CAAC,WAAW;AACjB,oCAAA,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC;AAC5B,oCAAA,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;AAC9B,wCAAA,IAAI,EAAE,IAAI;qCACX,CAAC;6BACL,CACF;yBACJ,CACF;AACF,qBAAA;iBACJ,CAAC;AACJ,kBAAE,CAAC,CACC,SAAS,EACT,EAAE,EACF;AACE,oBAAA,OAAO,EAAE,MACP,CAAC,CACC,cAAc,EACd,EAAE,OAAO,EAAE,OAAO,EAAE,EACpB;AACE,wBAAA,OAAO,EAAE,MAAM,KAAK,CAAC,YAAY;qBAClC,CACF;iBACJ,CACF;AACR,SAAA,CACF,CAAA;KACJ;AACF,CAAA;;;;"}
|
package/dist/esm/index.js
CHANGED
|
@@ -142,6 +142,8 @@ export { CProgressBar } from './components/progress/CProgressBar.js';
|
|
|
142
142
|
export { CProgressStacked } from './components/progress/CProgressStacked.js';
|
|
143
143
|
export { CPopoverPlugin } from './components/popover/index.js';
|
|
144
144
|
export { CPopover } from './components/popover/CPopover.js';
|
|
145
|
+
export { CRating } from './components/rating/CRating.js';
|
|
146
|
+
export { CRatingPlugin } from './components/rating/index.js';
|
|
145
147
|
export { CSidebarPlugin } from './components/sidebar/index.js';
|
|
146
148
|
export { CSidebar } from './components/sidebar/CSidebar.js';
|
|
147
149
|
export { CSidebarBrand } from './components/sidebar/CSidebarBrand.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Components","Directives"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":["Components","Directives"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,SAAS,GAAG;AAChB,IAAA,OAAO,EAAE,CAAC,GAAQ,KAAU;AAC1B,QAAA,KAAK,MAAM,GAAG,IAAIA,KAAU,EAAE;YAC5B,GAAG,CAAC,SAAS,CAAC,GAAG,EAAGA,KAAqC,CAAC,GAAG,CAAC,CAAC,CAAA;SAChE;AAED,QAAA,KAAK,MAAM,GAAG,IAAIC,OAAU,EAAE;AAC5B,YAAA,GAAG,CAAC,SAAS,CACVA,OAAqC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,EAClDA,OAAqC,CAAC,GAAG,CAAC,CAC5C,CAAA;SACF;KACF;;;;;"}
|