@eldrajs/ui 0.3.6 → 0.3.8
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/CHANGELOG.md +10 -0
- package/LICENSE-country-flag-icons +25 -0
- package/README.md +380 -79
- package/dist/PhoneInput-CYGpERg4.js +749 -0
- package/dist/{VariantPicker-BB-2Cj32.js → VariantPicker-D_Gg80So.js} +163 -2307
- package/dist/componentNames.d.ts +1 -1
- package/dist/components/badge/StockBadge.vue.d.ts +1 -1
- package/dist/components/chip/Chip.vue.d.ts +10 -0
- package/dist/components/dialog/Dialog.vue.d.ts +10 -0
- package/dist/components/drawer/Drawer.vue.d.ts +10 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +10 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +10 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +10 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +10 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +10 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +10 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +10 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +10 -0
- package/dist/components/nav-menu/NavMenu.vue.d.ts +10 -0
- package/dist/components/notice/Notice.vue.d.ts +28 -0
- package/dist/components/notice/types.d.ts +38 -0
- package/dist/components/pagination/Pagination.vue.d.ts +10 -0
- package/dist/components/price/Price.vue.d.ts +1 -1
- package/dist/components/product-card/ProductCard.vue.d.ts +1 -1
- package/dist/components/radio/RadioGroup.vue.d.ts +4 -0
- package/dist/components/radio/recipes.d.ts +4 -2
- package/dist/components/radio/types.d.ts +8 -1
- package/dist/components/range-slider/RangeSlider.vue.d.ts +10 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +10 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +10 -0
- package/dist/components/select/MultiSelect.vue.d.ts +10 -0
- package/dist/components/select/Select.vue.d.ts +10 -0
- package/dist/components/site-form/SiteForm.vue.d.ts +10 -0
- package/dist/components/spinner/Spinner.vue.d.ts +4 -1
- package/dist/components/spinner/types.d.ts +9 -0
- package/dist/components/step-indicator/StepIndicator.vue.d.ts +7 -0
- package/dist/components/step-indicator/types.d.ts +30 -0
- package/dist/components/toast/Toast.vue.d.ts +10 -0
- package/dist/components/toast/Toaster.vue.d.ts +10 -0
- package/dist/components.css +153 -0
- package/dist/icons/paths.d.ts +8 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +621 -302
- package/dist/messages/en-US.d.ts +27 -0
- package/dist/messages/is-IS.js +11 -1
- package/dist/phone/PhoneFlag.vue.d.ts +6 -0
- package/dist/phone/PhoneInput.vue.d.ts +220 -0
- package/dist/phone/caret.d.ts +14 -0
- package/dist/phone/examples.d.ts +2 -0
- package/dist/phone/flags.d.ts +8 -0
- package/dist/phone/index.d.ts +13 -0
- package/dist/phone/phone.d.ts +62 -0
- package/dist/phone/phoneFlagData.d.ts +2 -0
- package/dist/phone/rule.d.ts +22 -0
- package/dist/phone/types.d.ts +63 -0
- package/dist/phone/vee-validate/FieldPhoneInput.vue.d.ts +24 -0
- package/dist/phone/vee-validate/index.d.ts +3 -0
- package/dist/phone/vee-validate/types.d.ts +3 -0
- package/dist/phone/vee-validate.js +96 -0
- package/dist/phone.js +1 -0
- package/dist/phoneFlagData-D9dDT2uC.js +261 -0
- package/dist/resolver.d.ts +9 -2
- package/dist/resolver.js +18 -4
- package/dist/style.css +153 -0
- package/dist/useFieldControl-D_b9SC9s.js +273 -0
- package/dist/{useMessages-B5nzZghs.js → useMessages-DQQPh1P_.js} +28 -1
- package/dist/usePopover-4CQR2hB5.js +2228 -0
- package/dist/utilities.css +37 -0
- package/dist/vee-validate/FieldCheckbox.vue.d.ts +5 -1
- package/dist/vee-validate/FieldCheckboxGroup.vue.d.ts +5 -1
- package/dist/vee-validate/FieldCurrencyInput.vue.d.ts +5 -1
- package/dist/vee-validate/FieldInput.vue.d.ts +5 -1
- package/dist/vee-validate/FieldMultiSelect.vue.d.ts +5 -1
- package/dist/vee-validate/FieldQuantityStepper.vue.d.ts +5 -1
- package/dist/vee-validate/FieldRadioGroup.vue.d.ts +5 -1
- package/dist/vee-validate/FieldSearchBar.vue.d.ts +5 -1
- package/dist/vee-validate/FieldSelect.vue.d.ts +5 -1
- package/dist/vee-validate/FieldSwitch.vue.d.ts +5 -1
- package/dist/vee-validate/FieldTextarea.vue.d.ts +5 -1
- package/dist/vee-validate/FieldUnitInput.vue.d.ts +5 -1
- package/dist/vee-validate/FieldVariantPicker.vue.d.ts +5 -1
- package/dist/vee-validate/context.d.ts +32 -7
- package/dist/vee-validate/index.d.ts +8 -5
- package/dist/vee-validate/types.d.ts +26 -0
- package/dist/vee-validate/useFieldControl.d.ts +59 -10
- package/dist/vee-validate.js +114 -197
- package/dist/vue-i18n.js +4 -1
- package/package.json +20 -3
package/dist/vee-validate.js
CHANGED
|
@@ -1,153 +1,9 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { r as useMessages } from "./useMessages-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* The server's field errors, keyed by the path a `Field*` validates under (its `path`, or its
|
|
8
|
-
* `name` when there is none).
|
|
9
|
-
*
|
|
10
|
-
* `Form` provides it from its `apiErrors` prop and applies it to the form with vee-validate's own
|
|
11
|
-
* `setErrors`, so a 422 from the shop's API lands on the field it belongs to rather than in a
|
|
12
|
-
* banner above the form. Every `Field*` injects it and removes **its own** entry the moment its
|
|
13
|
-
* value changes — a server error is a statement about the value that was sent, so it stops being
|
|
14
|
-
* true as soon as the customer edits it, and nothing else would reliably clear it (a rule that
|
|
15
|
-
* already passes has no new message to overwrite it with).
|
|
16
|
-
*
|
|
17
|
-
* How long an entry survives a change to a *different* field is vee-validate's, not this key's.
|
|
18
|
-
* Before the first submit — and with per-field `rules` at any time — only the changed field is
|
|
19
|
-
* revalidated, so another field's server error stays put. After a submit, with a form-level
|
|
20
|
-
* `validationSchema`, every already-validated field is revalidated on each change
|
|
21
|
-
* (`validated-only`), and a field that now passes has its manually set error replaced by that
|
|
22
|
-
* pass — so the server's message for it goes too. Send the current map with each response rather
|
|
23
|
-
* than treating one as sticky; `src/vee-validate/__tests__/vee-validate.spec.ts` pins both halves.
|
|
24
|
-
*
|
|
25
|
-
* It is a plain `Ref`, so a consumer can provide one itself and drive server errors from outside a
|
|
26
|
-
* `Form`:
|
|
27
|
-
*
|
|
28
|
-
* ```ts
|
|
29
|
-
* import { API_ERRORS_KEY } from '@eldrajs/ui/vee-validate';
|
|
30
|
-
* provide(API_ERRORS_KEY, ref({ email: 'That address is already subscribed.' }));
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
var API_ERRORS_KEY = Symbol("eldra-ui:api-errors");
|
|
34
|
-
/** The key a `Form` provides its {@link FieldAnchorRegistry} on. Internal to this entry. */
|
|
35
|
-
var FIELD_ANCHORS_KEY = Symbol("eldra-ui:field-anchors");
|
|
36
|
-
// src/vee-validate/useFieldControl.ts
|
|
37
|
-
/** The props a `Field*` keeps for itself and never forwards to the component it wraps. */
|
|
38
|
-
var FIELD_ONLY = [
|
|
39
|
-
"path",
|
|
40
|
-
"rules",
|
|
41
|
-
"label",
|
|
42
|
-
"id"
|
|
43
|
-
];
|
|
44
|
-
/**
|
|
45
|
-
* The whole of what a `Field*` does, minus the one component it renders.
|
|
46
|
-
*
|
|
47
|
-
* Each `Field*` is a thin SFC over this: `useField(name, rules, { label })` for the value and the
|
|
48
|
-
* message, a gate that keeps a message hidden until the customer has left the field or submitted
|
|
49
|
-
* the form, the `id` the form's error summary links to, and the server error that stops being true
|
|
50
|
-
* as soon as the value changes. Keeping it here is what makes the eleven components agree on all
|
|
51
|
-
* of that rather than eleven files drifting apart.
|
|
52
|
-
*
|
|
53
|
-
* **The gate** is the spec's own rule (Form layout → Behaviour & motion: "Validate on submit, then
|
|
54
|
-
* on blur for fields that were invalid after the first submit"). vee-validate revalidates on every
|
|
55
|
-
* keystroke, so the field always *knows* its message; showing it only once `meta.touched` or the
|
|
56
|
-
* form has been submitted is what stops an error appearing under a half-typed email address.
|
|
57
|
-
*/
|
|
58
|
-
function useFieldControl(props, options) {
|
|
59
|
-
/**
|
|
60
|
-
* Where the value lives. `name` for every control whose `name` is the native form field name;
|
|
61
|
-
* `path` for the one whose is not — a `VariantPicker`'s `name` is the visible option name, so it
|
|
62
|
-
* would otherwise be both the legend and the key in `values`, and one of the two would be wrong.
|
|
63
|
-
*/
|
|
64
|
-
const path = computed(() => props.path ?? props.name);
|
|
65
|
-
const rules = computed(() => props.rules);
|
|
66
|
-
const { value, errorMessage, handleBlur, meta } = useField(path, rules, {
|
|
67
|
-
label: () => props.label,
|
|
68
|
-
initialValue: options.initialValue
|
|
69
|
-
});
|
|
70
|
-
const model = computed({
|
|
71
|
-
get: () => value.value ?? options.empty,
|
|
72
|
-
set: (next) => {
|
|
73
|
-
value.value = next;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
/**
|
|
77
|
-
* The form above, for `submitCount`. Injected rather than taken from `useFormContext()` so a
|
|
78
|
-
* `Field*` used on its own — a single validated search box, say — works with no form at all.
|
|
79
|
-
*/
|
|
80
|
-
const form = inject(FormContextKey, null);
|
|
81
|
-
const submitted = computed(() => (form?.submitCount.value ?? 0) > 0);
|
|
82
|
-
const apiErrors = inject(API_ERRORS_KEY, null);
|
|
83
|
-
const hasApiError = computed(() => apiErrors !== null && apiErrors.value[path.value] !== void 0);
|
|
84
|
-
/**
|
|
85
|
-
* A server error is never held back: it is the answer to a submit the customer has already made,
|
|
86
|
-
* so there is nothing left to wait for — which also covers a form rendered with errors from a
|
|
87
|
-
* round trip that happened before this page existed.
|
|
88
|
-
*/
|
|
89
|
-
const error = computed(() => meta.touched || submitted.value || hasApiError.value ? errorMessage.value : void 0);
|
|
90
|
-
const invalid = computed(() => error.value !== void 0);
|
|
91
|
-
const wrapper = inject(FIELD_KEY, null);
|
|
92
|
-
const ownError = computed(() => wrapper === null ? error.value : void 0);
|
|
93
|
-
/**
|
|
94
|
-
* The id. A `FieldWrapper` already owns one and has tied its `<label for>` to it, so nothing is
|
|
95
|
-
* forwarded there — handing a `Checkbox` or a `Switch` an explicit `id` is what tells it the
|
|
96
|
-
* wrapper is *not* naming it, and it would draw a second label. Standing on its own, the field
|
|
97
|
-
* generates one so the error summary has something to link to.
|
|
98
|
-
*/
|
|
99
|
-
const ownId = useUiId("field");
|
|
100
|
-
const id = computed(() => props.id ?? (wrapper === null && options.hasIdProp !== false ? ownId.value : void 0));
|
|
101
|
-
const anchorId = computed(() => props.id ?? wrapper?.value.id ?? (options.hasIdProp !== false ? ownId.value : void 0));
|
|
102
|
-
const anchors = inject(FIELD_ANCHORS_KEY, null);
|
|
103
|
-
if (anchors !== null) {
|
|
104
|
-
watch([path, anchorId], ([current, target], previous) => {
|
|
105
|
-
const previousPath = previous?.[0];
|
|
106
|
-
if (previousPath !== void 0 && previousPath !== current) anchors.unregister(previousPath);
|
|
107
|
-
anchors.register(current, target);
|
|
108
|
-
}, { immediate: true });
|
|
109
|
-
onScopeDispose(() => anchors.unregister(path.value));
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* A server error is a statement about the value that was sent, so it stops being true the moment
|
|
113
|
-
* the customer edits the field — and nothing else would clear it, because a rule that already
|
|
114
|
-
* passes produces no new message to overwrite it with. Dropping the entry is what tells the
|
|
115
|
-
* `Form` to unset it (see `context.ts`).
|
|
116
|
-
*/
|
|
117
|
-
if (apiErrors !== null) watch(value, () => {
|
|
118
|
-
if (!(path.value in apiErrors.value)) return;
|
|
119
|
-
const next = { ...apiErrors.value };
|
|
120
|
-
delete next[path.value];
|
|
121
|
-
apiErrors.value = next;
|
|
122
|
-
});
|
|
123
|
-
return {
|
|
124
|
-
model,
|
|
125
|
-
error,
|
|
126
|
-
invalid,
|
|
127
|
-
ownError,
|
|
128
|
-
id,
|
|
129
|
-
onBlur: handleBlur
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Everything the `Field*` was given, minus what it keeps for itself — the props it forwards to the
|
|
134
|
-
* agnostic component underneath, typed as exactly that `Omit`.
|
|
135
|
-
*
|
|
136
|
-
* Built by walking the props object rather than by destructuring, so a prop added to any of the
|
|
137
|
-
* eleven components is forwarded the day it is added and nothing here has to be told about it.
|
|
138
|
-
* `undefined` values are forwarded too, which is exactly right: Vue applies a component's own
|
|
139
|
-
* `withDefaults` value for a prop that is `undefined`, so an unset prop still lands on its default.
|
|
140
|
-
*/
|
|
141
|
-
function useControlProps(props, omit) {
|
|
142
|
-
return computed(() => {
|
|
143
|
-
const forwarded = {};
|
|
144
|
-
for (const [key, value] of Object.entries(props)) {
|
|
145
|
-
if (omit.includes(key)) continue;
|
|
146
|
-
forwarded[key] = value;
|
|
147
|
-
}
|
|
148
|
-
return forwarded;
|
|
149
|
-
});
|
|
150
|
-
}
|
|
1
|
+
import { A as UnitInput_default, C as Switch_default, G as CheckboxGroup_default, K as Checkbox_default, S as focusInvalid, T as Input_default, b as MultiSelect_default, i as SearchBar_default, k as CurrencyInput_default, l as RadioGroup_default, n as Textarea_default, r as Select_default, t as VariantPicker_default, x as FormLayout_default, y as QuantityStepper_default } from "./VariantPicker-D_Gg80So.js";
|
|
2
|
+
import { r as useMessages } from "./useMessages-DQQPh1P_.js";
|
|
3
|
+
import { a as useControlProps, c as FIELD_ANCHORS_KEY, i as FIELD_VALIDATION_PROPS, l as FIELD_MESSAGES_KEY, n as FIELD_ONLY, o as useFieldControl, r as FIELD_VALIDATION_DEFAULTS, s as API_ERRORS_KEY, t as FIELD_CHOICE_VALIDATION_DEFAULTS } from "./useFieldControl-D_b9SC9s.js";
|
|
4
|
+
import { $ as useEldraScope } from "./usePopover-4CQR2hB5.js";
|
|
5
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createSlots, createTextVNode, defineComponent, guardReactiveProps, isRef, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, onMounted, openBlock, provide, ref, renderList, renderSlot, toDisplayString, unref, watch, withCtx } from "vue";
|
|
6
|
+
import { useForm } from "vee-validate";
|
|
151
7
|
// src/vee-validate/Form.vue?vue&type=script&setup=true&lang.ts
|
|
152
8
|
var _hoisted_1 = ["data-eldra-scope"];
|
|
153
9
|
var _hoisted_2 = ["data-eldra-scope"];
|
|
@@ -202,17 +58,36 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
202
58
|
const apiErrors = ref({ ...props.apiErrors });
|
|
203
59
|
provide(API_ERRORS_KEY, apiErrors);
|
|
204
60
|
/**
|
|
61
|
+
* What each `Field*` below is showing, keyed by its path. A field holds its own displayed message
|
|
62
|
+
* and changes it only at its own moments (its blur, a submit, a value change when it asks for
|
|
63
|
+
* that — see `useFieldControl`), and reports it here, so the summary and the `errors` slot prop
|
|
64
|
+
* say what the fields say and change when they change. `known` is every path a `Field*` has
|
|
65
|
+
* registered, with or without a message.
|
|
66
|
+
*/
|
|
67
|
+
const reported = ref({});
|
|
68
|
+
/** Rises once a submit's validation has finished; every `Field*` reads its message again then. */
|
|
69
|
+
const settled = ref(0);
|
|
70
|
+
provide(FIELD_MESSAGES_KEY, {
|
|
71
|
+
report(path, message) {
|
|
72
|
+
reported.value[path] = message;
|
|
73
|
+
},
|
|
74
|
+
forget(path) {
|
|
75
|
+
delete reported.value[path];
|
|
76
|
+
},
|
|
77
|
+
settled
|
|
78
|
+
});
|
|
79
|
+
/**
|
|
205
80
|
* The errors that should currently be **shown**, which is not the same set as the errors that
|
|
206
|
-
* exist.
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
* `FieldWrapper` shows and what the control marks itself as cannot disagree.
|
|
81
|
+
* exist. For a path a `Field*` owns it is exactly what that field shows. Any other path — a
|
|
82
|
+
* consumer's own `useField`, or an error set on a path with no field — keeps the plain gate: its
|
|
83
|
+
* message surfaces once its field has been touched, the form has been submitted, or the server
|
|
84
|
+
* sent one.
|
|
211
85
|
*/
|
|
212
86
|
const visibleErrors = computed(() => {
|
|
213
87
|
const shown = {};
|
|
88
|
+
for (const [path, message] of Object.entries(reported.value)) if (message !== void 0) shown[path] = message;
|
|
214
89
|
for (const [path, message] of Object.entries(errors.value)) {
|
|
215
|
-
if (message === void 0) continue;
|
|
90
|
+
if (message === void 0 || path in reported.value) continue;
|
|
216
91
|
if (submitCount.value > 0 || form.isFieldTouched(path) || path in apiErrors.value) shown[path] = message;
|
|
217
92
|
}
|
|
218
93
|
return shown;
|
|
@@ -297,9 +172,11 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
297
172
|
/** Set by a submit that validated, and cleared by the next attempt. Drives `successMessage`. */
|
|
298
173
|
const submitted = ref(false);
|
|
299
174
|
const runSubmit = handleSubmit((submitValues, ctx) => {
|
|
175
|
+
settled.value += 1;
|
|
300
176
|
submitted.value = true;
|
|
301
177
|
emit("submit", submitValues, ctx);
|
|
302
178
|
}, ({ errors: failed }) => {
|
|
179
|
+
settled.value += 1;
|
|
303
180
|
emit("invalid", failed);
|
|
304
181
|
nextTick(focusFirstInvalid);
|
|
305
182
|
});
|
|
@@ -391,7 +268,7 @@ var Form_default = /* @__PURE__ */ defineComponent({
|
|
|
391
268
|
// src/vee-validate/FieldCheckbox.vue
|
|
392
269
|
var FieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
393
270
|
__name: "FieldCheckbox",
|
|
394
|
-
props: {
|
|
271
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
395
272
|
indeterminate: { type: Boolean },
|
|
396
273
|
value: {},
|
|
397
274
|
name: {},
|
|
@@ -412,8 +289,11 @@ var FieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
|
412
289
|
Function,
|
|
413
290
|
Array
|
|
414
291
|
] },
|
|
415
|
-
label: {}
|
|
416
|
-
|
|
292
|
+
label: {},
|
|
293
|
+
validateOnMount: { type: Boolean },
|
|
294
|
+
validateOnBlur: { type: Boolean },
|
|
295
|
+
validateOnValueUpdate: { type: Boolean }
|
|
296
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
417
297
|
setup(__props) {
|
|
418
298
|
/**
|
|
419
299
|
* A single `Checkbox` — a consent box, "Billing address is the same" — bound to a **boolean**
|
|
@@ -450,7 +330,7 @@ var FieldCheckbox_default = /* @__PURE__ */ defineComponent({
|
|
|
450
330
|
// src/vee-validate/FieldCheckboxGroup.vue
|
|
451
331
|
var FieldCheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
452
332
|
__name: "FieldCheckboxGroup",
|
|
453
|
-
props: {
|
|
333
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
454
334
|
legend: {},
|
|
455
335
|
options: {},
|
|
456
336
|
layout: {},
|
|
@@ -463,8 +343,11 @@ var FieldCheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
463
343
|
Function,
|
|
464
344
|
Array
|
|
465
345
|
] },
|
|
466
|
-
label: {}
|
|
467
|
-
|
|
346
|
+
label: {},
|
|
347
|
+
validateOnMount: { type: Boolean },
|
|
348
|
+
validateOnBlur: { type: Boolean },
|
|
349
|
+
validateOnValueUpdate: { type: Boolean }
|
|
350
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
468
351
|
setup(__props) {
|
|
469
352
|
/**
|
|
470
353
|
* `CheckboxGroup` bound to a **string array** field — one question, several answers ("Material").
|
|
@@ -502,7 +385,7 @@ var FieldCheckboxGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
502
385
|
// src/vee-validate/FieldCurrencyInput.vue
|
|
503
386
|
var FieldCurrencyInput_default = /* @__PURE__ */ defineComponent({
|
|
504
387
|
__name: "FieldCurrencyInput",
|
|
505
|
-
props: {
|
|
388
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
506
389
|
locale: {},
|
|
507
390
|
label: {},
|
|
508
391
|
maxFraction: {},
|
|
@@ -528,8 +411,11 @@ var FieldCurrencyInput_default = /* @__PURE__ */ defineComponent({
|
|
|
528
411
|
Object,
|
|
529
412
|
Function,
|
|
530
413
|
Array
|
|
531
|
-
] }
|
|
532
|
-
|
|
414
|
+
] },
|
|
415
|
+
validateOnMount: { type: Boolean },
|
|
416
|
+
validateOnBlur: { type: Boolean },
|
|
417
|
+
validateOnValueUpdate: { type: Boolean }
|
|
418
|
+
}, FIELD_VALIDATION_DEFAULTS),
|
|
533
419
|
setup(__props) {
|
|
534
420
|
/**
|
|
535
421
|
* `CurrencyInput` bound to a vee-validate field — `FieldUnitInput` for money, with the same
|
|
@@ -562,7 +448,7 @@ var FieldCurrencyInput_default = /* @__PURE__ */ defineComponent({
|
|
|
562
448
|
// src/vee-validate/FieldInput.vue
|
|
563
449
|
var FieldInput_default = /* @__PURE__ */ defineComponent({
|
|
564
450
|
__name: "FieldInput",
|
|
565
|
-
props: {
|
|
451
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
566
452
|
type: {},
|
|
567
453
|
size: {},
|
|
568
454
|
id: {},
|
|
@@ -588,8 +474,11 @@ var FieldInput_default = /* @__PURE__ */ defineComponent({
|
|
|
588
474
|
Function,
|
|
589
475
|
Array
|
|
590
476
|
] },
|
|
591
|
-
label: {}
|
|
592
|
-
|
|
477
|
+
label: {},
|
|
478
|
+
validateOnMount: { type: Boolean },
|
|
479
|
+
validateOnBlur: { type: Boolean },
|
|
480
|
+
validateOnValueUpdate: { type: Boolean }
|
|
481
|
+
}, FIELD_VALIDATION_DEFAULTS),
|
|
593
482
|
setup(__props) {
|
|
594
483
|
/**
|
|
595
484
|
* `Input` bound to a vee-validate field.
|
|
@@ -625,7 +514,7 @@ var FieldInput_default = /* @__PURE__ */ defineComponent({
|
|
|
625
514
|
// src/vee-validate/FieldMultiSelect.vue
|
|
626
515
|
var FieldMultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
627
516
|
__name: "FieldMultiSelect",
|
|
628
|
-
props: {
|
|
517
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
629
518
|
placeholder: {},
|
|
630
519
|
showTags: { type: Boolean },
|
|
631
520
|
tagPlacement: {},
|
|
@@ -656,8 +545,11 @@ var FieldMultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
656
545
|
Function,
|
|
657
546
|
Array
|
|
658
547
|
] },
|
|
659
|
-
label: {}
|
|
660
|
-
|
|
548
|
+
label: {},
|
|
549
|
+
validateOnMount: { type: Boolean },
|
|
550
|
+
validateOnBlur: { type: Boolean },
|
|
551
|
+
validateOnValueUpdate: { type: Boolean }
|
|
552
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
661
553
|
setup(__props) {
|
|
662
554
|
/**
|
|
663
555
|
* `MultiSelect` bound to a **string array** field.
|
|
@@ -693,7 +585,7 @@ var FieldMultiSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
693
585
|
// src/vee-validate/FieldQuantityStepper.vue
|
|
694
586
|
var FieldQuantityStepper_default = /* @__PURE__ */ defineComponent({
|
|
695
587
|
__name: "FieldQuantityStepper",
|
|
696
|
-
props: {
|
|
588
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
697
589
|
min: {},
|
|
698
590
|
max: {},
|
|
699
591
|
size: {},
|
|
@@ -710,8 +602,11 @@ var FieldQuantityStepper_default = /* @__PURE__ */ defineComponent({
|
|
|
710
602
|
Function,
|
|
711
603
|
Array
|
|
712
604
|
] },
|
|
713
|
-
label: {}
|
|
714
|
-
|
|
605
|
+
label: {},
|
|
606
|
+
validateOnMount: { type: Boolean },
|
|
607
|
+
validateOnBlur: { type: Boolean },
|
|
608
|
+
validateOnValueUpdate: { type: Boolean }
|
|
609
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
715
610
|
setup(__props) {
|
|
716
611
|
/**
|
|
717
612
|
* `QuantityStepper` bound to a **number** field.
|
|
@@ -753,7 +648,7 @@ var FieldQuantityStepper_default = /* @__PURE__ */ defineComponent({
|
|
|
753
648
|
// src/vee-validate/FieldRadioGroup.vue
|
|
754
649
|
var FieldRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
755
650
|
__name: "FieldRadioGroup",
|
|
756
|
-
props: {
|
|
651
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
757
652
|
name: {},
|
|
758
653
|
legend: {},
|
|
759
654
|
options: {},
|
|
@@ -771,8 +666,11 @@ var FieldRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
771
666
|
Function,
|
|
772
667
|
Array
|
|
773
668
|
] },
|
|
774
|
-
label: {}
|
|
775
|
-
|
|
669
|
+
label: {},
|
|
670
|
+
validateOnMount: { type: Boolean },
|
|
671
|
+
validateOnBlur: { type: Boolean },
|
|
672
|
+
validateOnValueUpdate: { type: Boolean }
|
|
673
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
776
674
|
setup(__props) {
|
|
777
675
|
/**
|
|
778
676
|
* `RadioGroup` bound to a vee-validate field. Like every fieldset control here it is touched by
|
|
@@ -807,7 +705,7 @@ var FieldRadioGroup_default = /* @__PURE__ */ defineComponent({
|
|
|
807
705
|
// src/vee-validate/FieldSearchBar.vue
|
|
808
706
|
var FieldSearchBar_default = /* @__PURE__ */ defineComponent({
|
|
809
707
|
__name: "FieldSearchBar",
|
|
810
|
-
props: {
|
|
708
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
811
709
|
size: {},
|
|
812
710
|
pill: { type: Boolean },
|
|
813
711
|
action: {},
|
|
@@ -831,8 +729,11 @@ var FieldSearchBar_default = /* @__PURE__ */ defineComponent({
|
|
|
831
729
|
Object,
|
|
832
730
|
Function,
|
|
833
731
|
Array
|
|
834
|
-
] }
|
|
835
|
-
|
|
732
|
+
] },
|
|
733
|
+
validateOnMount: { type: Boolean },
|
|
734
|
+
validateOnBlur: { type: Boolean },
|
|
735
|
+
validateOnValueUpdate: { type: Boolean }
|
|
736
|
+
}, FIELD_VALIDATION_DEFAULTS),
|
|
836
737
|
setup(__props) {
|
|
837
738
|
/**
|
|
838
739
|
* `SearchBar` bound to a vee-validate field, for a Search page whose query is validated before it
|
|
@@ -857,7 +758,8 @@ var FieldSearchBar_default = /* @__PURE__ */ defineComponent({
|
|
|
857
758
|
"path",
|
|
858
759
|
"rules",
|
|
859
760
|
"id",
|
|
860
|
-
"name"
|
|
761
|
+
"name",
|
|
762
|
+
...FIELD_VALIDATION_PROPS
|
|
861
763
|
]);
|
|
862
764
|
return (_ctx, _cache) => {
|
|
863
765
|
return openBlock(), createBlock(SearchBar_default, mergeProps(unref(control), {
|
|
@@ -876,7 +778,7 @@ var FieldSearchBar_default = /* @__PURE__ */ defineComponent({
|
|
|
876
778
|
// src/vee-validate/FieldSelect.vue
|
|
877
779
|
var FieldSelect_default = /* @__PURE__ */ defineComponent({
|
|
878
780
|
__name: "FieldSelect",
|
|
879
|
-
props: {
|
|
781
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
880
782
|
options: {},
|
|
881
783
|
name: {},
|
|
882
784
|
id: {},
|
|
@@ -904,8 +806,11 @@ var FieldSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
904
806
|
Function,
|
|
905
807
|
Array
|
|
906
808
|
] },
|
|
907
|
-
label: {}
|
|
908
|
-
|
|
809
|
+
label: {},
|
|
810
|
+
validateOnMount: { type: Boolean },
|
|
811
|
+
validateOnBlur: { type: Boolean },
|
|
812
|
+
validateOnValueUpdate: { type: Boolean }
|
|
813
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
909
814
|
setup(__props) {
|
|
910
815
|
/**
|
|
911
816
|
* `Select` bound to a vee-validate field. The hidden native `<select>` still carries `name`, so the
|
|
@@ -938,7 +843,7 @@ var FieldSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
938
843
|
// src/vee-validate/FieldSwitch.vue
|
|
939
844
|
var FieldSwitch_default = /* @__PURE__ */ defineComponent({
|
|
940
845
|
__name: "FieldSwitch",
|
|
941
|
-
props: {
|
|
846
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
942
847
|
size: {},
|
|
943
848
|
description: {},
|
|
944
849
|
disabled: { type: Boolean },
|
|
@@ -955,8 +860,11 @@ var FieldSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
955
860
|
Function,
|
|
956
861
|
Array
|
|
957
862
|
] },
|
|
958
|
-
label: {}
|
|
959
|
-
|
|
863
|
+
label: {},
|
|
864
|
+
validateOnMount: { type: Boolean },
|
|
865
|
+
validateOnBlur: { type: Boolean },
|
|
866
|
+
validateOnValueUpdate: { type: Boolean }
|
|
867
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
960
868
|
setup(__props) {
|
|
961
869
|
/**
|
|
962
870
|
* `Switch` bound to a boolean field.
|
|
@@ -989,7 +897,7 @@ var FieldSwitch_default = /* @__PURE__ */ defineComponent({
|
|
|
989
897
|
// src/vee-validate/FieldTextarea.vue
|
|
990
898
|
var FieldTextarea_default = /* @__PURE__ */ defineComponent({
|
|
991
899
|
__name: "FieldTextarea",
|
|
992
|
-
props: {
|
|
900
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
993
901
|
placeholder: {},
|
|
994
902
|
maxLength: {},
|
|
995
903
|
counter: { type: Boolean },
|
|
@@ -1010,8 +918,11 @@ var FieldTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1010
918
|
Function,
|
|
1011
919
|
Array
|
|
1012
920
|
] },
|
|
1013
|
-
label: {}
|
|
1014
|
-
|
|
921
|
+
label: {},
|
|
922
|
+
validateOnMount: { type: Boolean },
|
|
923
|
+
validateOnBlur: { type: Boolean },
|
|
924
|
+
validateOnValueUpdate: { type: Boolean }
|
|
925
|
+
}, FIELD_VALIDATION_DEFAULTS),
|
|
1015
926
|
setup(__props) {
|
|
1016
927
|
/**
|
|
1017
928
|
* `Textarea` bound to a vee-validate field. The counter, `maxLength`, `hardLimit` and `minHeight`
|
|
@@ -1044,7 +955,7 @@ var FieldTextarea_default = /* @__PURE__ */ defineComponent({
|
|
|
1044
955
|
// src/vee-validate/FieldUnitInput.vue
|
|
1045
956
|
var FieldUnitInput_default = /* @__PURE__ */ defineComponent({
|
|
1046
957
|
__name: "FieldUnitInput",
|
|
1047
|
-
props: {
|
|
958
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
1048
959
|
unit: {},
|
|
1049
960
|
locale: {},
|
|
1050
961
|
label: {},
|
|
@@ -1072,8 +983,11 @@ var FieldUnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1072
983
|
Object,
|
|
1073
984
|
Function,
|
|
1074
985
|
Array
|
|
1075
|
-
] }
|
|
1076
|
-
|
|
986
|
+
] },
|
|
987
|
+
validateOnMount: { type: Boolean },
|
|
988
|
+
validateOnBlur: { type: Boolean },
|
|
989
|
+
validateOnValueUpdate: { type: Boolean }
|
|
990
|
+
}, FIELD_VALIDATION_DEFAULTS),
|
|
1077
991
|
setup(__props) {
|
|
1078
992
|
/**
|
|
1079
993
|
* `UnitInput` bound to a vee-validate field.
|
|
@@ -1113,7 +1027,7 @@ var FieldUnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1113
1027
|
// src/vee-validate/FieldVariantPicker.vue
|
|
1114
1028
|
var FieldVariantPicker_default = /* @__PURE__ */ defineComponent({
|
|
1115
1029
|
__name: "FieldVariantPicker",
|
|
1116
|
-
props: {
|
|
1030
|
+
props: /*@__PURE__*/ mergeDefaults({
|
|
1117
1031
|
name: {},
|
|
1118
1032
|
legend: {},
|
|
1119
1033
|
type: {},
|
|
@@ -1126,8 +1040,11 @@ var FieldVariantPicker_default = /* @__PURE__ */ defineComponent({
|
|
|
1126
1040
|
Function,
|
|
1127
1041
|
Array
|
|
1128
1042
|
] },
|
|
1129
|
-
label: {}
|
|
1130
|
-
|
|
1043
|
+
label: {},
|
|
1044
|
+
validateOnMount: { type: Boolean },
|
|
1045
|
+
validateOnBlur: { type: Boolean },
|
|
1046
|
+
validateOnValueUpdate: { type: Boolean }
|
|
1047
|
+
}, FIELD_CHOICE_VALIDATION_DEFAULTS),
|
|
1131
1048
|
setup(__props) {
|
|
1132
1049
|
/**
|
|
1133
1050
|
* `VariantPicker` bound to a vee-validate field.
|
|
@@ -1170,4 +1087,4 @@ var FieldVariantPicker_default = /* @__PURE__ */ defineComponent({
|
|
|
1170
1087
|
};
|
|
1171
1088
|
}
|
|
1172
1089
|
});
|
|
1173
|
-
export { API_ERRORS_KEY, FIELD_ONLY, FieldCheckbox_default as FieldCheckbox, FieldCheckboxGroup_default as FieldCheckboxGroup, FieldCurrencyInput_default as FieldCurrencyInput, FieldInput_default as FieldInput, FieldMultiSelect_default as FieldMultiSelect, FieldQuantityStepper_default as FieldQuantityStepper, FieldRadioGroup_default as FieldRadioGroup, FieldSearchBar_default as FieldSearchBar, FieldSelect_default as FieldSelect, FieldSwitch_default as FieldSwitch, FieldTextarea_default as FieldTextarea, FieldUnitInput_default as FieldUnitInput, FieldVariantPicker_default as FieldVariantPicker, Form_default as Form, useFieldControl };
|
|
1090
|
+
export { API_ERRORS_KEY, FIELD_CHOICE_VALIDATION_DEFAULTS, FIELD_ONLY, FIELD_VALIDATION_DEFAULTS, FIELD_VALIDATION_PROPS, FieldCheckbox_default as FieldCheckbox, FieldCheckboxGroup_default as FieldCheckboxGroup, FieldCurrencyInput_default as FieldCurrencyInput, FieldInput_default as FieldInput, FieldMultiSelect_default as FieldMultiSelect, FieldQuantityStepper_default as FieldQuantityStepper, FieldRadioGroup_default as FieldRadioGroup, FieldSearchBar_default as FieldSearchBar, FieldSelect_default as FieldSelect, FieldSwitch_default as FieldSwitch, FieldTextarea_default as FieldTextarea, FieldUnitInput_default as FieldUnitInput, FieldVariantPicker_default as FieldVariantPicker, Form_default as Form, useFieldControl };
|
package/dist/vue-i18n.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as enUS, n as provideEldraUiMessages } from "./useMessages-
|
|
1
|
+
import { i as enUS, n as provideEldraUiMessages } from "./useMessages-DQQPh1P_.js";
|
|
2
2
|
import { t as formatConjunctionList } from "./listFormat-D9ecpDMT.js";
|
|
3
3
|
import { numberFormat } from "@eldrajs/sdk/format";
|
|
4
4
|
import { useI18n } from "vue-i18n";
|
|
@@ -21,6 +21,9 @@ var SHAPES = {
|
|
|
21
21
|
closeDrawer: text("name"),
|
|
22
22
|
noResultsFor: text("query"),
|
|
23
23
|
noMatchesFor: text("query"),
|
|
24
|
+
phoneCountry: text("name", "code"),
|
|
25
|
+
phoneNoMatch: text("query"),
|
|
26
|
+
phoneInvalid: text("country"),
|
|
24
27
|
createOption: text("query"),
|
|
25
28
|
moreSelected: counted(),
|
|
26
29
|
removeTag: text("label"),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Accessible Vue 3 core components for Eldra storefronts: buttons, forms, selects, cards, overlays and navigation, themed through CSS design tokens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessible",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"CHANGELOG.md",
|
|
24
24
|
"LICENSE",
|
|
25
|
-
"LICENSE-tabler-icons"
|
|
25
|
+
"LICENSE-tabler-icons",
|
|
26
|
+
"LICENSE-country-flag-icons"
|
|
26
27
|
],
|
|
27
28
|
"type": "module",
|
|
28
29
|
"sideEffects": [
|
|
@@ -45,6 +46,14 @@
|
|
|
45
46
|
"types": "./dist/vue-i18n/index.d.ts",
|
|
46
47
|
"import": "./dist/vue-i18n.js"
|
|
47
48
|
},
|
|
49
|
+
"./phone": {
|
|
50
|
+
"types": "./dist/phone/index.d.ts",
|
|
51
|
+
"import": "./dist/phone.js"
|
|
52
|
+
},
|
|
53
|
+
"./phone/vee-validate": {
|
|
54
|
+
"types": "./dist/phone/vee-validate/index.d.ts",
|
|
55
|
+
"import": "./dist/phone/vee-validate.js"
|
|
56
|
+
},
|
|
48
57
|
"./messages/is-IS": {
|
|
49
58
|
"types": "./dist/messages/is-IS.d.ts",
|
|
50
59
|
"import": "./dist/messages/is-IS.js"
|
|
@@ -64,7 +73,7 @@
|
|
|
64
73
|
"dependencies": {
|
|
65
74
|
"@floating-ui/vue": "^1.1.5",
|
|
66
75
|
"tailwind-merge": "^3.0.0",
|
|
67
|
-
"@eldrajs/sdk": "^0.4.
|
|
76
|
+
"@eldrajs/sdk": "^0.4.3"
|
|
68
77
|
},
|
|
69
78
|
"devDependencies": {
|
|
70
79
|
"@playwright/test": "1.62.1",
|
|
@@ -77,7 +86,9 @@
|
|
|
77
86
|
"@tailwindcss/vite": "^4.1.14",
|
|
78
87
|
"@vitejs/plugin-vue": "^6.0.5",
|
|
79
88
|
"@vue/test-utils": "^2.4.6",
|
|
89
|
+
"country-flag-icons": "1.6.20",
|
|
80
90
|
"happy-dom": "^21.0.4",
|
|
91
|
+
"libphonenumber-js": "^1.13.16",
|
|
81
92
|
"pixelmatch": "^7.1.0",
|
|
82
93
|
"pngjs": "^7.0.0",
|
|
83
94
|
"postcss": "^8.5.32",
|
|
@@ -94,11 +105,15 @@
|
|
|
94
105
|
"vue-tsc": "^3.3.11"
|
|
95
106
|
},
|
|
96
107
|
"peerDependencies": {
|
|
108
|
+
"libphonenumber-js": "^1.13.0",
|
|
97
109
|
"vee-validate": "^4.12.0",
|
|
98
110
|
"vue": "^3.5.0",
|
|
99
111
|
"vue-i18n": "^11.0.0"
|
|
100
112
|
},
|
|
101
113
|
"peerDependenciesMeta": {
|
|
114
|
+
"libphonenumber-js": {
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
102
117
|
"vee-validate": {
|
|
103
118
|
"optional": true
|
|
104
119
|
},
|
|
@@ -115,6 +130,8 @@
|
|
|
115
130
|
"check:tokens": "node scripts/build-tokens.mjs --check",
|
|
116
131
|
"build-tabler-icons": "node scripts/build-tabler-icons.mjs",
|
|
117
132
|
"check:tabler-icons": "node scripts/build-tabler-icons.mjs --check",
|
|
133
|
+
"build-phone-flags": "node scripts/build-phone-flags.mjs",
|
|
134
|
+
"check:phone-flags": "node scripts/build-phone-flags.mjs --check",
|
|
118
135
|
"typecheck": "vue-tsc --noEmit -p tsconfig.json",
|
|
119
136
|
"lint": "oxlint src scripts",
|
|
120
137
|
"test": "vitest run",
|