@mantine-vue/core 2.4.0 → 3.0.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/cjs/index.cjs +732 -165
- package/cjs/index.cjs.map +1 -1
- package/esm/index.mjs +732 -165
- package/esm/index.mjs.map +1 -1
- package/lib/components/AngleSlider/AngleSlider.d.ts +15 -2
- package/lib/components/Autocomplete/Autocomplete.d.ts +3 -1
- package/lib/components/Cascader/Cascader.d.ts +2 -1
- package/lib/components/Checkbox/Checkbox.d.ts +91 -9
- package/lib/components/Checkbox/CheckboxCard/CheckboxCard.d.ts +15 -2
- package/lib/components/Checkbox/CheckboxGroup/CheckboxGroup.d.ts +14 -2
- package/lib/components/Chip/Chip.d.ts +46 -7
- package/lib/components/Chip/ChipGroup/ChipGroup.d.ts +14 -2
- package/lib/components/ColorInput/ColorInput.d.ts +2 -1
- package/lib/components/ColorPicker/AlphaSlider/AlphaSlider.d.ts +26 -4
- package/lib/components/ColorPicker/ColorPicker.d.ts +14 -2
- package/lib/components/ColorPicker/ColorSlider/ColorSlider.d.ts +26 -4
- package/lib/components/ColorPicker/HueSlider/HueSlider.d.ts +26 -4
- package/lib/components/Combobox/Combobox.d.ts +64 -4
- package/lib/components/ComboboxPopover/ComboboxPopover.d.ts +45 -7
- package/lib/components/FileButton/FileButton.d.ts +17 -4
- package/lib/components/FileInput/FileInput.d.ts +14 -2
- package/lib/components/Input/Input.d.ts +74 -5
- package/lib/components/InputBase/InputBase.d.ts +41 -2
- package/lib/components/JsonInput/JsonInput.d.ts +14 -2
- package/lib/components/MaskInput/MaskInput.d.ts +45 -2
- package/lib/components/Menu/Menu.d.ts +82 -4
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -1
- package/lib/components/NativeSelect/NativeSelect.d.ts +19 -6
- package/lib/components/NumberInput/NumberInput.d.ts +14 -2
- package/lib/components/PasswordInput/PasswordInput.d.ts +41 -2
- package/lib/components/PillsInput/PillsInput.d.ts +41 -2
- package/lib/components/PillsInput/PillsInputField/PillsInputField.d.ts +41 -2
- package/lib/components/PinInput/PinInput.d.ts +15 -2
- package/lib/components/Radio/Radio.d.ts +124 -9
- package/lib/components/Radio/RadioCard/RadioCard.d.ts +33 -2
- package/lib/components/Radio/RadioGroup/RadioGroup.d.ts +14 -2
- package/lib/components/Rating/Rating.d.ts +14 -2
- package/lib/components/SegmentedControl/SegmentedControl.d.ts +14 -2
- package/lib/components/Select/Select.d.ts +3 -2
- package/lib/components/Slider/RangeSlider/RangeSlider.d.ts +14 -2
- package/lib/components/Slider/Slider/Slider.d.ts +14 -2
- package/lib/components/Switch/Switch.d.ts +67 -13
- package/lib/components/Switch/SwitchGroup/SwitchGroup.d.ts +15 -3
- package/lib/components/TagsInput/TagsInput.d.ts +2 -1
- package/lib/components/TextInput/TextInput.d.ts +36 -2
- package/lib/components/Textarea/Textarea.d.ts +32 -2
- package/lib/components/TreeSelect/TreeSelect.d.ts +3 -2
- package/package.json +3 -3
package/cjs/index.cjs
CHANGED
|
@@ -3749,6 +3749,10 @@ var AngleSlider = withBoxProps((0, vue.defineComponent)({
|
|
|
3749
3749
|
type: Number,
|
|
3750
3750
|
default: void 0
|
|
3751
3751
|
},
|
|
3752
|
+
modelValue: {
|
|
3753
|
+
type: Number,
|
|
3754
|
+
default: void 0
|
|
3755
|
+
},
|
|
3752
3756
|
value: {
|
|
3753
3757
|
type: Number,
|
|
3754
3758
|
default: void 0
|
|
@@ -3826,14 +3830,18 @@ var AngleSlider = withBoxProps((0, vue.defineComponent)({
|
|
|
3826
3830
|
default: false
|
|
3827
3831
|
}
|
|
3828
3832
|
},
|
|
3829
|
-
|
|
3833
|
+
emits: ["update:modelValue", "change"],
|
|
3834
|
+
setup(rawProps, { attrs, emit }) {
|
|
3830
3835
|
const props = useProps("AngleSlider", defaultProps$52, rawProps);
|
|
3831
3836
|
const rootRef = (0, vue.ref)(null);
|
|
3832
3837
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
3833
|
-
value: () => props.value,
|
|
3838
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
3834
3839
|
defaultValue: props.defaultValue,
|
|
3835
3840
|
finalValue: 0,
|
|
3836
|
-
onChange:
|
|
3841
|
+
onChange: (value) => {
|
|
3842
|
+
emit("update:modelValue", value);
|
|
3843
|
+
emit("change", value);
|
|
3844
|
+
}
|
|
3837
3845
|
});
|
|
3838
3846
|
const update = (nextValue) => {
|
|
3839
3847
|
if (!rootRef.value || props.disabled) return;
|
|
@@ -11123,9 +11131,17 @@ var FileButton = (0, vue.defineComponent)({
|
|
|
11123
11131
|
name: "FileButton",
|
|
11124
11132
|
inheritAttrs: false,
|
|
11125
11133
|
props: {
|
|
11134
|
+
modelValue: {
|
|
11135
|
+
type: [
|
|
11136
|
+
Object,
|
|
11137
|
+
Array,
|
|
11138
|
+
null
|
|
11139
|
+
],
|
|
11140
|
+
default: void 0
|
|
11141
|
+
},
|
|
11126
11142
|
onChange: {
|
|
11127
11143
|
type: Function,
|
|
11128
|
-
|
|
11144
|
+
default: void 0
|
|
11129
11145
|
},
|
|
11130
11146
|
multiple: {
|
|
11131
11147
|
type: Boolean,
|
|
@@ -11164,7 +11180,8 @@ var FileButton = (0, vue.defineComponent)({
|
|
|
11164
11180
|
default: void 0
|
|
11165
11181
|
}
|
|
11166
11182
|
},
|
|
11167
|
-
|
|
11183
|
+
emits: ["update:modelValue", "change"],
|
|
11184
|
+
setup(props, { attrs, slots, emit }) {
|
|
11168
11185
|
const inputRef = (0, vue.ref)(null);
|
|
11169
11186
|
const reset = () => {
|
|
11170
11187
|
if (inputRef.value) inputRef.value.value = "";
|
|
@@ -11189,10 +11206,14 @@ var FileButton = (0, vue.defineComponent)({
|
|
|
11189
11206
|
onChange: (event) => {
|
|
11190
11207
|
const files = event.currentTarget.files;
|
|
11191
11208
|
if (files === null) {
|
|
11192
|
-
props.
|
|
11209
|
+
const nextValue = props.multiple ? [] : null;
|
|
11210
|
+
emit("update:modelValue", nextValue);
|
|
11211
|
+
emit("change", nextValue);
|
|
11193
11212
|
return;
|
|
11194
11213
|
}
|
|
11195
|
-
props.
|
|
11214
|
+
const nextValue = props.multiple ? Array.from(files) : files[0] || null;
|
|
11215
|
+
emit("update:modelValue", nextValue);
|
|
11216
|
+
emit("change", nextValue);
|
|
11196
11217
|
}
|
|
11197
11218
|
}), slots.default?.({
|
|
11198
11219
|
onClick,
|
|
@@ -11833,6 +11854,22 @@ var InputBase$1 = (0, vue.defineComponent)({
|
|
|
11833
11854
|
],
|
|
11834
11855
|
default: "input"
|
|
11835
11856
|
},
|
|
11857
|
+
modelValue: {
|
|
11858
|
+
type: null,
|
|
11859
|
+
default: void 0
|
|
11860
|
+
},
|
|
11861
|
+
value: {
|
|
11862
|
+
type: null,
|
|
11863
|
+
default: void 0
|
|
11864
|
+
},
|
|
11865
|
+
defaultValue: {
|
|
11866
|
+
type: null,
|
|
11867
|
+
default: void 0
|
|
11868
|
+
},
|
|
11869
|
+
onChange: {
|
|
11870
|
+
type: Function,
|
|
11871
|
+
default: void 0
|
|
11872
|
+
},
|
|
11836
11873
|
__staticSelector: {
|
|
11837
11874
|
type: String,
|
|
11838
11875
|
default: void 0
|
|
@@ -12002,7 +12039,21 @@ var InputBase$1 = (0, vue.defineComponent)({
|
|
|
12002
12039
|
default: false
|
|
12003
12040
|
}
|
|
12004
12041
|
},
|
|
12005
|
-
|
|
12042
|
+
emits: ["update:modelValue", "change"],
|
|
12043
|
+
setup(props, { attrs, slots, emit }) {
|
|
12044
|
+
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
12045
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
12046
|
+
defaultValue: props.defaultValue,
|
|
12047
|
+
finalValue: void 0,
|
|
12048
|
+
onChange: (nextValue) => {
|
|
12049
|
+
emit("update:modelValue", nextValue);
|
|
12050
|
+
emit("change", nextValue);
|
|
12051
|
+
}
|
|
12052
|
+
});
|
|
12053
|
+
const callHandler = (handler, event) => {
|
|
12054
|
+
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
12055
|
+
else if (typeof handler === "function") handler(event);
|
|
12056
|
+
};
|
|
12006
12057
|
const wrapperCtx = useInputWrapperContext();
|
|
12007
12058
|
const stylesCtx = (0, vue.reactive)({
|
|
12008
12059
|
offsetBottom: false,
|
|
@@ -12072,6 +12123,14 @@ var InputBase$1 = (0, vue.defineComponent)({
|
|
|
12072
12123
|
(0, vue.h)(Box, {
|
|
12073
12124
|
...attrs,
|
|
12074
12125
|
...ariaAttributes,
|
|
12126
|
+
value: props.component === "button" || props.component === "div" ? void 0 : value.value,
|
|
12127
|
+
onInput: (event) => {
|
|
12128
|
+
callHandler(attrs.onInput, event);
|
|
12129
|
+
if (props.component !== "select") setValue(event.currentTarget.value);
|
|
12130
|
+
},
|
|
12131
|
+
onChange: (event) => {
|
|
12132
|
+
if (props.component === "select") setValue(event.currentTarget.value);
|
|
12133
|
+
},
|
|
12075
12134
|
component: props.component,
|
|
12076
12135
|
required: props.required,
|
|
12077
12136
|
disabled: props.disabled,
|
|
@@ -12127,6 +12186,22 @@ var InputBase = withBoxProps((0, vue.defineComponent)({
|
|
|
12127
12186
|
],
|
|
12128
12187
|
default: "input"
|
|
12129
12188
|
},
|
|
12189
|
+
modelValue: {
|
|
12190
|
+
type: null,
|
|
12191
|
+
default: void 0
|
|
12192
|
+
},
|
|
12193
|
+
value: {
|
|
12194
|
+
type: null,
|
|
12195
|
+
default: void 0
|
|
12196
|
+
},
|
|
12197
|
+
defaultValue: {
|
|
12198
|
+
type: null,
|
|
12199
|
+
default: void 0
|
|
12200
|
+
},
|
|
12201
|
+
onChange: {
|
|
12202
|
+
type: Function,
|
|
12203
|
+
default: void 0
|
|
12204
|
+
},
|
|
12130
12205
|
__staticSelector: {
|
|
12131
12206
|
type: String,
|
|
12132
12207
|
default: "InputBase"
|
|
@@ -12332,7 +12407,17 @@ var InputBase = withBoxProps((0, vue.defineComponent)({
|
|
|
12332
12407
|
default: void 0
|
|
12333
12408
|
}
|
|
12334
12409
|
},
|
|
12335
|
-
|
|
12410
|
+
emits: ["update:modelValue", "change"],
|
|
12411
|
+
setup(props, { attrs, slots, emit }) {
|
|
12412
|
+
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
12413
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
12414
|
+
defaultValue: props.defaultValue,
|
|
12415
|
+
finalValue: void 0,
|
|
12416
|
+
onChange: (nextValue) => {
|
|
12417
|
+
emit("update:modelValue", nextValue);
|
|
12418
|
+
emit("change", nextValue);
|
|
12419
|
+
}
|
|
12420
|
+
});
|
|
12336
12421
|
return () => (0, vue.h)(Input.Wrapper, {
|
|
12337
12422
|
...props.wrapperProps,
|
|
12338
12423
|
id: props.id,
|
|
@@ -12360,6 +12445,8 @@ var InputBase = withBoxProps((0, vue.defineComponent)({
|
|
|
12360
12445
|
error: slots.error,
|
|
12361
12446
|
default: () => (0, vue.h)(Input, {
|
|
12362
12447
|
...attrs,
|
|
12448
|
+
modelValue: value.value,
|
|
12449
|
+
"onUpdate:modelValue": setValue,
|
|
12363
12450
|
component: props.component,
|
|
12364
12451
|
__staticSelector: props.__staticSelector,
|
|
12365
12452
|
__stylesApiProps: props.__stylesApiProps ?? props,
|
|
@@ -12423,6 +12510,14 @@ var FileInput = (0, vue.defineComponent)({
|
|
|
12423
12510
|
type: String,
|
|
12424
12511
|
default: "button"
|
|
12425
12512
|
},
|
|
12513
|
+
modelValue: {
|
|
12514
|
+
type: [
|
|
12515
|
+
Object,
|
|
12516
|
+
Array,
|
|
12517
|
+
null
|
|
12518
|
+
],
|
|
12519
|
+
default: void 0
|
|
12520
|
+
},
|
|
12426
12521
|
onChange: {
|
|
12427
12522
|
type: Function,
|
|
12428
12523
|
default: void 0
|
|
@@ -12544,13 +12639,17 @@ var FileInput = (0, vue.defineComponent)({
|
|
|
12544
12639
|
default: false
|
|
12545
12640
|
}
|
|
12546
12641
|
},
|
|
12547
|
-
|
|
12642
|
+
emits: ["update:modelValue", "change"],
|
|
12643
|
+
setup(props, { attrs, slots, emit }) {
|
|
12548
12644
|
const resetRef = (0, vue.ref)(null);
|
|
12549
12645
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
12550
|
-
value: () => props.value,
|
|
12646
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
12551
12647
|
defaultValue: props.defaultValue,
|
|
12552
12648
|
finalValue: props.multiple ? [] : null,
|
|
12553
|
-
onChange: (nextValue) =>
|
|
12649
|
+
onChange: (nextValue) => {
|
|
12650
|
+
emit("update:modelValue", nextValue);
|
|
12651
|
+
emit("change", nextValue);
|
|
12652
|
+
}
|
|
12554
12653
|
});
|
|
12555
12654
|
const hasValue = (0, vue.computed)(() => Array.isArray(value.value) ? value.value.length !== 0 : value.value !== null);
|
|
12556
12655
|
const reset = () => {
|
|
@@ -13010,6 +13109,14 @@ var NumberInput = (0, vue.defineComponent)({
|
|
|
13010
13109
|
inheritAttrs: false,
|
|
13011
13110
|
slots: Object,
|
|
13012
13111
|
props: {
|
|
13112
|
+
modelValue: {
|
|
13113
|
+
type: [
|
|
13114
|
+
String,
|
|
13115
|
+
Number,
|
|
13116
|
+
BigInt
|
|
13117
|
+
],
|
|
13118
|
+
default: void 0
|
|
13119
|
+
},
|
|
13013
13120
|
value: {
|
|
13014
13121
|
type: [
|
|
13015
13122
|
String,
|
|
@@ -13199,15 +13306,19 @@ var NumberInput = (0, vue.defineComponent)({
|
|
|
13199
13306
|
default: false
|
|
13200
13307
|
}
|
|
13201
13308
|
},
|
|
13202
|
-
|
|
13309
|
+
emits: ["update:modelValue", "change"],
|
|
13310
|
+
setup(props, { attrs, slots, emit }) {
|
|
13203
13311
|
const inputRef = (0, vue.ref)(null);
|
|
13204
13312
|
const isEditing = (0, vue.ref)(false);
|
|
13205
|
-
const isBigIntMode = (0, vue.computed)(() => typeof props.value === "bigint" || typeof props.defaultValue === "bigint");
|
|
13313
|
+
const isBigIntMode = (0, vue.computed)(() => typeof props.modelValue === "bigint" || typeof props.value === "bigint" || typeof props.defaultValue === "bigint");
|
|
13206
13314
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
13207
|
-
value: () => props.value,
|
|
13315
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
13208
13316
|
defaultValue: props.defaultValue,
|
|
13209
13317
|
finalValue: "",
|
|
13210
|
-
onChange: (nextValue) =>
|
|
13318
|
+
onChange: (nextValue) => {
|
|
13319
|
+
emit("update:modelValue", nextValue);
|
|
13320
|
+
emit("change", nextValue);
|
|
13321
|
+
}
|
|
13211
13322
|
});
|
|
13212
13323
|
const getStyles = useStyles({
|
|
13213
13324
|
name: "NumberInput",
|
|
@@ -13604,6 +13715,10 @@ var PinInput = withBoxProps((0, vue.defineComponent)({
|
|
|
13604
13715
|
type: Boolean,
|
|
13605
13716
|
default: false
|
|
13606
13717
|
},
|
|
13718
|
+
modelValue: {
|
|
13719
|
+
type: String,
|
|
13720
|
+
default: void 0
|
|
13721
|
+
},
|
|
13607
13722
|
value: {
|
|
13608
13723
|
type: String,
|
|
13609
13724
|
default: void 0
|
|
@@ -13709,7 +13824,8 @@ var PinInput = withBoxProps((0, vue.defineComponent)({
|
|
|
13709
13824
|
default: false
|
|
13710
13825
|
}
|
|
13711
13826
|
},
|
|
13712
|
-
|
|
13827
|
+
emits: ["update:modelValue", "change"],
|
|
13828
|
+
setup(rawProps, { attrs, emit }) {
|
|
13713
13829
|
const props = useProps("PinInput", defaultProps$21, rawProps);
|
|
13714
13830
|
const uuid = (0, _mantine_vue_hooks.useId)(props.id);
|
|
13715
13831
|
const focusedIndex = (0, vue.ref)(-1);
|
|
@@ -13729,12 +13845,13 @@ var PinInput = withBoxProps((0, vue.defineComponent)({
|
|
|
13729
13845
|
varsResolver: varsResolver$38
|
|
13730
13846
|
});
|
|
13731
13847
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
13732
|
-
value: () => props.value !== void 0 ? createPinArray(currentLength.value, props.value) : void 0,
|
|
13848
|
+
value: () => props.modelValue !== void 0 || props.value !== void 0 ? createPinArray(currentLength.value, props.modelValue ?? props.value ?? "") : void 0,
|
|
13733
13849
|
defaultValue: props.defaultValue?.split("").slice(0, currentLength.value),
|
|
13734
13850
|
finalValue: createPinArray(currentLength.value, ""),
|
|
13735
13851
|
onChange: (nextValue) => {
|
|
13736
13852
|
const stringValue = nextValue.join("").trim();
|
|
13737
|
-
|
|
13853
|
+
emit("update:modelValue", stringValue);
|
|
13854
|
+
emit("change", stringValue);
|
|
13738
13855
|
if (stringValue.length === currentLength.value && !completed.value) {
|
|
13739
13856
|
completed.value = true;
|
|
13740
13857
|
props.onComplete?.(stringValue);
|
|
@@ -13868,7 +13985,6 @@ var PinInput = withBoxProps((0, vue.defineComponent)({
|
|
|
13868
13985
|
id: `${uuid.value}-${index + 1}`,
|
|
13869
13986
|
inputMode: props.inputMode || (props.type === "number" ? "numeric" : "text"),
|
|
13870
13987
|
onInput: (event) => handleInput(event, index),
|
|
13871
|
-
onChange: (event) => handleInput(event, index),
|
|
13872
13988
|
onKeydown: (event) => handleKeyDown(event, index),
|
|
13873
13989
|
onFocus: (event) => {
|
|
13874
13990
|
event.target.select();
|
|
@@ -14034,6 +14150,10 @@ var NativeSelect = (0, vue.defineComponent)({
|
|
|
14034
14150
|
type: String,
|
|
14035
14151
|
default: void 0
|
|
14036
14152
|
},
|
|
14153
|
+
modelValue: {
|
|
14154
|
+
type: String,
|
|
14155
|
+
default: void 0
|
|
14156
|
+
},
|
|
14037
14157
|
value: {
|
|
14038
14158
|
type: String,
|
|
14039
14159
|
default: void 0
|
|
@@ -14071,7 +14191,8 @@ var NativeSelect = (0, vue.defineComponent)({
|
|
|
14071
14191
|
default: false
|
|
14072
14192
|
}
|
|
14073
14193
|
},
|
|
14074
|
-
|
|
14194
|
+
emits: ["update:modelValue", "change"],
|
|
14195
|
+
setup(rawProps, { attrs, slots, emit }) {
|
|
14075
14196
|
const props = useProps("NativeSelect", defaultProps$20, rawProps);
|
|
14076
14197
|
return () => {
|
|
14077
14198
|
const parsedOptions = getParsedNativeSelectData(props.data).map((item, index) => (0, vue.h)(NativeSelectOption, {
|
|
@@ -14095,9 +14216,11 @@ var NativeSelect = (0, vue.defineComponent)({
|
|
|
14095
14216
|
id: props.id,
|
|
14096
14217
|
name: props.name,
|
|
14097
14218
|
form: props.form,
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14219
|
+
modelValue: props.modelValue,
|
|
14220
|
+
value: props.value,
|
|
14221
|
+
defaultValue: props.defaultValue,
|
|
14222
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
14223
|
+
onChange: (value) => emit("change", value),
|
|
14101
14224
|
variant: props.variant,
|
|
14102
14225
|
radius: props.radius,
|
|
14103
14226
|
classNames: props.classNames,
|
|
@@ -14145,7 +14268,7 @@ var varsResolver$37 = createVarsResolver((theme, { variant, color, childrenOffse
|
|
|
14145
14268
|
function renderContent(content) {
|
|
14146
14269
|
return typeof content === "function" ? content() : content;
|
|
14147
14270
|
}
|
|
14148
|
-
function callHandler$
|
|
14271
|
+
function callHandler$5(handler, event) {
|
|
14149
14272
|
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
14150
14273
|
else handler?.(event);
|
|
14151
14274
|
}
|
|
@@ -14298,11 +14421,11 @@ var NavLink = withBoxProps((0, vue.defineComponent)({
|
|
|
14298
14421
|
expanded: opened.value
|
|
14299
14422
|
}, props.mod],
|
|
14300
14423
|
onClick: (event) => {
|
|
14301
|
-
callHandler$
|
|
14424
|
+
callHandler$5(attrs.onClick, event);
|
|
14302
14425
|
toggle(event);
|
|
14303
14426
|
},
|
|
14304
14427
|
onKeydown: (event) => {
|
|
14305
|
-
callHandler$
|
|
14428
|
+
callHandler$5(attrs.onKeydown ?? attrs.onKeyDown, event);
|
|
14306
14429
|
if (event.code === "Space" && withChildren) toggle(event);
|
|
14307
14430
|
}
|
|
14308
14431
|
}, () => [
|
|
@@ -14867,6 +14990,10 @@ var Rating = withBoxProps((0, vue.defineComponent)({
|
|
|
14867
14990
|
inheritAttrs: false,
|
|
14868
14991
|
slots: Object,
|
|
14869
14992
|
props: {
|
|
14993
|
+
modelValue: {
|
|
14994
|
+
type: Number,
|
|
14995
|
+
default: void 0
|
|
14996
|
+
},
|
|
14870
14997
|
defaultValue: {
|
|
14871
14998
|
type: Number,
|
|
14872
14999
|
default: void 0
|
|
@@ -14948,7 +15075,8 @@ var Rating = withBoxProps((0, vue.defineComponent)({
|
|
|
14948
15075
|
default: false
|
|
14949
15076
|
}
|
|
14950
15077
|
},
|
|
14951
|
-
|
|
15078
|
+
emits: ["update:modelValue", "change"],
|
|
15079
|
+
setup(rawProps, { attrs, slots, emit }) {
|
|
14952
15080
|
const props = useProps("Rating", defaultProps$16, rawProps);
|
|
14953
15081
|
const rootRef = (0, vue.ref)(null);
|
|
14954
15082
|
const hovered = (0, vue.ref)(-1);
|
|
@@ -14957,10 +15085,13 @@ var Rating = withBoxProps((0, vue.defineComponent)({
|
|
|
14957
15085
|
const name = (0, _mantine_vue_hooks.useId)(props.name);
|
|
14958
15086
|
const id = (0, _mantine_vue_hooks.useId)(props.id);
|
|
14959
15087
|
const [currentValue, setCurrentValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
14960
|
-
value: () => props.value,
|
|
15088
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
14961
15089
|
defaultValue: props.defaultValue,
|
|
14962
15090
|
finalValue: 0,
|
|
14963
|
-
onChange: (value) =>
|
|
15091
|
+
onChange: (value) => {
|
|
15092
|
+
emit("update:modelValue", value);
|
|
15093
|
+
emit("change", value);
|
|
15094
|
+
}
|
|
14964
15095
|
});
|
|
14965
15096
|
const getStyles = useStyles({
|
|
14966
15097
|
name: "Rating",
|
|
@@ -15297,6 +15428,14 @@ var SegmentedControl = (0, vue.defineComponent)({
|
|
|
15297
15428
|
type: Array,
|
|
15298
15429
|
required: true
|
|
15299
15430
|
},
|
|
15431
|
+
modelValue: {
|
|
15432
|
+
type: [
|
|
15433
|
+
String,
|
|
15434
|
+
Number,
|
|
15435
|
+
Boolean
|
|
15436
|
+
],
|
|
15437
|
+
default: void 0
|
|
15438
|
+
},
|
|
15300
15439
|
value: {
|
|
15301
15440
|
type: [
|
|
15302
15441
|
String,
|
|
@@ -15390,7 +15529,8 @@ var SegmentedControl = (0, vue.defineComponent)({
|
|
|
15390
15529
|
default: false
|
|
15391
15530
|
}
|
|
15392
15531
|
},
|
|
15393
|
-
|
|
15532
|
+
emits: ["update:modelValue", "change"],
|
|
15533
|
+
setup(props, { attrs, emit }) {
|
|
15394
15534
|
const theme = useMantineTheme();
|
|
15395
15535
|
const uuid = (0, _mantine_vue_hooks.useId)(props.name);
|
|
15396
15536
|
const mounted = (0, _mantine_vue_hooks.useMounted)();
|
|
@@ -15398,10 +15538,13 @@ var SegmentedControl = (0, vue.defineComponent)({
|
|
|
15398
15538
|
const itemRefs = (0, vue.reactive)({});
|
|
15399
15539
|
const normalizedData = (0, vue.computed)(() => normalizeData(props.data));
|
|
15400
15540
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
15401
|
-
value: () => props.value,
|
|
15541
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
15402
15542
|
defaultValue: props.defaultValue,
|
|
15403
15543
|
finalValue: normalizedData.value.find((item) => !item.disabled)?.value ?? normalizedData.value[0]?.value,
|
|
15404
|
-
onChange: (nextValue) =>
|
|
15544
|
+
onChange: (nextValue) => {
|
|
15545
|
+
emit("update:modelValue", nextValue);
|
|
15546
|
+
emit("change", nextValue);
|
|
15547
|
+
}
|
|
15405
15548
|
});
|
|
15406
15549
|
const getStyles = useStyles({
|
|
15407
15550
|
name: "SegmentedControl",
|
|
@@ -16671,6 +16814,18 @@ var Textarea = (0, vue.defineComponent)({
|
|
|
16671
16814
|
inheritAttrs: false,
|
|
16672
16815
|
slots: Object,
|
|
16673
16816
|
props: {
|
|
16817
|
+
modelValue: {
|
|
16818
|
+
type: String,
|
|
16819
|
+
default: void 0
|
|
16820
|
+
},
|
|
16821
|
+
value: {
|
|
16822
|
+
type: String,
|
|
16823
|
+
default: void 0
|
|
16824
|
+
},
|
|
16825
|
+
defaultValue: {
|
|
16826
|
+
type: String,
|
|
16827
|
+
default: void 0
|
|
16828
|
+
},
|
|
16674
16829
|
autosize: {
|
|
16675
16830
|
type: Boolean,
|
|
16676
16831
|
default: false
|
|
@@ -16705,7 +16860,8 @@ var Textarea = (0, vue.defineComponent)({
|
|
|
16705
16860
|
default: void 0
|
|
16706
16861
|
}
|
|
16707
16862
|
},
|
|
16708
|
-
|
|
16863
|
+
emits: ["update:modelValue", "change"],
|
|
16864
|
+
setup(props, { attrs, slots, emit }) {
|
|
16709
16865
|
return () => {
|
|
16710
16866
|
const shouldAutosize = props.autosize;
|
|
16711
16867
|
const autosizeProps = shouldAutosize ? {
|
|
@@ -16714,6 +16870,11 @@ var Textarea = (0, vue.defineComponent)({
|
|
|
16714
16870
|
} : { rows: props.minRows };
|
|
16715
16871
|
return (0, vue.h)(InputBase, {
|
|
16716
16872
|
...attrs,
|
|
16873
|
+
modelValue: props.modelValue,
|
|
16874
|
+
value: props.value,
|
|
16875
|
+
defaultValue: props.defaultValue,
|
|
16876
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
16877
|
+
onChange: (value) => emit("change", value),
|
|
16717
16878
|
component: shouldAutosize ? TextareaAutosize : "textarea",
|
|
16718
16879
|
__staticSelector: props.__staticSelector || "Textarea",
|
|
16719
16880
|
multiline: true,
|
|
@@ -16740,7 +16901,7 @@ function validateJson(value, deserialize) {
|
|
|
16740
16901
|
}
|
|
16741
16902
|
//#endregion
|
|
16742
16903
|
//#region src/components/JsonInput/JsonInput.ts
|
|
16743
|
-
function callHandler$
|
|
16904
|
+
function callHandler$4(handler, event) {
|
|
16744
16905
|
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
16745
16906
|
else handler?.(event);
|
|
16746
16907
|
}
|
|
@@ -16748,6 +16909,10 @@ var JsonInput = (0, vue.defineComponent)({
|
|
|
16748
16909
|
name: "JsonInput",
|
|
16749
16910
|
inheritAttrs: false,
|
|
16750
16911
|
props: {
|
|
16912
|
+
modelValue: {
|
|
16913
|
+
type: String,
|
|
16914
|
+
default: void 0
|
|
16915
|
+
},
|
|
16751
16916
|
value: {
|
|
16752
16917
|
type: String,
|
|
16753
16918
|
default: void 0
|
|
@@ -16801,12 +16966,16 @@ var JsonInput = (0, vue.defineComponent)({
|
|
|
16801
16966
|
default: void 0
|
|
16802
16967
|
}
|
|
16803
16968
|
},
|
|
16804
|
-
|
|
16969
|
+
emits: ["update:modelValue", "change"],
|
|
16970
|
+
setup(props, { attrs, slots, emit }) {
|
|
16805
16971
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
16806
|
-
value: () => props.value,
|
|
16972
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
16807
16973
|
defaultValue: props.defaultValue,
|
|
16808
16974
|
finalValue: "",
|
|
16809
|
-
onChange: (nextValue) =>
|
|
16975
|
+
onChange: (nextValue) => {
|
|
16976
|
+
emit("update:modelValue", nextValue);
|
|
16977
|
+
emit("change", nextValue);
|
|
16978
|
+
}
|
|
16810
16979
|
});
|
|
16811
16980
|
const valid = (0, vue.ref)(validateJson(value.value, props.deserialize));
|
|
16812
16981
|
return () => (0, vue.h)(Textarea, {
|
|
@@ -16818,15 +16987,15 @@ var JsonInput = (0, vue.defineComponent)({
|
|
|
16818
16987
|
error: valid.value ? props.error : props.validationError || true,
|
|
16819
16988
|
"data-monospace": true,
|
|
16820
16989
|
onInput: (event) => {
|
|
16821
|
-
callHandler$
|
|
16990
|
+
callHandler$4(attrs.onInput, event);
|
|
16822
16991
|
setValue(event.currentTarget.value);
|
|
16823
16992
|
},
|
|
16824
16993
|
onFocus: (event) => {
|
|
16825
|
-
callHandler$
|
|
16994
|
+
callHandler$4(attrs.onFocus, event);
|
|
16826
16995
|
valid.value = true;
|
|
16827
16996
|
},
|
|
16828
16997
|
onBlur: (event) => {
|
|
16829
|
-
callHandler$
|
|
16998
|
+
callHandler$4(attrs.onBlur, event);
|
|
16830
16999
|
const target = event.currentTarget;
|
|
16831
17000
|
const isValid = validateJson(target.value, props.deserialize);
|
|
16832
17001
|
if (props.formatOnBlur && !props.readOnly && isValid && target.value.trim() !== "") setValue(props.serialize(props.deserialize(target.value), null, props.indentSpaces));
|
|
@@ -16841,9 +17010,29 @@ Object.assign(JsonInput, { classes: InputBase.classes });
|
|
|
16841
17010
|
var TextInput = (0, vue.defineComponent)({
|
|
16842
17011
|
name: "TextInput",
|
|
16843
17012
|
inheritAttrs: false,
|
|
16844
|
-
|
|
17013
|
+
props: {
|
|
17014
|
+
modelValue: {
|
|
17015
|
+
type: [String, Number],
|
|
17016
|
+
default: void 0
|
|
17017
|
+
},
|
|
17018
|
+
value: {
|
|
17019
|
+
type: [String, Number],
|
|
17020
|
+
default: void 0
|
|
17021
|
+
},
|
|
17022
|
+
defaultValue: {
|
|
17023
|
+
type: [String, Number],
|
|
17024
|
+
default: void 0
|
|
17025
|
+
}
|
|
17026
|
+
},
|
|
17027
|
+
emits: ["update:modelValue", "change"],
|
|
17028
|
+
setup(props, { attrs, slots, emit }) {
|
|
16845
17029
|
return () => (0, vue.h)(InputBase, {
|
|
16846
17030
|
...attrs,
|
|
17031
|
+
modelValue: props.modelValue,
|
|
17032
|
+
value: props.value,
|
|
17033
|
+
defaultValue: props.defaultValue,
|
|
17034
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
17035
|
+
onChange: (value) => emit("change", value),
|
|
16847
17036
|
component: "input",
|
|
16848
17037
|
__staticSelector: "TextInput",
|
|
16849
17038
|
__stylesApiProps: attrs
|
|
@@ -16935,6 +17124,22 @@ var PasswordInput = (0, vue.defineComponent)({
|
|
|
16935
17124
|
inheritAttrs: false,
|
|
16936
17125
|
slots: Object,
|
|
16937
17126
|
props: {
|
|
17127
|
+
modelValue: {
|
|
17128
|
+
type: String,
|
|
17129
|
+
default: void 0
|
|
17130
|
+
},
|
|
17131
|
+
value: {
|
|
17132
|
+
type: String,
|
|
17133
|
+
default: void 0
|
|
17134
|
+
},
|
|
17135
|
+
defaultValue: {
|
|
17136
|
+
type: String,
|
|
17137
|
+
default: void 0
|
|
17138
|
+
},
|
|
17139
|
+
onChange: {
|
|
17140
|
+
type: Function,
|
|
17141
|
+
default: void 0
|
|
17142
|
+
},
|
|
16938
17143
|
visibilityToggleIcon: {
|
|
16939
17144
|
type: [Object, Function],
|
|
16940
17145
|
default: void 0
|
|
@@ -17072,7 +17277,8 @@ var PasswordInput = (0, vue.defineComponent)({
|
|
|
17072
17277
|
default: false
|
|
17073
17278
|
}
|
|
17074
17279
|
},
|
|
17075
|
-
|
|
17280
|
+
emits: ["update:modelValue", "change"],
|
|
17281
|
+
setup(props, { attrs, slots, emit }) {
|
|
17076
17282
|
const uuid = (0, _mantine_vue_hooks.useId)(props.id);
|
|
17077
17283
|
const fallbackId = (0, vue.ref)(`password-input-${Math.random().toString(36).slice(2)}`);
|
|
17078
17284
|
const [visible, setVisible] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
@@ -17081,6 +17287,15 @@ var PasswordInput = (0, vue.defineComponent)({
|
|
|
17081
17287
|
finalValue: false,
|
|
17082
17288
|
onChange: (value) => props.onVisibilityChange?.(value)
|
|
17083
17289
|
});
|
|
17290
|
+
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
17291
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
17292
|
+
defaultValue: props.defaultValue,
|
|
17293
|
+
finalValue: "",
|
|
17294
|
+
onChange: (nextValue) => {
|
|
17295
|
+
emit("update:modelValue", nextValue);
|
|
17296
|
+
emit("change", nextValue);
|
|
17297
|
+
}
|
|
17298
|
+
});
|
|
17084
17299
|
const getStyles = useStyles({
|
|
17085
17300
|
name: "PasswordInput",
|
|
17086
17301
|
props,
|
|
@@ -17201,6 +17416,7 @@ var PasswordInput = (0, vue.defineComponent)({
|
|
|
17201
17416
|
default: () => (0, vue.h)("input", {
|
|
17202
17417
|
...attrs,
|
|
17203
17418
|
...getStyles("innerInput"),
|
|
17419
|
+
value: value.value,
|
|
17204
17420
|
required: props.required,
|
|
17205
17421
|
"data-invalid": props.error || slots.error ? true : void 0,
|
|
17206
17422
|
"data-with-left-section": props.leftSection !== void 0 || slots.leftSection ? true : void 0,
|
|
@@ -17208,7 +17424,12 @@ var PasswordInput = (0, vue.defineComponent)({
|
|
|
17208
17424
|
id,
|
|
17209
17425
|
"aria-describedby": describedBy,
|
|
17210
17426
|
autocomplete: attrs.autocomplete || "off",
|
|
17211
|
-
type: visible.value ? "text" : "password"
|
|
17427
|
+
type: visible.value ? "text" : "password",
|
|
17428
|
+
onInput: (event) => {
|
|
17429
|
+
const handler = attrs.onInput;
|
|
17430
|
+
handler?.(event);
|
|
17431
|
+
setValue(event.currentTarget.value);
|
|
17432
|
+
}
|
|
17212
17433
|
}),
|
|
17213
17434
|
leftSection: slots.leftSection,
|
|
17214
17435
|
rightSection: slots.rightSection
|
|
@@ -17454,6 +17675,10 @@ var CheckboxGroup = (0, vue.defineComponent)({
|
|
|
17454
17675
|
inheritAttrs: false,
|
|
17455
17676
|
slots: Object,
|
|
17456
17677
|
props: {
|
|
17678
|
+
modelValue: {
|
|
17679
|
+
type: Array,
|
|
17680
|
+
default: void 0
|
|
17681
|
+
},
|
|
17457
17682
|
value: {
|
|
17458
17683
|
type: Array,
|
|
17459
17684
|
default: void 0
|
|
@@ -17527,12 +17752,16 @@ var CheckboxGroup = (0, vue.defineComponent)({
|
|
|
17527
17752
|
default: false
|
|
17528
17753
|
}
|
|
17529
17754
|
},
|
|
17530
|
-
|
|
17755
|
+
emits: ["update:modelValue", "change"],
|
|
17756
|
+
setup(props, { attrs, slots, emit }) {
|
|
17531
17757
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
17532
|
-
value: () => props.value,
|
|
17758
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
17533
17759
|
defaultValue: props.defaultValue,
|
|
17534
17760
|
finalValue: [],
|
|
17535
|
-
onChange: (nextValue) =>
|
|
17761
|
+
onChange: (nextValue) => {
|
|
17762
|
+
emit("update:modelValue", nextValue);
|
|
17763
|
+
emit("change", nextValue);
|
|
17764
|
+
}
|
|
17536
17765
|
});
|
|
17537
17766
|
const handleChange = (eventOrValue) => {
|
|
17538
17767
|
if (props.readOnly) return;
|
|
@@ -17595,6 +17824,10 @@ var CheckboxCard = withBoxProps((0, vue.defineComponent)({
|
|
|
17595
17824
|
name: "CheckboxCard",
|
|
17596
17825
|
inheritAttrs: false,
|
|
17597
17826
|
props: {
|
|
17827
|
+
modelValue: {
|
|
17828
|
+
type: Boolean,
|
|
17829
|
+
default: void 0
|
|
17830
|
+
},
|
|
17598
17831
|
checked: {
|
|
17599
17832
|
type: Boolean,
|
|
17600
17833
|
default: void 0
|
|
@@ -17640,13 +17873,22 @@ var CheckboxCard = withBoxProps((0, vue.defineComponent)({
|
|
|
17640
17873
|
default: false
|
|
17641
17874
|
}
|
|
17642
17875
|
},
|
|
17643
|
-
|
|
17876
|
+
emits: [
|
|
17877
|
+
"update:modelValue",
|
|
17878
|
+
"update:checked",
|
|
17879
|
+
"change"
|
|
17880
|
+
],
|
|
17881
|
+
setup(props, { attrs, slots, emit }) {
|
|
17644
17882
|
const groupContext = useCheckboxGroupContext();
|
|
17645
17883
|
const [checked, setChecked] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
17646
|
-
value: () => typeof props.checked === "boolean" ? props.checked : groupContext ? groupContext.value.includes(props.value || "") : void 0,
|
|
17884
|
+
value: () => typeof props.modelValue === "boolean" ? props.modelValue : typeof props.checked === "boolean" ? props.checked : groupContext ? groupContext.value.includes(props.value || "") : void 0,
|
|
17647
17885
|
defaultValue: props.defaultChecked,
|
|
17648
17886
|
finalValue: false,
|
|
17649
|
-
onChange: (nextValue) =>
|
|
17887
|
+
onChange: (nextValue) => {
|
|
17888
|
+
emit("update:modelValue", nextValue);
|
|
17889
|
+
emit("update:checked", nextValue);
|
|
17890
|
+
emit("change", nextValue);
|
|
17891
|
+
}
|
|
17650
17892
|
});
|
|
17651
17893
|
const getStyles = useStyles({
|
|
17652
17894
|
name: "CheckboxCard",
|
|
@@ -17837,7 +18079,7 @@ var varsResolver$25 = createVarsResolver((theme, { radius, color, size, iconColo
|
|
|
17837
18079
|
autoContrast
|
|
17838
18080
|
}) : void 0
|
|
17839
18081
|
} }));
|
|
17840
|
-
function callHandler$
|
|
18082
|
+
function callHandler$3(handler, event) {
|
|
17841
18083
|
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
17842
18084
|
else handler?.(event);
|
|
17843
18085
|
}
|
|
@@ -17906,10 +18148,22 @@ var CheckboxBase = (0, vue.defineComponent)({
|
|
|
17906
18148
|
type: Boolean,
|
|
17907
18149
|
default: true
|
|
17908
18150
|
},
|
|
18151
|
+
modelValue: {
|
|
18152
|
+
type: Boolean,
|
|
18153
|
+
default: void 0
|
|
18154
|
+
},
|
|
17909
18155
|
checked: {
|
|
17910
18156
|
type: Boolean,
|
|
17911
18157
|
default: void 0
|
|
17912
18158
|
},
|
|
18159
|
+
defaultChecked: {
|
|
18160
|
+
type: Boolean,
|
|
18161
|
+
default: void 0
|
|
18162
|
+
},
|
|
18163
|
+
onChange: {
|
|
18164
|
+
type: Function,
|
|
18165
|
+
default: void 0
|
|
18166
|
+
},
|
|
17913
18167
|
disabled: {
|
|
17914
18168
|
type: Boolean,
|
|
17915
18169
|
default: false
|
|
@@ -17943,9 +18197,24 @@ var CheckboxBase = (0, vue.defineComponent)({
|
|
|
17943
18197
|
default: false
|
|
17944
18198
|
}
|
|
17945
18199
|
},
|
|
17946
|
-
|
|
18200
|
+
emits: [
|
|
18201
|
+
"update:modelValue",
|
|
18202
|
+
"update:checked",
|
|
18203
|
+
"change"
|
|
18204
|
+
],
|
|
18205
|
+
setup(props, { attrs, slots, emit }) {
|
|
17947
18206
|
const uuid = (0, _mantine_vue_hooks.useId)(props.id);
|
|
17948
18207
|
const groupContext = useCheckboxGroupContext();
|
|
18208
|
+
const [localChecked, setLocalChecked] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
18209
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
18210
|
+
defaultValue: props.defaultChecked,
|
|
18211
|
+
finalValue: false,
|
|
18212
|
+
onChange: (checked) => {
|
|
18213
|
+
emit("update:modelValue", checked);
|
|
18214
|
+
emit("update:checked", checked);
|
|
18215
|
+
emit("change", checked);
|
|
18216
|
+
}
|
|
18217
|
+
});
|
|
17949
18218
|
const getStyles = useStyles({
|
|
17950
18219
|
name: "Checkbox",
|
|
17951
18220
|
props,
|
|
@@ -17975,7 +18244,7 @@ var CheckboxBase = (0, vue.defineComponent)({
|
|
|
17975
18244
|
};
|
|
17976
18245
|
const Icon = props.icon || CheckboxIcon;
|
|
17977
18246
|
const value = String(attrs.value ?? "");
|
|
17978
|
-
const checked = groupContext ? groupContext.value.includes(value) :
|
|
18247
|
+
const checked = groupContext ? groupContext.value.includes(value) : localChecked.value;
|
|
17979
18248
|
const disabled = groupContext?.isDisabled?.(value) || props.disabled;
|
|
17980
18249
|
const size = groupContext?.size ?? props.size;
|
|
17981
18250
|
return (0, vue.h)(InlineInput, {
|
|
@@ -18020,13 +18289,14 @@ var CheckboxBase = (0, vue.defineComponent)({
|
|
|
18020
18289
|
},
|
|
18021
18290
|
variant: props.variant,
|
|
18022
18291
|
onClick: (event) => {
|
|
18023
|
-
callHandler$
|
|
18024
|
-
if (props.readOnly
|
|
18292
|
+
callHandler$3(attrs.onClick, event);
|
|
18293
|
+
if (props.readOnly) event.preventDefault();
|
|
18025
18294
|
},
|
|
18026
18295
|
onChange: (event) => {
|
|
18027
18296
|
if (props.readOnly) return;
|
|
18028
|
-
|
|
18297
|
+
const nextChecked = event.currentTarget.checked;
|
|
18029
18298
|
groupContext?.onChange(event);
|
|
18299
|
+
setLocalChecked(nextChecked);
|
|
18030
18300
|
}
|
|
18031
18301
|
}), slots.icon ? slots.icon(iconSlotProps) : (0, vue.h)(Icon, {
|
|
18032
18302
|
indeterminate: props.indeterminate,
|
|
@@ -18055,6 +18325,10 @@ var ChipGroup = (0, vue.defineComponent)({
|
|
|
18055
18325
|
type: Boolean,
|
|
18056
18326
|
default: false
|
|
18057
18327
|
},
|
|
18328
|
+
modelValue: {
|
|
18329
|
+
type: [String, Array],
|
|
18330
|
+
default: void 0
|
|
18331
|
+
},
|
|
18058
18332
|
value: {
|
|
18059
18333
|
type: [String, Array],
|
|
18060
18334
|
default: void 0
|
|
@@ -18068,12 +18342,16 @@ var ChipGroup = (0, vue.defineComponent)({
|
|
|
18068
18342
|
default: void 0
|
|
18069
18343
|
}
|
|
18070
18344
|
},
|
|
18071
|
-
|
|
18345
|
+
emits: ["update:modelValue", "change"],
|
|
18346
|
+
setup(props, { slots, emit }) {
|
|
18072
18347
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
18073
|
-
value: () => props.value,
|
|
18348
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
18074
18349
|
defaultValue: props.defaultValue,
|
|
18075
18350
|
finalValue: props.multiple ? [] : null,
|
|
18076
|
-
onChange: (nextValue) =>
|
|
18351
|
+
onChange: (nextValue) => {
|
|
18352
|
+
emit("update:modelValue", nextValue);
|
|
18353
|
+
emit("change", nextValue);
|
|
18354
|
+
}
|
|
18077
18355
|
});
|
|
18078
18356
|
const isChipSelected = (chipValue) => Array.isArray(value.value) ? value.value.includes(chipValue) : value.value === chipValue;
|
|
18079
18357
|
const handleChange = (event) => {
|
|
@@ -18121,10 +18399,6 @@ var varsResolver$24 = createVarsResolver((theme, { size, radius, variant, color,
|
|
|
18121
18399
|
"--chip-spacing": getSize(size, "chip-spacing")
|
|
18122
18400
|
} };
|
|
18123
18401
|
});
|
|
18124
|
-
function callHandler$5(handler, event) {
|
|
18125
|
-
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
18126
|
-
else handler?.(event);
|
|
18127
|
-
}
|
|
18128
18402
|
var ChipBase = (0, vue.defineComponent)({
|
|
18129
18403
|
name: "Chip",
|
|
18130
18404
|
inheritAttrs: false,
|
|
@@ -18145,6 +18419,10 @@ var ChipBase = (0, vue.defineComponent)({
|
|
|
18145
18419
|
type: String,
|
|
18146
18420
|
default: "checkbox"
|
|
18147
18421
|
},
|
|
18422
|
+
modelValue: {
|
|
18423
|
+
type: Boolean,
|
|
18424
|
+
default: void 0
|
|
18425
|
+
},
|
|
18148
18426
|
checked: {
|
|
18149
18427
|
type: Boolean,
|
|
18150
18428
|
default: void 0
|
|
@@ -18216,15 +18494,24 @@ var ChipBase = (0, vue.defineComponent)({
|
|
|
18216
18494
|
default: false
|
|
18217
18495
|
}
|
|
18218
18496
|
},
|
|
18219
|
-
|
|
18497
|
+
emits: [
|
|
18498
|
+
"update:modelValue",
|
|
18499
|
+
"update:checked",
|
|
18500
|
+
"change"
|
|
18501
|
+
],
|
|
18502
|
+
setup(rawProps, { attrs, slots, emit }) {
|
|
18220
18503
|
const props = useProps("Chip", null, rawProps);
|
|
18221
18504
|
const groupContext = useChipGroupContext();
|
|
18222
18505
|
const uuid = (0, _mantine_vue_hooks.useId)(props.id);
|
|
18223
18506
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
18224
|
-
value: () => props.checked,
|
|
18507
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
18225
18508
|
defaultValue: props.defaultChecked,
|
|
18226
18509
|
finalValue: false,
|
|
18227
|
-
onChange: (nextValue) =>
|
|
18510
|
+
onChange: (nextValue) => {
|
|
18511
|
+
emit("update:modelValue", nextValue);
|
|
18512
|
+
emit("update:checked", nextValue);
|
|
18513
|
+
emit("change", nextValue);
|
|
18514
|
+
}
|
|
18228
18515
|
});
|
|
18229
18516
|
const getStyles = useStyles({
|
|
18230
18517
|
name: "Chip",
|
|
@@ -18245,7 +18532,7 @@ var ChipBase = (0, vue.defineComponent)({
|
|
|
18245
18532
|
const inputType = groupContext ? groupContext.multiple ? "checkbox" : "radio" : props.type;
|
|
18246
18533
|
const icon = props.icon ?? slots.icon;
|
|
18247
18534
|
const showIcon = checked && icon !== null && icon !== false;
|
|
18248
|
-
const { class: _class, style: _style,
|
|
18535
|
+
const { class: _class, style: _style, value: _attrsValue, ...inputAttrs } = attrs;
|
|
18249
18536
|
const renderIcon = () => {
|
|
18250
18537
|
const iconProps = getStyles("checkIcon");
|
|
18251
18538
|
if (icon === void 0) return (0, vue.h)(CheckIcon, iconProps);
|
|
@@ -18270,11 +18557,9 @@ var ChipBase = (0, vue.defineComponent)({
|
|
|
18270
18557
|
disabled: props.disabled,
|
|
18271
18558
|
value: chipValue,
|
|
18272
18559
|
onChange: (event) => {
|
|
18273
|
-
|
|
18274
|
-
if (groupContext)
|
|
18275
|
-
|
|
18276
|
-
props.onChange?.(event.currentTarget.checked);
|
|
18277
|
-
} else setValue(event.currentTarget.checked);
|
|
18560
|
+
const nextChecked = event.currentTarget.checked;
|
|
18561
|
+
if (groupContext) groupContext.onChange(event);
|
|
18562
|
+
setValue(nextChecked);
|
|
18278
18563
|
}
|
|
18279
18564
|
}), (0, vue.h)(Box, {
|
|
18280
18565
|
component: "label",
|
|
@@ -18398,7 +18683,7 @@ var varsResolver$22 = createVarsResolver((_, { radius }, ctx) => ({ root: {
|
|
|
18398
18683
|
"--pill-height": getSize(ctx.size, "pill-height"),
|
|
18399
18684
|
"--pill-radius": radius === void 0 ? void 0 : getRadius(radius)
|
|
18400
18685
|
} }));
|
|
18401
|
-
function callHandler$
|
|
18686
|
+
function callHandler$2(handler, event) {
|
|
18402
18687
|
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
18403
18688
|
else handler?.(event);
|
|
18404
18689
|
}
|
|
@@ -18507,12 +18792,12 @@ var PillBase = (0, vue.defineComponent)({
|
|
|
18507
18792
|
onMousedown: (event) => {
|
|
18508
18793
|
event.preventDefault();
|
|
18509
18794
|
event.stopPropagation();
|
|
18510
|
-
callHandler$
|
|
18795
|
+
callHandler$2(removeButtonProps.onMousedown ?? removeButtonProps.onMousedown ?? removeButtonProps.onMouseDown, event);
|
|
18511
18796
|
},
|
|
18512
18797
|
onClick: (event) => {
|
|
18513
18798
|
event.stopPropagation();
|
|
18514
18799
|
props.onRemove?.();
|
|
18515
|
-
callHandler$
|
|
18800
|
+
callHandler$2(removeButtonProps.onClick, event);
|
|
18516
18801
|
}
|
|
18517
18802
|
}) : null]);
|
|
18518
18803
|
};
|
|
@@ -18530,6 +18815,22 @@ var PillsInputField = withBoxProps((0, vue.defineComponent)({
|
|
|
18530
18815
|
name: "PillsInputField",
|
|
18531
18816
|
inheritAttrs: false,
|
|
18532
18817
|
props: {
|
|
18818
|
+
modelValue: {
|
|
18819
|
+
type: String,
|
|
18820
|
+
default: void 0
|
|
18821
|
+
},
|
|
18822
|
+
value: {
|
|
18823
|
+
type: String,
|
|
18824
|
+
default: void 0
|
|
18825
|
+
},
|
|
18826
|
+
defaultValue: {
|
|
18827
|
+
type: String,
|
|
18828
|
+
default: void 0
|
|
18829
|
+
},
|
|
18830
|
+
onChange: {
|
|
18831
|
+
type: Function,
|
|
18832
|
+
default: void 0
|
|
18833
|
+
},
|
|
18533
18834
|
type: {
|
|
18534
18835
|
type: String,
|
|
18535
18836
|
default: "visible"
|
|
@@ -18571,8 +18872,18 @@ var PillsInputField = withBoxProps((0, vue.defineComponent)({
|
|
|
18571
18872
|
default: false
|
|
18572
18873
|
}
|
|
18573
18874
|
},
|
|
18574
|
-
|
|
18875
|
+
emits: ["update:modelValue", "change"],
|
|
18876
|
+
setup(rawProps, { attrs, emit }) {
|
|
18575
18877
|
const props = useProps("PillsInputField", null, rawProps);
|
|
18878
|
+
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
18879
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
18880
|
+
defaultValue: props.defaultValue,
|
|
18881
|
+
finalValue: "",
|
|
18882
|
+
onChange: (nextValue) => {
|
|
18883
|
+
emit("update:modelValue", nextValue);
|
|
18884
|
+
emit("change", nextValue);
|
|
18885
|
+
}
|
|
18886
|
+
});
|
|
18576
18887
|
const context = usePillsInputContext();
|
|
18577
18888
|
const inputWrapperContext = useInputWrapperContext();
|
|
18578
18889
|
const getStyles = useStyles({
|
|
@@ -18594,6 +18905,7 @@ var PillsInputField = withBoxProps((0, vue.defineComponent)({
|
|
|
18594
18905
|
style: attrs.style
|
|
18595
18906
|
}),
|
|
18596
18907
|
component: "input",
|
|
18908
|
+
value: value.value,
|
|
18597
18909
|
ref: (node) => {
|
|
18598
18910
|
const input = node?.$el ?? node ?? null;
|
|
18599
18911
|
if (context) context.fieldRef.value = input;
|
|
@@ -18609,6 +18921,11 @@ var PillsInputField = withBoxProps((0, vue.defineComponent)({
|
|
|
18609
18921
|
"aria-invalid": context?.hasError || void 0,
|
|
18610
18922
|
"aria-describedby": inputWrapperContext.describedBy,
|
|
18611
18923
|
type: "text",
|
|
18924
|
+
onInput: (event) => {
|
|
18925
|
+
const handler = attrs.onInput;
|
|
18926
|
+
handler?.(event);
|
|
18927
|
+
setValue(event.currentTarget.value);
|
|
18928
|
+
},
|
|
18612
18929
|
onMousedown: (event) => {
|
|
18613
18930
|
if (!props.pointer) event.stopPropagation();
|
|
18614
18931
|
}
|
|
@@ -18775,6 +19092,10 @@ var RadioGroup = (0, vue.defineComponent)({
|
|
|
18775
19092
|
inheritAttrs: false,
|
|
18776
19093
|
slots: Object,
|
|
18777
19094
|
props: {
|
|
19095
|
+
modelValue: {
|
|
19096
|
+
type: String,
|
|
19097
|
+
default: void 0
|
|
19098
|
+
},
|
|
18778
19099
|
value: {
|
|
18779
19100
|
type: String,
|
|
18780
19101
|
default: void 0
|
|
@@ -18836,13 +19157,17 @@ var RadioGroup = (0, vue.defineComponent)({
|
|
|
18836
19157
|
default: false
|
|
18837
19158
|
}
|
|
18838
19159
|
},
|
|
18839
|
-
|
|
19160
|
+
emits: ["update:modelValue", "change"],
|
|
19161
|
+
setup(props, { attrs, slots, emit }) {
|
|
18840
19162
|
const name = (0, _mantine_vue_hooks.useId)(props.name);
|
|
18841
19163
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
18842
|
-
value: () => props.value,
|
|
19164
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
18843
19165
|
defaultValue: props.defaultValue,
|
|
18844
19166
|
finalValue: "",
|
|
18845
|
-
onChange: (nextValue) =>
|
|
19167
|
+
onChange: (nextValue) => {
|
|
19168
|
+
emit("update:modelValue", nextValue);
|
|
19169
|
+
emit("change", nextValue);
|
|
19170
|
+
}
|
|
18846
19171
|
});
|
|
18847
19172
|
const handleChange = (eventOrValue) => {
|
|
18848
19173
|
if (props.readOnly) return;
|
|
@@ -18888,7 +19213,7 @@ function useRadioCardContext() {
|
|
|
18888
19213
|
return (0, vue.inject)(RadioCardContextKey, null);
|
|
18889
19214
|
}
|
|
18890
19215
|
var varsResolver$21 = createVarsResolver((_, { radius }) => ({ card: { "--card-radius": getRadius(radius) } }));
|
|
18891
|
-
function callHandler$
|
|
19216
|
+
function callHandler$1(handler, event) {
|
|
18892
19217
|
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
18893
19218
|
else handler?.(event);
|
|
18894
19219
|
}
|
|
@@ -18896,10 +19221,22 @@ var RadioCard = withBoxProps((0, vue.defineComponent)({
|
|
|
18896
19221
|
name: "RadioCard",
|
|
18897
19222
|
inheritAttrs: false,
|
|
18898
19223
|
props: {
|
|
19224
|
+
modelValue: {
|
|
19225
|
+
type: Boolean,
|
|
19226
|
+
default: void 0
|
|
19227
|
+
},
|
|
18899
19228
|
checked: {
|
|
18900
19229
|
type: Boolean,
|
|
18901
19230
|
default: void 0
|
|
18902
19231
|
},
|
|
19232
|
+
defaultChecked: {
|
|
19233
|
+
type: Boolean,
|
|
19234
|
+
default: void 0
|
|
19235
|
+
},
|
|
19236
|
+
onChange: {
|
|
19237
|
+
type: Function,
|
|
19238
|
+
default: void 0
|
|
19239
|
+
},
|
|
18903
19240
|
withBorder: {
|
|
18904
19241
|
type: Boolean,
|
|
18905
19242
|
default: true
|
|
@@ -18937,8 +19274,23 @@ var RadioCard = withBoxProps((0, vue.defineComponent)({
|
|
|
18937
19274
|
default: false
|
|
18938
19275
|
}
|
|
18939
19276
|
},
|
|
18940
|
-
|
|
19277
|
+
emits: [
|
|
19278
|
+
"update:modelValue",
|
|
19279
|
+
"update:checked",
|
|
19280
|
+
"change"
|
|
19281
|
+
],
|
|
19282
|
+
setup(props, { attrs, slots, emit }) {
|
|
18941
19283
|
const groupContext = useRadioGroupContext();
|
|
19284
|
+
const [localChecked, setLocalChecked] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
19285
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
19286
|
+
defaultValue: props.defaultChecked,
|
|
19287
|
+
finalValue: false,
|
|
19288
|
+
onChange: (checked) => {
|
|
19289
|
+
emit("update:modelValue", checked);
|
|
19290
|
+
emit("update:checked", checked);
|
|
19291
|
+
emit("change", checked);
|
|
19292
|
+
}
|
|
19293
|
+
});
|
|
18942
19294
|
const getStyles = useStyles({
|
|
18943
19295
|
name: "RadioCard",
|
|
18944
19296
|
props,
|
|
@@ -18951,7 +19303,7 @@ var RadioCard = withBoxProps((0, vue.defineComponent)({
|
|
|
18951
19303
|
vars: props.vars,
|
|
18952
19304
|
varsResolver: varsResolver$21
|
|
18953
19305
|
});
|
|
18954
|
-
const isChecked = () =>
|
|
19306
|
+
const isChecked = () => groupContext ? groupContext.value === props.value : localChecked.value;
|
|
18955
19307
|
(0, vue.provide)(RadioCardContextKey, { get checked() {
|
|
18956
19308
|
return isChecked();
|
|
18957
19309
|
} });
|
|
@@ -18973,8 +19325,9 @@ var RadioCard = withBoxProps((0, vue.defineComponent)({
|
|
|
18973
19325
|
name,
|
|
18974
19326
|
"aria-checked": checked,
|
|
18975
19327
|
onClick: (event) => {
|
|
18976
|
-
callHandler$
|
|
19328
|
+
callHandler$1(attrs.onClick, event);
|
|
18977
19329
|
groupContext?.onChange(props.value || "");
|
|
19330
|
+
setLocalChecked(true);
|
|
18978
19331
|
}
|
|
18979
19332
|
}, () => slots.default?.());
|
|
18980
19333
|
};
|
|
@@ -19144,10 +19497,6 @@ var varsResolver$19 = createVarsResolver((theme, { size, radius, color, iconColo
|
|
|
19144
19497
|
}) : void 0,
|
|
19145
19498
|
"--radio-icon-size": getSize(size, "radio-icon-size")
|
|
19146
19499
|
} }));
|
|
19147
|
-
function callHandler$2(handler, event) {
|
|
19148
|
-
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
19149
|
-
else handler?.(event);
|
|
19150
|
-
}
|
|
19151
19500
|
var RadioBase = (0, vue.defineComponent)({
|
|
19152
19501
|
name: "Radio",
|
|
19153
19502
|
inheritAttrs: false,
|
|
@@ -19209,14 +19558,30 @@ var RadioBase = (0, vue.defineComponent)({
|
|
|
19209
19558
|
type: Boolean,
|
|
19210
19559
|
default: true
|
|
19211
19560
|
},
|
|
19561
|
+
modelValue: {
|
|
19562
|
+
type: Boolean,
|
|
19563
|
+
default: void 0
|
|
19564
|
+
},
|
|
19212
19565
|
checked: {
|
|
19213
19566
|
type: Boolean,
|
|
19214
19567
|
default: void 0
|
|
19215
19568
|
},
|
|
19569
|
+
defaultChecked: {
|
|
19570
|
+
type: Boolean,
|
|
19571
|
+
default: void 0
|
|
19572
|
+
},
|
|
19573
|
+
onChange: {
|
|
19574
|
+
type: Function,
|
|
19575
|
+
default: void 0
|
|
19576
|
+
},
|
|
19216
19577
|
disabled: {
|
|
19217
19578
|
type: Boolean,
|
|
19218
19579
|
default: false
|
|
19219
19580
|
},
|
|
19581
|
+
readOnly: {
|
|
19582
|
+
type: Boolean,
|
|
19583
|
+
default: false
|
|
19584
|
+
},
|
|
19220
19585
|
variant: {
|
|
19221
19586
|
type: String,
|
|
19222
19587
|
default: "filled"
|
|
@@ -19242,9 +19607,24 @@ var RadioBase = (0, vue.defineComponent)({
|
|
|
19242
19607
|
default: false
|
|
19243
19608
|
}
|
|
19244
19609
|
},
|
|
19245
|
-
|
|
19610
|
+
emits: [
|
|
19611
|
+
"update:modelValue",
|
|
19612
|
+
"update:checked",
|
|
19613
|
+
"change"
|
|
19614
|
+
],
|
|
19615
|
+
setup(props, { attrs, slots, emit }) {
|
|
19246
19616
|
const uuid = (0, _mantine_vue_hooks.useId)(props.id);
|
|
19247
19617
|
const groupContext = useRadioGroupContext();
|
|
19618
|
+
const [localChecked, setLocalChecked] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
19619
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
19620
|
+
defaultValue: props.defaultChecked,
|
|
19621
|
+
finalValue: false,
|
|
19622
|
+
onChange: (checked) => {
|
|
19623
|
+
emit("update:modelValue", checked);
|
|
19624
|
+
emit("update:checked", checked);
|
|
19625
|
+
emit("change", checked);
|
|
19626
|
+
}
|
|
19627
|
+
});
|
|
19248
19628
|
const getStyles = useStyles({
|
|
19249
19629
|
name: "Radio",
|
|
19250
19630
|
props,
|
|
@@ -19270,7 +19650,7 @@ var RadioBase = (0, vue.defineComponent)({
|
|
|
19270
19650
|
const iconStyles = getStyles("icon");
|
|
19271
19651
|
const Icon = props.icon || RadioIcon;
|
|
19272
19652
|
const value = String(attrs.value ?? "");
|
|
19273
|
-
const checked = groupContext ? groupContext.value === value :
|
|
19653
|
+
const checked = groupContext ? groupContext.value === value : localChecked.value;
|
|
19274
19654
|
const disabled = groupContext?.disabled || props.disabled;
|
|
19275
19655
|
const size = groupContext?.size ?? props.size;
|
|
19276
19656
|
const name = groupContext?.name ?? attrs.name;
|
|
@@ -19306,6 +19686,7 @@ var RadioBase = (0, vue.defineComponent)({
|
|
|
19306
19686
|
id,
|
|
19307
19687
|
checked,
|
|
19308
19688
|
disabled,
|
|
19689
|
+
readonly: props.readOnly,
|
|
19309
19690
|
name,
|
|
19310
19691
|
type: "radio",
|
|
19311
19692
|
"aria-describedby": describedBy,
|
|
@@ -19315,8 +19696,12 @@ var RadioBase = (0, vue.defineComponent)({
|
|
|
19315
19696
|
},
|
|
19316
19697
|
variant: props.variant,
|
|
19317
19698
|
onChange: (event) => {
|
|
19318
|
-
|
|
19699
|
+
if (props.readOnly) {
|
|
19700
|
+
event.currentTarget.checked = Boolean(checked);
|
|
19701
|
+
return;
|
|
19702
|
+
}
|
|
19319
19703
|
groupContext?.onChange(event);
|
|
19704
|
+
setLocalChecked(event.currentTarget.checked);
|
|
19320
19705
|
}
|
|
19321
19706
|
}), slots.icon ? slots.icon(iconStyles) : (0, vue.h)(Icon, iconStyles)]));
|
|
19322
19707
|
};
|
|
@@ -19340,6 +19725,10 @@ var SwitchGroup = (0, vue.defineComponent)({
|
|
|
19340
19725
|
inheritAttrs: false,
|
|
19341
19726
|
slots: Object,
|
|
19342
19727
|
props: {
|
|
19728
|
+
modelValue: {
|
|
19729
|
+
type: Array,
|
|
19730
|
+
default: void 0
|
|
19731
|
+
},
|
|
19343
19732
|
value: {
|
|
19344
19733
|
type: Array,
|
|
19345
19734
|
default: void 0
|
|
@@ -19413,16 +19802,20 @@ var SwitchGroup = (0, vue.defineComponent)({
|
|
|
19413
19802
|
default: false
|
|
19414
19803
|
}
|
|
19415
19804
|
},
|
|
19416
|
-
|
|
19805
|
+
emits: ["update:modelValue", "change"],
|
|
19806
|
+
setup(props, { attrs, slots, emit }) {
|
|
19417
19807
|
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
19418
|
-
value: () => props.value,
|
|
19808
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
19419
19809
|
defaultValue: props.defaultValue,
|
|
19420
19810
|
finalValue: [],
|
|
19421
|
-
onChange: (nextValue) =>
|
|
19811
|
+
onChange: (nextValue) => {
|
|
19812
|
+
emit("update:modelValue", nextValue);
|
|
19813
|
+
emit("change", nextValue);
|
|
19814
|
+
}
|
|
19422
19815
|
});
|
|
19423
|
-
const handleChange = (
|
|
19816
|
+
const handleChange = (eventOrValue) => {
|
|
19424
19817
|
if (props.readOnly) return;
|
|
19425
|
-
const itemValue = String(
|
|
19818
|
+
const itemValue = typeof eventOrValue === "string" ? eventOrValue : String(eventOrValue.currentTarget?.value ?? "");
|
|
19426
19819
|
const isCurrentlySelected = value.value.includes(itemValue);
|
|
19427
19820
|
if (!isCurrentlySelected && props.maxSelectedValues && value.value.length >= props.maxSelectedValues) return;
|
|
19428
19821
|
setValue(isCurrentlySelected ? value.value.filter((item) => item !== itemValue) : [...value.value, itemValue]);
|
|
@@ -19488,10 +19881,6 @@ var varsResolver$18 = createVarsResolver((theme, { radius, color, size }) => ({
|
|
|
19488
19881
|
"--switch-track-label-padding": getSize(size, "switch-track-label-padding"),
|
|
19489
19882
|
"--switch-color": color ? getThemeColor(color, theme) : void 0
|
|
19490
19883
|
} }));
|
|
19491
|
-
function callHandler$1(handler, event) {
|
|
19492
|
-
if (Array.isArray(handler)) handler.forEach((item) => item?.(event));
|
|
19493
|
-
else handler?.(event);
|
|
19494
|
-
}
|
|
19495
19884
|
var SwitchBase = (0, vue.defineComponent)({
|
|
19496
19885
|
name: "Switch",
|
|
19497
19886
|
inheritAttrs: false,
|
|
@@ -19553,6 +19942,10 @@ var SwitchBase = (0, vue.defineComponent)({
|
|
|
19553
19942
|
type: Boolean,
|
|
19554
19943
|
default: true
|
|
19555
19944
|
},
|
|
19945
|
+
modelValue: {
|
|
19946
|
+
type: Boolean,
|
|
19947
|
+
default: void 0
|
|
19948
|
+
},
|
|
19556
19949
|
checked: {
|
|
19557
19950
|
type: Boolean,
|
|
19558
19951
|
default: void 0
|
|
@@ -19569,6 +19962,10 @@ var SwitchBase = (0, vue.defineComponent)({
|
|
|
19569
19962
|
type: Boolean,
|
|
19570
19963
|
default: false
|
|
19571
19964
|
},
|
|
19965
|
+
readOnly: {
|
|
19966
|
+
type: Boolean,
|
|
19967
|
+
default: false
|
|
19968
|
+
},
|
|
19572
19969
|
variant: {
|
|
19573
19970
|
type: String,
|
|
19574
19971
|
default: void 0
|
|
@@ -19594,16 +19991,22 @@ var SwitchBase = (0, vue.defineComponent)({
|
|
|
19594
19991
|
default: false
|
|
19595
19992
|
}
|
|
19596
19993
|
},
|
|
19597
|
-
|
|
19994
|
+
emits: [
|
|
19995
|
+
"update:modelValue",
|
|
19996
|
+
"update:checked",
|
|
19997
|
+
"change"
|
|
19998
|
+
],
|
|
19999
|
+
setup(props, { attrs, slots, emit }) {
|
|
19598
20000
|
const uuid = (0, _mantine_vue_hooks.useId)(props.id);
|
|
19599
20001
|
const groupContext = useSwitchGroupContext();
|
|
19600
|
-
const internalChecked = (0, vue.ref)(false);
|
|
19601
20002
|
const [checked, setChecked] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
19602
|
-
value: () => props.checked,
|
|
20003
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.checked,
|
|
19603
20004
|
defaultValue: props.defaultChecked,
|
|
19604
20005
|
finalValue: false,
|
|
19605
20006
|
onChange: (value) => {
|
|
19606
|
-
|
|
20007
|
+
emit("update:modelValue", value);
|
|
20008
|
+
emit("update:checked", value);
|
|
20009
|
+
emit("change", value);
|
|
19607
20010
|
}
|
|
19608
20011
|
});
|
|
19609
20012
|
const getStyles = useStyles({
|
|
@@ -19664,15 +20067,19 @@ var SwitchBase = (0, vue.defineComponent)({
|
|
|
19664
20067
|
...getStyles("input"),
|
|
19665
20068
|
disabled,
|
|
19666
20069
|
checked: currentChecked,
|
|
20070
|
+
readonly: props.readOnly,
|
|
19667
20071
|
id,
|
|
19668
20072
|
type: "checkbox",
|
|
19669
20073
|
role: "switch",
|
|
19670
20074
|
"aria-describedby": describedBy,
|
|
19671
20075
|
onChange: (event) => {
|
|
19672
|
-
|
|
19673
|
-
|
|
20076
|
+
if (props.readOnly) {
|
|
20077
|
+
event.currentTarget.checked = currentChecked;
|
|
20078
|
+
return;
|
|
20079
|
+
}
|
|
20080
|
+
const nextChecked = event.currentTarget.checked;
|
|
19674
20081
|
if (groupContext) groupContext.onChange(event);
|
|
19675
|
-
|
|
20082
|
+
setChecked(nextChecked);
|
|
19676
20083
|
}
|
|
19677
20084
|
}), (0, vue.h)(Box, {
|
|
19678
20085
|
component: "span",
|
|
@@ -21519,6 +21926,10 @@ var Slider = withBoxProps((0, vue.defineComponent)({
|
|
|
21519
21926
|
type: Number,
|
|
21520
21927
|
default: void 0
|
|
21521
21928
|
},
|
|
21929
|
+
modelValue: {
|
|
21930
|
+
type: Number,
|
|
21931
|
+
default: void 0
|
|
21932
|
+
},
|
|
21522
21933
|
value: {
|
|
21523
21934
|
type: Number,
|
|
21524
21935
|
default: void 0
|
|
@@ -21634,16 +22045,23 @@ var Slider = withBoxProps((0, vue.defineComponent)({
|
|
|
21634
22045
|
default: false
|
|
21635
22046
|
}
|
|
21636
22047
|
},
|
|
21637
|
-
|
|
22048
|
+
emits: ["update:modelValue", "change"],
|
|
22049
|
+
setup(rawProps, { attrs, slots, emit }) {
|
|
21638
22050
|
const props = useProps("Slider", defaultProps$6, rawProps);
|
|
21639
22051
|
const direction = useDirection();
|
|
21640
22052
|
const hovered = (0, vue.ref)(false);
|
|
21641
22053
|
const thumb = (0, vue.ref)(null);
|
|
21642
22054
|
const [current, setCurrent] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
21643
|
-
value: () =>
|
|
22055
|
+
value: () => {
|
|
22056
|
+
const controlledValue = props.modelValue !== void 0 ? props.modelValue : props.value;
|
|
22057
|
+
return controlledValue === void 0 ? void 0 : clamp$1(controlledValue, props.min, props.max);
|
|
22058
|
+
},
|
|
21644
22059
|
defaultValue: props.defaultValue === void 0 ? void 0 : clamp$1(props.defaultValue, props.min, props.max),
|
|
21645
22060
|
finalValue: clamp$1(0, props.min, props.max),
|
|
21646
|
-
onChange: (value) =>
|
|
22061
|
+
onChange: (value) => {
|
|
22062
|
+
emit("update:modelValue", value);
|
|
22063
|
+
emit("change", value);
|
|
22064
|
+
}
|
|
21647
22065
|
});
|
|
21648
22066
|
const valueRef = (0, vue.ref)(current.value);
|
|
21649
22067
|
(0, vue.watch)(current, (value) => {
|
|
@@ -21781,6 +22199,10 @@ var RangeSlider = (0, vue.defineComponent)({
|
|
|
21781
22199
|
inheritAttrs: false,
|
|
21782
22200
|
slots: Object,
|
|
21783
22201
|
props: {
|
|
22202
|
+
modelValue: {
|
|
22203
|
+
type: Array,
|
|
22204
|
+
default: void 0
|
|
22205
|
+
},
|
|
21784
22206
|
value: {
|
|
21785
22207
|
type: Array,
|
|
21786
22208
|
default: void 0
|
|
@@ -21927,17 +22349,21 @@ var RangeSlider = (0, vue.defineComponent)({
|
|
|
21927
22349
|
default: false
|
|
21928
22350
|
}
|
|
21929
22351
|
},
|
|
21930
|
-
|
|
22352
|
+
emits: ["update:modelValue", "change"],
|
|
22353
|
+
setup(rawProps, { attrs, slots, emit }) {
|
|
21931
22354
|
const props = useProps("RangeSlider", defaults$5, rawProps);
|
|
21932
22355
|
const direction = useDirection();
|
|
21933
22356
|
const activeThumb = (0, vue.ref)(0);
|
|
21934
22357
|
const focused = (0, vue.ref)(0);
|
|
21935
22358
|
const hovered = (0, vue.ref)(false);
|
|
21936
22359
|
const [current, setCurrent] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
21937
|
-
value: () => props.value,
|
|
22360
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
21938
22361
|
defaultValue: props.defaultValue,
|
|
21939
22362
|
finalValue: [props.min, props.max],
|
|
21940
|
-
onChange: (value) =>
|
|
22363
|
+
onChange: (value) => {
|
|
22364
|
+
emit("update:modelValue", value);
|
|
22365
|
+
emit("change", value);
|
|
22366
|
+
}
|
|
21941
22367
|
});
|
|
21942
22368
|
const valueRef = (0, vue.ref)([...current.value]);
|
|
21943
22369
|
(0, vue.watch)(current, (value) => valueRef.value = [...value]);
|
|
@@ -22104,9 +22530,17 @@ var ColorSlider = (0, vue.defineComponent)({
|
|
|
22104
22530
|
name: "ColorSlider",
|
|
22105
22531
|
inheritAttrs: false,
|
|
22106
22532
|
props: {
|
|
22533
|
+
modelValue: {
|
|
22534
|
+
type: Number,
|
|
22535
|
+
default: void 0
|
|
22536
|
+
},
|
|
22107
22537
|
value: {
|
|
22108
22538
|
type: Number,
|
|
22109
|
-
|
|
22539
|
+
default: void 0
|
|
22540
|
+
},
|
|
22541
|
+
defaultValue: {
|
|
22542
|
+
type: Number,
|
|
22543
|
+
default: void 0
|
|
22110
22544
|
},
|
|
22111
22545
|
onChange: {
|
|
22112
22546
|
type: Function,
|
|
@@ -22165,11 +22599,21 @@ var ColorSlider = (0, vue.defineComponent)({
|
|
|
22165
22599
|
default: false
|
|
22166
22600
|
}
|
|
22167
22601
|
},
|
|
22168
|
-
|
|
22602
|
+
emits: ["update:modelValue", "change"],
|
|
22603
|
+
setup(props, { attrs, emit }) {
|
|
22169
22604
|
const ctx = useColorPickerContext();
|
|
22170
22605
|
const theme = useMantineTheme();
|
|
22606
|
+
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
22607
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
22608
|
+
defaultValue: props.defaultValue,
|
|
22609
|
+
finalValue: 0,
|
|
22610
|
+
onChange: (nextValue) => {
|
|
22611
|
+
emit("update:modelValue", nextValue);
|
|
22612
|
+
emit("change", nextValue);
|
|
22613
|
+
}
|
|
22614
|
+
});
|
|
22171
22615
|
const position = (0, vue.ref)({
|
|
22172
|
-
x:
|
|
22616
|
+
x: value.value / props.maxValue,
|
|
22173
22617
|
y: 0
|
|
22174
22618
|
});
|
|
22175
22619
|
const positionRef = (0, vue.ref)(position.value);
|
|
@@ -22194,7 +22638,7 @@ var ColorSlider = (0, vue.defineComponent)({
|
|
|
22194
22638
|
x,
|
|
22195
22639
|
y: 0
|
|
22196
22640
|
};
|
|
22197
|
-
|
|
22641
|
+
setValue(changeValue(x));
|
|
22198
22642
|
}, {
|
|
22199
22643
|
onScrubStart: props.onScrubStart,
|
|
22200
22644
|
onScrubEnd: () => {
|
|
@@ -22202,7 +22646,7 @@ var ColorSlider = (0, vue.defineComponent)({
|
|
|
22202
22646
|
props.onScrubEnd?.();
|
|
22203
22647
|
}
|
|
22204
22648
|
});
|
|
22205
|
-
(0, vue.watch)(
|
|
22649
|
+
(0, vue.watch)(value, (value) => position.value = {
|
|
22206
22650
|
x: value / props.maxValue,
|
|
22207
22651
|
y: 0
|
|
22208
22652
|
});
|
|
@@ -22213,7 +22657,7 @@ var ColorSlider = (0, vue.defineComponent)({
|
|
|
22213
22657
|
x: position.value.x + (event.key === "ArrowRight" ? .05 : -.05),
|
|
22214
22658
|
y: 0
|
|
22215
22659
|
}).x);
|
|
22216
|
-
|
|
22660
|
+
setValue(value);
|
|
22217
22661
|
props.onChangeEnd?.(value);
|
|
22218
22662
|
};
|
|
22219
22663
|
return () => (0, vue.h)(Box, {
|
|
@@ -22224,7 +22668,7 @@ var ColorSlider = (0, vue.defineComponent)({
|
|
|
22224
22668
|
style: attrs.style
|
|
22225
22669
|
}),
|
|
22226
22670
|
role: "slider",
|
|
22227
|
-
"aria-valuenow":
|
|
22671
|
+
"aria-valuenow": value.value,
|
|
22228
22672
|
"aria-valuemax": props.maxValue,
|
|
22229
22673
|
"aria-valuemin": 0,
|
|
22230
22674
|
tabindex: props.focusable ? 0 : -1,
|
|
@@ -22459,9 +22903,17 @@ var AlphaSlider = (0, vue.defineComponent)({
|
|
|
22459
22903
|
name: "AlphaSlider",
|
|
22460
22904
|
inheritAttrs: false,
|
|
22461
22905
|
props: {
|
|
22906
|
+
modelValue: {
|
|
22907
|
+
type: Number,
|
|
22908
|
+
default: void 0
|
|
22909
|
+
},
|
|
22462
22910
|
value: {
|
|
22463
22911
|
type: Number,
|
|
22464
|
-
|
|
22912
|
+
default: void 0
|
|
22913
|
+
},
|
|
22914
|
+
defaultValue: {
|
|
22915
|
+
type: Number,
|
|
22916
|
+
default: void 0
|
|
22465
22917
|
},
|
|
22466
22918
|
color: {
|
|
22467
22919
|
type: String,
|
|
@@ -22492,7 +22944,8 @@ var AlphaSlider = (0, vue.defineComponent)({
|
|
|
22492
22944
|
default: true
|
|
22493
22945
|
}
|
|
22494
22946
|
},
|
|
22495
|
-
|
|
22947
|
+
emits: ["update:modelValue", "change"],
|
|
22948
|
+
setup(props, { attrs, emit }) {
|
|
22496
22949
|
return () => (0, vue.h)(ColorSlider, {
|
|
22497
22950
|
...attrs,
|
|
22498
22951
|
...props,
|
|
@@ -22500,7 +22953,8 @@ var AlphaSlider = (0, vue.defineComponent)({
|
|
|
22500
22953
|
maxValue: 1,
|
|
22501
22954
|
round: false,
|
|
22502
22955
|
"data-alpha": "",
|
|
22503
|
-
|
|
22956
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", round(value, 2)),
|
|
22957
|
+
onChange: (value) => emit("change", round(value, 2)),
|
|
22504
22958
|
onChangeEnd: (value) => props.onChangeEnd?.(round(value, 2)),
|
|
22505
22959
|
overlays: [
|
|
22506
22960
|
{
|
|
@@ -22520,9 +22974,17 @@ var HueSlider = (0, vue.defineComponent)({
|
|
|
22520
22974
|
name: "HueSlider",
|
|
22521
22975
|
inheritAttrs: false,
|
|
22522
22976
|
props: {
|
|
22977
|
+
modelValue: {
|
|
22978
|
+
type: Number,
|
|
22979
|
+
default: void 0
|
|
22980
|
+
},
|
|
22523
22981
|
value: {
|
|
22524
22982
|
type: Number,
|
|
22525
|
-
|
|
22983
|
+
default: void 0
|
|
22984
|
+
},
|
|
22985
|
+
defaultValue: {
|
|
22986
|
+
type: Number,
|
|
22987
|
+
default: void 0
|
|
22526
22988
|
},
|
|
22527
22989
|
onChange: {
|
|
22528
22990
|
type: Function,
|
|
@@ -22549,13 +23011,16 @@ var HueSlider = (0, vue.defineComponent)({
|
|
|
22549
23011
|
default: true
|
|
22550
23012
|
}
|
|
22551
23013
|
},
|
|
22552
|
-
|
|
23014
|
+
emits: ["update:modelValue", "change"],
|
|
23015
|
+
setup(props, { attrs, emit }) {
|
|
22553
23016
|
return () => (0, vue.h)(ColorSlider, {
|
|
22554
23017
|
...attrs,
|
|
22555
23018
|
...props,
|
|
23019
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
23020
|
+
onChange: (value) => emit("change", value),
|
|
22556
23021
|
__staticSelector: "HueSlider",
|
|
22557
23022
|
maxValue: 360,
|
|
22558
|
-
thumbColor: `hsl(${props.value}, 100%, 50%)`,
|
|
23023
|
+
thumbColor: `hsl(${props.modelValue ?? props.value ?? props.defaultValue ?? 0}, 100%, 50%)`,
|
|
22559
23024
|
round: true,
|
|
22560
23025
|
"data-hue": "",
|
|
22561
23026
|
overlays: [{ backgroundImage: "linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))" }, { boxShadow: `rgba(0,0,0,.1) 0 0 0 ${rem(1)} inset, rgba(0,0,0,.15) 0 0 ${rem(4)} inset` }]
|
|
@@ -22753,6 +23218,10 @@ var ColorPicker = (0, vue.defineComponent)({
|
|
|
22753
23218
|
name: "ColorPicker",
|
|
22754
23219
|
inheritAttrs: false,
|
|
22755
23220
|
props: {
|
|
23221
|
+
modelValue: {
|
|
23222
|
+
type: String,
|
|
23223
|
+
default: void 0
|
|
23224
|
+
},
|
|
22756
23225
|
value: {
|
|
22757
23226
|
type: String,
|
|
22758
23227
|
default: void 0
|
|
@@ -22846,13 +23315,17 @@ var ColorPicker = (0, vue.defineComponent)({
|
|
|
22846
23315
|
default: false
|
|
22847
23316
|
}
|
|
22848
23317
|
},
|
|
22849
|
-
|
|
23318
|
+
emits: ["update:modelValue", "change"],
|
|
23319
|
+
setup(rawProps, { attrs, emit }) {
|
|
22850
23320
|
const props = useProps("ColorPicker", defaults$4, rawProps);
|
|
22851
23321
|
const [current, setCurrent, controlled] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
22852
|
-
value: () => props.value,
|
|
23322
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
22853
23323
|
defaultValue: props.defaultValue,
|
|
22854
23324
|
finalValue: "#FFFFFF",
|
|
22855
|
-
onChange: (value) =>
|
|
23325
|
+
onChange: (value) => {
|
|
23326
|
+
emit("update:modelValue", value);
|
|
23327
|
+
emit("change", value);
|
|
23328
|
+
}
|
|
22856
23329
|
});
|
|
22857
23330
|
const parsed = (0, vue.ref)(parseColor(current.value));
|
|
22858
23331
|
let scrubbing = false;
|
|
@@ -23616,6 +24089,22 @@ var MaskInput = (0, vue.defineComponent)({
|
|
|
23616
24089
|
type: [String, Array],
|
|
23617
24090
|
required: true
|
|
23618
24091
|
},
|
|
24092
|
+
modelValue: {
|
|
24093
|
+
type: String,
|
|
24094
|
+
default: void 0
|
|
24095
|
+
},
|
|
24096
|
+
value: {
|
|
24097
|
+
type: String,
|
|
24098
|
+
default: void 0
|
|
24099
|
+
},
|
|
24100
|
+
defaultValue: {
|
|
24101
|
+
type: String,
|
|
24102
|
+
default: void 0
|
|
24103
|
+
},
|
|
24104
|
+
onChange: {
|
|
24105
|
+
type: Function,
|
|
24106
|
+
default: void 0
|
|
24107
|
+
},
|
|
23619
24108
|
tokens: {
|
|
23620
24109
|
type: Object,
|
|
23621
24110
|
default: void 0
|
|
@@ -23665,7 +24154,8 @@ var MaskInput = (0, vue.defineComponent)({
|
|
|
23665
24154
|
default: void 0
|
|
23666
24155
|
}
|
|
23667
24156
|
},
|
|
23668
|
-
|
|
24157
|
+
emits: ["update:modelValue", "change"],
|
|
24158
|
+
setup(props, { attrs, slots, emit }) {
|
|
23669
24159
|
const input = (0, vue.ref)(null);
|
|
23670
24160
|
const processed = (0, vue.ref)("");
|
|
23671
24161
|
const rawValue = (0, vue.ref)("");
|
|
@@ -23726,6 +24216,8 @@ var MaskInput = (0, vue.defineComponent)({
|
|
|
23726
24216
|
}
|
|
23727
24217
|
const complete = isComplete(reprocessed, resolved.slots);
|
|
23728
24218
|
if (notify) {
|
|
24219
|
+
emit("update:modelValue", nextDisplay);
|
|
24220
|
+
emit("change", nextDisplay);
|
|
23729
24221
|
props.onChangeRaw?.(resolvedRaw, nextDisplay);
|
|
23730
24222
|
if (complete && !wasComplete.value) props.onComplete?.(nextDisplay, resolvedRaw);
|
|
23731
24223
|
}
|
|
@@ -23738,11 +24230,13 @@ var MaskInput = (0, vue.defineComponent)({
|
|
|
23738
24230
|
const resolved = resolveMaskOptions(options(), "");
|
|
23739
24231
|
displayValue.value = props.alwaysShowMask ? buildDisplayValue("", resolved.slots, resolved.slotChar, true) : "";
|
|
23740
24232
|
if (input.value) input.value.value = displayValue.value;
|
|
24233
|
+
emit("update:modelValue", "");
|
|
24234
|
+
emit("change", "");
|
|
23741
24235
|
props.onChangeRaw?.("", "");
|
|
23742
24236
|
};
|
|
23743
24237
|
(0, _mantine_vue_hooks.assignRef)(props.resetRef, reset);
|
|
23744
24238
|
(0, vue.watch)(() => props.resetRef, (value) => (0, _mantine_vue_hooks.assignRef)(value, reset));
|
|
23745
|
-
(0, vue.watch)(() =>
|
|
24239
|
+
(0, vue.watch)(() => props.modelValue !== void 0 ? props.modelValue : props.value, (value) => {
|
|
23746
24240
|
if (input.value && value !== void 0 && String(value) !== displayValue.value) commit(String(value), void 0, false, String(value));
|
|
23747
24241
|
});
|
|
23748
24242
|
(0, vue.onBeforeUnmount)(() => (0, _mantine_vue_hooks.assignRef)(props.resetRef, null));
|
|
@@ -23751,7 +24245,7 @@ var MaskInput = (0, vue.defineComponent)({
|
|
|
23751
24245
|
input.value = element instanceof HTMLInputElement ? element : null;
|
|
23752
24246
|
(0, _mantine_vue_hooks.assignRef)(attrs.rootRef, root?.$el ?? root ?? null);
|
|
23753
24247
|
if (!input.value) return;
|
|
23754
|
-
const initial =
|
|
24248
|
+
const initial = props.modelValue ?? props.value ?? props.defaultValue ?? input.value.value;
|
|
23755
24249
|
if (initial) commit(String(initial), void 0, false, String(initial));
|
|
23756
24250
|
else if (props.alwaysShowMask) {
|
|
23757
24251
|
const resolved = resolveMaskOptions(options(), "");
|
|
@@ -23862,6 +24356,7 @@ var MaskInput = (0, vue.defineComponent)({
|
|
|
23862
24356
|
type: forwarded.type ?? "text",
|
|
23863
24357
|
__staticSelector: "MaskInput",
|
|
23864
24358
|
__stylesApiProps: attrs,
|
|
24359
|
+
value: displayValue.value,
|
|
23865
24360
|
rootRef: attach,
|
|
23866
24361
|
onInput: handleInput,
|
|
23867
24362
|
onFocus: handleFocus,
|
|
@@ -28351,19 +28846,44 @@ var MenuDivider = (0, vue.defineComponent)({
|
|
|
28351
28846
|
var MenuSearch = (0, vue.defineComponent)({
|
|
28352
28847
|
name: "MenuSearch",
|
|
28353
28848
|
inheritAttrs: false,
|
|
28354
|
-
props: {
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28849
|
+
props: {
|
|
28850
|
+
modelValue: {
|
|
28851
|
+
type: String,
|
|
28852
|
+
default: void 0
|
|
28853
|
+
},
|
|
28854
|
+
value: {
|
|
28855
|
+
type: String,
|
|
28856
|
+
default: void 0
|
|
28857
|
+
},
|
|
28858
|
+
defaultValue: {
|
|
28859
|
+
type: String,
|
|
28860
|
+
default: void 0
|
|
28861
|
+
},
|
|
28862
|
+
onChange: {
|
|
28863
|
+
type: Function,
|
|
28864
|
+
default: void 0
|
|
28865
|
+
},
|
|
28866
|
+
clearSearchOnClose: {
|
|
28867
|
+
type: Boolean,
|
|
28868
|
+
default: true
|
|
28869
|
+
}
|
|
28870
|
+
},
|
|
28871
|
+
emits: ["update:modelValue", "change"],
|
|
28872
|
+
setup(props, { attrs, emit }) {
|
|
28359
28873
|
const ctx = useMenuContext();
|
|
28874
|
+
const [value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
28875
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
28876
|
+
defaultValue: props.defaultValue,
|
|
28877
|
+
finalValue: "",
|
|
28878
|
+
onChange: (nextValue) => {
|
|
28879
|
+
emit("update:modelValue", nextValue);
|
|
28880
|
+
emit("change", nextValue);
|
|
28881
|
+
}
|
|
28882
|
+
});
|
|
28360
28883
|
const unregister = ctx.registerSearch();
|
|
28361
28884
|
ctx.setSearchExitClear(props.clearSearchOnClose ? () => {
|
|
28362
28885
|
clearActive(document.querySelector("[data-menu-dropdown]"));
|
|
28363
|
-
|
|
28364
|
-
currentTarget: { value: "" },
|
|
28365
|
-
target: { value: "" }
|
|
28366
|
-
});
|
|
28886
|
+
setValue("");
|
|
28367
28887
|
} : null);
|
|
28368
28888
|
(0, vue.onUnmounted)(() => {
|
|
28369
28889
|
unregister();
|
|
@@ -28387,6 +28907,7 @@ var MenuSearch = (0, vue.defineComponent)({
|
|
|
28387
28907
|
const inputStyles = attrs.styles;
|
|
28388
28908
|
return (0, vue.h)(Input, {
|
|
28389
28909
|
...forwarded,
|
|
28910
|
+
value: value.value,
|
|
28390
28911
|
type: "search",
|
|
28391
28912
|
"data-autofocus": "",
|
|
28392
28913
|
"data-mantine-stop-propagation": "",
|
|
@@ -28404,11 +28925,7 @@ var MenuSearch = (0, vue.defineComponent)({
|
|
|
28404
28925
|
},
|
|
28405
28926
|
onInput: (event) => {
|
|
28406
28927
|
call$1(attrs.onInput, event);
|
|
28407
|
-
|
|
28408
|
-
clearActive(event.currentTarget.closest("[data-menu-dropdown]"));
|
|
28409
|
-
},
|
|
28410
|
-
onChange: (event) => {
|
|
28411
|
-
call$1(attrs.onChange, event);
|
|
28928
|
+
setValue(event.currentTarget.value);
|
|
28412
28929
|
clearActive(event.currentTarget.closest("[data-menu-dropdown]"));
|
|
28413
28930
|
},
|
|
28414
28931
|
onKeydown: (event) => {
|
|
@@ -29809,6 +30326,18 @@ var ComboboxSearch = (0, vue.defineComponent)({
|
|
|
29809
30326
|
name: "ComboboxSearch",
|
|
29810
30327
|
inheritAttrs: false,
|
|
29811
30328
|
props: {
|
|
30329
|
+
modelValue: {
|
|
30330
|
+
type: String,
|
|
30331
|
+
default: void 0
|
|
30332
|
+
},
|
|
30333
|
+
value: {
|
|
30334
|
+
type: String,
|
|
30335
|
+
default: void 0
|
|
30336
|
+
},
|
|
30337
|
+
defaultValue: {
|
|
30338
|
+
type: String,
|
|
30339
|
+
default: void 0
|
|
30340
|
+
},
|
|
29812
30341
|
withAriaAttributes: {
|
|
29813
30342
|
type: Boolean,
|
|
29814
30343
|
default: true
|
|
@@ -29819,7 +30348,8 @@ var ComboboxSearch = (0, vue.defineComponent)({
|
|
|
29819
30348
|
},
|
|
29820
30349
|
size: String
|
|
29821
30350
|
},
|
|
29822
|
-
|
|
30351
|
+
emits: ["update:modelValue", "change"],
|
|
30352
|
+
setup(props, { attrs, emit }) {
|
|
29823
30353
|
const ctx = useComboboxContext();
|
|
29824
30354
|
const targetProps = useComboboxTargetProps({
|
|
29825
30355
|
targetType: "input",
|
|
@@ -29832,6 +30362,11 @@ var ComboboxSearch = (0, vue.defineComponent)({
|
|
|
29832
30362
|
});
|
|
29833
30363
|
return () => (0, vue.h)(Input, {
|
|
29834
30364
|
...attrs,
|
|
30365
|
+
modelValue: props.modelValue,
|
|
30366
|
+
value: props.value,
|
|
30367
|
+
defaultValue: props.defaultValue,
|
|
30368
|
+
"onUpdate:modelValue": (value) => emit("update:modelValue", value),
|
|
30369
|
+
onChange: (value) => emit("change", value),
|
|
29835
30370
|
...targetProps,
|
|
29836
30371
|
ref: (node) => {
|
|
29837
30372
|
const element = node?.$el?.querySelector?.("input") ?? node?.$el ?? node;
|
|
@@ -30370,6 +30905,10 @@ var ComboboxPopoverBase = (0, vue.defineComponent)({
|
|
|
30370
30905
|
type: Boolean,
|
|
30371
30906
|
default: void 0
|
|
30372
30907
|
},
|
|
30908
|
+
modelValue: {
|
|
30909
|
+
type: null,
|
|
30910
|
+
default: void 0
|
|
30911
|
+
},
|
|
30373
30912
|
value: {
|
|
30374
30913
|
type: null,
|
|
30375
30914
|
default: void 0
|
|
@@ -30507,7 +31046,8 @@ var ComboboxPopoverBase = (0, vue.defineComponent)({
|
|
|
30507
31046
|
default: false
|
|
30508
31047
|
}
|
|
30509
31048
|
},
|
|
30510
|
-
|
|
31049
|
+
emits: ["update:modelValue", "change"],
|
|
31050
|
+
setup(rawProps, { attrs, slots, emit }) {
|
|
30511
31051
|
const props = new Proxy(rawProps, { get(target, key) {
|
|
30512
31052
|
const value = target[key];
|
|
30513
31053
|
return value === void 0 && key in defaultProps$2 ? defaultProps$2[key] : value;
|
|
@@ -30515,10 +31055,13 @@ var ComboboxPopoverBase = (0, vue.defineComponent)({
|
|
|
30515
31055
|
const parsedData = (0, vue.computed)(() => getParsedComboboxData(props.data));
|
|
30516
31056
|
const optionsLockup = (0, vue.computed)(() => getOptionsLockup(parsedData.value));
|
|
30517
31057
|
const [_value, setValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
30518
|
-
value: () => props.value,
|
|
31058
|
+
value: () => props.modelValue !== void 0 ? props.modelValue : props.value,
|
|
30519
31059
|
defaultValue: props.defaultValue,
|
|
30520
31060
|
finalValue: props.multiple ? [] : null,
|
|
30521
|
-
onChange: (
|
|
31061
|
+
onChange: (value) => {
|
|
31062
|
+
emit("update:modelValue", value);
|
|
31063
|
+
emit("change", value);
|
|
31064
|
+
}
|
|
30522
31065
|
});
|
|
30523
31066
|
const [_searchValue, setSearchValue] = (0, _mantine_vue_hooks.useUncontrolled)({
|
|
30524
31067
|
value: () => props.searchValue,
|
|
@@ -31269,7 +31812,11 @@ var Select = (0, vue.defineComponent)({
|
|
|
31269
31812
|
default: void 0
|
|
31270
31813
|
}
|
|
31271
31814
|
},
|
|
31272
|
-
emits: [
|
|
31815
|
+
emits: [
|
|
31816
|
+
"update:modelValue",
|
|
31817
|
+
"update:searchValue",
|
|
31818
|
+
"change"
|
|
31819
|
+
],
|
|
31273
31820
|
setup(props, { attrs, emit, slots }) {
|
|
31274
31821
|
const parsed = (0, vue.computed)(() => getParsedComboboxData(props.data));
|
|
31275
31822
|
const lockup = (0, vue.computed)(() => getOptionsLockup(parsed.value));
|
|
@@ -31289,8 +31836,8 @@ var Select = (0, vue.defineComponent)({
|
|
|
31289
31836
|
};
|
|
31290
31837
|
const changeValue = (value, option) => {
|
|
31291
31838
|
if (!controlled()) internal.value = value;
|
|
31292
|
-
props.onChange?.(value, option);
|
|
31293
31839
|
emit("update:modelValue", value);
|
|
31840
|
+
emit("change", value, option);
|
|
31294
31841
|
};
|
|
31295
31842
|
const combobox = useCombobox({
|
|
31296
31843
|
opened: () => props.dropdownOpened,
|
|
@@ -31478,15 +32025,18 @@ var Autocomplete = (0, vue.defineComponent)({
|
|
|
31478
32025
|
default: true
|
|
31479
32026
|
}
|
|
31480
32027
|
},
|
|
31481
|
-
emits: {
|
|
32028
|
+
emits: {
|
|
32029
|
+
"update:modelValue": (value) => typeof value === "string",
|
|
32030
|
+
change: (value) => typeof value === "string"
|
|
32031
|
+
},
|
|
31482
32032
|
setup(props, { attrs, emit, slots }) {
|
|
31483
32033
|
const internal = (0, vue.ref)(props.defaultValue);
|
|
31484
32034
|
const current = () => props.modelValue ?? props.value ?? internal.value;
|
|
31485
32035
|
const controlled = () => props.modelValue !== void 0 || props.value !== void 0;
|
|
31486
32036
|
const change = (value) => {
|
|
31487
32037
|
if (!controlled()) internal.value = value;
|
|
31488
|
-
props.onChange?.(value);
|
|
31489
32038
|
emit("update:modelValue", value);
|
|
32039
|
+
emit("change", value);
|
|
31490
32040
|
combobox.resetSelectedOption();
|
|
31491
32041
|
};
|
|
31492
32042
|
const parsed = (0, vue.computed)(() => getParsedComboboxData(props.data));
|
|
@@ -31673,7 +32223,11 @@ var MultiSelect = (0, vue.defineComponent)({
|
|
|
31673
32223
|
},
|
|
31674
32224
|
selectFirstOptionOnDropdownOpen: Boolean
|
|
31675
32225
|
},
|
|
31676
|
-
emits: [
|
|
32226
|
+
emits: [
|
|
32227
|
+
"update:modelValue",
|
|
32228
|
+
"update:searchValue",
|
|
32229
|
+
"change"
|
|
32230
|
+
],
|
|
31677
32231
|
setup(props, { attrs, emit, slots }) {
|
|
31678
32232
|
const parsed = (0, vue.computed)(() => getParsedComboboxData(props.data));
|
|
31679
32233
|
const lockup = (0, vue.computed)(() => getOptionsLockup(parsed.value));
|
|
@@ -31691,8 +32245,8 @@ var MultiSelect = (0, vue.defineComponent)({
|
|
|
31691
32245
|
};
|
|
31692
32246
|
const setValue = (value) => {
|
|
31693
32247
|
if (!controlled()) internal.value = value;
|
|
31694
|
-
props.onChange?.(value);
|
|
31695
32248
|
emit("update:modelValue", value);
|
|
32249
|
+
emit("change", value);
|
|
31696
32250
|
};
|
|
31697
32251
|
const combobox = useCombobox({
|
|
31698
32252
|
opened: () => props.dropdownOpened,
|
|
@@ -31932,7 +32486,11 @@ var TagsInput = (0, vue.defineComponent)({
|
|
|
31932
32486
|
},
|
|
31933
32487
|
selectFirstOptionOnDropdownOpen: Boolean
|
|
31934
32488
|
},
|
|
31935
|
-
emits: [
|
|
32489
|
+
emits: [
|
|
32490
|
+
"update:modelValue",
|
|
32491
|
+
"update:searchValue",
|
|
32492
|
+
"change"
|
|
32493
|
+
],
|
|
31936
32494
|
setup(props, { attrs, emit, slots }) {
|
|
31937
32495
|
const parsed = (0, vue.computed)(() => getParsedComboboxData(props.data));
|
|
31938
32496
|
const lockup = (0, vue.computed)(() => getOptionsLockup(parsed.value));
|
|
@@ -31949,8 +32507,8 @@ var TagsInput = (0, vue.defineComponent)({
|
|
|
31949
32507
|
};
|
|
31950
32508
|
const setValue = (value) => {
|
|
31951
32509
|
if (!controlled()) internal.value = value;
|
|
31952
|
-
props.onChange?.(value);
|
|
31953
32510
|
emit("update:modelValue", value);
|
|
32511
|
+
emit("change", value);
|
|
31954
32512
|
};
|
|
31955
32513
|
const combobox = useCombobox({
|
|
31956
32514
|
opened: () => props.dropdownOpened,
|
|
@@ -32224,7 +32782,7 @@ var ColorInput = (0, vue.defineComponent)({
|
|
|
32224
32782
|
default: 7
|
|
32225
32783
|
}
|
|
32226
32784
|
},
|
|
32227
|
-
emits: ["update:modelValue"],
|
|
32785
|
+
emits: ["update:modelValue", "change"],
|
|
32228
32786
|
setup(props, { attrs, emit, slots }) {
|
|
32229
32787
|
const internal = (0, vue.ref)(props.defaultValue);
|
|
32230
32788
|
const current = () => props.modelValue ?? props.value ?? internal.value;
|
|
@@ -32233,8 +32791,8 @@ var ColorInput = (0, vue.defineComponent)({
|
|
|
32233
32791
|
const lastValid = (0, vue.ref)(isColorValid(current()) ? current() : "");
|
|
32234
32792
|
const setValue = (value, end = false) => {
|
|
32235
32793
|
if (!controlled()) internal.value = value;
|
|
32236
|
-
props.onChange?.(value);
|
|
32237
32794
|
emit("update:modelValue", value);
|
|
32795
|
+
emit("change", value);
|
|
32238
32796
|
if (isColorValid(value)) {
|
|
32239
32797
|
lastValid.value = value;
|
|
32240
32798
|
if (end) props.onChangeEnd?.(convertHsvaTo(props.format, parseColor(value)));
|
|
@@ -32642,15 +33200,19 @@ var TreeSelect = (0, vue.defineComponent)({
|
|
|
32642
33200
|
},
|
|
32643
33201
|
chevronAriaLabels: Object
|
|
32644
33202
|
},
|
|
32645
|
-
emits: [
|
|
33203
|
+
emits: [
|
|
33204
|
+
"update:modelValue",
|
|
33205
|
+
"update:searchValue",
|
|
33206
|
+
"change"
|
|
33207
|
+
],
|
|
32646
33208
|
setup(props, { attrs, emit, slots }) {
|
|
32647
33209
|
const isMulti = () => props.mode !== "single";
|
|
32648
33210
|
const internal = (0, vue.ref)(props.defaultValue !== void 0 ? props.defaultValue : isMulti() ? [] : null);
|
|
32649
|
-
const current = () => props.modelValue
|
|
33211
|
+
const current = () => props.modelValue !== void 0 ? props.modelValue : props.value !== void 0 ? props.value : internal.value;
|
|
32650
33212
|
const setValue = (value) => {
|
|
32651
33213
|
if (props.modelValue === void 0 && props.value === void 0) internal.value = value;
|
|
32652
|
-
props.onChange?.(value);
|
|
32653
33214
|
emit("update:modelValue", value);
|
|
33215
|
+
emit("change", value);
|
|
32654
33216
|
};
|
|
32655
33217
|
const expandedInternal = (0, vue.ref)(props.defaultExpandAll ? allValues(props.data) : props.defaultExpandedValues ?? []);
|
|
32656
33218
|
const expanded = () => props.expandedValues ?? expandedInternal.value;
|
|
@@ -33069,11 +33631,15 @@ var Cascader = (0, vue.defineComponent)({
|
|
|
33069
33631
|
styles: [Object, Function],
|
|
33070
33632
|
unstyled: Boolean
|
|
33071
33633
|
},
|
|
33072
|
-
emits: [
|
|
33634
|
+
emits: [
|
|
33635
|
+
"update:modelValue",
|
|
33636
|
+
"update:searchValue",
|
|
33637
|
+
"change"
|
|
33638
|
+
],
|
|
33073
33639
|
setup(props, { attrs, emit, slots }) {
|
|
33074
33640
|
const id = (0, _mantine_vue_hooks.useId)(attrs.id);
|
|
33075
33641
|
const internalValue = (0, vue.ref)(props.defaultValue ?? null);
|
|
33076
|
-
const currentValue = (0, vue.computed)(() => props.modelValue
|
|
33642
|
+
const currentValue = (0, vue.computed)(() => props.modelValue !== void 0 ? props.modelValue : props.value !== void 0 ? props.value : internalValue.value);
|
|
33077
33643
|
const pathOptions = (0, vue.computed)(() => getCascaderPathOptions(props.data, currentValue.value));
|
|
33078
33644
|
const separatorString = (0, vue.computed)(() => typeof props.separator === "string" || typeof props.separator === "number" ? String(props.separator) : "/");
|
|
33079
33645
|
const separatorContent = () => resolveNode(props.separator, slots.separator) ?? "/";
|
|
@@ -33101,8 +33667,9 @@ var Cascader = (0, vue.defineComponent)({
|
|
|
33101
33667
|
};
|
|
33102
33668
|
const setValue = (value) => {
|
|
33103
33669
|
if (props.modelValue === void 0 && props.value === void 0) internalValue.value = value;
|
|
33104
|
-
|
|
33670
|
+
const selectedOptions = getCascaderPathOptions(props.data, value);
|
|
33105
33671
|
emit("update:modelValue", value);
|
|
33672
|
+
emit("change", value, selectedOptions);
|
|
33106
33673
|
};
|
|
33107
33674
|
const resetActivePath = () => {
|
|
33108
33675
|
activePath.value = currentValue.value ? [...currentValue.value] : [];
|