rx-compo 1.0.52 → 1.0.54

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.
Files changed (77) hide show
  1. package/entry/types/index.d.ts +0 -1
  2. package/es/components/RxButton/index.js +16 -25
  3. package/es/components/RxCheckbox/index.js +3712 -0
  4. package/es/components/RxCheckboxGroup/index.js +6430 -0
  5. package/es/components/RxDatePicker/index.js +13042 -0
  6. package/es/components/RxInput/index.js +1560 -0
  7. package/es/components/RxOption/index.js +8859 -0
  8. package/es/components/RxRadio/index.js +646 -0
  9. package/es/components/RxRadioButton/index.js +646 -0
  10. package/es/components/RxRadioGroup/index.js +1117 -0
  11. package/es/components/RxScrollbar/index.js +867 -0
  12. package/es/components/RxSelect/index.js +9022 -0
  13. package/es/components/RxSelectPlus/index.js +17471 -0
  14. package/es/components/RxSuperCondition/index.js +8690 -0
  15. package/es/components/RxTooltip/index.js +2470 -0
  16. package/es/components/index.js +13 -0
  17. package/es/index.d.ts +0 -1
  18. package/es/index.js +0 -1
  19. package/es/utils/useContext.d.ts +10 -0
  20. package/es/utils/useContext.js +13 -0
  21. package/es/utils/useTextOverflow.d.ts +4 -0
  22. package/es/utils/useTextOverflow.js +13 -0
  23. package/es/utils/with-install.d.ts +3 -0
  24. package/es/utils/with-install.js +7 -0
  25. package/index.esm.js +43171 -1577
  26. package/index.js +43192 -1585
  27. package/lib/components/RxButton/index.js +15 -24
  28. package/lib/components/RxCheckbox/index.js +3717 -0
  29. package/lib/components/RxCheckboxGroup/index.js +6435 -0
  30. package/lib/components/RxDatePicker/index.js +13047 -0
  31. package/lib/components/RxInput/index.js +1565 -0
  32. package/lib/components/RxOption/index.js +8864 -0
  33. package/lib/components/RxRadio/index.js +651 -0
  34. package/lib/components/RxRadioButton/index.js +651 -0
  35. package/lib/components/RxRadioGroup/index.js +1122 -0
  36. package/lib/components/RxScrollbar/index.js +872 -0
  37. package/lib/components/RxSelect/index.js +9027 -0
  38. package/lib/components/RxSelectPlus/index.js +17476 -0
  39. package/lib/components/RxSuperCondition/index.js +8695 -0
  40. package/lib/components/RxTooltip/index.js +2475 -0
  41. package/lib/components/index.js +91 -0
  42. package/lib/index.d.ts +0 -1
  43. package/lib/index.js +0 -1
  44. package/lib/utils/useContext.d.ts +10 -0
  45. package/lib/utils/useContext.js +18 -0
  46. package/lib/utils/useTextOverflow.d.ts +4 -0
  47. package/lib/utils/useTextOverflow.js +17 -0
  48. package/lib/utils/with-install.d.ts +3 -0
  49. package/lib/utils/with-install.js +11 -0
  50. package/package.json +4 -2
  51. package/theme-chalk/css/index.css +1 -1
  52. package/theme-chalk/css/rx-button.css +1 -0
  53. package/theme-chalk/css/rx-checkbox-group.css +1 -0
  54. package/theme-chalk/css/rx-checkbox.css +1 -0
  55. package/theme-chalk/css/rx-date-picker.css +0 -0
  56. package/theme-chalk/css/rx-input.css +1 -0
  57. package/theme-chalk/css/rx-option.css +1 -0
  58. package/theme-chalk/css/rx-radio-button.css +0 -0
  59. package/theme-chalk/css/rx-radio-group.css +1 -0
  60. package/theme-chalk/css/rx-radio.css +1 -0
  61. package/theme-chalk/css/rx-scrollbar.css +0 -0
  62. package/theme-chalk/css/rx-select.css +1 -0
  63. package/theme-chalk/css/rx-super-condition.css +0 -0
  64. package/theme-chalk/css/rx-tooltip.css +0 -0
  65. package/es/components/RxButton/index.d.ts +0 -3
  66. package/es/components/RxButton/src/index.d.ts +0 -3
  67. package/es/components/RxButton/src/index.vue.d.ts +0 -10
  68. package/es/components/index.d.ts +0 -2
  69. package/lib/components/RxButton/index.d.ts +0 -3
  70. package/lib/components/RxButton/src/index.d.ts +0 -3
  71. package/lib/components/RxButton/src/index.vue.d.ts +0 -10
  72. package/lib/components/index.d.ts +0 -2
  73. package/types/components/RxButton/index.d.ts +0 -3
  74. package/types/components/RxButton/src/index.d.ts +0 -3
  75. package/types/components/RxButton/src/index.vue.d.ts +0 -10
  76. package/types/components/index.d.ts +0 -2
  77. package/types/utils/with-install.d.ts +0 -3
@@ -0,0 +1,646 @@
1
+ import { withInstall as withInstall$1 } from 'rx-compo/es/utils/with-install';
2
+ import { warn, inject, ref, computed, unref, getCurrentInstance, onMounted, watch, toRef, onUnmounted, defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, withDirectives, isRef, vModelRadio, withModifiers, renderSlot, createTextVNode, toDisplayString, nextTick, normalizeStyle, provide, reactive, toRefs, resolveComponent, createBlock, mergeProps, createSlots, withCtx } from 'vue';
3
+ import 'vue-demi';
4
+
5
+ const RxRadioButtonProps = {};
6
+
7
+ var _a;
8
+ const isClient = typeof window !== "undefined";
9
+ isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
10
+
11
+ !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
12
+ !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
13
+ const NOOP = () => {
14
+ };
15
+ const hasOwnProperty = Object.prototype.hasOwnProperty;
16
+ const hasOwn = (val, key) => hasOwnProperty.call(val, key);
17
+ const isString = (val) => typeof val === "string";
18
+ const isObject = (val) => val !== null && typeof val === "object";
19
+
20
+ /**
21
+ * The inverse of `_.toPairs`; this method returns an object composed
22
+ * from key-value `pairs`.
23
+ *
24
+ * @static
25
+ * @memberOf _
26
+ * @since 4.0.0
27
+ * @category Array
28
+ * @param {Array} pairs The key-value pairs.
29
+ * @returns {Object} Returns the new object.
30
+ * @example
31
+ *
32
+ * _.fromPairs([['a', 1], ['b', 2]]);
33
+ * // => { 'a': 1, 'b': 2 }
34
+ */
35
+ function fromPairs(pairs) {
36
+ var index = -1,
37
+ length = pairs == null ? 0 : pairs.length,
38
+ result = {};
39
+
40
+ while (++index < length) {
41
+ var pair = pairs[index];
42
+ result[pair[0]] = pair[1];
43
+ }
44
+ return result;
45
+ }
46
+
47
+ const isBoolean = (val) => typeof val === "boolean";
48
+ const isNumber = (val) => typeof val === "number";
49
+
50
+ class ElementPlusError extends Error {
51
+ constructor(m) {
52
+ super(m);
53
+ this.name = "ElementPlusError";
54
+ }
55
+ }
56
+ function debugWarn(scope, message) {
57
+ if (process.env.NODE_ENV !== "production") {
58
+ const error = isString(scope) ? new ElementPlusError(`[${scope}] ${message}`) : scope;
59
+ console.warn(error);
60
+ }
61
+ }
62
+
63
+ const epPropKey = "__epPropKey";
64
+ const isEpProp = (val) => isObject(val) && !!val[epPropKey];
65
+ const buildProp = (prop, key) => {
66
+ if (!isObject(prop) || isEpProp(prop))
67
+ return prop;
68
+ const { values, required, default: defaultValue, type, validator } = prop;
69
+ const _validator = values || validator ? (val) => {
70
+ let valid = false;
71
+ let allowedValues = [];
72
+ if (values) {
73
+ allowedValues = Array.from(values);
74
+ if (hasOwn(prop, "default")) {
75
+ allowedValues.push(defaultValue);
76
+ }
77
+ valid || (valid = allowedValues.includes(val));
78
+ }
79
+ if (validator)
80
+ valid || (valid = validator(val));
81
+ if (!valid && allowedValues.length > 0) {
82
+ const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
83
+ warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
84
+ }
85
+ return valid;
86
+ } : void 0;
87
+ const epProp = {
88
+ type,
89
+ required: !!required,
90
+ validator: _validator,
91
+ [epPropKey]: true
92
+ };
93
+ if (hasOwn(prop, "default"))
94
+ epProp.default = defaultValue;
95
+ return epProp;
96
+ };
97
+ const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
98
+ key,
99
+ buildProp(option, key)
100
+ ]));
101
+
102
+ const withInstall = (main, extra) => {
103
+ main.install = (app) => {
104
+ for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
105
+ app.component(comp.name, comp);
106
+ }
107
+ };
108
+ if (extra) {
109
+ for (const [key, comp] of Object.entries(extra)) {
110
+ main[key] = comp;
111
+ }
112
+ }
113
+ return main;
114
+ };
115
+ const withNoopInstall = (component) => {
116
+ component.install = NOOP;
117
+ return component;
118
+ };
119
+
120
+ const UPDATE_MODEL_EVENT = "update:modelValue";
121
+ const CHANGE_EVENT = "change";
122
+
123
+ const componentSizes = ["", "default", "small", "large"];
124
+
125
+ const defaultNamespace = "el";
126
+ const statePrefix = "is-";
127
+ const _bem = (namespace, block, blockSuffix, element, modifier) => {
128
+ let cls = `${namespace}-${block}`;
129
+ if (blockSuffix) {
130
+ cls += `-${blockSuffix}`;
131
+ }
132
+ if (element) {
133
+ cls += `__${element}`;
134
+ }
135
+ if (modifier) {
136
+ cls += `--${modifier}`;
137
+ }
138
+ return cls;
139
+ };
140
+ const namespaceContextKey = Symbol("namespaceContextKey");
141
+ const useGetDerivedNamespace = (namespaceOverrides) => {
142
+ const derivedNamespace = namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace));
143
+ const namespace = computed(() => {
144
+ return unref(derivedNamespace) || defaultNamespace;
145
+ });
146
+ return namespace;
147
+ };
148
+ const useNamespace = (block, namespaceOverrides) => {
149
+ const namespace = useGetDerivedNamespace(namespaceOverrides);
150
+ const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
151
+ const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
152
+ const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
153
+ const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
154
+ const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
155
+ const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
156
+ const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
157
+ const is = (name, ...args) => {
158
+ const state = args.length >= 1 ? args[0] : true;
159
+ return name && state ? `${statePrefix}${name}` : "";
160
+ };
161
+ const cssVar = (object) => {
162
+ const styles = {};
163
+ for (const key in object) {
164
+ if (object[key]) {
165
+ styles[`--${namespace.value}-${key}`] = object[key];
166
+ }
167
+ }
168
+ return styles;
169
+ };
170
+ const cssVarBlock = (object) => {
171
+ const styles = {};
172
+ for (const key in object) {
173
+ if (object[key]) {
174
+ styles[`--${namespace.value}-${block}-${key}`] = object[key];
175
+ }
176
+ }
177
+ return styles;
178
+ };
179
+ const cssVarName = (name) => `--${namespace.value}-${name}`;
180
+ const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
181
+ return {
182
+ namespace,
183
+ b,
184
+ e,
185
+ m,
186
+ be,
187
+ em,
188
+ bm,
189
+ bem,
190
+ is,
191
+ cssVar,
192
+ cssVarName,
193
+ cssVarBlock,
194
+ cssVarBlockName
195
+ };
196
+ };
197
+
198
+ const useProp = (name) => {
199
+ const vm = getCurrentInstance();
200
+ return computed(() => {
201
+ var _a, _b;
202
+ return (_b = (_a = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a.$props) == null ? void 0 : _b[name];
203
+ });
204
+ };
205
+
206
+ const defaultIdInjection = {
207
+ prefix: Math.floor(Math.random() * 1e4),
208
+ current: 0
209
+ };
210
+ const ID_INJECTION_KEY = Symbol("elIdInjection");
211
+ const useIdInjection = () => {
212
+ return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
213
+ };
214
+ const useId = (deterministicId) => {
215
+ const idInjection = useIdInjection();
216
+ if (!isClient && idInjection === defaultIdInjection) {
217
+ debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
218
+ usage: app.provide(ID_INJECTION_KEY, {
219
+ prefix: number,
220
+ current: number,
221
+ })`);
222
+ }
223
+ const namespace = useGetDerivedNamespace();
224
+ const idRef = computed(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
225
+ return idRef;
226
+ };
227
+
228
+ const useSizeProp = buildProp({
229
+ type: String,
230
+ values: componentSizes,
231
+ required: false
232
+ });
233
+ const SIZE_INJECTION_KEY = Symbol("size");
234
+ const useGlobalSize = () => {
235
+ const injectedSize = inject(SIZE_INJECTION_KEY, {});
236
+ return computed(() => {
237
+ return unref(injectedSize.size) || "";
238
+ });
239
+ };
240
+
241
+ var _export_sfc = (sfc, props) => {
242
+ const target = sfc.__vccOpts || sfc;
243
+ for (const [key, val] of props) {
244
+ target[key] = val;
245
+ }
246
+ return target;
247
+ };
248
+
249
+ const formContextKey = Symbol("formContextKey");
250
+ const formItemContextKey = Symbol("formItemContextKey");
251
+
252
+ const useFormSize = (fallback, ignore = {}) => {
253
+ const emptyRef = ref(void 0);
254
+ const size = ignore.prop ? emptyRef : useProp("size");
255
+ const globalConfig = ignore.global ? emptyRef : useGlobalSize();
256
+ const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
257
+ const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
258
+ return computed(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || "");
259
+ };
260
+ const useFormDisabled = (fallback) => {
261
+ const disabled = useProp("disabled");
262
+ const form = inject(formContextKey, void 0);
263
+ return computed(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
264
+ };
265
+
266
+ const useFormItem = () => {
267
+ const form = inject(formContextKey, void 0);
268
+ const formItem = inject(formItemContextKey, void 0);
269
+ return {
270
+ form,
271
+ formItem
272
+ };
273
+ };
274
+ const useFormItemInputId = (props, {
275
+ formItemContext,
276
+ disableIdGeneration,
277
+ disableIdManagement
278
+ }) => {
279
+ if (!disableIdGeneration) {
280
+ disableIdGeneration = ref(false);
281
+ }
282
+ if (!disableIdManagement) {
283
+ disableIdManagement = ref(false);
284
+ }
285
+ const inputId = ref();
286
+ let idUnwatch = void 0;
287
+ const isLabeledByFormItem = computed(() => {
288
+ var _a;
289
+ return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1);
290
+ });
291
+ onMounted(() => {
292
+ idUnwatch = watch([toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
293
+ const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
294
+ if (newId !== inputId.value) {
295
+ if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
296
+ inputId.value && formItemContext.removeInputId(inputId.value);
297
+ if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
298
+ formItemContext.addInputId(newId);
299
+ }
300
+ }
301
+ inputId.value = newId;
302
+ }
303
+ }, { immediate: true });
304
+ });
305
+ onUnmounted(() => {
306
+ idUnwatch && idUnwatch();
307
+ if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
308
+ inputId.value && formItemContext.removeInputId(inputId.value);
309
+ }
310
+ });
311
+ return {
312
+ isLabeledByFormItem,
313
+ inputId
314
+ };
315
+ };
316
+
317
+ const radioPropsBase = buildProps({
318
+ size: useSizeProp,
319
+ disabled: Boolean,
320
+ label: {
321
+ type: [String, Number, Boolean],
322
+ default: ""
323
+ }
324
+ });
325
+ const radioProps = buildProps({
326
+ ...radioPropsBase,
327
+ modelValue: {
328
+ type: [String, Number, Boolean],
329
+ default: ""
330
+ },
331
+ name: {
332
+ type: String,
333
+ default: ""
334
+ },
335
+ border: Boolean
336
+ });
337
+ const radioEmits = {
338
+ [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
339
+ [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
340
+ };
341
+
342
+ const radioGroupKey = Symbol("radioGroupKey");
343
+
344
+ const useRadio = (props, emit) => {
345
+ const radioRef = ref();
346
+ const radioGroup = inject(radioGroupKey, void 0);
347
+ const isGroup = computed(() => !!radioGroup);
348
+ const modelValue = computed({
349
+ get() {
350
+ return isGroup.value ? radioGroup.modelValue : props.modelValue;
351
+ },
352
+ set(val) {
353
+ if (isGroup.value) {
354
+ radioGroup.changeEvent(val);
355
+ } else {
356
+ emit && emit(UPDATE_MODEL_EVENT, val);
357
+ }
358
+ radioRef.value.checked = props.modelValue === props.label;
359
+ }
360
+ });
361
+ const size = useFormSize(computed(() => radioGroup == null ? void 0 : radioGroup.size));
362
+ const disabled = useFormDisabled(computed(() => radioGroup == null ? void 0 : radioGroup.disabled));
363
+ const focus = ref(false);
364
+ const tabIndex = computed(() => {
365
+ return disabled.value || isGroup.value && modelValue.value !== props.label ? -1 : 0;
366
+ });
367
+ return {
368
+ radioRef,
369
+ isGroup,
370
+ radioGroup,
371
+ focus,
372
+ size,
373
+ disabled,
374
+ tabIndex,
375
+ modelValue
376
+ };
377
+ };
378
+
379
+ const _hoisted_1$2 = ["value", "name", "disabled"];
380
+ const __default__$2 = defineComponent({
381
+ name: "ElRadio"
382
+ });
383
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
384
+ ...__default__$2,
385
+ props: radioProps,
386
+ emits: radioEmits,
387
+ setup(__props, { emit }) {
388
+ const props = __props;
389
+ const ns = useNamespace("radio");
390
+ const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(props, emit);
391
+ function handleChange() {
392
+ nextTick(() => emit("change", modelValue.value));
393
+ }
394
+ return (_ctx, _cache) => {
395
+ var _a;
396
+ return openBlock(), createElementBlock("label", {
397
+ class: normalizeClass([
398
+ unref(ns).b(),
399
+ unref(ns).is("disabled", unref(disabled)),
400
+ unref(ns).is("focus", unref(focus)),
401
+ unref(ns).is("bordered", _ctx.border),
402
+ unref(ns).is("checked", unref(modelValue) === _ctx.label),
403
+ unref(ns).m(unref(size))
404
+ ])
405
+ }, [
406
+ createElementVNode("span", {
407
+ class: normalizeClass([
408
+ unref(ns).e("input"),
409
+ unref(ns).is("disabled", unref(disabled)),
410
+ unref(ns).is("checked", unref(modelValue) === _ctx.label)
411
+ ])
412
+ }, [
413
+ withDirectives(createElementVNode("input", {
414
+ ref_key: "radioRef",
415
+ ref: radioRef,
416
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
417
+ class: normalizeClass(unref(ns).e("original")),
418
+ value: _ctx.label,
419
+ name: _ctx.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
420
+ disabled: unref(disabled),
421
+ type: "radio",
422
+ onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
423
+ onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
424
+ onChange: handleChange
425
+ }, null, 42, _hoisted_1$2), [
426
+ [vModelRadio, unref(modelValue)]
427
+ ]),
428
+ createElementVNode("span", {
429
+ class: normalizeClass(unref(ns).e("inner"))
430
+ }, null, 2)
431
+ ], 2),
432
+ createElementVNode("span", {
433
+ class: normalizeClass(unref(ns).e("label")),
434
+ onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
435
+ }, ["stop"]))
436
+ }, [
437
+ renderSlot(_ctx.$slots, "default", {}, () => [
438
+ createTextVNode(toDisplayString(_ctx.label), 1)
439
+ ])
440
+ ], 34)
441
+ ], 2);
442
+ };
443
+ }
444
+ });
445
+ var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio.vue"]]);
446
+
447
+ const radioButtonProps = buildProps({
448
+ ...radioPropsBase,
449
+ name: {
450
+ type: String,
451
+ default: ""
452
+ }
453
+ });
454
+
455
+ const _hoisted_1$1 = ["value", "name", "disabled"];
456
+ const __default__$1 = defineComponent({
457
+ name: "ElRadioButton"
458
+ });
459
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
460
+ ...__default__$1,
461
+ props: radioButtonProps,
462
+ setup(__props) {
463
+ const props = __props;
464
+ const ns = useNamespace("radio");
465
+ const { radioRef, focus, size, disabled, modelValue, radioGroup } = useRadio(props);
466
+ const activeStyle = computed(() => {
467
+ return {
468
+ backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
469
+ borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
470
+ boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
471
+ color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
472
+ };
473
+ });
474
+ return (_ctx, _cache) => {
475
+ var _a;
476
+ return openBlock(), createElementBlock("label", {
477
+ class: normalizeClass([
478
+ unref(ns).b("button"),
479
+ unref(ns).is("active", unref(modelValue) === _ctx.label),
480
+ unref(ns).is("disabled", unref(disabled)),
481
+ unref(ns).is("focus", unref(focus)),
482
+ unref(ns).bm("button", unref(size))
483
+ ])
484
+ }, [
485
+ withDirectives(createElementVNode("input", {
486
+ ref_key: "radioRef",
487
+ ref: radioRef,
488
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
489
+ class: normalizeClass(unref(ns).be("button", "original-radio")),
490
+ value: _ctx.label,
491
+ type: "radio",
492
+ name: _ctx.name || ((_a = unref(radioGroup)) == null ? void 0 : _a.name),
493
+ disabled: unref(disabled),
494
+ onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
495
+ onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false)
496
+ }, null, 42, _hoisted_1$1), [
497
+ [vModelRadio, unref(modelValue)]
498
+ ]),
499
+ createElementVNode("span", {
500
+ class: normalizeClass(unref(ns).be("button", "inner")),
501
+ style: normalizeStyle(unref(modelValue) === _ctx.label ? unref(activeStyle) : {}),
502
+ onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
503
+ }, ["stop"]))
504
+ }, [
505
+ renderSlot(_ctx.$slots, "default", {}, () => [
506
+ createTextVNode(toDisplayString(_ctx.label), 1)
507
+ ])
508
+ ], 38)
509
+ ], 2);
510
+ };
511
+ }
512
+ });
513
+ var RadioButton = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-button.vue"]]);
514
+
515
+ const radioGroupProps = buildProps({
516
+ id: {
517
+ type: String,
518
+ default: void 0
519
+ },
520
+ size: useSizeProp,
521
+ disabled: Boolean,
522
+ modelValue: {
523
+ type: [String, Number, Boolean],
524
+ default: ""
525
+ },
526
+ fill: {
527
+ type: String,
528
+ default: ""
529
+ },
530
+ label: {
531
+ type: String,
532
+ default: void 0
533
+ },
534
+ textColor: {
535
+ type: String,
536
+ default: ""
537
+ },
538
+ name: {
539
+ type: String,
540
+ default: void 0
541
+ },
542
+ validateEvent: {
543
+ type: Boolean,
544
+ default: true
545
+ }
546
+ });
547
+ const radioGroupEmits = radioEmits;
548
+
549
+ const _hoisted_1 = ["id", "aria-label", "aria-labelledby"];
550
+ const __default__ = defineComponent({
551
+ name: "ElRadioGroup"
552
+ });
553
+ const _sfc_main = /* @__PURE__ */ defineComponent({
554
+ ...__default__,
555
+ props: radioGroupProps,
556
+ emits: radioGroupEmits,
557
+ setup(__props, { emit }) {
558
+ const props = __props;
559
+ const ns = useNamespace("radio");
560
+ const radioId = useId();
561
+ const radioGroupRef = ref();
562
+ const { formItem } = useFormItem();
563
+ const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
564
+ formItemContext: formItem
565
+ });
566
+ const changeEvent = (value) => {
567
+ emit(UPDATE_MODEL_EVENT, value);
568
+ nextTick(() => emit("change", value));
569
+ };
570
+ onMounted(() => {
571
+ const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
572
+ const firstLabel = radios[0];
573
+ if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
574
+ firstLabel.tabIndex = 0;
575
+ }
576
+ });
577
+ const name = computed(() => {
578
+ return props.name || radioId.value;
579
+ });
580
+ provide(radioGroupKey, reactive({
581
+ ...toRefs(props),
582
+ changeEvent,
583
+ name
584
+ }));
585
+ watch(() => props.modelValue, () => {
586
+ if (props.validateEvent) {
587
+ formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn(err));
588
+ }
589
+ });
590
+ return (_ctx, _cache) => {
591
+ return openBlock(), createElementBlock("div", {
592
+ id: unref(groupId),
593
+ ref_key: "radioGroupRef",
594
+ ref: radioGroupRef,
595
+ class: normalizeClass(unref(ns).b("group")),
596
+ role: "radiogroup",
597
+ "aria-label": !unref(isLabeledByFormItem) ? _ctx.label || "radio-group" : void 0,
598
+ "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
599
+ }, [
600
+ renderSlot(_ctx.$slots, "default")
601
+ ], 10, _hoisted_1);
602
+ };
603
+ }
604
+ });
605
+ var RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-group.vue"]]);
606
+
607
+ withInstall(Radio, {
608
+ RadioButton,
609
+ RadioGroup
610
+ });
611
+ withNoopInstall(RadioGroup);
612
+ const ElRadioButton = withNoopInstall(RadioButton);
613
+
614
+ var script = defineComponent({
615
+ name: 'RxRadioButton',
616
+ components: {
617
+ ElRadioButton
618
+ },
619
+ props: RxRadioButtonProps,
620
+ setup() {
621
+ return {};
622
+ }
623
+ });
624
+
625
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
626
+ const _component_el_radio_button = resolveComponent("el-radio-button");
627
+
628
+ return (openBlock(), createBlock(_component_el_radio_button, mergeProps(_ctx.$props, { class: "rx-radio-button" }), createSlots({ _: 2 /* DYNAMIC */ }, [
629
+ (_ctx.$slots.default)
630
+ ? {
631
+ name: "default",
632
+ fn: withCtx(() => [
633
+ renderSlot(_ctx.$slots, "default")
634
+ ]),
635
+ key: "0"
636
+ }
637
+ : undefined
638
+ ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */))
639
+ }
640
+
641
+ script.render = render;
642
+ script.__file = "packages/components/RxRadioButton/src/index.vue";
643
+
644
+ const RxRadioButton = withInstall$1(script);
645
+
646
+ export { RxRadioButton, RxRadioButton as default };