@onereach/ui-components 2.70.3-beta.2213.0 → 2.70.3-beta.2224.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 (186) hide show
  1. package/dist/bundled/v2/{OrCardCollection-89428bbf.js → OrCardCollection-166cfcc6.js} +5 -5
  2. package/dist/bundled/v2/{OrConfirm-56d01cff.js → OrConfirm-55b89b17.js} +4 -4
  3. package/dist/bundled/v2/{OrListOfInputs-8f076650.js → OrListOfInputs-ab7f9d97.js} +4 -4
  4. package/dist/bundled/v2/OrNumberInput-face8ccc.js +227 -0
  5. package/dist/bundled/v2/OrPassword-a818e7b5.js +227 -0
  6. package/dist/bundled/v2/{OrSearch-f7cfa52f.js → OrSearch-832d7978.js} +4 -4
  7. package/dist/bundled/v2/OrSidebar-c95ef614.js +230 -0
  8. package/dist/bundled/v2/{OrPassword-7da938aa.js → OrTextarea-71ff236d.js} +7 -449
  9. package/dist/bundled/v2/components/index.d.ts +5 -1
  10. package/dist/bundled/v2/components/index.js +10 -8
  11. package/dist/bundled/v2/components/or-card-collection/index.js +4 -4
  12. package/dist/bundled/v2/components/or-confirm/index.js +2 -2
  13. package/dist/bundled/v2/components/or-input/index.d.ts +1 -0
  14. package/dist/bundled/v2/components/or-input/index.js +13 -0
  15. package/dist/bundled/v2/components/or-list-of-inputs/index.js +2 -2
  16. package/dist/bundled/v2/components/or-number-input/index.d.ts +1 -0
  17. package/dist/bundled/v2/components/or-number-input/index.js +14 -0
  18. package/dist/bundled/v2/components/or-password/index.d.ts +1 -0
  19. package/dist/bundled/v2/components/{or-inputs → or-password}/index.js +3 -4
  20. package/dist/bundled/v2/components/or-search/index.d.ts +1 -0
  21. package/dist/bundled/v2/components/or-search/index.js +25 -0
  22. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  23. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  24. package/dist/bundled/v2/components/or-sidebar-v3/index.js +1 -13
  25. package/dist/bundled/v2/components/or-sidebar-v3/styles.d.ts +1 -8
  26. package/dist/bundled/v2/components/or-textarea/index.d.ts +1 -0
  27. package/dist/bundled/v2/components/or-textarea/index.js +13 -0
  28. package/dist/bundled/v2/index.js +10 -8
  29. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-d8124dda.js → OrCardCollection.vue_vue_type_script_lang-cd84f344.js} +4 -4
  30. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-0f16fc67.js → OrConfirm.vue_vue_type_script_lang-41b4d791.js} +2 -1
  31. package/dist/bundled/v3/{OrInput-7d4b571a.js → OrInput-704e72ba.js} +5 -193
  32. package/dist/bundled/v3/OrInput.vue_vue_type_script_lang-409235cc.js +190 -0
  33. package/dist/bundled/v3/{OrListOfInputs.vue_vue_type_script_lang-62dbf1e7.js → OrListOfInputs.vue_vue_type_script_lang-6c5cf7a5.js} +2 -1
  34. package/dist/bundled/v3/OrNumberInput.vue_vue_type_script_lang-f061d829.js +113 -0
  35. package/dist/bundled/v3/OrPassword.vue_vue_type_script_lang-b75f6543.js +99 -0
  36. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-16fbccc0.js → OrSearch.vue_vue_type_script_lang-5356fa79.js} +2 -1
  37. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-ce0b152c.js +181 -0
  38. package/dist/bundled/v3/OrTextarea.vue_vue_type_script_lang-69ea22e9.js +187 -0
  39. package/dist/bundled/v3/components/index.d.ts +5 -1
  40. package/dist/bundled/v3/components/index.js +11 -8
  41. package/dist/bundled/v3/components/or-card-collection/index.js +5 -4
  42. package/dist/bundled/v3/components/or-confirm/index.js +3 -2
  43. package/dist/bundled/v3/components/or-input/index.d.ts +1 -0
  44. package/dist/bundled/v3/components/or-input/index.js +14 -0
  45. package/dist/bundled/v3/components/or-list-of-inputs/index.js +3 -2
  46. package/dist/bundled/v3/components/or-number-input/index.d.ts +1 -0
  47. package/dist/bundled/v3/components/or-number-input/index.js +16 -0
  48. package/dist/bundled/v3/components/or-password/index.d.ts +1 -0
  49. package/dist/bundled/v3/components/or-password/index.js +31 -0
  50. package/dist/bundled/v3/components/or-search/index.d.ts +1 -0
  51. package/dist/bundled/v3/components/{or-inputs → or-search}/index.js +4 -5
  52. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  53. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  54. package/dist/bundled/v3/components/or-sidebar-v3/index.js +1 -15
  55. package/dist/bundled/v3/components/or-sidebar-v3/styles.d.ts +1 -8
  56. package/dist/bundled/v3/components/or-textarea/index.d.ts +1 -0
  57. package/dist/bundled/v3/components/or-textarea/index.js +14 -0
  58. package/dist/bundled/v3/index.js +666 -677
  59. package/dist/esm/v2/{OrCardCollection-f6b07557.js → OrCardCollection-19582949.js} +6 -7
  60. package/dist/esm/v2/{OrConfirm-d7112dd3.js → OrConfirm-ede619eb.js} +4 -4
  61. package/dist/esm/v2/{OrSearch.vue_rollup-plugin-vue_script-197d77fc.js → OrInput-6e6cfd11.js} +4 -492
  62. package/dist/esm/v2/{OrListOfInputs-50aa1ef1.js → OrListOfInputs-4298fa2c.js} +5 -5
  63. package/dist/esm/v2/OrNumberInput-b20d75d2.js +225 -0
  64. package/dist/esm/v2/OrPassword-e6d5e968.js +225 -0
  65. package/dist/esm/v2/{OrSearch-0589d17d.js → OrSearch-b4f4d59b.js} +122 -5
  66. package/dist/esm/v2/OrSidebar-fabc7bc9.js +228 -0
  67. package/dist/esm/v2/{OrPassword-1fa97156.js → OrTextarea-91a95068.js} +187 -245
  68. package/dist/esm/v2/components/index.d.ts +5 -1
  69. package/dist/esm/v2/components/index.js +10 -8
  70. package/dist/esm/v2/components/or-card-collection/index.js +3 -4
  71. package/dist/esm/v2/components/or-confirm/index.js +2 -3
  72. package/dist/esm/v2/components/or-input/index.d.ts +1 -0
  73. package/dist/esm/v2/components/or-input/index.js +11 -0
  74. package/dist/esm/v2/components/or-list-of-inputs/index.js +2 -4
  75. package/dist/esm/v2/components/or-number-input/index.d.ts +1 -0
  76. package/dist/esm/v2/components/or-number-input/index.js +12 -0
  77. package/dist/esm/v2/components/or-password/index.d.ts +1 -0
  78. package/dist/esm/v2/components/{or-inputs → or-password}/index.js +5 -6
  79. package/dist/esm/v2/components/or-search/index.d.ts +1 -0
  80. package/dist/esm/v2/components/or-search/index.js +23 -0
  81. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  82. package/dist/esm/v2/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  83. package/dist/esm/v2/components/or-sidebar-v3/index.js +1 -13
  84. package/dist/esm/v2/components/or-sidebar-v3/styles.d.ts +1 -8
  85. package/dist/esm/v2/components/or-textarea/index.d.ts +1 -0
  86. package/dist/esm/v2/components/or-textarea/index.js +11 -0
  87. package/dist/esm/v2/index.js +9 -7
  88. package/dist/esm/v3/{OrCardCollection-a5e326ef.js → OrCardCollection-1e44c758.js} +2 -2
  89. package/dist/esm/v3/{OrConfirm-f39bd784.js → OrConfirm-c11ee2ec.js} +1 -1
  90. package/dist/esm/v3/OrInput-81125804.js +295 -0
  91. package/dist/esm/v3/{OrListOfInputs-7a67440f.js → OrListOfInputs-508e056f.js} +1 -1
  92. package/dist/esm/v3/OrNumberInput-b32b5ce3.js +170 -0
  93. package/dist/esm/v3/OrPassword-b0cbb578.js +162 -0
  94. package/dist/esm/v3/OrSearch-11fdf667.js +188 -0
  95. package/dist/esm/v3/OrSidebar-a62972f5.js +206 -0
  96. package/dist/esm/v3/OrTextarea-1f5c3be1.js +290 -0
  97. package/dist/esm/v3/components/index.d.ts +5 -1
  98. package/dist/esm/v3/components/index.js +10 -6
  99. package/dist/esm/v3/components/or-card-collection/index.js +3 -3
  100. package/dist/esm/v3/components/or-confirm/index.js +2 -3
  101. package/dist/esm/v3/components/or-input/index.d.ts +1 -0
  102. package/dist/esm/v3/components/or-input/index.js +11 -0
  103. package/dist/esm/v3/components/or-list-of-inputs/index.js +2 -4
  104. package/dist/esm/v3/components/or-number-input/index.d.ts +1 -0
  105. package/dist/esm/v3/components/or-number-input/index.js +12 -0
  106. package/dist/esm/v3/components/or-password/index.d.ts +1 -0
  107. package/dist/esm/v3/components/{or-inputs → or-password}/index.js +3 -2
  108. package/dist/esm/v3/components/or-search/index.d.ts +1 -0
  109. package/dist/esm/v3/components/or-search/index.js +20 -0
  110. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.stories3.d.ts +1 -36
  111. package/dist/esm/v3/components/or-sidebar-v3/OrSidebar.vue.d.ts +4 -49
  112. package/dist/esm/v3/components/or-sidebar-v3/index.js +1 -12
  113. package/dist/esm/v3/components/or-sidebar-v3/styles.d.ts +1 -8
  114. package/dist/esm/v3/components/or-textarea/index.d.ts +1 -0
  115. package/dist/esm/v3/components/or-textarea/index.js +11 -0
  116. package/dist/esm/v3/index.js +9 -5
  117. package/package.json +1 -1
  118. package/src/components/index.ts +5 -1
  119. package/src/components/or-card-collection/OrCardCollection.vue +8 -8
  120. package/src/components/or-confirm/OrConfirm.vue +1 -1
  121. package/src/components/or-input/index.ts +1 -0
  122. package/src/components/or-list/OrList.stories.ts +1 -1
  123. package/src/components/or-list-of-inputs/OrListOfInputs.vue +1 -1
  124. package/src/components/or-modal/OrModal.stories.ts +1 -1
  125. package/src/components/{or-inputs → or-number-input}/OrNumberInput.vue +1 -1
  126. package/src/components/or-number-input/index.ts +1 -0
  127. package/src/components/{or-inputs → or-password}/OrPassword.vue +1 -1
  128. package/src/components/or-password/index.ts +1 -0
  129. package/src/components/{or-inputs → or-search}/OrSearch.vue +1 -1
  130. package/src/components/or-search/index.ts +1 -0
  131. package/src/components/or-sidebar-v3/OrSidebar.docs.mdx +0 -6
  132. package/src/components/or-sidebar-v3/OrSidebar.stories3.ts +10 -230
  133. package/src/components/or-sidebar-v3/OrSidebar.vue +22 -121
  134. package/src/components/or-sidebar-v3/styles.ts +9 -161
  135. package/src/components/{or-inputs → or-textarea}/OrTextarea.vue +225 -6
  136. package/src/components/or-textarea/index.ts +1 -0
  137. package/dist/bundled/v2/OrSidebar-774b382d.js +0 -462
  138. package/dist/bundled/v2/components/or-inputs/index.d.ts +0 -5
  139. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  140. package/dist/bundled/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  141. package/dist/bundled/v3/OrPassword.vue_vue_type_script_lang-13bc5b00.js +0 -390
  142. package/dist/bundled/v3/OrSidebar.vue_vue_type_script_lang-8305a28b.js +0 -354
  143. package/dist/bundled/v3/components/or-inputs/index.d.ts +0 -5
  144. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  145. package/dist/bundled/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  146. package/dist/esm/v2/OrSidebar-a6ee22d1.js +0 -459
  147. package/dist/esm/v2/components/or-inputs/index.d.ts +0 -5
  148. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  149. package/dist/esm/v2/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  150. package/dist/esm/v3/OrSearch-7cb2c91c.js +0 -1075
  151. package/dist/esm/v3/OrSidebar-f2150587.js +0 -394
  152. package/dist/esm/v3/components/or-inputs/index.d.ts +0 -5
  153. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.d.ts +0 -12
  154. package/dist/esm/v3/components/or-sidebar-v3/OrSidebarCollapseButton.vue.d.ts +0 -53
  155. package/src/components/or-inputs/index.ts +0 -5
  156. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.stories3.ts +0 -48
  157. package/src/components/or-sidebar-v3/OrSidebarCollapseButton.vue +0 -74
  158. /package/dist/bundled/v2/{OrInput-08f2f666.js → OrInput-df1a14fa.js} +0 -0
  159. /package/dist/bundled/v2/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
  160. /package/dist/bundled/v2/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
  161. /package/dist/bundled/v2/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
  162. /package/dist/bundled/v2/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
  163. /package/dist/bundled/v2/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
  164. /package/dist/bundled/v3/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
  165. /package/dist/bundled/v3/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
  166. /package/dist/bundled/v3/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
  167. /package/dist/bundled/v3/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
  168. /package/dist/bundled/v3/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
  169. /package/dist/esm/v2/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
  170. /package/dist/esm/v2/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
  171. /package/dist/esm/v2/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
  172. /package/dist/esm/v2/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
  173. /package/dist/esm/v2/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
  174. /package/dist/esm/v3/components/{or-inputs → or-input}/OrInput.vue.d.ts +0 -0
  175. /package/dist/esm/v3/components/{or-inputs → or-number-input}/OrNumberInput.vue.d.ts +0 -0
  176. /package/dist/esm/v3/components/{or-inputs → or-password}/OrPassword.vue.d.ts +0 -0
  177. /package/dist/esm/v3/components/{or-inputs → or-search}/OrSearch.vue.d.ts +0 -0
  178. /package/dist/esm/v3/components/{or-inputs → or-textarea}/OrTextarea.vue.d.ts +0 -0
  179. /package/src/components/{or-inputs → or-input}/OrInput.stories.ts +0 -0
  180. /package/src/components/{or-inputs → or-input}/OrInput.vue +0 -0
  181. /package/src/components/{or-inputs → or-input}/or-textbox-migration.stories.mdx +0 -0
  182. /package/src/components/{or-inputs → or-input}/styles.scss +0 -0
  183. /package/src/components/{or-inputs → or-number-input}/OrNumberInput.stories.ts +0 -0
  184. /package/src/components/{or-inputs → or-password}/OrPassword.stories.ts +0 -0
  185. /package/src/components/{or-inputs → or-search}/OrSearch.stories.ts +0 -0
  186. /package/src/components/{or-inputs → or-textarea}/OrTextarea.stories.ts +0 -0
@@ -0,0 +1,113 @@
1
+ import { defineComponent, ref } from 'vue';
2
+ import './OrInput-704e72ba.js';
3
+ import { s as script$1 } from './OrInput.vue_vue_type_script_lang-409235cc.js';
4
+
5
+ var script = defineComponent({
6
+ name: 'OrNumberInput',
7
+ components: {
8
+ OrInput: script$1
9
+ },
10
+ model: {
11
+ prop: 'modelValue',
12
+ event: 'update:modelValue'
13
+ },
14
+ props: {
15
+ modelValue: {
16
+ type: Number,
17
+ default: undefined,
18
+ required: false
19
+ },
20
+ htmlId: {
21
+ type: String,
22
+ default: '',
23
+ required: false
24
+ },
25
+ placeholder: {
26
+ type: String,
27
+ default: '',
28
+ required: false
29
+ },
30
+ label: {
31
+ type: String,
32
+ default: '',
33
+ required: false
34
+ },
35
+ error: {
36
+ type: String,
37
+ default: '',
38
+ required: false
39
+ },
40
+ hint: {
41
+ type: String,
42
+ default: '',
43
+ required: false
44
+ },
45
+ minValue: {
46
+ type: Number,
47
+ default: undefined,
48
+ required: false
49
+ },
50
+ maxValue: {
51
+ type: Number,
52
+ default: undefined,
53
+ required: false
54
+ },
55
+ stepValue: {
56
+ type: Number,
57
+ default: undefined,
58
+ required: false
59
+ },
60
+ isSmall: Boolean,
61
+ isRequired: Boolean,
62
+ isDisabled: Boolean,
63
+ isReadonly: Boolean,
64
+ isInvalid: Boolean
65
+ },
66
+ emits: ['focus', 'blur', 'update:modelValue', 'input', 'keypress', 'keyup', 'keydown'],
67
+ setup(props, {
68
+ emit
69
+ }) {
70
+ const inputRef = ref();
71
+ if (props.modelValue) {
72
+ if (props.minValue !== undefined && props.modelValue < props.minValue) {
73
+ emit('update:modelValue', props.minValue);
74
+ } else if (props.maxValue !== undefined && props.modelValue > props.maxValue) {
75
+ emit('update:modelValue', props.maxValue);
76
+ }
77
+ }
78
+ return {
79
+ inputRef
80
+ };
81
+ },
82
+ computed: {
83
+ htmlInputAttrs() {
84
+ return {
85
+ min: this.minValue,
86
+ max: this.maxValue,
87
+ step: this.stepValue
88
+ };
89
+ },
90
+ localValue: {
91
+ get() {
92
+ var _a;
93
+ return ((_a = this.modelValue) !== null && _a !== void 0 ? _a : '') + '';
94
+ },
95
+ set(val) {
96
+ if (val === undefined || val === '') {
97
+ this.$emit('update:modelValue', undefined);
98
+ return;
99
+ }
100
+ const numVal = +val;
101
+ if (this.minValue !== undefined && numVal < this.minValue) {
102
+ this.$emit('update:modelValue', this.minValue);
103
+ } else if (this.maxValue !== undefined && numVal > this.maxValue) {
104
+ this.$emit('update:modelValue', this.maxValue);
105
+ } else {
106
+ this.$emit('update:modelValue', numVal);
107
+ }
108
+ }
109
+ }
110
+ }
111
+ });
112
+
113
+ export { script as s };
@@ -0,0 +1,99 @@
1
+ import { defineComponent, ref } from 'vue';
2
+ import { useVModel } from '@vueuse/core';
3
+ import './OrInput-704e72ba.js';
4
+ import './OrIconButton-e637158e.js';
5
+ import { u as useToggle } from './useToggle-09b6cb90.js';
6
+ import { b as BUTTON_SIZE } from './constants-c5d1139f.js';
7
+ import { s as script$1 } from './OrInput.vue_vue_type_script_lang-409235cc.js';
8
+ import { s as script$2 } from './OrIconButton.vue_vue_type_script_lang-40547ab0.js';
9
+
10
+ var script = defineComponent({
11
+ name: 'OrPassword',
12
+ components: {
13
+ OrInput: script$1,
14
+ OrIconButton: script$2
15
+ },
16
+ model: {
17
+ prop: 'modelValue',
18
+ event: 'update:modelValue'
19
+ },
20
+ props: {
21
+ modelValue: {
22
+ type: String,
23
+ default: '',
24
+ required: false
25
+ },
26
+ htmlId: {
27
+ type: String,
28
+ default: '',
29
+ required: false
30
+ },
31
+ placeholder: {
32
+ type: String,
33
+ default: '',
34
+ required: false
35
+ },
36
+ label: {
37
+ type: String,
38
+ default: '',
39
+ required: false
40
+ },
41
+ error: {
42
+ type: String,
43
+ default: '',
44
+ required: false
45
+ },
46
+ hint: {
47
+ type: String,
48
+ default: '',
49
+ required: false
50
+ },
51
+ maxLength: {
52
+ type: Number,
53
+ default: undefined,
54
+ required: false
55
+ },
56
+ isSmall: Boolean,
57
+ isRequired: Boolean,
58
+ isDisabled: Boolean,
59
+ isReadonly: Boolean,
60
+ isInvalid: Boolean
61
+ },
62
+ emits: ['focus', 'blur', 'update:modelValue', 'input', 'keypress', 'keyup', 'keydown'],
63
+ setup(props, {
64
+ emit
65
+ }) {
66
+ const inputRef = ref();
67
+ const localValue = useVModel(props, 'modelValue', emit);
68
+ const {
69
+ isActiveToggle,
70
+ toggle
71
+ } = useToggle();
72
+ return {
73
+ inputRef,
74
+ localValue,
75
+ isActiveToggle,
76
+ toggle
77
+ };
78
+ },
79
+ computed: {
80
+ currentButtonIcon() {
81
+ return this.isActiveToggle ? 'visibility' : 'visibility_off';
82
+ },
83
+ type() {
84
+ return this.isActiveToggle ? 'text' : 'password';
85
+ },
86
+ size() {
87
+ return this.isSmall ? BUTTON_SIZE.SMALL : BUTTON_SIZE.DEFAULT;
88
+ }
89
+ },
90
+ methods: {
91
+ onClick() {
92
+ var _a;
93
+ this.toggle();
94
+ (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
95
+ }
96
+ }
97
+ });
98
+
99
+ export { script as s };
@@ -1,6 +1,7 @@
1
1
  import { defineComponent, ref } from 'vue';
2
- import { s as script$1 } from './OrInput-7d4b571a.js';
3
2
  import { debouncedWatch } from '@vueuse/core';
3
+ import './OrInput-704e72ba.js';
4
+ import { s as script$1 } from './OrInput.vue_vue_type_script_lang-409235cc.js';
4
5
  import './OrIconButton-e637158e.js';
5
6
  import { b as BUTTON_SIZE } from './constants-c5d1139f.js';
6
7
  import { s as script$2 } from './OrIconButton.vue_vue_type_script_lang-40547ab0.js';
@@ -0,0 +1,181 @@
1
+ import { useDraggable, useElementBounding } from '@vueuse/core';
2
+ import _ from 'lodash';
3
+ import { defineComponent, ref, computed, watch } from 'vue';
4
+
5
+ var OrSidebarPlacement;
6
+ (function (OrSidebarPlacement) {
7
+ OrSidebarPlacement["left"] = "left";
8
+ OrSidebarPlacement["right"] = "right";
9
+ })(OrSidebarPlacement || (OrSidebarPlacement = {}));
10
+
11
+ const SidebarRoot = [
12
+ // Position
13
+ 'relative',
14
+ // Layout
15
+ 'flex', 'flex-col', 'shrink-0',
16
+ // Box
17
+ 'min-h-0', 'p-0'];
18
+ const SidebarRootSides = {
19
+ [OrSidebarPlacement.left]: [
20
+ // Borders
21
+ 'border-r-[1px]', 'border-r-solid', 'border-r-secondary dark:border-r-secondary-dark'],
22
+ [OrSidebarPlacement.right]: [
23
+ // Borders
24
+ 'border-l-[1px]', 'border-l-solid', 'border-l-secondary dark:border-l-secondary-dark']
25
+ };
26
+ const SidebarResize = [
27
+ // Position
28
+ 'absolute', 'inset-y-none', 'z-[1]',
29
+ // Box
30
+ 'w-[12px]', 'h-[100%]',
31
+ // Cursor
32
+ 'cursor-ew-resize'];
33
+ const SidebarResizeSides = {
34
+ [OrSidebarPlacement.left]: [
35
+ // Position
36
+ '-right-[1px]',
37
+ // Borders
38
+ 'hover:border-r-2', 'hover:border-r-primary hover:dark:border-r-primary-dark',
39
+ // Transition
40
+ 'transition-[border-right]'],
41
+ [OrSidebarPlacement.right]: [
42
+ // Position
43
+ '-left-[1px]',
44
+ // Borders
45
+ 'hover:border-l-2', 'hover:border-l-primary hover:dark:border-l-primary-dark',
46
+ // Transition
47
+ 'transition-[border-left]']
48
+ };
49
+ const SidebarResizingSides = {
50
+ [OrSidebarPlacement.left]: [
51
+ // Borders
52
+ 'border-r-2', 'border-r-primary dark:border-r-primary-dark'],
53
+ [OrSidebarPlacement.right]: [
54
+ // Borders
55
+ 'border-l-2', 'border-l-primary dark:border-l-primary-dark']
56
+ };
57
+ const SidebarMain = [
58
+ // Layout
59
+ 'flex', 'flex-col', 'grow',
60
+ // Box
61
+ 'min-h-0'];
62
+ const SidebarHeader = [
63
+ // Sizing
64
+ 'p-md'];
65
+ const SidebarContent = [
66
+ // Layout
67
+ 'grow', 'overflow-auto',
68
+ // Sizing
69
+ 'p-md'];
70
+ const SidebarFooter = [
71
+ // Sizing
72
+ 'p-md',
73
+ // Borders
74
+ 'border-t-[1px]', 'border-t-solid', 'border-t-secondary dark:border-t-secondary-dark'];
75
+
76
+ var script = defineComponent({
77
+ name: 'OrSidebar',
78
+ props: {
79
+ width: {
80
+ type: Number,
81
+ required: false,
82
+ default: 0,
83
+ validator: value => _.isNumber(value) && value >= 0
84
+ },
85
+ minimumWidth: {
86
+ type: Number,
87
+ required: false,
88
+ default: 350,
89
+ validator: value => _.isNumber(value) && value >= 0
90
+ },
91
+ /**
92
+ * User may put the component on the right or the left side of a container.
93
+ * This property mirrors the resizing behavior (drag direction) and styling (horizontal border) of the sidebar.
94
+ *
95
+ * Note: the property doesn't reposition the component in the parent container.
96
+ * @values left, right
97
+ */
98
+ side: {
99
+ type: String,
100
+ default: OrSidebarPlacement.right,
101
+ validator: value => _.includes(_.values(OrSidebarPlacement), value)
102
+ }
103
+ },
104
+ emits: ['change:width'],
105
+ setup(props, {
106
+ emit
107
+ }) {
108
+ // Refs
109
+ const root = ref();
110
+ const resizeBar = ref(null);
111
+ const parentContainer = computed(() => {
112
+ var _a;
113
+ return (_a = root.value) === null || _a === void 0 ? void 0 : _a.parentElement;
114
+ });
115
+ // State
116
+ const startPositionX = ref(0);
117
+ const isResizing = ref(false);
118
+ const localWidth = ref(props.width >= props.minimumWidth ? props.width : props.minimumWidth);
119
+ // Styles
120
+ const sidebarStyle = computed(() => ({
121
+ width: localWidth.value + 'px'
122
+ }));
123
+ const rootStyles = computed(() => ['or-sidebar', ...SidebarRoot, ...SidebarRootSides[props.side]]);
124
+ const resizeStyles = computed(() => [...SidebarResize, ...SidebarResizeSides[props.side], ...(isResizing.value ? SidebarResizingSides[props.side] : [])]);
125
+ const mainStyles = computed(() => [...SidebarMain]);
126
+ const headerStyles = computed(() => [...SidebarHeader]);
127
+ const contentStyles = computed(() => [...SidebarContent]);
128
+ const footerStyles = computed(() => [...SidebarFooter]);
129
+ // Effects
130
+ useDraggable(resizeBar, {
131
+ preventDefault: true,
132
+ onStart: (position, event) => {
133
+ document.body.style.cursor = 'ew-resize';
134
+ document.body.style.userSelect = 'none';
135
+ startPositionX.value = event.x;
136
+ isResizing.value = true;
137
+ },
138
+ onMove: position => {
139
+ const delta = (position.x - startPositionX.value) * (props.side === OrSidebarPlacement.left ? -1 : 1);
140
+ const newWidth = localWidth.value - delta;
141
+ localWidth.value = newWidth > maximumWidth.value ? maximumWidth.value : newWidth < props.minimumWidth ? props.minimumWidth : newWidth;
142
+ startPositionX.value = position.x;
143
+ },
144
+ onEnd: () => {
145
+ document.body.style.cursor = '';
146
+ document.body.style.userSelect = '';
147
+ isResizing.value = false;
148
+ }
149
+ });
150
+ const {
151
+ width: maximumWidth
152
+ } = useElementBounding(parentContainer);
153
+ watch(() => props.width, newValue => {
154
+ if (newValue !== localWidth.value) {
155
+ localWidth.value = newValue > maximumWidth.value ? maximumWidth.value : newValue < props.minimumWidth ? props.minimumWidth : newValue;
156
+ }
157
+ });
158
+ watch(() => props.minimumWidth, newMinimum => {
159
+ if (newMinimum > localWidth.value) localWidth.value = newMinimum;
160
+ });
161
+ watch(maximumWidth, newMaximum => {
162
+ if (newMaximum < localWidth.value) localWidth.value = newMaximum;
163
+ });
164
+ watch(localWidth, val => emit('change:width', val));
165
+ return {
166
+ root,
167
+ resizeBar,
168
+ isResizing,
169
+ localWidth,
170
+ sidebarStyle,
171
+ rootStyles,
172
+ resizeStyles,
173
+ mainStyles,
174
+ headerStyles,
175
+ contentStyles,
176
+ footerStyles
177
+ };
178
+ }
179
+ });
180
+
181
+ export { OrSidebarPlacement as O, script as s };
@@ -0,0 +1,187 @@
1
+ import { defineComponent, ref, getCurrentInstance } from 'vue';
2
+ import { p as pxToRem } from './px-to-rem-0b26b83e.js';
3
+ import { s as setStyle, r as requestAF, g as getCS, a as reflow, c as cancelAF } from './dom-d21d0a92.js';
4
+ import './OrLabel-e412c532.js';
5
+ import './OrHint-c9114268.js';
6
+ import './OrError-b43ebad8.js';
7
+ import './OrCollapse-63e83681.js';
8
+ import { s as script$1 } from './OrLabel.vue_vue_type_script_lang-27f8b12d.js';
9
+ import { s as script$2 } from './OrHint.vue_vue_type_script_lang-78598c8e.js';
10
+ import { s as script$3 } from './OrError.vue_vue_type_script_lang-7c39e012.js';
11
+ import { s as script$4 } from './OrCollapse.vue_vue_type_script_lang-65cbb754.js';
12
+
13
+ var script = defineComponent({
14
+ name: 'OrTextarea',
15
+ components: {
16
+ OrLabel: script$1,
17
+ OrHint: script$2,
18
+ OrError: script$3,
19
+ OrCollapse: script$4
20
+ },
21
+ model: {
22
+ prop: 'modelValue',
23
+ event: 'update:modelValue'
24
+ },
25
+ props: {
26
+ modelValue: {
27
+ type: String,
28
+ default: '',
29
+ required: false
30
+ },
31
+ htmlId: {
32
+ type: String,
33
+ default: '',
34
+ required: false
35
+ },
36
+ placeholder: {
37
+ type: String,
38
+ default: '',
39
+ required: false
40
+ },
41
+ label: {
42
+ type: String,
43
+ default: '',
44
+ required: false
45
+ },
46
+ error: {
47
+ type: String,
48
+ default: '',
49
+ required: false
50
+ },
51
+ hint: {
52
+ type: String,
53
+ default: '',
54
+ required: false
55
+ },
56
+ maxLength: {
57
+ type: Number,
58
+ default: undefined,
59
+ required: false
60
+ },
61
+ isSmall: Boolean,
62
+ isRequired: Boolean,
63
+ isDisabled: Boolean,
64
+ isReadonly: Boolean,
65
+ isInvalid: Boolean
66
+ },
67
+ emits: ['focus', 'blur', 'update:modelValue', 'input', 'keypress', 'keyup', 'keydown'],
68
+ setup() {
69
+ const inputRef = ref();
70
+ return {
71
+ inputRef
72
+ };
73
+ },
74
+ data() {
75
+ return {
76
+ reqAF: null,
77
+ isFocused: false
78
+ };
79
+ },
80
+ computed: {
81
+ localValue() {
82
+ if (this.maxLength && this.modelValue.length > this.maxLength) {
83
+ return this.modelValue.slice(0, -(this.modelValue.length - this.maxLength));
84
+ }
85
+ return this.modelValue;
86
+ },
87
+ localId() {
88
+ var _a;
89
+ return this.htmlId || `input-${(_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.uid}`;
90
+ },
91
+ hasValue() {
92
+ return !!this.localValue.length;
93
+ },
94
+ counterString() {
95
+ return this.maxLength && this.maxLength > 0 ? `${this.localValue.length} / ${this.maxLength}` : '';
96
+ },
97
+ isInactive() {
98
+ return this.isDisabled || this.isReadonly;
99
+ },
100
+ isShowError() {
101
+ return !!this.error && this.isInvalid;
102
+ },
103
+ isShowHint() {
104
+ return !!this.hint && !this.isShowError;
105
+ },
106
+ isShowInfo() {
107
+ return this.isShowError || this.isShowHint || !!this.maxLength;
108
+ },
109
+ rootClasses() {
110
+ return ['or-textbox', {
111
+ 'is-show-info': this.isShowInfo,
112
+ 'is-small': this.isSmall,
113
+ 'has-counter': !!this.maxLength,
114
+ 'has-label': !!this.label || !!this.$slots['label-default']
115
+ }];
116
+ },
117
+ inputClasses() {
118
+ return ['or-textbox--input-textarea', {
119
+ 'is-disabled': this.isDisabled,
120
+ 'is-readonly': this.isReadonly,
121
+ 'is-focused': this.isFocused,
122
+ 'is-required': this.isRequired,
123
+ 'has-error': this.isInvalid
124
+ }];
125
+ }
126
+ },
127
+ methods: {
128
+ focus() {
129
+ var _a;
130
+ (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
131
+ },
132
+ calcTextareaHeight() {
133
+ var _a;
134
+ if (this.inputRef) {
135
+ setStyle(this.inputRef, 'height', 0);
136
+ setStyle(this.inputRef, 'height', pxToRem((_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.scrollHeight));
137
+ }
138
+ },
139
+ onInput(event) {
140
+ if (this.isInactive) return;
141
+ this.calcTextareaHeight();
142
+ this.$emit('update:modelValue', event.target.value);
143
+ this.$emit('input', event.target.value);
144
+ },
145
+ onFocus(event) {
146
+ var _a;
147
+ this.isFocused = true;
148
+ (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
149
+ this.$emit('focus', event);
150
+ },
151
+ onBlur(event) {
152
+ var _a;
153
+ this.isFocused = false;
154
+ (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.blur();
155
+ this.$emit('blur', event);
156
+ },
157
+ beforeEnter(el) {
158
+ setStyle(el, 'opacity', 0);
159
+ },
160
+ enter(el) {
161
+ const {
162
+ scrollHeight,
163
+ parentElement
164
+ } = el;
165
+ this.reqAF = requestAF(() => {
166
+ const pt = parseFloat(getCS(parentElement).paddingTop);
167
+ const pb = parseFloat(getCS(parentElement).paddingBottom);
168
+ const height = scrollHeight + pt + pb;
169
+ if (parentElement) {
170
+ reflow(parentElement);
171
+ setStyle(parentElement, 'height', pxToRem(height));
172
+ }
173
+ setStyle(el, 'opacity', 1);
174
+ });
175
+ },
176
+ leave(el) {
177
+ this.reqAF = requestAF(() => {
178
+ el.style.opacity = '0';
179
+ });
180
+ },
181
+ cancelRequestAF() {
182
+ cancelAF(this.reqAF);
183
+ }
184
+ }
185
+ });
186
+
187
+ export { script as s };
@@ -36,7 +36,7 @@ export * from './or-inline-text-edit';
36
36
  export * from './or-inline-textarea-v3';
37
37
  export * from './or-input-box-v3';
38
38
  export * from './or-input-v3';
39
- export * from './or-inputs';
39
+ export * from './or-input';
40
40
  export * from './or-label';
41
41
  export * from './or-label-v3';
42
42
  export * from './or-link-v3';
@@ -50,9 +50,11 @@ export * from './or-modal';
50
50
  export * from './or-modal-v3';
51
51
  export * from './or-notification';
52
52
  export * from './or-notification-v3';
53
+ export * from './or-number-input';
53
54
  export * from './or-overflow-menu';
54
55
  export * from './or-overlay';
55
56
  export * from './or-overlay-v3';
57
+ export * from './or-password';
56
58
  export * from './or-pagination-v3';
57
59
  export * from './or-popover-v3';
58
60
  export * from './or-progress';
@@ -60,6 +62,7 @@ export * from './or-progress-v3';
60
62
  export * from './or-radio';
61
63
  export * from './or-radio-group';
62
64
  export * from './or-radio-v3';
65
+ export * from './or-search';
63
66
  export * from './or-search-v3';
64
67
  export * from './or-segmented-control-v3';
65
68
  export * from './or-select';
@@ -83,6 +86,7 @@ export * from './or-tag-v3';
83
86
  export * from './or-teleport';
84
87
  export * from './or-teleport-v3';
85
88
  export * from './or-text-v3';
89
+ export * from './or-textarea';
86
90
  export * from './or-textarea-v3';
87
91
  export * from './or-textbox';
88
92
  export * from './or-toast';