@onereach/ui-components 8.16.1 → 8.16.2-beta.3856.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.
@@ -1,6 +1,6 @@
1
1
  import { a as useMagicKeys, o as onClickOutside } from '../../index-cc89d6b7.js';
2
2
  import { l as logicAnd } from '../../index-017c190e.js';
3
- import { defineComponent, ref, toRef, computed, watch } from 'vue-demi';
3
+ import { defineComponent, ref, computed, toRef, watch } from 'vue-demi';
4
4
  import { ConfirmType } from './props.js';
5
5
  import { Confirm, ConfirmHeader, ConfirmInput, ConfirmFooter, ConfirmFooterTypes, ConfirmFooterButtons } from './styles.js';
6
6
  import __vue_component__$1 from '../OrOverlayV3/OrOverlay.js';
@@ -74,8 +74,13 @@ var script = defineComponent({
74
74
  const root = ref();
75
75
  const confirmationInput = ref();
76
76
  const confirmationButton = ref();
77
+ // Styles
78
+ const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
79
+ const headerStyles = computed(() => [...ConfirmHeader]);
80
+ const inputBoxStyles = computed(() => [...ConfirmInput]);
81
+ const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
82
+ const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
77
83
  // State
78
- const touched = ref(false);
79
84
  const {
80
85
  state,
81
86
  open,
@@ -83,6 +88,20 @@ var script = defineComponent({
83
88
  } = usePopoverState(toRef(props, 'isOpen'), context.emit);
84
89
  const isInputActive = ref(false);
85
90
  const confirmationValue = ref('');
91
+ const touched = ref(false);
92
+ watch(state, value => {
93
+ confirmationValue.value = '';
94
+ if (value === 'open') {
95
+ touched.value = false;
96
+ }
97
+ }, {
98
+ immediate: true
99
+ });
100
+ watch(confirmationValue, value => {
101
+ if (value.length > 0) {
102
+ touched.value = true;
103
+ }
104
+ });
86
105
  const {
87
106
  escape,
88
107
  enter
@@ -103,18 +122,11 @@ var script = defineComponent({
103
122
  }
104
123
  function onInputBlur() {
105
124
  isInputActive.value = false;
106
- touched.value = true;
107
125
  }
108
126
  // Events
109
127
  watch(escape, val => {
110
128
  if (val) close();
111
129
  });
112
- watch(state, value => {
113
- if (value === 'closed') {
114
- confirmationValue.value = '';
115
- touched.value = false;
116
- }
117
- });
118
130
  // types here are used for fixing TS2349
119
131
  watch(confirmationInput, val => {
120
132
  var _a;
@@ -128,12 +140,6 @@ var script = defineComponent({
128
140
  }
129
141
  });
130
142
  whenever(logicAnd(enter, isInputActive), () => confirm());
131
- // Styles
132
- const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
133
- const headerStyles = computed(() => [...ConfirmHeader]);
134
- const inputBoxStyles = computed(() => [...ConfirmInput]);
135
- const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
136
- const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
137
143
  // #region Click Outside
138
144
  onClickOutside(root, close);
139
145
  // #endregion
@@ -1 +1 @@
1
- export { s as default } from '../OrConfirmV3-c2eeee5c.js';
1
+ export { s as default } from '../OrConfirmV3-c9d90846.js';
@@ -1 +1 @@
1
- export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirmV3-c2eeee5c.js';
1
+ export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirmV3-c9d90846.js';
@@ -1 +1 @@
1
- export { C as ConfirmType } from '../OrConfirmV3-c2eeee5c.js';
1
+ export { C as ConfirmType } from '../OrConfirmV3-c9d90846.js';
@@ -1 +1 @@
1
- export { a as Confirm, d as ConfirmFooter, f as ConfirmFooterButtons, e as ConfirmFooterTypes, b as ConfirmHeader, c as ConfirmInput } from '../OrConfirmV3-c2eeee5c.js';
1
+ export { a as Confirm, d as ConfirmFooter, f as ConfirmFooterButtons, e as ConfirmFooterTypes, b as ConfirmHeader, c as ConfirmInput } from '../OrConfirmV3-c9d90846.js';
@@ -1,7 +1,7 @@
1
1
  import { resolveComponent, openBlock, createBlock, withCtx, createElementVNode, mergeProps, normalizeClass, renderSlot, createTextVNode, toDisplayString, createElementBlock, createVNode, createCommentVNode } from 'vue';
2
2
  import { b as useMagicKeys, w as whenever, o as onClickOutside } from './OrBottomSheetV3-66815f6f.js';
3
3
  import { l as logicAnd } from './OrConfirm-f95a3ce6.js';
4
- import { defineComponent, ref, toRef, computed, watch } from 'vue-demi';
4
+ import { defineComponent, ref, computed, toRef, watch } from 'vue-demi';
5
5
  import { s as script$1 } from './OrOverlayV3-b2576ca1.js';
6
6
  import { s as script$2, B as ButtonColor } from './OrButtonV3-529c4206.js';
7
7
  import { s as script$3 } from './OrInputV3-1b3a2135.js';
@@ -120,8 +120,13 @@ var script = defineComponent({
120
120
  const root = ref();
121
121
  const confirmationInput = ref();
122
122
  const confirmationButton = ref();
123
+ // Styles
124
+ const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
125
+ const headerStyles = computed(() => [...ConfirmHeader]);
126
+ const inputBoxStyles = computed(() => [...ConfirmInput]);
127
+ const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
128
+ const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
123
129
  // State
124
- const touched = ref(false);
125
130
  const {
126
131
  state,
127
132
  open,
@@ -129,6 +134,20 @@ var script = defineComponent({
129
134
  } = usePopoverState(toRef(props, 'isOpen'), context.emit);
130
135
  const isInputActive = ref(false);
131
136
  const confirmationValue = ref('');
137
+ const touched = ref(false);
138
+ watch(state, value => {
139
+ confirmationValue.value = '';
140
+ if (value === 'open') {
141
+ touched.value = false;
142
+ }
143
+ }, {
144
+ immediate: true
145
+ });
146
+ watch(confirmationValue, value => {
147
+ if (value.length > 0) {
148
+ touched.value = true;
149
+ }
150
+ });
132
151
  const {
133
152
  escape,
134
153
  enter
@@ -149,18 +168,11 @@ var script = defineComponent({
149
168
  }
150
169
  function onInputBlur() {
151
170
  isInputActive.value = false;
152
- touched.value = true;
153
171
  }
154
172
  // Events
155
173
  watch(escape, val => {
156
174
  if (val) close();
157
175
  });
158
- watch(state, value => {
159
- if (value === 'closed') {
160
- confirmationValue.value = '';
161
- touched.value = false;
162
- }
163
- });
164
176
  // types here are used for fixing TS2349
165
177
  watch(confirmationInput, val => {
166
178
  var _a;
@@ -174,12 +186,6 @@ var script = defineComponent({
174
186
  }
175
187
  });
176
188
  whenever(logicAnd(enter, isInputActive), () => confirm());
177
- // Styles
178
- const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
179
- const headerStyles = computed(() => [...ConfirmHeader]);
180
- const inputBoxStyles = computed(() => [...ConfirmInput]);
181
- const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
182
- const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
183
189
  // #region Click Outside
184
190
  onClickOutside(root, close);
185
191
  // #endregion
@@ -22,7 +22,7 @@ export { s as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k
22
22
  export { s as OrCombinedInputV3 } from './OrCombinedInputV3-795e8cf2.js';
23
23
  export { I as CombinedInputSize, I as DatePickerSize, I as DateRangePickerSize, I as DateTimePickerSize, I as InputBoxSize, a as InputBoxVariant, I as InputSize, s as OrInputBoxV3, I as SearchSize, I as SelectSize, I as TagInputSize, I as TextareaSize, I as TimePickerSize, I as TimeRangePickerSize } from './OrInputBoxV3-ddd117f0.js';
24
24
  export { s as OrConfirm } from './OrConfirm-f95a3ce6.js';
25
- export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-c2eeee5c.js';
25
+ export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-c9d90846.js';
26
26
  export { OrContextMenuV3 } from './OrContextMenuV3/index.js';
27
27
  export { P as ContextMenuPlacement, P as MenuPlacement, s as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, P as TooltipPlacement } from './OrPopoverV3-a7d181a4.js';
28
28
  export { s as OrDateFormatV3 } from './OrDateFormatV3-8456e52e.js';
@@ -13,7 +13,7 @@ export { C as CodeLanguage, s as OrCodeV3 } from './components/OrCodeV3-7ecb46ca
13
13
  export { s as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k as brown, c as cyan, j as deepOrange, d as deepPurple, g as green, i as indigo, l as lightBlue, e as lightGreen, f as lime, o as orange, p as pink, a as purple, r as red, t as teal, w as white, y as yellow } from './components/OrColorPicker-2271c176.js';
14
14
  export { s as OrCombinedInputV3 } from './components/OrCombinedInputV3-795e8cf2.js';
15
15
  export { s as OrConfirm } from './components/OrConfirm-f95a3ce6.js';
16
- export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-c2eeee5c.js';
16
+ export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-c9d90846.js';
17
17
  export { OrContextMenuV3 } from './components/OrContextMenuV3/index.js';
18
18
  export { s as OrDateFormatV3 } from './components/OrDateFormatV3-8456e52e.js';
19
19
  export { s as OrDatePickerV3 } from './components/OrDatePickerV3-a3e534f7.js';
@@ -1,6 +1,6 @@
1
1
  import { useMagicKeys, whenever, onClickOutside } from '@vueuse/core';
2
2
  import { logicAnd } from '@vueuse/math';
3
- import { defineComponent, ref, toRef, computed, watch } from 'vue-demi';
3
+ import { defineComponent, ref, computed, toRef, watch } from 'vue-demi';
4
4
  import './dom-aecadd9a.js';
5
5
  import { u as usePopoverState } from './usePopoverState-5033b9cb.js';
6
6
  import '@onereach/styles/tailwind/plugins/core';
@@ -124,8 +124,13 @@ var script = defineComponent({
124
124
  const root = ref();
125
125
  const confirmationInput = ref();
126
126
  const confirmationButton = ref();
127
+ // Styles
128
+ const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
129
+ const headerStyles = computed(() => [...ConfirmHeader]);
130
+ const inputBoxStyles = computed(() => [...ConfirmInput]);
131
+ const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
132
+ const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
127
133
  // State
128
- const touched = ref(false);
129
134
  const {
130
135
  state,
131
136
  open,
@@ -133,6 +138,20 @@ var script = defineComponent({
133
138
  } = usePopoverState(toRef(props, 'isOpen'), context.emit);
134
139
  const isInputActive = ref(false);
135
140
  const confirmationValue = ref('');
141
+ const touched = ref(false);
142
+ watch(state, value => {
143
+ confirmationValue.value = '';
144
+ if (value === 'open') {
145
+ touched.value = false;
146
+ }
147
+ }, {
148
+ immediate: true
149
+ });
150
+ watch(confirmationValue, value => {
151
+ if (value.length > 0) {
152
+ touched.value = true;
153
+ }
154
+ });
136
155
  const {
137
156
  escape,
138
157
  enter
@@ -153,18 +172,11 @@ var script = defineComponent({
153
172
  }
154
173
  function onInputBlur() {
155
174
  isInputActive.value = false;
156
- touched.value = true;
157
175
  }
158
176
  // Events
159
177
  watch(escape, val => {
160
178
  if (val) close();
161
179
  });
162
- watch(state, value => {
163
- if (value === 'closed') {
164
- confirmationValue.value = '';
165
- touched.value = false;
166
- }
167
- });
168
180
  // types here are used for fixing TS2349
169
181
  watch(confirmationInput, val => {
170
182
  var _a;
@@ -178,12 +190,6 @@ var script = defineComponent({
178
190
  }
179
191
  });
180
192
  whenever(logicAnd(enter, isInputActive), () => confirm());
181
- // Styles
182
- const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
183
- const headerStyles = computed(() => [...ConfirmHeader]);
184
- const inputBoxStyles = computed(() => [...ConfirmInput]);
185
- const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
186
- const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
187
193
  // #region Click Outside
188
194
  onClickOutside(root, close);
189
195
  // #endregion
@@ -33,7 +33,7 @@ export { _ as OrCombinedInputV3 } from '../OrCombinedInput-27179a1d.js';
33
33
  export { _ as OrInputBoxV3 } from '../OrInputBox-140c344d.js';
34
34
  export { I as CombinedInputSize, I as DatePickerSize, I as DateRangePickerSize, I as DateTimePickerSize, I as InputBoxSize, a as InputBoxVariant, I as InputSize, I as SearchSize, I as SelectSize, I as TagInputSize, I as TextareaSize, I as TimePickerSize, I as TimeRangePickerSize } from '../OrInputBox.vue_rollup-plugin-vue_script-65ebcf4d.js';
35
35
  export { _ as OrConfirm } from '../OrConfirm-f3f7ec59.js';
36
- export { C as ConfirmType, _ as OrConfirmV3 } from '../OrConfirm-dc9219de.js';
36
+ export { C as ConfirmType, _ as OrConfirmV3 } from '../OrConfirm-a9568ff9.js';
37
37
  export { _ as OrContextMenuV3 } from '../OrContextMenu-7292aca0.js';
38
38
  export { _ as OrMenuV3 } from '../OrMenu-6fa468e0.js';
39
39
  export { P as ContextMenuPlacement, P as MenuPlacement, _ as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, P as TooltipPlacement } from '../OrPopover-07b82c80.js';
@@ -1,4 +1,4 @@
1
- export { C as ConfirmType, _ as OrConfirmV3 } from '../../OrConfirm-dc9219de.js';
1
+ export { C as ConfirmType, _ as OrConfirmV3 } from '../../OrConfirm-a9568ff9.js';
2
2
  import '@vueuse/core';
3
3
  import '@vueuse/math';
4
4
  import 'vue-demi';
@@ -33,7 +33,7 @@ export { _ as OrCombinedInputV3 } from './OrCombinedInput-27179a1d.js';
33
33
  export { _ as OrInputBoxV3 } from './OrInputBox-140c344d.js';
34
34
  export { I as CombinedInputSize, I as DatePickerSize, I as DateRangePickerSize, I as DateTimePickerSize, I as InputBoxSize, a as InputBoxVariant, I as InputSize, I as SearchSize, I as SelectSize, I as TagInputSize, I as TextareaSize, I as TimePickerSize, I as TimeRangePickerSize } from './OrInputBox.vue_rollup-plugin-vue_script-65ebcf4d.js';
35
35
  export { _ as OrConfirm } from './OrConfirm-f3f7ec59.js';
36
- export { C as ConfirmType, _ as OrConfirmV3 } from './OrConfirm-dc9219de.js';
36
+ export { C as ConfirmType, _ as OrConfirmV3 } from './OrConfirm-a9568ff9.js';
37
37
  export { _ as OrContextMenuV3 } from './OrContextMenu-7292aca0.js';
38
38
  export { _ as OrMenuV3 } from './OrMenu-6fa468e0.js';
39
39
  export { P as ContextMenuPlacement, P as MenuPlacement, _ as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, P as TooltipPlacement } from './OrPopover-07b82c80.js';
@@ -1,6 +1,6 @@
1
1
  import { useMagicKeys, whenever, onClickOutside } from '@vueuse/core';
2
2
  import { logicAnd } from '@vueuse/math';
3
- import { defineComponent, ref, toRef, computed, watch } from 'vue-demi';
3
+ import { defineComponent, ref, computed, toRef, watch } from 'vue-demi';
4
4
  import './dom-aecadd9a.js';
5
5
  import { u as usePopoverState } from './usePopoverState-5033b9cb.js';
6
6
  import '@onereach/styles/tailwind/plugins/core';
@@ -123,8 +123,13 @@ var script = defineComponent({
123
123
  const root = ref();
124
124
  const confirmationInput = ref();
125
125
  const confirmationButton = ref();
126
+ // Styles
127
+ const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
128
+ const headerStyles = computed(() => [...ConfirmHeader]);
129
+ const inputBoxStyles = computed(() => [...ConfirmInput]);
130
+ const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
131
+ const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
126
132
  // State
127
- const touched = ref(false);
128
133
  const {
129
134
  state,
130
135
  open,
@@ -132,6 +137,20 @@ var script = defineComponent({
132
137
  } = usePopoverState(toRef(props, 'isOpen'), context.emit);
133
138
  const isInputActive = ref(false);
134
139
  const confirmationValue = ref('');
140
+ const touched = ref(false);
141
+ watch(state, value => {
142
+ confirmationValue.value = '';
143
+ if (value === 'open') {
144
+ touched.value = false;
145
+ }
146
+ }, {
147
+ immediate: true
148
+ });
149
+ watch(confirmationValue, value => {
150
+ if (value.length > 0) {
151
+ touched.value = true;
152
+ }
153
+ });
135
154
  const {
136
155
  escape,
137
156
  enter
@@ -152,18 +171,11 @@ var script = defineComponent({
152
171
  }
153
172
  function onInputBlur() {
154
173
  isInputActive.value = false;
155
- touched.value = true;
156
174
  }
157
175
  // Events
158
176
  watch(escape, val => {
159
177
  if (val) close();
160
178
  });
161
- watch(state, value => {
162
- if (value === 'closed') {
163
- confirmationValue.value = '';
164
- touched.value = false;
165
- }
166
- });
167
179
  // types here are used for fixing TS2349
168
180
  watch(confirmationInput, val => {
169
181
  var _a;
@@ -177,12 +189,6 @@ var script = defineComponent({
177
189
  }
178
190
  });
179
191
  whenever(logicAnd(enter, isInputActive), () => confirm());
180
- // Styles
181
- const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
182
- const headerStyles = computed(() => [...ConfirmHeader]);
183
- const inputBoxStyles = computed(() => [...ConfirmInput]);
184
- const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
185
- const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
186
192
  // #region Click Outside
187
193
  onClickOutside(root, close);
188
194
  // #endregion
@@ -30,7 +30,7 @@ export { s as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k
30
30
  export { s as OrCombinedInputV3 } from '../OrCombinedInput-aeac0bb1.js';
31
31
  export { I as CombinedInputSize, I as DatePickerSize, I as DateRangePickerSize, I as DateTimePickerSize, I as InputBoxSize, a as InputBoxVariant, I as InputSize, s as OrInputBoxV3, I as SearchSize, I as SelectSize, I as TagInputSize, I as TextareaSize, I as TimePickerSize, I as TimeRangePickerSize } from '../OrInputBox-8c1a29dd.js';
32
32
  export { s as OrConfirm } from '../OrConfirm-859ff5a2.js';
33
- export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirm-a999f6ce.js';
33
+ export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirm-3846fc7c.js';
34
34
  export { s as OrContextMenuV3 } from '../OrContextMenu-8468ecfd.js';
35
35
  export { s as OrMenuV3 } from '../OrMenu-690d1376.js';
36
36
  export { P as ContextMenuPlacement, P as MenuPlacement, s as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, P as TooltipPlacement } from '../OrPopover-88b8aa2a.js';
@@ -1,4 +1,4 @@
1
- export { C as ConfirmType, s as OrConfirmV3 } from '../../OrConfirm-a999f6ce.js';
1
+ export { C as ConfirmType, s as OrConfirmV3 } from '../../OrConfirm-3846fc7c.js';
2
2
  import '@vueuse/core';
3
3
  import '@vueuse/math';
4
4
  import 'vue-demi';
@@ -30,7 +30,7 @@ export { s as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k
30
30
  export { s as OrCombinedInputV3 } from './OrCombinedInput-aeac0bb1.js';
31
31
  export { I as CombinedInputSize, I as DatePickerSize, I as DateRangePickerSize, I as DateTimePickerSize, I as InputBoxSize, a as InputBoxVariant, I as InputSize, s as OrInputBoxV3, I as SearchSize, I as SelectSize, I as TagInputSize, I as TextareaSize, I as TimePickerSize, I as TimeRangePickerSize } from './OrInputBox-8c1a29dd.js';
32
32
  export { s as OrConfirm } from './OrConfirm-859ff5a2.js';
33
- export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-a999f6ce.js';
33
+ export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-3846fc7c.js';
34
34
  export { s as OrContextMenuV3 } from './OrContextMenu-8468ecfd.js';
35
35
  export { s as OrMenuV3 } from './OrMenu-690d1376.js';
36
36
  export { P as ContextMenuPlacement, P as MenuPlacement, s as OrPopoverV3, P as PopoverPlacement, a as PopoverVariant, P as TooltipPlacement } from './OrPopover-88b8aa2a.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "8.16.1",
3
+ "version": "8.16.2-beta.3856.0",
4
4
  "npmUnpacked": "4.15.2",
5
5
  "description": "Vue components library for v2/3",
6
6
  "sideEffects": false,
@@ -176,6 +176,5 @@
176
176
  "default": "./dist/bundled/v3/components/*/index.js"
177
177
  },
178
178
  "./package.json": "./package.json"
179
- },
180
- "gitHead": "99292ae49e945d7f918bab350aaa4f46e5054398"
179
+ }
181
180
  }
@@ -166,14 +166,52 @@ export default defineComponent({
166
166
  setup(props, context) {
167
167
  // Refs
168
168
  const root = ref<HTMLElement>();
169
+
169
170
  const confirmationInput = ref<InstanceType<typeof OrInput>>();
170
171
  const confirmationButton = ref<InstanceType<typeof OrButton>>();
171
172
 
173
+ // Styles
174
+ const rootStyles = computed(() => [
175
+ 'or-confirm-v3',
176
+ ...Confirm,
177
+ ]);
178
+
179
+ const headerStyles = computed(() => [
180
+ ...ConfirmHeader,
181
+ ]);
182
+
183
+ const inputBoxStyles = computed(() => [
184
+ ...ConfirmInput,
185
+ ]);
186
+
187
+ const footerStyles = computed(() => [
188
+ ...ConfirmFooter,
189
+ ...ConfirmFooterTypes[props.confirmType],
190
+ ]);
191
+
192
+ const buttonsStyles = computed(() => [
193
+ ...ConfirmFooterButtons,
194
+ ]);
195
+
172
196
  // State
173
- const touched = ref(false);
174
197
  const { state, open, close } = usePopoverState(toRef(props, 'isOpen'), context.emit);
175
198
  const isInputActive = ref(false);
176
- const confirmationValue = ref<string>('');
199
+ const confirmationValue = ref('');
200
+ const touched = ref(false);
201
+
202
+ watch(state, (value) => {
203
+ confirmationValue.value = '';
204
+
205
+ if (value === 'open') {
206
+ touched.value = false;
207
+ }
208
+ }, { immediate: true });
209
+
210
+ watch(confirmationValue, (value) => {
211
+ if (value.length > 0) {
212
+ touched.value = true;
213
+ }
214
+ });
177
215
 
178
216
  const { escape, enter } = useMagicKeys();
179
217
 
@@ -200,7 +238,6 @@ export default defineComponent({
200
238
 
201
239
  function onInputBlur(): void {
202
240
  isInputActive.value = false;
203
- touched.value = true;
204
241
  }
205
242
 
206
243
  // Events
@@ -208,13 +245,6 @@ export default defineComponent({
208
245
  if (val) close();
209
246
  });
210
247
 
211
- watch(state, (value) => {
212
- if (value === 'closed') {
213
- confirmationValue.value = '';
214
- touched.value = false;
215
- }
216
- });
217
-
218
248
  // types here are used for fixing TS2349
219
249
  watch(confirmationInput as any, (val: InstanceType<typeof OrInput>) =>
220
250
  (val?.focus as (() => void) | undefined)?.());
@@ -229,29 +259,6 @@ export default defineComponent({
229
259
 
230
260
  whenever(logicAnd(enter, isInputActive), () => confirm());
231
261
 
232
- // Styles
233
- const rootStyles = computed(() => [
234
- 'or-confirm-v3',
235
- ...Confirm,
236
- ]);
237
-
238
- const headerStyles = computed(() => [
239
- ...ConfirmHeader,
240
- ]);
241
-
242
- const inputBoxStyles = computed(() => [
243
- ...ConfirmInput,
244
- ]);
245
-
246
- const footerStyles = computed(() => [
247
- ...ConfirmFooter,
248
- ...ConfirmFooterTypes[props.confirmType],
249
- ]);
250
-
251
- const buttonsStyles = computed(() => [
252
- ...ConfirmFooterButtons,
253
- ]);
254
-
255
262
  // #region Click Outside
256
263
  onClickOutside(root, close);
257
264
  // #endregion