@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,2 @@
1
+ export { b as RATING_LENGTH, _ as default } from '../OrRatingV3-cdef097d.js';
2
+ import '../OrAvatar-f32ddb1f.js';
@@ -0,0 +1,56 @@
1
+ export declare const RATING_LENGTH: unique symbol;
2
+ declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
3
+ length: number;
4
+ root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
5
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
6
+ starStyles: import("@vue/composition-api").ComputedRef<string[]>;
7
+ proxyModelValue: import("../../hooks").UseProxyModelValueReturn<number>;
8
+ draftModelValue: import("@vue/composition-api").Ref<number>;
9
+ hoverIndex: boolean[];
10
+ onMouseEnter: (event: MouseEvent, index: number) => void;
11
+ onMouseMove: (event: MouseEvent, index: number) => void;
12
+ onMouseLeave: (event: MouseEvent, index: number) => void;
13
+ }> & import("@vue/composition-api").Data, {}, {}, {
14
+ modelValue: {
15
+ type: NumberConstructor;
16
+ default: number;
17
+ };
18
+ disabled: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ }, import("@vue/composition-api").ExtractPropTypes<{
23
+ modelValue: {
24
+ type: NumberConstructor;
25
+ default: number;
26
+ };
27
+ disabled: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
32
+ modelValue: number;
33
+ disabled: boolean;
34
+ } & {} & {
35
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
36
+ }, import("@vue/composition-api").ShallowUnwrapRef<{
37
+ length: number;
38
+ root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
39
+ rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
40
+ starStyles: import("@vue/composition-api").ComputedRef<string[]>;
41
+ proxyModelValue: import("../../hooks").UseProxyModelValueReturn<number>;
42
+ draftModelValue: import("@vue/composition-api").Ref<number>;
43
+ hoverIndex: boolean[];
44
+ onMouseEnter: (event: MouseEvent, index: number) => void;
45
+ onMouseMove: (event: MouseEvent, index: number) => void;
46
+ onMouseLeave: (event: MouseEvent, index: number) => void;
47
+ }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
48
+ modelValue: number;
49
+ disabled: boolean;
50
+ } & {} & {
51
+ [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
52
+ }, {
53
+ modelValue: number;
54
+ disabled: boolean;
55
+ }, true>);
56
+ export default _default;
@@ -0,0 +1 @@
1
+ export { default as OrRatingV3 } from './OrRating.vue';
@@ -0,0 +1 @@
1
+ export { _ as OrRatingV3 } from '../OrRatingV3-cdef097d.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-cdef097d.js';
@@ -0,0 +1,156 @@
1
+ import { defineComponent, inject, ref, computed, toRef, watch, reactive } from 'vue-demi';
2
+ import { _ as __vue_component__$1 } from './OrIconV3-5d1d188a.js';
3
+ import { u as useProxyModelValue } from './OrBottomSheetV3-c8001cd5.js';
4
+ import { n as normalizeComponent } from './OrAvatar-f32ddb1f.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: __vue_component__$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
+ /* script */
89
+ const __vue_script__ = script;
90
+
91
+ /* template */
92
+ var __vue_render__ = function () {
93
+ var _vm = this;
94
+ var _h = _vm.$createElement;
95
+ var _c = _vm._self._c || _h;
96
+ return _c('div', {
97
+ ref: "root",
98
+ class: _vm.rootStyles,
99
+ attrs: {
100
+ "disabled": _vm.disabled
101
+ }
102
+ }, _vm._l(_vm.length, function (value) {
103
+ return _c('div', {
104
+ key: value,
105
+ ref: "stars",
106
+ refInFor: true,
107
+ class: _vm.starStyles,
108
+ attrs: {
109
+ "activated": value <= Math.ceil(_vm.proxyModelValue),
110
+ "disabled": _vm.disabled
111
+ },
112
+ on: {
113
+ "mouseenter": function ($event) {
114
+ return _vm.onMouseEnter($event, value - 1);
115
+ },
116
+ "mousemove": function ($event) {
117
+ return _vm.onMouseMove($event, value - 1);
118
+ },
119
+ "mouseleave": function ($event) {
120
+ return _vm.onMouseLeave($event, value - 1);
121
+ },
122
+ "click": function ($event) {
123
+ _vm.proxyModelValue = _vm.draftModelValue;
124
+ }
125
+ }
126
+ }, [_c('OrIcon', {
127
+ attrs: {
128
+ "icon": _vm.draftModelValue - value + 1 === 0.5 ? 'star_half' : 'star',
129
+ "variant": value <= _vm.draftModelValue ? 'filled' : 'outlined',
130
+ "size": _vm.hoverIndex[value - 1] ? 'xl' : 'l'
131
+ }
132
+ })], 1);
133
+ }), 0);
134
+ };
135
+ var __vue_staticRenderFns__ = [];
136
+
137
+ /* style */
138
+ const __vue_inject_styles__ = undefined;
139
+ /* scoped */
140
+ const __vue_scope_id__ = undefined;
141
+ /* module identifier */
142
+ const __vue_module_identifier__ = undefined;
143
+ /* functional template */
144
+ const __vue_is_functional_template__ = false;
145
+ /* style inject */
146
+
147
+ /* style inject SSR */
148
+
149
+ /* style inject shadow dom */
150
+
151
+ const __vue_component__ = /*#__PURE__*/normalizeComponent({
152
+ render: __vue_render__,
153
+ staticRenderFns: __vue_staticRenderFns__
154
+ }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
155
+
156
+ export { Rating as R, __vue_component__ as _, RatingStar as a, RATING_LENGTH as b };
@@ -1,2 +1,2 @@
1
- export { _ as default } from '../OrTagInputV3-697eb4bf.js';
1
+ export { _ as default } from '../OrTagInputV3-69f191d0.js';
2
2
  import '../OrAvatar-f32ddb1f.js';
@@ -90,10 +90,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
90
90
  type: BooleanConstructor;
91
91
  default: boolean;
92
92
  };
93
- saveDraftValueOnClickOutside: {
94
- type: BooleanConstructor;
95
- default: boolean;
96
- };
97
93
  }, import("@vue/composition-api").ExtractPropTypes<{
98
94
  modelValue: {
99
95
  type: PropType<string[]>;
@@ -139,10 +135,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
139
135
  type: BooleanConstructor;
140
136
  default: boolean;
141
137
  };
142
- saveDraftValueOnClickOutside: {
143
- type: BooleanConstructor;
144
- default: boolean;
145
- };
146
138
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
147
139
  modelValue: string[];
148
140
  label: string;
@@ -155,7 +147,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
155
147
  disableDefaultStyles: boolean;
156
148
  overflow: "default" | "wrap" | "hidden" | "scroll";
157
149
  enableClear: boolean;
158
- saveDraftValueOnClickOutside: boolean;
159
150
  } & {} & {
160
151
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
161
152
  }, import("@vue/composition-api").ShallowUnwrapRef<{
@@ -215,7 +206,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
215
206
  disableDefaultStyles: boolean;
216
207
  overflow: "default" | "wrap" | "hidden" | "scroll";
217
208
  enableClear: boolean;
218
- saveDraftValueOnClickOutside: boolean;
219
209
  } & {} & {
220
210
  [x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
221
211
  }, {
@@ -230,6 +220,5 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
230
220
  disableDefaultStyles: boolean;
231
221
  overflow: "default" | "wrap" | "hidden" | "scroll";
232
222
  enableClear: boolean;
233
- saveDraftValueOnClickOutside: boolean;
234
223
  }, true>);
235
224
  export default _default;
@@ -1,2 +1,2 @@
1
- export { _ as OrTagInputV3 } from '../OrTagInputV3-697eb4bf.js';
1
+ export { _ as OrTagInputV3 } from '../OrTagInputV3-69f191d0.js';
2
2
  export { I as TagInputSize } from '../OrInputBoxV3-14649b7c.js';
@@ -1 +1 @@
1
- export { T as TagInput, a as TagInputControl, b as TagInputItem } from '../OrTagInputV3-697eb4bf.js';
1
+ export { T as TagInput, a as TagInputControl, b as TagInputItem } from '../OrTagInputV3-69f191d0.js';
@@ -82,10 +82,6 @@ var script = defineComponent({
82
82
  enableClear: {
83
83
  type: Boolean,
84
84
  default: true
85
- },
86
- saveDraftValueOnClickOutside: {
87
- type: Boolean,
88
- default: false
89
85
  }
90
86
  },
91
87
  emits: ['update:modelValue', 'keydown', 'keyup', 'focus', 'blur', 'reset'],
@@ -102,8 +98,7 @@ var script = defineComponent({
102
98
  overflow,
103
99
  placeholder,
104
100
  disabled,
105
- readonly,
106
- saveDraftValueOnClickOutside
101
+ readonly
107
102
  } = toRefs(props);
108
103
  // Styles
109
104
  const rootStyles = computed(() => ['or-tag-input-v3', ...TagInput]);
@@ -174,7 +169,6 @@ var script = defineComponent({
174
169
  onClickOutside(inputBox, () => {
175
170
  var _a, _b;
176
171
  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;
177
- if (saveDraftValueOnClickOutside.value) add();
178
172
  deactivate();
179
173
  });
180
174
  watch(proxyModelValue, (items, prevItems) => {
@@ -210,7 +204,7 @@ var script = defineComponent({
210
204
  }
211
205
  });
212
206
 
213
- var css_248z = "input[data-v-6e446c91]{min-width:0;background:0 0;outline:0}";
207
+ var css_248z = "input[data-v-5083e0d4]{min-width:0;background:0 0;outline:0}";
214
208
  styleInject(css_248z);
215
209
 
216
210
  /* script */
@@ -382,7 +376,7 @@ var __vue_staticRenderFns__ = [];
382
376
  /* style */
383
377
  const __vue_inject_styles__ = undefined;
384
378
  /* scoped */
385
- const __vue_scope_id__ = "data-v-6e446c91";
379
+ const __vue_scope_id__ = "data-v-5083e0d4";
386
380
  /* module identifier */
387
381
  const __vue_module_identifier__ = undefined;
388
382
  /* functional template */
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue2").ComponentOptions<import("vue2").default, import("@vue/composition-api").ShallowUnwrapRef<{
1
+ declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
2
2
  inputRef: import("@vue/composition-api").Ref<HTMLTextAreaElement | undefined>;
3
3
  }> & {
4
4
  reqAF: any;
@@ -106,7 +106,7 @@ declare const _default: import("vue2").ComponentOptions<import("vue2").default,
106
106
  isDisabled: BooleanConstructor;
107
107
  isReadonly: BooleanConstructor;
108
108
  isInvalid: BooleanConstructor;
109
- }>> & Omit<import("vue2").VueConstructor<import("vue2").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
109
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
110
110
  modelValue: string;
111
111
  isSmall: boolean;
112
112
  isRequired: boolean;
@@ -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 { _ as OrRadioV3 } from './OrRadioV3-9e90e1b8.js';
79
79
  export { _ as OrRangeSliderV3 } from './OrRangeSliderV3-280b8864.js';
80
80
  export { _ as OrSliderV3, S as RangeSliderColor, a as RangeSliderOrientation, S as SliderColor, a as SliderOrientation } from './OrSliderV3-f3a65a56.js';
81
+ export { _ as OrRatingV3 } from './OrRatingV3-cdef097d.js';
81
82
  export { _ as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement, R as SidebarPadding } from './OrResizeablePanelV3-93accac1.js';
82
83
  export { F as Formats, _ as OrRichTextEditorV3 } from './OrRichTextEditorV3-720917c5.js';
83
84
  export { default as OrSearch } from './OrSearch/OrSearch.js';
@@ -101,7 +102,7 @@ export { _ as OrTabV3 } from './OrTabV3-c7dd4c84.js';
101
102
  export { default as OrTabs } from './OrTabs/OrTabs.js';
102
103
  export { _ as OrTabsV3, T as TabsVariant } from './OrTabsV3-d7fe1568.js';
103
104
  export { default as OrTag } from './OrTag/OrTag.js';
104
- export { _ as OrTagInputV3 } from './OrTagInputV3-697eb4bf.js';
105
+ export { _ as OrTagInputV3 } from './OrTagInputV3-69f191d0.js';
105
106
  export { _ as OrTagV3, a as TagColor, T as TagVariant } from './OrTagV3-071da959.js';
106
107
  export { _ as OrTagsV3, T as TagsOverflow } from './OrTagsV3-f89f00ff.js';
107
108
  export { _ as OrTeleport } from './OrTeleport-a1a9f326.js';