@onereach/ui-components 8.13.0-beta.3770.0 → 8.13.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 (59) hide show
  1. package/dist/bundled/v2/components/OrRatingV3/OrRating.js +2 -0
  2. package/dist/bundled/v2/components/OrRatingV3/OrRating.vue.d.ts +56 -0
  3. package/dist/bundled/v2/components/OrRatingV3/index.d.ts +1 -0
  4. package/dist/bundled/v2/components/OrRatingV3/index.js +1 -0
  5. package/dist/bundled/v2/components/OrRatingV3/styles.d.ts +2 -0
  6. package/dist/bundled/v2/components/OrRatingV3/styles.js +1 -0
  7. package/dist/bundled/v2/components/OrRatingV3-cdef097d.js +156 -0
  8. package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.js +1 -1
  9. package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.vue.d.ts +0 -11
  10. package/dist/bundled/v2/components/OrTagInputV3/index.js +1 -1
  11. package/dist/bundled/v2/components/OrTagInputV3/styles.js +1 -1
  12. package/dist/bundled/v2/components/{OrTagInputV3-697eb4bf.js → OrTagInputV3-69f191d0.js} +3 -9
  13. package/dist/bundled/v2/components/OrTextarea/OrTextarea.vue.d.ts +2 -2
  14. package/dist/bundled/v2/components/index.d.ts +1 -0
  15. package/dist/bundled/v2/components/index.js +2 -1
  16. package/dist/bundled/v2/index.js +3 -2
  17. package/dist/bundled/v3/components/OrRatingV3/OrRating.js +1 -0
  18. package/dist/bundled/v3/components/OrRatingV3/OrRating.vue.d.ts +37 -0
  19. package/dist/bundled/v3/components/OrRatingV3/index.d.ts +1 -0
  20. package/dist/bundled/v3/components/OrRatingV3/index.js +1 -0
  21. package/dist/bundled/v3/components/OrRatingV3/styles.d.ts +2 -0
  22. package/dist/bundled/v3/components/OrRatingV3/styles.js +1 -0
  23. package/dist/bundled/v3/components/OrRatingV3-a63edd01.js +119 -0
  24. package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.js +1 -1
  25. package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.vue.d.ts +0 -9
  26. package/dist/bundled/v3/components/OrTagInputV3/index.js +1 -1
  27. package/dist/bundled/v3/components/OrTagInputV3/styles.js +1 -1
  28. package/dist/bundled/v3/components/{OrTagInputV3-e511c0bf.js → OrTagInputV3-820b890f.js} +1 -7
  29. package/dist/bundled/v3/components/index.d.ts +1 -0
  30. package/dist/bundled/v3/components/index.js +2 -1
  31. package/dist/bundled/v3/index.js +3 -2
  32. package/dist/esm/v2/OrRating-2aaadb46.js +160 -0
  33. package/dist/esm/v2/{OrTagInput-e7b69c98.js → OrTagInput-a2905657.js} +3 -9
  34. package/dist/esm/v2/components/index.d.ts +1 -0
  35. package/dist/esm/v2/components/index.js +2 -1
  36. package/dist/esm/v2/components/or-rating-v3/OrRating.vue.d.ts +56 -0
  37. package/dist/esm/v2/components/or-rating-v3/index.d.ts +1 -0
  38. package/dist/esm/v2/components/or-rating-v3/index.js +11 -0
  39. package/dist/esm/v2/components/or-rating-v3/styles.d.ts +2 -0
  40. package/dist/esm/v2/components/or-tag-input-v3/OrTagInput.vue.d.ts +0 -11
  41. package/dist/esm/v2/components/or-tag-input-v3/index.js +1 -1
  42. package/dist/esm/v2/index.js +2 -1
  43. package/dist/esm/v3/OrRating-fdb024b7.js +123 -0
  44. package/dist/esm/v3/{OrTagInput-1290510b.js → OrTagInput-4a9158c9.js} +1 -7
  45. package/dist/esm/v3/components/index.d.ts +1 -0
  46. package/dist/esm/v3/components/index.js +2 -1
  47. package/dist/esm/v3/components/or-rating-v3/OrRating.vue.d.ts +37 -0
  48. package/dist/esm/v3/components/or-rating-v3/index.d.ts +1 -0
  49. package/dist/esm/v3/components/or-rating-v3/index.js +11 -0
  50. package/dist/esm/v3/components/or-rating-v3/styles.d.ts +2 -0
  51. package/dist/esm/v3/components/or-tag-input-v3/OrTagInput.vue.d.ts +0 -9
  52. package/dist/esm/v3/components/or-tag-input-v3/index.js +1 -1
  53. package/dist/esm/v3/index.js +2 -1
  54. package/package.json +4 -3
  55. package/src/components/index.ts +1 -0
  56. package/src/components/or-rating-v3/OrRating.vue +129 -0
  57. package/src/components/or-rating-v3/index.ts +1 -0
  58. package/src/components/or-rating-v3/styles.ts +28 -0
  59. package/src/components/or-tag-input-v3/OrTagInput.vue +1 -7
@@ -0,0 +1 @@
1
+ export { b as RATING_LENGTH, s as default } from '../OrRatingV3-a63edd01.js';
@@ -0,0 +1,37 @@
1
+ export declare const RATING_LENGTH: unique symbol;
2
+ declare const _default: import("vue-demi").DefineComponent<{
3
+ modelValue: {
4
+ type: NumberConstructor;
5
+ default: number;
6
+ };
7
+ disabled: {
8
+ type: BooleanConstructor;
9
+ default: boolean;
10
+ };
11
+ }, {
12
+ length: number;
13
+ root: import("vue-demi").Ref<HTMLElement | undefined>;
14
+ rootStyles: import("vue-demi").ComputedRef<string[]>;
15
+ starStyles: import("vue-demi").ComputedRef<string[]>;
16
+ proxyModelValue: import("../../hooks").UseProxyModelValueReturn<number>;
17
+ draftModelValue: import("vue-demi").Ref<number>;
18
+ hoverIndex: boolean[];
19
+ onMouseEnter: (event: MouseEvent, index: number) => void;
20
+ onMouseMove: (event: MouseEvent, index: number) => void;
21
+ onMouseLeave: (event: MouseEvent, index: number) => void;
22
+ }, 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<{
23
+ modelValue: {
24
+ type: NumberConstructor;
25
+ default: number;
26
+ };
27
+ disabled: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ }>> & {
32
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
33
+ }, {
34
+ modelValue: number;
35
+ disabled: boolean;
36
+ }>;
37
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as OrRatingV3 } from './OrRating.vue';
@@ -0,0 +1 @@
1
+ export { s as OrRatingV3 } from '../OrRatingV3-a63edd01.js';
@@ -0,0 +1,2 @@
1
+ export declare const Rating: string[];
2
+ export declare const RatingStar: string[];
@@ -0,0 +1 @@
1
+ export { R as Rating, a as RatingStar } from '../OrRatingV3-a63edd01.js';
@@ -0,0 +1,119 @@
1
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createVNode } from 'vue';
2
+ import { defineComponent, inject, ref, computed, toRef, watch, reactive } from 'vue-demi';
3
+ import { s as script$1 } from './OrIconV3-85d7d26b.js';
4
+ import { u as useProxyModelValue } from './OrBottomSheetV3-74a98d9e.js';
5
+
6
+ const Rating = [
7
+ // Layout
8
+ 'layout-row',
9
+ // Theme
10
+ 'theme-foreground-disabled', 'dark:theme-foreground-disabled-dark'];
11
+ const RatingStar = [
12
+ // Layout
13
+ 'layout-row justify-center',
14
+ // Interactivity
15
+ 'interactivity-click',
16
+ // Box
17
+ 'w-[28px] md:w-[24px]', 'h-[28px] md:h-[24px]',
18
+ // Theme (activated)
19
+ 'activated:text-warning-hover', 'dark:activated:text-warning-hover-dark',
20
+ // Theme (disabled)
21
+ 'disabled:text-disabled', 'dark:disabled:text-disabled-dark'];
22
+
23
+ const RATING_LENGTH = Symbol();
24
+ var script = defineComponent({
25
+ components: {
26
+ OrIcon: script$1
27
+ },
28
+ model: {
29
+ prop: 'modelValue',
30
+ event: 'update:modelValue'
31
+ },
32
+ props: {
33
+ modelValue: {
34
+ type: Number,
35
+ default: 0
36
+ },
37
+ disabled: {
38
+ type: Boolean,
39
+ default: false
40
+ }
41
+ },
42
+ emits: ['update:modelValue'],
43
+ expose: ['root'],
44
+ setup(props, context) {
45
+ // Options
46
+ const length = inject(RATING_LENGTH, 5);
47
+ // Refs
48
+ const root = ref();
49
+ // Styles
50
+ const rootStyles = computed(() => ['or-rating-v3', ...Rating]);
51
+ const starStyles = computed(() => [...RatingStar]);
52
+ // State
53
+ const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
54
+ const draftModelValue = ref(proxyModelValue.value);
55
+ watch(proxyModelValue, value => {
56
+ draftModelValue.value = value;
57
+ });
58
+ const hoverIndex = reactive(Array(length).fill(false));
59
+ // Handlers
60
+ function onMouseEnter(event, index) {
61
+ hoverIndex[index] = true;
62
+ }
63
+ function onMouseMove(event, index) {
64
+ const {
65
+ width
66
+ } = event.currentTarget.getBoundingClientRect();
67
+ draftModelValue.value = Math.ceil((index - (width - event.offsetX) / width + 1) * 2) / 2;
68
+ }
69
+ function onMouseLeave(event, index) {
70
+ hoverIndex[index] = false;
71
+ draftModelValue.value = proxyModelValue.value;
72
+ }
73
+ return {
74
+ length,
75
+ root,
76
+ rootStyles,
77
+ starStyles,
78
+ proxyModelValue,
79
+ draftModelValue,
80
+ hoverIndex,
81
+ onMouseEnter,
82
+ onMouseMove,
83
+ onMouseLeave
84
+ };
85
+ }
86
+ });
87
+
88
+ const _hoisted_1 = ["disabled"];
89
+ const _hoisted_2 = ["activated", "disabled", "onMouseenter", "onMousemove", "onMouseleave"];
90
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
91
+ const _component_OrIcon = resolveComponent("OrIcon");
92
+ return openBlock(), createElementBlock("div", {
93
+ ref: "root",
94
+ class: normalizeClass(_ctx.rootStyles),
95
+ disabled: _ctx.disabled
96
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.length, value => {
97
+ return openBlock(), createElementBlock("div", {
98
+ ref_for: true,
99
+ ref: "stars",
100
+ key: value,
101
+ class: normalizeClass(_ctx.starStyles),
102
+ activated: value <= Math.ceil(_ctx.proxyModelValue),
103
+ disabled: _ctx.disabled,
104
+ onMouseenter: $event => _ctx.onMouseEnter($event, value - 1),
105
+ onMousemove: $event => _ctx.onMouseMove($event, value - 1),
106
+ onMouseleave: $event => _ctx.onMouseLeave($event, value - 1),
107
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.proxyModelValue = _ctx.draftModelValue)
108
+ }, [createVNode(_component_OrIcon, {
109
+ icon: _ctx.draftModelValue - value + 1 === 0.5 ? 'star_half' : 'star',
110
+ variant: value <= _ctx.draftModelValue ? 'filled' : 'outlined',
111
+ size: _ctx.hoverIndex[value - 1] ? 'xl' : 'l'
112
+ }, null, 8 /* PROPS */, ["icon", "variant", "size"])], 42 /* CLASS, PROPS, HYDRATE_EVENTS */, _hoisted_2);
113
+ }), 128 /* KEYED_FRAGMENT */))], 10 /* CLASS, PROPS */, _hoisted_1);
114
+ }
115
+
116
+ script.render = render;
117
+ script.__file = "src/components/or-rating-v3/OrRating.vue";
118
+
119
+ export { Rating as R, RatingStar as a, RATING_LENGTH as b, script as s };
@@ -1 +1 @@
1
- export { s as default } from '../OrTagInputV3-e511c0bf.js';
1
+ export { s as default } from '../OrTagInputV3-820b890f.js';
@@ -45,10 +45,6 @@ declare const _default: import("vue-demi").DefineComponent<{
45
45
  type: BooleanConstructor;
46
46
  default: boolean;
47
47
  };
48
- saveDraftValueOnClickOutside: {
49
- type: BooleanConstructor;
50
- default: boolean;
51
- };
52
48
  }, {
53
49
  root: import("vue-demi").Ref<HTMLElement | undefined>;
54
50
  control: import("vue-demi").Ref<HTMLInputElement | undefined>;
@@ -131,10 +127,6 @@ declare const _default: import("vue-demi").DefineComponent<{
131
127
  type: BooleanConstructor;
132
128
  default: boolean;
133
129
  };
134
- saveDraftValueOnClickOutside: {
135
- type: BooleanConstructor;
136
- default: boolean;
137
- };
138
130
  }>> & {
139
131
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
140
132
  onKeydown?: ((...args: any[]) => any) | undefined;
@@ -154,6 +146,5 @@ declare const _default: import("vue-demi").DefineComponent<{
154
146
  disableDefaultStyles: boolean;
155
147
  overflow: "default" | "wrap" | "hidden" | "scroll";
156
148
  enableClear: boolean;
157
- saveDraftValueOnClickOutside: boolean;
158
149
  }>;
159
150
  export default _default;
@@ -1,2 +1,2 @@
1
- export { s as OrTagInputV3 } from '../OrTagInputV3-e511c0bf.js';
1
+ export { s as OrTagInputV3 } from '../OrTagInputV3-820b890f.js';
2
2
  export { I as TagInputSize } from '../OrInputBoxV3-158edd7f.js';
@@ -1 +1 @@
1
- export { T as TagInput, a as TagInputControl, b as TagInputItem } from '../OrTagInputV3-e511c0bf.js';
1
+ export { T as TagInput, a as TagInputControl, b as TagInputItem } from '../OrTagInputV3-820b890f.js';
@@ -83,10 +83,6 @@ var script = defineComponent({
83
83
  enableClear: {
84
84
  type: Boolean,
85
85
  default: true
86
- },
87
- saveDraftValueOnClickOutside: {
88
- type: Boolean,
89
- default: false
90
86
  }
91
87
  },
92
88
  emits: ['update:modelValue', 'keydown', 'keyup', 'focus', 'blur', 'reset'],
@@ -103,8 +99,7 @@ var script = defineComponent({
103
99
  overflow,
104
100
  placeholder,
105
101
  disabled,
106
- readonly,
107
- saveDraftValueOnClickOutside
102
+ readonly
108
103
  } = toRefs(props);
109
104
  // Styles
110
105
  const rootStyles = computed(() => ['or-tag-input-v3', ...TagInput]);
@@ -175,7 +170,6 @@ var script = defineComponent({
175
170
  onClickOutside(inputBox, () => {
176
171
  var _a, _b;
177
172
  if (activated.value === false || ((_b = (_a = tags.value) === null || _a === void 0 ? void 0 : _a.overflowPopover) === null || _b === void 0 ? void 0 : _b.state) === 'open') return;
178
- if (saveDraftValueOnClickOutside.value) add();
179
173
  deactivate();
180
174
  });
181
175
  watch(proxyModelValue, (items, prevItems) => {
@@ -77,6 +77,7 @@ export * from './or-radio-group';
77
77
  export * from './or-radio-group-v3';
78
78
  export * from './or-radio-v3';
79
79
  export * from './or-range-slider-v3';
80
+ export * from './or-rating-v3';
80
81
  export * from './or-resizeable-panel-v3';
81
82
  export * from './or-rich-text-editor-v3';
82
83
  export * from './or-search';
@@ -78,6 +78,7 @@ export { default as OrRadioGroupV3 } from './OrRadioGroupV3/OrRadioGroup.js';
78
78
  export { s as OrRadioV3 } from './OrRadioV3-480629da.js';
79
79
  export { s as OrRangeSliderV3 } from './OrRangeSliderV3-1383949e.js';
80
80
  export { s as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSliderV3-7d496e6b.js';
81
+ export { s as OrRatingV3 } from './OrRatingV3-a63edd01.js';
81
82
  export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanelV3-07812398.js';
82
83
  export { F as Formats, s as OrRichTextEditorV3 } from './OrRichTextEditorV3-d6ea8050.js';
83
84
  export { default as OrSearch } from './OrSearch/OrSearch.js';
@@ -101,7 +102,7 @@ export { s as OrTabV3 } from './OrTabV3-b041538e.js';
101
102
  export { default as OrTabs } from './OrTabs/OrTabs.js';
102
103
  export { s as OrTabsV3, T as TabsVariant } from './OrTabsV3-87c77545.js';
103
104
  export { default as OrTag } from './OrTag/OrTag.js';
104
- export { s as OrTagInputV3 } from './OrTagInputV3-e511c0bf.js';
105
+ export { s as OrTagInputV3 } from './OrTagInputV3-820b890f.js';
105
106
  export { s as OrTagV3, a as TagColor, T as TagVariant } from './OrTagV3-acb6e27c.js';
106
107
  export { s as OrTagsV3, T as TagsOverflow } from './OrTagsV3-2597d2e1.js';
107
108
  export { s as OrTeleport } from './OrTeleport-5a34b07f.js';