@onereach/ui-components 8.17.1 → 8.17.2-beta.3887.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/OrConfirmV3/OrConfirm.js +14 -25
- package/dist/bundled/v2/components/OrConfirmV3/OrConfirm.vue.d.ts +0 -13
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +1 -1
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.vue.d.ts +0 -10
- package/dist/bundled/v3/components/OrConfirmV3/index.js +1 -1
- package/dist/bundled/v3/components/OrConfirmV3/props.js +1 -1
- package/dist/bundled/v3/components/OrConfirmV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrConfirmV3-b5efd082.js → OrConfirmV3-90f5d00b.js} +14 -25
- package/dist/bundled/v3/components/index.js +1 -1
- package/dist/bundled/v3/index.js +1 -1
- package/dist/esm/v2/{OrConfirm-096d70f2.js → OrConfirm-174b82fd.js} +14 -25
- package/dist/esm/v2/components/index.js +1 -1
- package/dist/esm/v2/components/or-confirm-v3/OrConfirm.vue.d.ts +0 -13
- package/dist/esm/v2/components/or-confirm-v3/index.js +1 -1
- package/dist/esm/v2/index.js +1 -1
- package/dist/esm/v3/{OrConfirm-b9db8793.js → OrConfirm-dd801326.js} +14 -25
- package/dist/esm/v3/components/index.js +1 -1
- package/dist/esm/v3/components/or-confirm-v3/OrConfirm.vue.d.ts +0 -10
- package/dist/esm/v3/components/or-confirm-v3/index.js +1 -1
- package/dist/esm/v3/index.js +1 -1
- package/package.json +2 -3
- package/src/components/or-confirm-v3/OrConfirm.vue +31 -42
|
@@ -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,
|
|
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';
|
|
@@ -61,10 +61,6 @@ var script = defineComponent({
|
|
|
61
61
|
textConfirmationPlaceholder: {
|
|
62
62
|
type: String,
|
|
63
63
|
default: undefined
|
|
64
|
-
},
|
|
65
|
-
textConfirmationError: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: undefined
|
|
68
64
|
}
|
|
69
65
|
},
|
|
70
66
|
emits: ['update:state', 'open', 'close', 'confirm'],
|
|
@@ -74,8 +70,13 @@ var script = defineComponent({
|
|
|
74
70
|
const root = ref();
|
|
75
71
|
const confirmationInput = ref();
|
|
76
72
|
const confirmationButton = ref();
|
|
73
|
+
// Styles
|
|
74
|
+
const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
|
|
75
|
+
const headerStyles = computed(() => [...ConfirmHeader]);
|
|
76
|
+
const inputBoxStyles = computed(() => [...ConfirmInput]);
|
|
77
|
+
const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
|
|
78
|
+
const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
|
|
77
79
|
// State
|
|
78
|
-
const touched = ref(false);
|
|
79
80
|
const {
|
|
80
81
|
state,
|
|
81
82
|
open,
|
|
@@ -83,6 +84,9 @@ var script = defineComponent({
|
|
|
83
84
|
} = usePopoverState(toRef(props, 'isOpen'), context.emit);
|
|
84
85
|
const isInputActive = ref(false);
|
|
85
86
|
const confirmationValue = ref('');
|
|
87
|
+
watch(state, () => {
|
|
88
|
+
confirmationValue.value = '';
|
|
89
|
+
});
|
|
86
90
|
const {
|
|
87
91
|
escape,
|
|
88
92
|
enter
|
|
@@ -103,18 +107,11 @@ var script = defineComponent({
|
|
|
103
107
|
}
|
|
104
108
|
function onInputBlur() {
|
|
105
109
|
isInputActive.value = false;
|
|
106
|
-
touched.value = true;
|
|
107
110
|
}
|
|
108
111
|
// Events
|
|
109
112
|
watch(escape, val => {
|
|
110
113
|
if (val) close();
|
|
111
114
|
});
|
|
112
|
-
watch(state, value => {
|
|
113
|
-
if (value === 'closed') {
|
|
114
|
-
confirmationValue.value = '';
|
|
115
|
-
touched.value = false;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
115
|
// types here are used for fixing TS2349
|
|
119
116
|
watch(confirmationInput, val => {
|
|
120
117
|
var _a;
|
|
@@ -128,12 +125,6 @@ var script = defineComponent({
|
|
|
128
125
|
}
|
|
129
126
|
});
|
|
130
127
|
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
128
|
// #region Click Outside
|
|
138
129
|
onClickOutside(root, close);
|
|
139
130
|
// #endregion
|
|
@@ -145,7 +136,6 @@ var script = defineComponent({
|
|
|
145
136
|
confirmButtonColor,
|
|
146
137
|
isInvalid,
|
|
147
138
|
isConfirmationButtonDisabled,
|
|
148
|
-
touched,
|
|
149
139
|
state,
|
|
150
140
|
isInputActive,
|
|
151
141
|
escape,
|
|
@@ -193,8 +183,7 @@ var __vue_render__ = function () {
|
|
|
193
183
|
ref: "confirmationInput",
|
|
194
184
|
attrs: {
|
|
195
185
|
"label": _vm.textConfirmationLabel,
|
|
196
|
-
"placeholder": _vm.textConfirmationPlaceholder
|
|
197
|
-
"error": _vm.touched && _vm.isInvalid ? _vm.textConfirmationError : undefined
|
|
186
|
+
"placeholder": _vm.textConfirmationPlaceholder
|
|
198
187
|
},
|
|
199
188
|
on: {
|
|
200
189
|
"focus": _vm.onInputFocus,
|
|
@@ -213,7 +202,7 @@ var __vue_render__ = function () {
|
|
|
213
202
|
}, [_c('OrButton', {
|
|
214
203
|
class: _vm.buttonsStyles,
|
|
215
204
|
attrs: {
|
|
216
|
-
"variant":
|
|
205
|
+
"variant": 'outlined',
|
|
217
206
|
"disabled": _vm.loading
|
|
218
207
|
},
|
|
219
208
|
on: {
|
|
@@ -232,8 +221,8 @@ var __vue_render__ = function () {
|
|
|
232
221
|
}
|
|
233
222
|
}, [_vm._v("\n " + _vm._s(_vm.confirmButtonText) + "\n ")])], 1)];
|
|
234
223
|
}, {
|
|
235
|
-
"
|
|
236
|
-
"
|
|
224
|
+
"confirm": _vm.confirm,
|
|
225
|
+
"cancel": _vm.close
|
|
237
226
|
})], 2)]) : _vm._e();
|
|
238
227
|
};
|
|
239
228
|
var __vue_staticRenderFns__ = [];
|
|
@@ -17,7 +17,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
17
17
|
confirmButtonColor: import("@vue/composition-api").ComputedRef<ButtonColor.Primary | ButtonColor.Danger>;
|
|
18
18
|
isInvalid: import("@vue/composition-api").ComputedRef<boolean>;
|
|
19
19
|
isConfirmationButtonDisabled: import("@vue/composition-api").ComputedRef<boolean>;
|
|
20
|
-
touched: import("@vue/composition-api").Ref<boolean>;
|
|
21
20
|
state: import("@vue/composition-api").Ref<"open" | "closed">;
|
|
22
21
|
isInputActive: import("@vue/composition-api").Ref<boolean>;
|
|
23
22
|
escape: import("@vue/composition-api").ComputedRef<boolean>;
|
|
@@ -74,10 +73,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
74
73
|
type: StringConstructor;
|
|
75
74
|
default: undefined;
|
|
76
75
|
};
|
|
77
|
-
textConfirmationError: {
|
|
78
|
-
type: StringConstructor;
|
|
79
|
-
default: undefined;
|
|
80
|
-
};
|
|
81
76
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
82
77
|
isOpen: {
|
|
83
78
|
type: BooleanConstructor;
|
|
@@ -121,10 +116,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
121
116
|
type: StringConstructor;
|
|
122
117
|
default: undefined;
|
|
123
118
|
};
|
|
124
|
-
textConfirmationError: {
|
|
125
|
-
type: StringConstructor;
|
|
126
|
-
default: undefined;
|
|
127
|
-
};
|
|
128
119
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
129
120
|
isOpen: boolean;
|
|
130
121
|
titleText: string;
|
|
@@ -136,7 +127,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
136
127
|
confirmationText: string;
|
|
137
128
|
textConfirmationLabel: string;
|
|
138
129
|
textConfirmationPlaceholder: string;
|
|
139
|
-
textConfirmationError: string;
|
|
140
130
|
} & {} & {
|
|
141
131
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
142
132
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -155,7 +145,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
155
145
|
confirmButtonColor: import("@vue/composition-api").ComputedRef<ButtonColor.Primary | ButtonColor.Danger>;
|
|
156
146
|
isInvalid: import("@vue/composition-api").ComputedRef<boolean>;
|
|
157
147
|
isConfirmationButtonDisabled: import("@vue/composition-api").ComputedRef<boolean>;
|
|
158
|
-
touched: import("@vue/composition-api").Ref<boolean>;
|
|
159
148
|
state: import("@vue/composition-api").Ref<"open" | "closed">;
|
|
160
149
|
isInputActive: import("@vue/composition-api").Ref<boolean>;
|
|
161
150
|
escape: import("@vue/composition-api").ComputedRef<boolean>;
|
|
@@ -180,7 +169,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
180
169
|
confirmationText: string;
|
|
181
170
|
textConfirmationLabel: string;
|
|
182
171
|
textConfirmationPlaceholder: string;
|
|
183
|
-
textConfirmationError: string;
|
|
184
172
|
} & {} & {
|
|
185
173
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
186
174
|
}, {
|
|
@@ -194,6 +182,5 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
194
182
|
confirmationText: string;
|
|
195
183
|
textConfirmationLabel: string;
|
|
196
184
|
textConfirmationPlaceholder: string;
|
|
197
|
-
textConfirmationError: string;
|
|
198
185
|
}, true>);
|
|
199
186
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as default } from '../OrConfirmV3-
|
|
1
|
+
export { s as default } from '../OrConfirmV3-90f5d00b.js';
|
|
@@ -44,10 +44,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
44
44
|
type: StringConstructor;
|
|
45
45
|
default: undefined;
|
|
46
46
|
};
|
|
47
|
-
textConfirmationError: {
|
|
48
|
-
type: StringConstructor;
|
|
49
|
-
default: undefined;
|
|
50
|
-
};
|
|
51
47
|
}, {
|
|
52
48
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
53
49
|
confirmationInput: import("vue-demi").Ref<any>;
|
|
@@ -56,7 +52,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
56
52
|
confirmButtonColor: import("vue-demi").ComputedRef<ButtonColor.Primary | ButtonColor.Danger>;
|
|
57
53
|
isInvalid: import("vue-demi").ComputedRef<boolean>;
|
|
58
54
|
isConfirmationButtonDisabled: import("vue-demi").ComputedRef<boolean>;
|
|
59
|
-
touched: import("vue-demi").Ref<boolean>;
|
|
60
55
|
state: import("vue-demi").Ref<"open" | "closed">;
|
|
61
56
|
isInputActive: import("vue-demi").Ref<boolean>;
|
|
62
57
|
escape: import("vue-demi").ComputedRef<boolean>;
|
|
@@ -113,10 +108,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
113
108
|
type: StringConstructor;
|
|
114
109
|
default: undefined;
|
|
115
110
|
};
|
|
116
|
-
textConfirmationError: {
|
|
117
|
-
type: StringConstructor;
|
|
118
|
-
default: undefined;
|
|
119
|
-
};
|
|
120
111
|
}>> & {
|
|
121
112
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
122
113
|
"onUpdate:state"?: ((...args: any[]) => any) | undefined;
|
|
@@ -133,6 +124,5 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
133
124
|
confirmationText: string;
|
|
134
125
|
textConfirmationLabel: string;
|
|
135
126
|
textConfirmationPlaceholder: string;
|
|
136
|
-
textConfirmationError: string;
|
|
137
127
|
}>;
|
|
138
128
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirmV3-
|
|
1
|
+
export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirmV3-90f5d00b.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as ConfirmType } from '../OrConfirmV3-
|
|
1
|
+
export { C as ConfirmType } from '../OrConfirmV3-90f5d00b.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-
|
|
1
|
+
export { a as Confirm, d as ConfirmFooter, f as ConfirmFooterButtons, e as ConfirmFooterTypes, b as ConfirmHeader, c as ConfirmInput } from '../OrConfirmV3-90f5d00b.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,
|
|
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-5ed9b5fd.js';
|
|
@@ -107,10 +107,6 @@ var script = defineComponent({
|
|
|
107
107
|
textConfirmationPlaceholder: {
|
|
108
108
|
type: String,
|
|
109
109
|
default: undefined
|
|
110
|
-
},
|
|
111
|
-
textConfirmationError: {
|
|
112
|
-
type: String,
|
|
113
|
-
default: undefined
|
|
114
110
|
}
|
|
115
111
|
},
|
|
116
112
|
emits: ['update:state', 'open', 'close', 'confirm'],
|
|
@@ -120,8 +116,13 @@ var script = defineComponent({
|
|
|
120
116
|
const root = ref();
|
|
121
117
|
const confirmationInput = ref();
|
|
122
118
|
const confirmationButton = ref();
|
|
119
|
+
// Styles
|
|
120
|
+
const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
|
|
121
|
+
const headerStyles = computed(() => [...ConfirmHeader]);
|
|
122
|
+
const inputBoxStyles = computed(() => [...ConfirmInput]);
|
|
123
|
+
const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
|
|
124
|
+
const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
|
|
123
125
|
// State
|
|
124
|
-
const touched = ref(false);
|
|
125
126
|
const {
|
|
126
127
|
state,
|
|
127
128
|
open,
|
|
@@ -129,6 +130,9 @@ var script = defineComponent({
|
|
|
129
130
|
} = usePopoverState(toRef(props, 'isOpen'), context.emit);
|
|
130
131
|
const isInputActive = ref(false);
|
|
131
132
|
const confirmationValue = ref('');
|
|
133
|
+
watch(state, () => {
|
|
134
|
+
confirmationValue.value = '';
|
|
135
|
+
});
|
|
132
136
|
const {
|
|
133
137
|
escape,
|
|
134
138
|
enter
|
|
@@ -149,18 +153,11 @@ var script = defineComponent({
|
|
|
149
153
|
}
|
|
150
154
|
function onInputBlur() {
|
|
151
155
|
isInputActive.value = false;
|
|
152
|
-
touched.value = true;
|
|
153
156
|
}
|
|
154
157
|
// Events
|
|
155
158
|
watch(escape, val => {
|
|
156
159
|
if (val) close();
|
|
157
160
|
});
|
|
158
|
-
watch(state, value => {
|
|
159
|
-
if (value === 'closed') {
|
|
160
|
-
confirmationValue.value = '';
|
|
161
|
-
touched.value = false;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
161
|
// types here are used for fixing TS2349
|
|
165
162
|
watch(confirmationInput, val => {
|
|
166
163
|
var _a;
|
|
@@ -174,12 +171,6 @@ var script = defineComponent({
|
|
|
174
171
|
}
|
|
175
172
|
});
|
|
176
173
|
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
174
|
// #region Click Outside
|
|
184
175
|
onClickOutside(root, close);
|
|
185
176
|
// #endregion
|
|
@@ -191,7 +182,6 @@ var script = defineComponent({
|
|
|
191
182
|
confirmButtonColor,
|
|
192
183
|
isInvalid,
|
|
193
184
|
isConfirmationButtonDisabled,
|
|
194
|
-
touched,
|
|
195
185
|
state,
|
|
196
186
|
isInputActive,
|
|
197
187
|
escape,
|
|
@@ -236,17 +226,16 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
236
226
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.confirmationValue = $event),
|
|
237
227
|
label: _ctx.textConfirmationLabel,
|
|
238
228
|
placeholder: _ctx.textConfirmationPlaceholder,
|
|
239
|
-
error: _ctx.touched && _ctx.isInvalid ? _ctx.textConfirmationError : undefined,
|
|
240
229
|
onFocus: _ctx.onInputFocus,
|
|
241
230
|
onBlur: _ctx.onInputBlur
|
|
242
|
-
}, null, 8 /* PROPS */, ["modelValue", "label", "placeholder", "
|
|
243
|
-
|
|
244
|
-
|
|
231
|
+
}, null, 8 /* PROPS */, ["modelValue", "label", "placeholder", "onFocus", "onBlur"])], 2 /* CLASS */)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "footer", {
|
|
232
|
+
confirm: _ctx.confirm,
|
|
233
|
+
cancel: _ctx.close
|
|
245
234
|
}, () => [createElementVNode("div", {
|
|
246
235
|
class: normalizeClass(_ctx.footerStyles)
|
|
247
236
|
}, [createVNode(_component_OrButton, {
|
|
248
237
|
class: normalizeClass(_ctx.buttonsStyles),
|
|
249
|
-
variant:
|
|
238
|
+
variant: 'outlined',
|
|
250
239
|
disabled: _ctx.loading,
|
|
251
240
|
onClick: _ctx.close
|
|
252
241
|
}, {
|
|
@@ -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-
|
|
25
|
+
export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-90f5d00b.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';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { C as CodeLanguage, s as OrCodeV3 } from './components/OrCodeV3-628f8e28
|
|
|
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-
|
|
16
|
+
export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-90f5d00b.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,
|
|
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';
|
|
@@ -111,10 +111,6 @@ var script = defineComponent({
|
|
|
111
111
|
textConfirmationPlaceholder: {
|
|
112
112
|
type: String,
|
|
113
113
|
default: undefined
|
|
114
|
-
},
|
|
115
|
-
textConfirmationError: {
|
|
116
|
-
type: String,
|
|
117
|
-
default: undefined
|
|
118
114
|
}
|
|
119
115
|
},
|
|
120
116
|
emits: ['update:state', 'open', 'close', 'confirm'],
|
|
@@ -124,8 +120,13 @@ var script = defineComponent({
|
|
|
124
120
|
const root = ref();
|
|
125
121
|
const confirmationInput = ref();
|
|
126
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]);
|
|
127
129
|
// State
|
|
128
|
-
const touched = ref(false);
|
|
129
130
|
const {
|
|
130
131
|
state,
|
|
131
132
|
open,
|
|
@@ -133,6 +134,9 @@ var script = defineComponent({
|
|
|
133
134
|
} = usePopoverState(toRef(props, 'isOpen'), context.emit);
|
|
134
135
|
const isInputActive = ref(false);
|
|
135
136
|
const confirmationValue = ref('');
|
|
137
|
+
watch(state, () => {
|
|
138
|
+
confirmationValue.value = '';
|
|
139
|
+
});
|
|
136
140
|
const {
|
|
137
141
|
escape,
|
|
138
142
|
enter
|
|
@@ -153,18 +157,11 @@ var script = defineComponent({
|
|
|
153
157
|
}
|
|
154
158
|
function onInputBlur() {
|
|
155
159
|
isInputActive.value = false;
|
|
156
|
-
touched.value = true;
|
|
157
160
|
}
|
|
158
161
|
// Events
|
|
159
162
|
watch(escape, val => {
|
|
160
163
|
if (val) close();
|
|
161
164
|
});
|
|
162
|
-
watch(state, value => {
|
|
163
|
-
if (value === 'closed') {
|
|
164
|
-
confirmationValue.value = '';
|
|
165
|
-
touched.value = false;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
165
|
// types here are used for fixing TS2349
|
|
169
166
|
watch(confirmationInput, val => {
|
|
170
167
|
var _a;
|
|
@@ -178,12 +175,6 @@ var script = defineComponent({
|
|
|
178
175
|
}
|
|
179
176
|
});
|
|
180
177
|
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
178
|
// #region Click Outside
|
|
188
179
|
onClickOutside(root, close);
|
|
189
180
|
// #endregion
|
|
@@ -195,7 +186,6 @@ var script = defineComponent({
|
|
|
195
186
|
confirmButtonColor,
|
|
196
187
|
isInvalid,
|
|
197
188
|
isConfirmationButtonDisabled,
|
|
198
|
-
touched,
|
|
199
189
|
state,
|
|
200
190
|
isInputActive,
|
|
201
191
|
escape,
|
|
@@ -243,8 +233,7 @@ var __vue_render__ = function () {
|
|
|
243
233
|
ref: "confirmationInput",
|
|
244
234
|
attrs: {
|
|
245
235
|
"label": _vm.textConfirmationLabel,
|
|
246
|
-
"placeholder": _vm.textConfirmationPlaceholder
|
|
247
|
-
"error": _vm.touched && _vm.isInvalid ? _vm.textConfirmationError : undefined
|
|
236
|
+
"placeholder": _vm.textConfirmationPlaceholder
|
|
248
237
|
},
|
|
249
238
|
on: {
|
|
250
239
|
"focus": _vm.onInputFocus,
|
|
@@ -263,7 +252,7 @@ var __vue_render__ = function () {
|
|
|
263
252
|
}, [_c('OrButton', {
|
|
264
253
|
class: _vm.buttonsStyles,
|
|
265
254
|
attrs: {
|
|
266
|
-
"variant":
|
|
255
|
+
"variant": 'outlined',
|
|
267
256
|
"disabled": _vm.loading
|
|
268
257
|
},
|
|
269
258
|
on: {
|
|
@@ -282,8 +271,8 @@ var __vue_render__ = function () {
|
|
|
282
271
|
}
|
|
283
272
|
}, [_vm._v("\n " + _vm._s(_vm.confirmButtonText) + "\n ")])], 1)];
|
|
284
273
|
}, {
|
|
285
|
-
"
|
|
286
|
-
"
|
|
274
|
+
"confirm": _vm.confirm,
|
|
275
|
+
"cancel": _vm.close
|
|
287
276
|
})], 2)]) : _vm._e();
|
|
288
277
|
};
|
|
289
278
|
var __vue_staticRenderFns__ = [];
|
|
@@ -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-
|
|
36
|
+
export { C as ConfirmType, _ as OrConfirmV3 } from '../OrConfirm-174b82fd.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';
|
|
@@ -17,7 +17,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
17
17
|
confirmButtonColor: import("@vue/composition-api").ComputedRef<ButtonColor.Primary | ButtonColor.Danger>;
|
|
18
18
|
isInvalid: import("@vue/composition-api").ComputedRef<boolean>;
|
|
19
19
|
isConfirmationButtonDisabled: import("@vue/composition-api").ComputedRef<boolean>;
|
|
20
|
-
touched: import("@vue/composition-api").Ref<boolean>;
|
|
21
20
|
state: import("@vue/composition-api").Ref<"open" | "closed">;
|
|
22
21
|
isInputActive: import("@vue/composition-api").Ref<boolean>;
|
|
23
22
|
escape: import("@vue/composition-api").ComputedRef<boolean>;
|
|
@@ -74,10 +73,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
74
73
|
type: StringConstructor;
|
|
75
74
|
default: undefined;
|
|
76
75
|
};
|
|
77
|
-
textConfirmationError: {
|
|
78
|
-
type: StringConstructor;
|
|
79
|
-
default: undefined;
|
|
80
|
-
};
|
|
81
76
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
82
77
|
isOpen: {
|
|
83
78
|
type: BooleanConstructor;
|
|
@@ -121,10 +116,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
121
116
|
type: StringConstructor;
|
|
122
117
|
default: undefined;
|
|
123
118
|
};
|
|
124
|
-
textConfirmationError: {
|
|
125
|
-
type: StringConstructor;
|
|
126
|
-
default: undefined;
|
|
127
|
-
};
|
|
128
119
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
129
120
|
isOpen: boolean;
|
|
130
121
|
titleText: string;
|
|
@@ -136,7 +127,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
136
127
|
confirmationText: string;
|
|
137
128
|
textConfirmationLabel: string;
|
|
138
129
|
textConfirmationPlaceholder: string;
|
|
139
|
-
textConfirmationError: string;
|
|
140
130
|
} & {} & {
|
|
141
131
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
142
132
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
@@ -155,7 +145,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
155
145
|
confirmButtonColor: import("@vue/composition-api").ComputedRef<ButtonColor.Primary | ButtonColor.Danger>;
|
|
156
146
|
isInvalid: import("@vue/composition-api").ComputedRef<boolean>;
|
|
157
147
|
isConfirmationButtonDisabled: import("@vue/composition-api").ComputedRef<boolean>;
|
|
158
|
-
touched: import("@vue/composition-api").Ref<boolean>;
|
|
159
148
|
state: import("@vue/composition-api").Ref<"open" | "closed">;
|
|
160
149
|
isInputActive: import("@vue/composition-api").Ref<boolean>;
|
|
161
150
|
escape: import("@vue/composition-api").ComputedRef<boolean>;
|
|
@@ -180,7 +169,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
180
169
|
confirmationText: string;
|
|
181
170
|
textConfirmationLabel: string;
|
|
182
171
|
textConfirmationPlaceholder: string;
|
|
183
|
-
textConfirmationError: string;
|
|
184
172
|
} & {} & {
|
|
185
173
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
186
174
|
}, {
|
|
@@ -194,6 +182,5 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
194
182
|
confirmationText: string;
|
|
195
183
|
textConfirmationLabel: string;
|
|
196
184
|
textConfirmationPlaceholder: string;
|
|
197
|
-
textConfirmationError: string;
|
|
198
185
|
}, true>);
|
|
199
186
|
export default _default;
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -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-
|
|
36
|
+
export { C as ConfirmType, _ as OrConfirmV3 } from './OrConfirm-174b82fd.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,
|
|
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';
|
|
@@ -110,10 +110,6 @@ var script = defineComponent({
|
|
|
110
110
|
textConfirmationPlaceholder: {
|
|
111
111
|
type: String,
|
|
112
112
|
default: undefined
|
|
113
|
-
},
|
|
114
|
-
textConfirmationError: {
|
|
115
|
-
type: String,
|
|
116
|
-
default: undefined
|
|
117
113
|
}
|
|
118
114
|
},
|
|
119
115
|
emits: ['update:state', 'open', 'close', 'confirm'],
|
|
@@ -123,8 +119,13 @@ var script = defineComponent({
|
|
|
123
119
|
const root = ref();
|
|
124
120
|
const confirmationInput = ref();
|
|
125
121
|
const confirmationButton = ref();
|
|
122
|
+
// Styles
|
|
123
|
+
const rootStyles = computed(() => ['or-confirm-v3', ...Confirm]);
|
|
124
|
+
const headerStyles = computed(() => [...ConfirmHeader]);
|
|
125
|
+
const inputBoxStyles = computed(() => [...ConfirmInput]);
|
|
126
|
+
const footerStyles = computed(() => [...ConfirmFooter, ...ConfirmFooterTypes[props.confirmType]]);
|
|
127
|
+
const buttonsStyles = computed(() => [...ConfirmFooterButtons]);
|
|
126
128
|
// State
|
|
127
|
-
const touched = ref(false);
|
|
128
129
|
const {
|
|
129
130
|
state,
|
|
130
131
|
open,
|
|
@@ -132,6 +133,9 @@ var script = defineComponent({
|
|
|
132
133
|
} = usePopoverState(toRef(props, 'isOpen'), context.emit);
|
|
133
134
|
const isInputActive = ref(false);
|
|
134
135
|
const confirmationValue = ref('');
|
|
136
|
+
watch(state, () => {
|
|
137
|
+
confirmationValue.value = '';
|
|
138
|
+
});
|
|
135
139
|
const {
|
|
136
140
|
escape,
|
|
137
141
|
enter
|
|
@@ -152,18 +156,11 @@ var script = defineComponent({
|
|
|
152
156
|
}
|
|
153
157
|
function onInputBlur() {
|
|
154
158
|
isInputActive.value = false;
|
|
155
|
-
touched.value = true;
|
|
156
159
|
}
|
|
157
160
|
// Events
|
|
158
161
|
watch(escape, val => {
|
|
159
162
|
if (val) close();
|
|
160
163
|
});
|
|
161
|
-
watch(state, value => {
|
|
162
|
-
if (value === 'closed') {
|
|
163
|
-
confirmationValue.value = '';
|
|
164
|
-
touched.value = false;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
164
|
// types here are used for fixing TS2349
|
|
168
165
|
watch(confirmationInput, val => {
|
|
169
166
|
var _a;
|
|
@@ -177,12 +174,6 @@ var script = defineComponent({
|
|
|
177
174
|
}
|
|
178
175
|
});
|
|
179
176
|
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
177
|
// #region Click Outside
|
|
187
178
|
onClickOutside(root, close);
|
|
188
179
|
// #endregion
|
|
@@ -194,7 +185,6 @@ var script = defineComponent({
|
|
|
194
185
|
confirmButtonColor,
|
|
195
186
|
isInvalid,
|
|
196
187
|
isConfirmationButtonDisabled,
|
|
197
|
-
touched,
|
|
198
188
|
state,
|
|
199
189
|
isInputActive,
|
|
200
190
|
escape,
|
|
@@ -239,17 +229,16 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
239
229
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => _ctx.confirmationValue = $event),
|
|
240
230
|
label: _ctx.textConfirmationLabel,
|
|
241
231
|
placeholder: _ctx.textConfirmationPlaceholder,
|
|
242
|
-
error: _ctx.touched && _ctx.isInvalid ? _ctx.textConfirmationError : undefined,
|
|
243
232
|
onFocus: _ctx.onInputFocus,
|
|
244
233
|
onBlur: _ctx.onInputBlur
|
|
245
|
-
}, null, 8 /* PROPS */, ["modelValue", "label", "placeholder", "
|
|
246
|
-
|
|
247
|
-
|
|
234
|
+
}, null, 8 /* PROPS */, ["modelValue", "label", "placeholder", "onFocus", "onBlur"])], 2 /* CLASS */)) : createCommentVNode("v-if", true)]), renderSlot(_ctx.$slots, "footer", {
|
|
235
|
+
confirm: _ctx.confirm,
|
|
236
|
+
cancel: _ctx.close
|
|
248
237
|
}, () => [createElementVNode("div", {
|
|
249
238
|
class: normalizeClass(_ctx.footerStyles)
|
|
250
239
|
}, [createVNode(_component_OrButton, {
|
|
251
240
|
class: normalizeClass(_ctx.buttonsStyles),
|
|
252
|
-
variant:
|
|
241
|
+
variant: 'outlined',
|
|
253
242
|
disabled: _ctx.loading,
|
|
254
243
|
onClick: _ctx.close
|
|
255
244
|
}, {
|
|
@@ -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-
|
|
33
|
+
export { C as ConfirmType, s as OrConfirmV3 } from '../OrConfirm-dd801326.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';
|
|
@@ -44,10 +44,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
44
44
|
type: StringConstructor;
|
|
45
45
|
default: undefined;
|
|
46
46
|
};
|
|
47
|
-
textConfirmationError: {
|
|
48
|
-
type: StringConstructor;
|
|
49
|
-
default: undefined;
|
|
50
|
-
};
|
|
51
47
|
}, {
|
|
52
48
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
53
49
|
confirmationInput: import("vue-demi").Ref<any>;
|
|
@@ -56,7 +52,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
56
52
|
confirmButtonColor: import("vue-demi").ComputedRef<ButtonColor.Primary | ButtonColor.Danger>;
|
|
57
53
|
isInvalid: import("vue-demi").ComputedRef<boolean>;
|
|
58
54
|
isConfirmationButtonDisabled: import("vue-demi").ComputedRef<boolean>;
|
|
59
|
-
touched: import("vue-demi").Ref<boolean>;
|
|
60
55
|
state: import("vue-demi").Ref<"open" | "closed">;
|
|
61
56
|
isInputActive: import("vue-demi").Ref<boolean>;
|
|
62
57
|
escape: import("vue-demi").ComputedRef<boolean>;
|
|
@@ -113,10 +108,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
113
108
|
type: StringConstructor;
|
|
114
109
|
default: undefined;
|
|
115
110
|
};
|
|
116
|
-
textConfirmationError: {
|
|
117
|
-
type: StringConstructor;
|
|
118
|
-
default: undefined;
|
|
119
|
-
};
|
|
120
111
|
}>> & {
|
|
121
112
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
122
113
|
"onUpdate:state"?: ((...args: any[]) => any) | undefined;
|
|
@@ -133,6 +124,5 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
133
124
|
confirmationText: string;
|
|
134
125
|
textConfirmationLabel: string;
|
|
135
126
|
textConfirmationPlaceholder: string;
|
|
136
|
-
textConfirmationError: string;
|
|
137
127
|
}>;
|
|
138
128
|
export default _default;
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -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-
|
|
33
|
+
export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-dd801326.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.17.
|
|
3
|
+
"version": "8.17.2-beta.3887.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": "798375a61ed57648c7700ba5a493de0162a1514d"
|
|
179
|
+
}
|
|
181
180
|
}
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
v-model="confirmationValue"
|
|
28
28
|
:label="textConfirmationLabel"
|
|
29
29
|
:placeholder="textConfirmationPlaceholder"
|
|
30
|
-
:error="(touched && isInvalid) ? textConfirmationError : undefined"
|
|
31
30
|
@focus="onInputFocus"
|
|
32
31
|
@blur="onInputBlur"
|
|
33
32
|
/>
|
|
@@ -36,13 +35,13 @@
|
|
|
36
35
|
|
|
37
36
|
<slot
|
|
38
37
|
name="footer"
|
|
39
|
-
:cancel="close"
|
|
40
38
|
:confirm="confirm"
|
|
39
|
+
:cancel="close"
|
|
41
40
|
>
|
|
42
41
|
<div :class="footerStyles">
|
|
43
42
|
<OrButton
|
|
44
43
|
:class="buttonsStyles"
|
|
45
|
-
variant="outlined"
|
|
44
|
+
:variant="'outlined'"
|
|
46
45
|
:disabled="loading"
|
|
47
46
|
@click="close"
|
|
48
47
|
>
|
|
@@ -139,11 +138,6 @@ export default defineComponent({
|
|
|
139
138
|
type: String,
|
|
140
139
|
default: undefined,
|
|
141
140
|
},
|
|
142
|
-
|
|
143
|
-
textConfirmationError: {
|
|
144
|
-
type: String,
|
|
145
|
-
default: undefined,
|
|
146
|
-
},
|
|
147
141
|
},
|
|
148
142
|
|
|
149
143
|
emits: [
|
|
@@ -166,14 +160,41 @@ export default defineComponent({
|
|
|
166
160
|
setup(props, context) {
|
|
167
161
|
// Refs
|
|
168
162
|
const root = ref<HTMLElement>();
|
|
163
|
+
|
|
169
164
|
const confirmationInput = ref<InstanceType<typeof OrInput>>();
|
|
170
165
|
const confirmationButton = ref<InstanceType<typeof OrButton>>();
|
|
171
166
|
|
|
167
|
+
// Styles
|
|
168
|
+
const rootStyles = computed(() => [
|
|
169
|
+
'or-confirm-v3',
|
|
170
|
+
...Confirm,
|
|
171
|
+
]);
|
|
172
|
+
|
|
173
|
+
const headerStyles = computed(() => [
|
|
174
|
+
...ConfirmHeader,
|
|
175
|
+
]);
|
|
176
|
+
|
|
177
|
+
const inputBoxStyles = computed(() => [
|
|
178
|
+
...ConfirmInput,
|
|
179
|
+
]);
|
|
180
|
+
|
|
181
|
+
const footerStyles = computed(() => [
|
|
182
|
+
...ConfirmFooter,
|
|
183
|
+
...ConfirmFooterTypes[props.confirmType],
|
|
184
|
+
]);
|
|
185
|
+
|
|
186
|
+
const buttonsStyles = computed(() => [
|
|
187
|
+
...ConfirmFooterButtons,
|
|
188
|
+
]);
|
|
189
|
+
|
|
172
190
|
// State
|
|
173
|
-
const touched = ref(false);
|
|
174
191
|
const { state, open, close } = usePopoverState(toRef(props, 'isOpen'), context.emit);
|
|
175
192
|
const isInputActive = ref(false);
|
|
176
|
-
const confirmationValue = ref
|
|
193
|
+
const confirmationValue = ref('');
|
|
194
|
+
|
|
195
|
+
watch(state, () => {
|
|
196
|
+
confirmationValue.value = '';
|
|
197
|
+
});
|
|
177
198
|
|
|
178
199
|
const { escape, enter } = useMagicKeys();
|
|
179
200
|
|
|
@@ -200,7 +221,6 @@ export default defineComponent({
|
|
|
200
221
|
|
|
201
222
|
function onInputBlur(): void {
|
|
202
223
|
isInputActive.value = false;
|
|
203
|
-
touched.value = true;
|
|
204
224
|
}
|
|
205
225
|
|
|
206
226
|
// Events
|
|
@@ -208,13 +228,6 @@ export default defineComponent({
|
|
|
208
228
|
if (val) close();
|
|
209
229
|
});
|
|
210
230
|
|
|
211
|
-
watch(state, (value) => {
|
|
212
|
-
if (value === 'closed') {
|
|
213
|
-
confirmationValue.value = '';
|
|
214
|
-
touched.value = false;
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
|
|
218
231
|
// types here are used for fixing TS2349
|
|
219
232
|
watch(confirmationInput as any, (val: InstanceType<typeof OrInput>) =>
|
|
220
233
|
(val?.focus as (() => void) | undefined)?.());
|
|
@@ -229,29 +242,6 @@ export default defineComponent({
|
|
|
229
242
|
|
|
230
243
|
whenever(logicAnd(enter, isInputActive), () => confirm());
|
|
231
244
|
|
|
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
245
|
// #region Click Outside
|
|
256
246
|
onClickOutside(root, close);
|
|
257
247
|
// #endregion
|
|
@@ -264,7 +254,6 @@ export default defineComponent({
|
|
|
264
254
|
confirmButtonColor,
|
|
265
255
|
isInvalid,
|
|
266
256
|
isConfirmationButtonDisabled,
|
|
267
|
-
touched,
|
|
268
257
|
state,
|
|
269
258
|
isInputActive,
|
|
270
259
|
escape,
|