@onereach/ui-components 11.2.1 → 11.2.2-beta.4403.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/dist/bundled/v2/components/OrRatingV3/OrRating.js +16 -14
- package/dist/bundled/v2/components/OrRatingV3/OrRating.vue.d.ts +12 -12
- package/dist/bundled/v2/components/OrRatingV3/types.d.ts +2 -0
- package/dist/bundled/v3/components/OrRatingV3/OrRating.js +1 -1
- package/dist/bundled/v3/components/OrRatingV3/OrRating.vue.d.ts +8 -8
- package/dist/bundled/v3/components/OrRatingV3/index.js +1 -1
- package/dist/bundled/v3/components/OrRatingV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrRatingV3/types.d.ts +2 -0
- package/dist/bundled/v3/components/{OrRatingV3-7ee136ba.js → OrRatingV3-df6e78b0.js} +16 -14
- package/dist/bundled/v3/components/index.js +1 -1
- package/dist/bundled/v3/index.js +1 -1
- package/dist/esm/v2/{OrRating-dfceb6bb.js → OrRating-2be5ccfb.js} +16 -14
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-rating-v3/OrRating.vue.d.ts +12 -12
- package/dist/esm/v2/components/or-rating-v3/index.js +1 -1
- package/dist/esm/v2/components/or-rating-v3/types.d.ts +2 -0
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v3/{OrRating-dc69e378.js → OrRating-cd40504a.js} +16 -14
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-rating-v3/OrRating.vue.d.ts +8 -8
- package/dist/esm/v3/components/or-rating-v3/index.js +1 -1
- package/dist/esm/v3/components/or-rating-v3/types.d.ts +2 -0
- package/dist/esm/v3/index.js +1 -1
- package/package.json +2 -3
- package/src/components/or-rating-v3/OrRating.vue +15 -15
- package/src/components/or-rating-v3/types.ts +4 -0
|
@@ -16,8 +16,8 @@ var script = defineComponent({
|
|
|
16
16
|
},
|
|
17
17
|
props: {
|
|
18
18
|
modelValue: {
|
|
19
|
-
type:
|
|
20
|
-
default:
|
|
19
|
+
type: undefined,
|
|
20
|
+
default: undefined
|
|
21
21
|
},
|
|
22
22
|
variant: {
|
|
23
23
|
type: String,
|
|
@@ -42,10 +42,12 @@ var script = defineComponent({
|
|
|
42
42
|
// Options
|
|
43
43
|
const length = inject(RATING_LENGTH, 5);
|
|
44
44
|
// State
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit, {
|
|
46
|
+
defaultValue: ref(0)
|
|
47
|
+
});
|
|
48
|
+
const draft = ref(model.value);
|
|
49
|
+
watch(model, value => {
|
|
50
|
+
draft.value = Math.floor(value * 2) / 2;
|
|
49
51
|
});
|
|
50
52
|
const hoverIndex = reactive(Array(length).fill(false));
|
|
51
53
|
// Handlers
|
|
@@ -56,19 +58,19 @@ var script = defineComponent({
|
|
|
56
58
|
const {
|
|
57
59
|
width
|
|
58
60
|
} = event.currentTarget.getBoundingClientRect();
|
|
59
|
-
|
|
61
|
+
draft.value = Math.ceil((index - (width - event.offsetX) / width + 1) * 2) / 2;
|
|
60
62
|
}
|
|
61
63
|
function onMouseLeave(event, index) {
|
|
62
64
|
hoverIndex[index] = false;
|
|
63
|
-
|
|
65
|
+
draft.value = model.value;
|
|
64
66
|
}
|
|
65
67
|
return {
|
|
66
68
|
length,
|
|
67
69
|
root,
|
|
68
70
|
rootStyles,
|
|
69
71
|
starStyles,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
model,
|
|
73
|
+
draft,
|
|
72
74
|
hoverIndex,
|
|
73
75
|
onMouseEnter,
|
|
74
76
|
onMouseMove,
|
|
@@ -98,7 +100,7 @@ var __vue_render__ = function () {
|
|
|
98
100
|
refInFor: true,
|
|
99
101
|
class: _vm.starStyles,
|
|
100
102
|
attrs: {
|
|
101
|
-
"activated": value <= Math.ceil(_vm.
|
|
103
|
+
"activated": value <= Math.ceil(_vm.model),
|
|
102
104
|
"disabled": _vm.disabled
|
|
103
105
|
},
|
|
104
106
|
on: {
|
|
@@ -112,14 +114,14 @@ var __vue_render__ = function () {
|
|
|
112
114
|
return _vm.onMouseLeave($event, value - 1);
|
|
113
115
|
},
|
|
114
116
|
"click": function ($event) {
|
|
115
|
-
_vm.
|
|
117
|
+
_vm.model = _vm.draft;
|
|
116
118
|
_vm.hoverIndex[value - 1] = false;
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
}, [_c('OrIcon', {
|
|
120
122
|
attrs: {
|
|
121
|
-
"icon": _vm.
|
|
122
|
-
"variant": value <= _vm.
|
|
123
|
+
"icon": _vm.draft - value + 1 === 0.5 ? 'star_half' : 'star',
|
|
124
|
+
"variant": value <= _vm.draft ? 'filled' : 'outlined',
|
|
123
125
|
"size": _vm.variant === 'fitted' ? 'inherit' : _vm.hoverIndex[value - 1] ? 'xl' : 'l'
|
|
124
126
|
}
|
|
125
127
|
})], 1);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import { RatingVariant } from './types';
|
|
2
|
+
import { RatingModelValue, RatingVariant } from './types';
|
|
3
3
|
export declare const RATING_LENGTH: unique symbol;
|
|
4
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
5
5
|
length: number;
|
|
6
6
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
7
7
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
8
8
|
starStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
model: import("../../hooks").UseProxyModelValueReturn<number>;
|
|
10
|
+
draft: import("@vue/composition-api").Ref<number>;
|
|
11
11
|
hoverIndex: boolean[];
|
|
12
12
|
onMouseEnter: (event: MouseEvent, index: number) => void;
|
|
13
13
|
onMouseMove: (event: MouseEvent, index: number) => void;
|
|
14
14
|
onMouseLeave: (event: MouseEvent, index: number) => void;
|
|
15
15
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
16
16
|
modelValue: {
|
|
17
|
-
type:
|
|
18
|
-
default:
|
|
17
|
+
type: PropType<RatingModelValue>;
|
|
18
|
+
default: undefined;
|
|
19
19
|
};
|
|
20
20
|
variant: {
|
|
21
21
|
type: PropType<"default" | "fitted">;
|
|
@@ -31,8 +31,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
31
31
|
};
|
|
32
32
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
33
33
|
modelValue: {
|
|
34
|
-
type:
|
|
35
|
-
default:
|
|
34
|
+
type: PropType<RatingModelValue>;
|
|
35
|
+
default: undefined;
|
|
36
36
|
};
|
|
37
37
|
variant: {
|
|
38
38
|
type: PropType<"default" | "fitted">;
|
|
@@ -47,7 +47,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
47
47
|
default: boolean;
|
|
48
48
|
};
|
|
49
49
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
50
|
-
modelValue:
|
|
50
|
+
modelValue: RatingModelValue;
|
|
51
51
|
variant: "default" | "fitted";
|
|
52
52
|
readonly: boolean;
|
|
53
53
|
disabled: boolean;
|
|
@@ -58,21 +58,21 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
58
58
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
59
59
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
60
60
|
starStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
model: import("../../hooks").UseProxyModelValueReturn<number>;
|
|
62
|
+
draft: import("@vue/composition-api").Ref<number>;
|
|
63
63
|
hoverIndex: boolean[];
|
|
64
64
|
onMouseEnter: (event: MouseEvent, index: number) => void;
|
|
65
65
|
onMouseMove: (event: MouseEvent, index: number) => void;
|
|
66
66
|
onMouseLeave: (event: MouseEvent, index: number) => void;
|
|
67
67
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
68
|
-
modelValue:
|
|
68
|
+
modelValue: RatingModelValue;
|
|
69
69
|
variant: "default" | "fitted";
|
|
70
70
|
readonly: boolean;
|
|
71
71
|
disabled: boolean;
|
|
72
72
|
} & {} & {
|
|
73
73
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
74
74
|
}, {
|
|
75
|
-
modelValue:
|
|
75
|
+
modelValue: RatingModelValue;
|
|
76
76
|
variant: "default" | "fitted";
|
|
77
77
|
readonly: boolean;
|
|
78
78
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { d as RATING_LENGTH, s as default } from '../OrRatingV3-
|
|
1
|
+
export { d as RATING_LENGTH, s as default } from '../OrRatingV3-df6e78b0.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import { RatingVariant } from './types';
|
|
2
|
+
import { RatingModelValue, RatingVariant } from './types';
|
|
3
3
|
export declare const RATING_LENGTH: unique symbol;
|
|
4
4
|
declare const _default: import("vue-demi").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
6
|
-
type:
|
|
7
|
-
default:
|
|
6
|
+
type: PropType<RatingModelValue>;
|
|
7
|
+
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
variant: {
|
|
10
10
|
type: PropType<"default" | "fitted">;
|
|
@@ -23,16 +23,16 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
23
23
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
24
24
|
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
25
25
|
starStyles: import("vue-demi").ComputedRef<string[]>;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
model: import("../../hooks").UseProxyModelValueReturn<number>;
|
|
27
|
+
draft: import("vue-demi").Ref<number>;
|
|
28
28
|
hoverIndex: boolean[];
|
|
29
29
|
onMouseEnter: (event: MouseEvent, index: number) => void;
|
|
30
30
|
onMouseMove: (event: MouseEvent, index: number) => void;
|
|
31
31
|
onMouseLeave: (event: MouseEvent, index: number) => void;
|
|
32
32
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
33
33
|
modelValue: {
|
|
34
|
-
type:
|
|
35
|
-
default:
|
|
34
|
+
type: PropType<RatingModelValue>;
|
|
35
|
+
default: undefined;
|
|
36
36
|
};
|
|
37
37
|
variant: {
|
|
38
38
|
type: PropType<"default" | "fitted">;
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
49
49
|
}>> & {
|
|
50
50
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
modelValue:
|
|
52
|
+
modelValue: RatingModelValue;
|
|
53
53
|
variant: "default" | "fitted";
|
|
54
54
|
readonly: boolean;
|
|
55
55
|
disabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as OrRatingV3, R as RatingVariant } from '../OrRatingV3-
|
|
1
|
+
export { s as OrRatingV3, R as RatingVariant } from '../OrRatingV3-df6e78b0.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as Rating, c as RatingStar, b as RatingVariants } from '../OrRatingV3-
|
|
1
|
+
export { a as Rating, c as RatingStar, b as RatingVariants } from '../OrRatingV3-df6e78b0.js';
|
|
@@ -44,8 +44,8 @@ var script = defineComponent({
|
|
|
44
44
|
},
|
|
45
45
|
props: {
|
|
46
46
|
modelValue: {
|
|
47
|
-
type:
|
|
48
|
-
default:
|
|
47
|
+
type: undefined,
|
|
48
|
+
default: undefined
|
|
49
49
|
},
|
|
50
50
|
variant: {
|
|
51
51
|
type: String,
|
|
@@ -70,10 +70,12 @@ var script = defineComponent({
|
|
|
70
70
|
// Options
|
|
71
71
|
const length = inject(RATING_LENGTH, 5);
|
|
72
72
|
// State
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit, {
|
|
74
|
+
defaultValue: ref(0)
|
|
75
|
+
});
|
|
76
|
+
const draft = ref(model.value);
|
|
77
|
+
watch(model, value => {
|
|
78
|
+
draft.value = Math.floor(value * 2) / 2;
|
|
77
79
|
});
|
|
78
80
|
const hoverIndex = reactive(Array(length).fill(false));
|
|
79
81
|
// Handlers
|
|
@@ -84,19 +86,19 @@ var script = defineComponent({
|
|
|
84
86
|
const {
|
|
85
87
|
width
|
|
86
88
|
} = event.currentTarget.getBoundingClientRect();
|
|
87
|
-
|
|
89
|
+
draft.value = Math.ceil((index - (width - event.offsetX) / width + 1) * 2) / 2;
|
|
88
90
|
}
|
|
89
91
|
function onMouseLeave(event, index) {
|
|
90
92
|
hoverIndex[index] = false;
|
|
91
|
-
|
|
93
|
+
draft.value = model.value;
|
|
92
94
|
}
|
|
93
95
|
return {
|
|
94
96
|
length,
|
|
95
97
|
root,
|
|
96
98
|
rootStyles,
|
|
97
99
|
starStyles,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
model,
|
|
101
|
+
draft,
|
|
100
102
|
hoverIndex,
|
|
101
103
|
onMouseEnter,
|
|
102
104
|
onMouseMove,
|
|
@@ -119,18 +121,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
119
121
|
ref: 'stars',
|
|
120
122
|
key: value,
|
|
121
123
|
class: normalizeClass(_ctx.starStyles),
|
|
122
|
-
activated: value <= Math.ceil(_ctx.
|
|
124
|
+
activated: value <= Math.ceil(_ctx.model),
|
|
123
125
|
disabled: _ctx.disabled,
|
|
124
126
|
onMouseenter: $event => _ctx.onMouseEnter($event, value - 1),
|
|
125
127
|
onMousemove: $event => _ctx.onMouseMove($event, value - 1),
|
|
126
128
|
onMouseleave: $event => _ctx.onMouseLeave($event, value - 1),
|
|
127
129
|
onClick: $event => {
|
|
128
|
-
_ctx.
|
|
130
|
+
_ctx.model = _ctx.draft;
|
|
129
131
|
_ctx.hoverIndex[value - 1] = false;
|
|
130
132
|
}
|
|
131
133
|
}, [createVNode(_component_OrIcon, {
|
|
132
|
-
icon: _ctx.
|
|
133
|
-
variant: value <= _ctx.
|
|
134
|
+
icon: _ctx.draft - value + 1 === 0.5 ? 'star_half' : 'star',
|
|
135
|
+
variant: value <= _ctx.draft ? 'filled' : 'outlined',
|
|
134
136
|
size: _ctx.variant === 'fitted' ? 'inherit' : _ctx.hoverIndex[value - 1] ? 'xl' : 'l'
|
|
135
137
|
}, null, 8 /* PROPS */, ["icon", "variant", "size"])], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_2);
|
|
136
138
|
}), 128 /* KEYED_FRAGMENT */))], 10 /* CLASS, PROPS */, _hoisted_1);
|
|
@@ -81,7 +81,7 @@ export { default as OrRadioGroup } from './OrRadioGroup/OrRadioGroup.js';
|
|
|
81
81
|
export { default as OrRadioGroupV3 } from './OrRadioGroupV3/OrRadioGroup.js';
|
|
82
82
|
export { s as OrRadioV3 } from './OrRadioV3-1ee2699d.js';
|
|
83
83
|
export { s as OrRangeSliderV3 } from './OrRangeSliderV3-daf86dd4.js';
|
|
84
|
-
export { s as OrRatingV3, R as RatingVariant } from './OrRatingV3-
|
|
84
|
+
export { s as OrRatingV3, R as RatingVariant } from './OrRatingV3-df6e78b0.js';
|
|
85
85
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement } from './OrResizeablePanelV3-adcb500d.js';
|
|
86
86
|
export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditorV3-fe0c2321.js';
|
|
87
87
|
export { default as OrSearch } from './OrSearch/OrSearch.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -44,7 +44,7 @@ export { s as OrRadio } from './components/OrRadio-f7e867e2.js';
|
|
|
44
44
|
export { default as OrRadioGroup } from './components/OrRadioGroup/OrRadioGroup.js';
|
|
45
45
|
export { default as OrRadioGroupV3 } from './components/OrRadioGroupV3/OrRadioGroup.js';
|
|
46
46
|
export { s as OrRangeSliderV3 } from './components/OrRangeSliderV3-daf86dd4.js';
|
|
47
|
-
export { s as OrRatingV3, R as RatingVariant } from './components/OrRatingV3-
|
|
47
|
+
export { s as OrRatingV3, R as RatingVariant } from './components/OrRatingV3-df6e78b0.js';
|
|
48
48
|
export { F as Formats, s as OrRichTextEditorV3 } from './components/OrRichTextEditorV3-fe0c2321.js';
|
|
49
49
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './components/OrSegmentedControlV3-bedef411.js';
|
|
50
50
|
export { s as OrSelect } from './components/OrSelect-fdac646f.js';
|
|
@@ -49,8 +49,8 @@ var script = defineComponent({
|
|
|
49
49
|
},
|
|
50
50
|
props: {
|
|
51
51
|
modelValue: {
|
|
52
|
-
type:
|
|
53
|
-
default:
|
|
52
|
+
type: undefined,
|
|
53
|
+
default: undefined
|
|
54
54
|
},
|
|
55
55
|
variant: {
|
|
56
56
|
type: String,
|
|
@@ -75,10 +75,12 @@ var script = defineComponent({
|
|
|
75
75
|
// Options
|
|
76
76
|
const length = inject(RATING_LENGTH, 5);
|
|
77
77
|
// State
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit, {
|
|
79
|
+
defaultValue: ref(0)
|
|
80
|
+
});
|
|
81
|
+
const draft = ref(model.value);
|
|
82
|
+
watch(model, value => {
|
|
83
|
+
draft.value = Math.floor(value * 2) / 2;
|
|
82
84
|
});
|
|
83
85
|
const hoverIndex = reactive(Array(length).fill(false));
|
|
84
86
|
// Handlers
|
|
@@ -89,19 +91,19 @@ var script = defineComponent({
|
|
|
89
91
|
const {
|
|
90
92
|
width
|
|
91
93
|
} = event.currentTarget.getBoundingClientRect();
|
|
92
|
-
|
|
94
|
+
draft.value = Math.ceil((index - (width - event.offsetX) / width + 1) * 2) / 2;
|
|
93
95
|
}
|
|
94
96
|
function onMouseLeave(event, index) {
|
|
95
97
|
hoverIndex[index] = false;
|
|
96
|
-
|
|
98
|
+
draft.value = model.value;
|
|
97
99
|
}
|
|
98
100
|
return {
|
|
99
101
|
length,
|
|
100
102
|
root,
|
|
101
103
|
rootStyles,
|
|
102
104
|
starStyles,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
model,
|
|
106
|
+
draft,
|
|
105
107
|
hoverIndex,
|
|
106
108
|
onMouseEnter,
|
|
107
109
|
onMouseMove,
|
|
@@ -131,7 +133,7 @@ var __vue_render__ = function () {
|
|
|
131
133
|
refInFor: true,
|
|
132
134
|
class: _vm.starStyles,
|
|
133
135
|
attrs: {
|
|
134
|
-
"activated": value <= Math.ceil(_vm.
|
|
136
|
+
"activated": value <= Math.ceil(_vm.model),
|
|
135
137
|
"disabled": _vm.disabled
|
|
136
138
|
},
|
|
137
139
|
on: {
|
|
@@ -145,14 +147,14 @@ var __vue_render__ = function () {
|
|
|
145
147
|
return _vm.onMouseLeave($event, value - 1);
|
|
146
148
|
},
|
|
147
149
|
"click": function ($event) {
|
|
148
|
-
_vm.
|
|
150
|
+
_vm.model = _vm.draft;
|
|
149
151
|
_vm.hoverIndex[value - 1] = false;
|
|
150
152
|
}
|
|
151
153
|
}
|
|
152
154
|
}, [_c('OrIcon', {
|
|
153
155
|
attrs: {
|
|
154
|
-
"icon": _vm.
|
|
155
|
-
"variant": value <= _vm.
|
|
156
|
+
"icon": _vm.draft - value + 1 === 0.5 ? 'star_half' : 'star',
|
|
157
|
+
"variant": value <= _vm.draft ? 'filled' : 'outlined',
|
|
156
158
|
"size": _vm.variant === 'fitted' ? 'inherit' : _vm.hoverIndex[value - 1] ? 'xl' : 'l'
|
|
157
159
|
}
|
|
158
160
|
})], 1);
|
|
@@ -100,7 +100,7 @@ export { _ as OrRadioGroup } from '../OrRadioGroup-11424644.js';
|
|
|
100
100
|
export { _ as OrRadioGroupV3 } from '../OrRadioGroup-9d01d97d.js';
|
|
101
101
|
export { _ as OrRadioV3 } from '../OrRadio-b014fb70.js';
|
|
102
102
|
export { _ as OrRangeSliderV3 } from '../OrRangeSlider-8a0a82a1.js';
|
|
103
|
-
export { _ as OrRatingV3, R as RatingVariant } from '../OrRating-
|
|
103
|
+
export { _ as OrRatingV3, R as RatingVariant } from '../OrRating-2be5ccfb.js';
|
|
104
104
|
export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement } from '../OrResizeablePanel-fa8600ec.js';
|
|
105
105
|
export { F as Formats, _ as OrRichTextEditorV3 } from '../OrRichTextEditor-a5c133a1.js';
|
|
106
106
|
export { _ as OrSearch } from '../OrSearch-3f55fbee.js';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import { RatingVariant } from './types';
|
|
2
|
+
import { RatingModelValue, RatingVariant } from './types';
|
|
3
3
|
export declare const RATING_LENGTH: unique symbol;
|
|
4
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
5
5
|
length: number;
|
|
6
6
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
7
7
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
8
8
|
starStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
model: import("../../hooks").UseProxyModelValueReturn<number>;
|
|
10
|
+
draft: import("@vue/composition-api").Ref<number>;
|
|
11
11
|
hoverIndex: boolean[];
|
|
12
12
|
onMouseEnter: (event: MouseEvent, index: number) => void;
|
|
13
13
|
onMouseMove: (event: MouseEvent, index: number) => void;
|
|
14
14
|
onMouseLeave: (event: MouseEvent, index: number) => void;
|
|
15
15
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
16
16
|
modelValue: {
|
|
17
|
-
type:
|
|
18
|
-
default:
|
|
17
|
+
type: PropType<RatingModelValue>;
|
|
18
|
+
default: undefined;
|
|
19
19
|
};
|
|
20
20
|
variant: {
|
|
21
21
|
type: PropType<"default" | "fitted">;
|
|
@@ -31,8 +31,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
31
31
|
};
|
|
32
32
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
33
33
|
modelValue: {
|
|
34
|
-
type:
|
|
35
|
-
default:
|
|
34
|
+
type: PropType<RatingModelValue>;
|
|
35
|
+
default: undefined;
|
|
36
36
|
};
|
|
37
37
|
variant: {
|
|
38
38
|
type: PropType<"default" | "fitted">;
|
|
@@ -47,7 +47,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
47
47
|
default: boolean;
|
|
48
48
|
};
|
|
49
49
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
50
|
-
modelValue:
|
|
50
|
+
modelValue: RatingModelValue;
|
|
51
51
|
variant: "default" | "fitted";
|
|
52
52
|
readonly: boolean;
|
|
53
53
|
disabled: boolean;
|
|
@@ -58,21 +58,21 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
58
58
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
59
59
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
60
60
|
starStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
model: import("../../hooks").UseProxyModelValueReturn<number>;
|
|
62
|
+
draft: import("@vue/composition-api").Ref<number>;
|
|
63
63
|
hoverIndex: boolean[];
|
|
64
64
|
onMouseEnter: (event: MouseEvent, index: number) => void;
|
|
65
65
|
onMouseMove: (event: MouseEvent, index: number) => void;
|
|
66
66
|
onMouseLeave: (event: MouseEvent, index: number) => void;
|
|
67
67
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
68
|
-
modelValue:
|
|
68
|
+
modelValue: RatingModelValue;
|
|
69
69
|
variant: "default" | "fitted";
|
|
70
70
|
readonly: boolean;
|
|
71
71
|
disabled: boolean;
|
|
72
72
|
} & {} & {
|
|
73
73
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
74
74
|
}, {
|
|
75
|
-
modelValue:
|
|
75
|
+
modelValue: RatingModelValue;
|
|
76
76
|
variant: "default" | "fitted";
|
|
77
77
|
readonly: boolean;
|
|
78
78
|
disabled: boolean;
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -100,7 +100,7 @@ export { _ as OrRadioGroup } from './OrRadioGroup-11424644.js';
|
|
|
100
100
|
export { _ as OrRadioGroupV3 } from './OrRadioGroup-9d01d97d.js';
|
|
101
101
|
export { _ as OrRadioV3 } from './OrRadio-b014fb70.js';
|
|
102
102
|
export { _ as OrRangeSliderV3 } from './OrRangeSlider-8a0a82a1.js';
|
|
103
|
-
export { _ as OrRatingV3, R as RatingVariant } from './OrRating-
|
|
103
|
+
export { _ as OrRatingV3, R as RatingVariant } from './OrRating-2be5ccfb.js';
|
|
104
104
|
export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement } from './OrResizeablePanel-fa8600ec.js';
|
|
105
105
|
export { F as Formats, _ as OrRichTextEditorV3 } from './OrRichTextEditor-a5c133a1.js';
|
|
106
106
|
export { _ as OrSearch } from './OrSearch-3f55fbee.js';
|
|
@@ -49,8 +49,8 @@ var script = defineComponent({
|
|
|
49
49
|
},
|
|
50
50
|
props: {
|
|
51
51
|
modelValue: {
|
|
52
|
-
type:
|
|
53
|
-
default:
|
|
52
|
+
type: undefined,
|
|
53
|
+
default: undefined
|
|
54
54
|
},
|
|
55
55
|
variant: {
|
|
56
56
|
type: String,
|
|
@@ -75,10 +75,12 @@ var script = defineComponent({
|
|
|
75
75
|
// Options
|
|
76
76
|
const length = inject(RATING_LENGTH, 5);
|
|
77
77
|
// State
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit, {
|
|
79
|
+
defaultValue: ref(0)
|
|
80
|
+
});
|
|
81
|
+
const draft = ref(model.value);
|
|
82
|
+
watch(model, value => {
|
|
83
|
+
draft.value = Math.floor(value * 2) / 2;
|
|
82
84
|
});
|
|
83
85
|
const hoverIndex = reactive(Array(length).fill(false));
|
|
84
86
|
// Handlers
|
|
@@ -89,19 +91,19 @@ var script = defineComponent({
|
|
|
89
91
|
const {
|
|
90
92
|
width
|
|
91
93
|
} = event.currentTarget.getBoundingClientRect();
|
|
92
|
-
|
|
94
|
+
draft.value = Math.ceil((index - (width - event.offsetX) / width + 1) * 2) / 2;
|
|
93
95
|
}
|
|
94
96
|
function onMouseLeave(event, index) {
|
|
95
97
|
hoverIndex[index] = false;
|
|
96
|
-
|
|
98
|
+
draft.value = model.value;
|
|
97
99
|
}
|
|
98
100
|
return {
|
|
99
101
|
length,
|
|
100
102
|
root,
|
|
101
103
|
rootStyles,
|
|
102
104
|
starStyles,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
model,
|
|
106
|
+
draft,
|
|
105
107
|
hoverIndex,
|
|
106
108
|
onMouseEnter,
|
|
107
109
|
onMouseMove,
|
|
@@ -124,18 +126,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
124
126
|
ref: 'stars',
|
|
125
127
|
key: value,
|
|
126
128
|
class: normalizeClass(_ctx.starStyles),
|
|
127
|
-
activated: value <= Math.ceil(_ctx.
|
|
129
|
+
activated: value <= Math.ceil(_ctx.model),
|
|
128
130
|
disabled: _ctx.disabled,
|
|
129
131
|
onMouseenter: $event => _ctx.onMouseEnter($event, value - 1),
|
|
130
132
|
onMousemove: $event => _ctx.onMouseMove($event, value - 1),
|
|
131
133
|
onMouseleave: $event => _ctx.onMouseLeave($event, value - 1),
|
|
132
134
|
onClick: $event => {
|
|
133
|
-
_ctx.
|
|
135
|
+
_ctx.model = _ctx.draft;
|
|
134
136
|
_ctx.hoverIndex[value - 1] = false;
|
|
135
137
|
}
|
|
136
138
|
}, [createVNode(_component_OrIcon, {
|
|
137
|
-
icon: _ctx.
|
|
138
|
-
variant: value <= _ctx.
|
|
139
|
+
icon: _ctx.draft - value + 1 === 0.5 ? 'star_half' : 'star',
|
|
140
|
+
variant: value <= _ctx.draft ? 'filled' : 'outlined',
|
|
139
141
|
size: _ctx.variant === 'fitted' ? 'inherit' : _ctx.hoverIndex[value - 1] ? 'xl' : 'l'
|
|
140
142
|
}, null, 8 /* PROPS */, ["icon", "variant", "size"])], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_2);
|
|
141
143
|
}), 128 /* KEYED_FRAGMENT */))], 10 /* CLASS, PROPS */, _hoisted_1);
|
|
@@ -97,7 +97,7 @@ export { s as OrRadioGroup } from '../OrRadioGroup-00785e41.js';
|
|
|
97
97
|
export { s as OrRadioGroupV3 } from '../OrRadioGroup-1db95868.js';
|
|
98
98
|
export { s as OrRadioV3 } from '../OrRadio-85e4f28e.js';
|
|
99
99
|
export { s as OrRangeSliderV3 } from '../OrRangeSlider-ee94eca3.js';
|
|
100
|
-
export { s as OrRatingV3, R as RatingVariant } from '../OrRating-
|
|
100
|
+
export { s as OrRatingV3, R as RatingVariant } from '../OrRating-cd40504a.js';
|
|
101
101
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement } from '../OrResizeablePanel-40ade7d4.js';
|
|
102
102
|
export { F as Formats, s as OrRichTextEditorV3 } from '../OrRichTextEditor-32e38a29.js';
|
|
103
103
|
export { s as OrSearch } from '../OrSearch-740f931b.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
-
import { RatingVariant } from './types';
|
|
2
|
+
import { RatingModelValue, RatingVariant } from './types';
|
|
3
3
|
export declare const RATING_LENGTH: unique symbol;
|
|
4
4
|
declare const _default: import("vue-demi").DefineComponent<{
|
|
5
5
|
modelValue: {
|
|
6
|
-
type:
|
|
7
|
-
default:
|
|
6
|
+
type: PropType<RatingModelValue>;
|
|
7
|
+
default: undefined;
|
|
8
8
|
};
|
|
9
9
|
variant: {
|
|
10
10
|
type: PropType<"default" | "fitted">;
|
|
@@ -23,16 +23,16 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
23
23
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
24
24
|
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
25
25
|
starStyles: import("vue-demi").ComputedRef<string[]>;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
model: import("../../hooks").UseProxyModelValueReturn<number>;
|
|
27
|
+
draft: import("vue-demi").Ref<number>;
|
|
28
28
|
hoverIndex: boolean[];
|
|
29
29
|
onMouseEnter: (event: MouseEvent, index: number) => void;
|
|
30
30
|
onMouseMove: (event: MouseEvent, index: number) => void;
|
|
31
31
|
onMouseLeave: (event: MouseEvent, index: number) => void;
|
|
32
32
|
}, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
|
|
33
33
|
modelValue: {
|
|
34
|
-
type:
|
|
35
|
-
default:
|
|
34
|
+
type: PropType<RatingModelValue>;
|
|
35
|
+
default: undefined;
|
|
36
36
|
};
|
|
37
37
|
variant: {
|
|
38
38
|
type: PropType<"default" | "fitted">;
|
|
@@ -49,7 +49,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
49
49
|
}>> & {
|
|
50
50
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
51
51
|
}, {
|
|
52
|
-
modelValue:
|
|
52
|
+
modelValue: RatingModelValue;
|
|
53
53
|
variant: "default" | "fitted";
|
|
54
54
|
readonly: boolean;
|
|
55
55
|
disabled: boolean;
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -97,7 +97,7 @@ export { s as OrRadioGroup } from './OrRadioGroup-00785e41.js';
|
|
|
97
97
|
export { s as OrRadioGroupV3 } from './OrRadioGroup-1db95868.js';
|
|
98
98
|
export { s as OrRadioV3 } from './OrRadio-85e4f28e.js';
|
|
99
99
|
export { s as OrRangeSliderV3 } from './OrRangeSlider-ee94eca3.js';
|
|
100
|
-
export { s as OrRatingV3, R as RatingVariant } from './OrRating-
|
|
100
|
+
export { s as OrRatingV3, R as RatingVariant } from './OrRating-cd40504a.js';
|
|
101
101
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement } from './OrResizeablePanel-40ade7d4.js';
|
|
102
102
|
export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditor-32e38a29.js';
|
|
103
103
|
export { s as OrSearch } from './OrSearch-740f931b.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "11.2.
|
|
3
|
+
"version": "11.2.2-beta.4403.0",
|
|
4
4
|
"npmUnpacked": "4.15.2",
|
|
5
5
|
"description": "Vue components library for v2/3",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -179,6 +179,5 @@
|
|
|
179
179
|
"default": "./dist/bundled/v3/components/*/index.js"
|
|
180
180
|
},
|
|
181
181
|
"./package.json": "./package.json"
|
|
182
|
-
}
|
|
183
|
-
"gitHead": "506838356e2e888a528b2945e9892901cb8c3444"
|
|
182
|
+
}
|
|
184
183
|
}
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
:ref="'stars'"
|
|
10
10
|
:key="value"
|
|
11
11
|
:class="starStyles"
|
|
12
|
-
:activated="value <= Math.ceil(
|
|
12
|
+
:activated="value <= Math.ceil(model)"
|
|
13
13
|
:disabled="disabled"
|
|
14
14
|
@mouseenter="onMouseEnter($event, value - 1)"
|
|
15
15
|
@mousemove="onMouseMove($event, value - 1)"
|
|
16
16
|
@mouseleave="onMouseLeave($event, value - 1)"
|
|
17
|
-
@click="
|
|
17
|
+
@click="model = draft; hoverIndex[value - 1] = false"
|
|
18
18
|
>
|
|
19
19
|
<OrIcon
|
|
20
|
-
:icon="
|
|
21
|
-
:variant="value <=
|
|
20
|
+
:icon="draft - value + 1 === 0.5 ? 'star_half' : 'star'"
|
|
21
|
+
:variant="value <= draft ? 'filled' : 'outlined'"
|
|
22
22
|
:size="variant === 'fitted' ? 'inherit' : hoverIndex[value - 1] ? 'xl' : 'l'"
|
|
23
23
|
/>
|
|
24
24
|
</div>
|
|
@@ -30,7 +30,7 @@ import { PropType, computed, defineComponent, inject, reactive, ref, toRef, watc
|
|
|
30
30
|
import { useProxyModelValue } from '../../hooks';
|
|
31
31
|
import { OrIconV3 as OrIcon } from '../or-icon-v3';
|
|
32
32
|
import * as Styles from './styles';
|
|
33
|
-
import { RatingVariant } from './types';
|
|
33
|
+
import { RatingModelValue, RatingVariant } from './types';
|
|
34
34
|
|
|
35
35
|
export const RATING_LENGTH = Symbol();
|
|
36
36
|
|
|
@@ -48,8 +48,8 @@ export default defineComponent({
|
|
|
48
48
|
|
|
49
49
|
props: {
|
|
50
50
|
modelValue: {
|
|
51
|
-
type:
|
|
52
|
-
default:
|
|
51
|
+
type: undefined as unknown as PropType<RatingModelValue>,
|
|
52
|
+
default: undefined,
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
variant: {
|
|
@@ -95,11 +95,11 @@ export default defineComponent({
|
|
|
95
95
|
const length = inject(RATING_LENGTH, 5);
|
|
96
96
|
|
|
97
97
|
// State
|
|
98
|
-
const
|
|
99
|
-
const
|
|
98
|
+
const model = useProxyModelValue(toRef(props, 'modelValue'), context.emit, { defaultValue: ref(0) });
|
|
99
|
+
const draft = ref(model.value);
|
|
100
100
|
|
|
101
|
-
watch(
|
|
102
|
-
|
|
101
|
+
watch(model, (value) => {
|
|
102
|
+
draft.value = Math.floor(value * 2) / 2;
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
const hoverIndex = reactive(Array<boolean>(length).fill(false));
|
|
@@ -112,13 +112,13 @@ export default defineComponent({
|
|
|
112
112
|
function onMouseMove(event: MouseEvent, index: number): void {
|
|
113
113
|
const { width } = (event.currentTarget as Element).getBoundingClientRect();
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
draft.value = Math.ceil((index - (width - event.offsetX) / width + 1) * 2) / 2;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
function onMouseLeave(event: MouseEvent, index: number): void {
|
|
119
119
|
hoverIndex[index] = false;
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
draft.value = model.value;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
return {
|
|
@@ -129,8 +129,8 @@ export default defineComponent({
|
|
|
129
129
|
rootStyles,
|
|
130
130
|
starStyles,
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
model,
|
|
133
|
+
draft,
|
|
134
134
|
|
|
135
135
|
hoverIndex,
|
|
136
136
|
|