@eldrajs/ui 0.3.20 → 0.3.21
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 +5 -0
- package/README.md +63 -31
- package/dist/{PhoneInput-CHTpjbtS.js → PhoneInput-f6wxvduD.js} +1 -1
- package/dist/{VariantPicker-BLuaCwee.js → VariantPicker-CCci26If.js} +523 -310
- package/dist/components/autocomplete/Autocomplete.vue.d.ts +2 -0
- package/dist/components/chip/Chip.vue.d.ts +2 -0
- package/dist/components/currency-input/CurrencyInput.vue.d.ts +5 -1
- package/dist/components/dialog/Dialog.vue.d.ts +2 -0
- package/dist/components/drawer/Drawer.vue.d.ts +2 -0
- package/dist/components/filter-panel/FilterGroup.vue.d.ts +2 -0
- package/dist/components/filter-panel/FilterPanel.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ColourFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ListFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/RangeFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/SizeFacet.vue.d.ts +2 -0
- package/dist/components/filter-panel/facets/ToggleFacet.vue.d.ts +2 -0
- package/dist/components/lightbox/Lightbox.vue.d.ts +2 -0
- package/dist/components/load-more/LoadMore.vue.d.ts +1 -1
- package/dist/components/nav-menu/NavMenu.vue.d.ts +2 -0
- package/dist/components/pagination/Pagination.vue.d.ts +2 -0
- package/dist/components/range-slider/RangeSlider.vue.d.ts +2 -0
- package/dist/components/search-bar/SearchBar.vue.d.ts +2 -0
- package/dist/components/search-modal/SearchModal.vue.d.ts +2 -0
- package/dist/components/select/MultiSelect.vue.d.ts +2 -0
- package/dist/components/select/Select.vue.d.ts +2 -0
- package/dist/components/site-form/SiteForm.vue.d.ts +2 -0
- package/dist/components/toast/Toast.vue.d.ts +2 -0
- package/dist/components/toast/Toaster.vue.d.ts +2 -0
- package/dist/components/unit-input/UnitInput.vue.d.ts +8 -0
- package/dist/components/unit-input/types.d.ts +13 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -3
- package/dist/messages/en-US.d.ts +4 -0
- package/dist/messages/is-IS.js +3 -1
- package/dist/phone/PhoneInput.vue.d.ts +2 -0
- package/dist/phone/vee-validate.js +3 -3
- package/dist/phone.js +1 -1
- package/dist/{useFieldControl-B1JvPEeM.js → useFieldControl-BnO3B37W.js} +17 -6
- package/dist/{useMessages-BdN9F1cW.js → useMessages-D8bTGX7c.js} +5 -1
- package/dist/utils/amount.d.ts +71 -0
- package/dist/vee-validate/useFieldControl.d.ts +6 -0
- package/dist/vee-validate.js +35 -5
- package/dist/vue-i18n.js +1 -1
- package/package.json +1 -1
package/dist/vee-validate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as UnitInput_default,
|
|
2
|
-
import { r as useMessages } from "./useMessages-
|
|
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-
|
|
1
|
+
import { $ as Autocomplete_default, E as UnitInput_default, G as Checkbox_default, S as Switch_default, T as CurrencyInput_default, W as CheckboxGroup_default, b as FormLayout_default, c as RadioGroup_default, et as Input_default, n as Textarea_default, r as SearchBar_default, t as VariantPicker_default, v as QuantityStepper_default, w as Select_default, x as focusInvalid, y as MultiSelect_default } from "./VariantPicker-CCci26If.js";
|
|
2
|
+
import { r as useMessages } from "./useMessages-D8bTGX7c.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-BnO3B37W.js";
|
|
4
4
|
import { r as useEldraScope } from "./useEldraScope-BDbGzt7R.js";
|
|
5
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
6
|
import { useForm } from "vee-validate";
|
|
@@ -463,6 +463,9 @@ var FieldCurrencyInput_default = /* @__PURE__ */ defineComponent({
|
|
|
463
463
|
clearable: { type: Boolean },
|
|
464
464
|
currency: {},
|
|
465
465
|
narrowSymbol: { type: Boolean },
|
|
466
|
+
fixedFraction: { type: Boolean },
|
|
467
|
+
nullable: { type: Boolean },
|
|
468
|
+
placeholder: {},
|
|
466
469
|
size: {},
|
|
467
470
|
id: {},
|
|
468
471
|
name: {},
|
|
@@ -489,14 +492,26 @@ var FieldCurrencyInput_default = /* @__PURE__ */ defineComponent({
|
|
|
489
492
|
* `number | null` value. See `FieldUnitInput` for what is forwarded and why the value is a number.
|
|
490
493
|
*/
|
|
491
494
|
const props = __props;
|
|
492
|
-
const
|
|
495
|
+
const control$ = ref(null);
|
|
496
|
+
const readable = ref(true);
|
|
497
|
+
const messages = useMessages();
|
|
498
|
+
const { model, invalid, id, onBlur } = useFieldControl(props, {
|
|
499
|
+
empty: null,
|
|
500
|
+
unreadable: () => {
|
|
501
|
+
if (readable.value) return void 0;
|
|
502
|
+
return control$.value?.invalidReason === "noDecimals" ? messages.value.amountNoDecimals : messages.value.amountNotANumber;
|
|
503
|
+
}
|
|
504
|
+
});
|
|
493
505
|
const control = useControlProps(props, FIELD_ONLY);
|
|
494
506
|
return (_ctx, _cache) => {
|
|
495
507
|
return openBlock(), createBlock(CurrencyInput_default, mergeProps(unref(control), {
|
|
496
508
|
id: unref(id),
|
|
509
|
+
ref_key: "control$",
|
|
510
|
+
ref: control$,
|
|
497
511
|
modelValue: unref(model),
|
|
498
512
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
|
|
499
513
|
invalid: unref(invalid),
|
|
514
|
+
"onUpdate:valid": _cache[1] || (_cache[1] = ($event) => readable.value = $event),
|
|
500
515
|
onBlur: unref(onBlur)
|
|
501
516
|
}), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, slotName) => {
|
|
502
517
|
return {
|
|
@@ -1036,6 +1051,9 @@ var FieldUnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1036
1051
|
isCurrency: { type: Boolean },
|
|
1037
1052
|
currency: {},
|
|
1038
1053
|
narrowSymbol: { type: Boolean },
|
|
1054
|
+
fixedFraction: { type: Boolean },
|
|
1055
|
+
nullable: { type: Boolean },
|
|
1056
|
+
placeholder: {},
|
|
1039
1057
|
size: {},
|
|
1040
1058
|
id: {},
|
|
1041
1059
|
name: {},
|
|
@@ -1069,14 +1087,26 @@ var FieldUnitInput_default = /* @__PURE__ */ defineComponent({
|
|
|
1069
1087
|
* compares numerically) and a form submits one.
|
|
1070
1088
|
*/
|
|
1071
1089
|
const props = __props;
|
|
1072
|
-
const
|
|
1090
|
+
const control$ = ref(null);
|
|
1091
|
+
const readable = ref(true);
|
|
1092
|
+
const messages = useMessages();
|
|
1093
|
+
const { model, invalid, id, onBlur } = useFieldControl(props, {
|
|
1094
|
+
empty: null,
|
|
1095
|
+
unreadable: () => {
|
|
1096
|
+
if (readable.value) return void 0;
|
|
1097
|
+
return control$.value?.invalidReason === "noDecimals" ? messages.value.amountNoDecimals : messages.value.amountNotANumber;
|
|
1098
|
+
}
|
|
1099
|
+
});
|
|
1073
1100
|
const control = useControlProps(props, FIELD_ONLY);
|
|
1074
1101
|
return (_ctx, _cache) => {
|
|
1075
1102
|
return openBlock(), createBlock(UnitInput_default, mergeProps(unref(control), {
|
|
1076
1103
|
id: unref(id),
|
|
1104
|
+
ref_key: "control$",
|
|
1105
|
+
ref: control$,
|
|
1077
1106
|
modelValue: unref(model),
|
|
1078
1107
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
|
|
1079
1108
|
invalid: unref(invalid),
|
|
1109
|
+
"onUpdate:valid": _cache[1] || (_cache[1] = ($event) => readable.value = $event),
|
|
1080
1110
|
onBlur: unref(onBlur)
|
|
1081
1111
|
}), createSlots({ _: 2 }, [renderList(_ctx.$slots, (_, slotName) => {
|
|
1082
1112
|
return {
|
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-D8bTGX7c.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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eldrajs/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
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",
|