@dragonmastery/zinia-forms-core 0.5.9 → 0.5.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +65 -2
- package/dist/index.js +170 -72
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -309,6 +309,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
309
309
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
310
310
|
return TextareaField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
311
311
|
};
|
|
312
|
+
textareaFieldComponent.inheritAttrs = false;
|
|
312
313
|
fields[typedPath] = textareaFieldComponent;
|
|
313
314
|
components[componentName] = textareaFieldComponent;
|
|
314
315
|
return;
|
|
@@ -318,6 +319,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
318
319
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
319
320
|
return PasswordField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
320
321
|
};
|
|
322
|
+
passwordFieldComponent.inheritAttrs = false;
|
|
321
323
|
fields[typedPath] = passwordFieldComponent;
|
|
322
324
|
components[componentName] = passwordFieldComponent;
|
|
323
325
|
return;
|
|
@@ -327,6 +329,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
327
329
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
328
330
|
return EmailField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
329
331
|
};
|
|
332
|
+
emailFieldComponent.inheritAttrs = false;
|
|
330
333
|
fields[typedPath] = emailFieldComponent;
|
|
331
334
|
components[componentName] = emailFieldComponent;
|
|
332
335
|
return;
|
|
@@ -336,6 +339,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
336
339
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
337
340
|
return TelField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
338
341
|
};
|
|
342
|
+
telFieldComponent.inheritAttrs = false;
|
|
339
343
|
fields[typedPath] = telFieldComponent;
|
|
340
344
|
components[componentName] = telFieldComponent;
|
|
341
345
|
return;
|
|
@@ -345,6 +349,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
345
349
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
346
350
|
return NumberField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
347
351
|
};
|
|
352
|
+
numberInputFieldComponent.inheritAttrs = false;
|
|
348
353
|
fields[typedPath] = numberInputFieldComponent;
|
|
349
354
|
components[componentName] = numberInputFieldComponent;
|
|
350
355
|
return;
|
|
@@ -354,6 +359,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
354
359
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
355
360
|
return CheckboxField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
356
361
|
};
|
|
362
|
+
checkboxFieldComponent.inheritAttrs = false;
|
|
357
363
|
fields[typedPath] = checkboxFieldComponent;
|
|
358
364
|
components[componentName] = checkboxFieldComponent;
|
|
359
365
|
return;
|
|
@@ -363,12 +369,14 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
363
369
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
364
370
|
return RadioField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
365
371
|
};
|
|
372
|
+
radioFieldComponent.inheritAttrs = false;
|
|
366
373
|
fields[typedPath] = radioFieldComponent;
|
|
367
374
|
components[componentName] = radioFieldComponent;
|
|
368
375
|
return;
|
|
369
376
|
// Skip the type-based switch below
|
|
370
377
|
case "select":
|
|
371
378
|
const selectFieldComponent = typedSelectFieldFactory(typedPath);
|
|
379
|
+
selectFieldComponent.inheritAttrs = false;
|
|
372
380
|
fields[typedPath] = selectFieldComponent;
|
|
373
381
|
components[componentName] = selectFieldComponent;
|
|
374
382
|
typedSelectFields[typedPath] = selectFieldComponent;
|
|
@@ -376,6 +384,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
376
384
|
// Skip the type-based switch below
|
|
377
385
|
case "combobox":
|
|
378
386
|
const comboboxFieldComponent = typedComboboxFieldFactory(typedPath);
|
|
387
|
+
comboboxFieldComponent.inheritAttrs = false;
|
|
379
388
|
fields[typedPath] = comboboxFieldComponent;
|
|
380
389
|
components[componentName] = comboboxFieldComponent;
|
|
381
390
|
return;
|
|
@@ -385,6 +394,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
385
394
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
386
395
|
return TextField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
387
396
|
};
|
|
397
|
+
textFieldComponent.inheritAttrs = false;
|
|
388
398
|
fields[typedPath] = textFieldComponent;
|
|
389
399
|
components[componentName] = textFieldComponent;
|
|
390
400
|
return;
|
|
@@ -394,6 +404,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
394
404
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
395
405
|
return CurrencyField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
396
406
|
};
|
|
407
|
+
currencyFieldComponent.inheritAttrs = false;
|
|
397
408
|
fields[typedPath] = currencyFieldComponent;
|
|
398
409
|
components[componentName] = currencyFieldComponent;
|
|
399
410
|
return;
|
|
@@ -403,6 +414,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
403
414
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
404
415
|
return DateField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
405
416
|
};
|
|
417
|
+
dateFieldComponent.inheritAttrs = false;
|
|
406
418
|
fields[typedPath] = dateFieldComponent;
|
|
407
419
|
components[componentName] = dateFieldComponent;
|
|
408
420
|
return;
|
|
@@ -418,6 +430,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
418
430
|
case "enum":
|
|
419
431
|
if (fieldMeta.options && fieldMeta.options.length > 0) {
|
|
420
432
|
const fieldComponent = typedSelectFieldFactory(typedPath);
|
|
433
|
+
fieldComponent.inheritAttrs = false;
|
|
421
434
|
fields[typedPath] = fieldComponent;
|
|
422
435
|
components[componentName] = fieldComponent;
|
|
423
436
|
typedSelectFields[typedPath] = fieldComponent;
|
|
@@ -428,6 +441,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
428
441
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
429
442
|
return TextField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
430
443
|
};
|
|
444
|
+
stringFieldComponent.inheritAttrs = false;
|
|
431
445
|
fields[typedPath] = stringFieldComponent;
|
|
432
446
|
components[componentName] = stringFieldComponent;
|
|
433
447
|
break;
|
|
@@ -436,6 +450,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
436
450
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
437
451
|
return NumberField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
438
452
|
};
|
|
453
|
+
numberFieldComponent.inheritAttrs = false;
|
|
439
454
|
fields[typedPath] = numberFieldComponent;
|
|
440
455
|
components[componentName] = numberFieldComponent;
|
|
441
456
|
break;
|
|
@@ -444,6 +459,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
444
459
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
445
460
|
return CheckboxField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
446
461
|
};
|
|
462
|
+
booleanFieldComponent.inheritAttrs = false;
|
|
447
463
|
fields[typedPath] = booleanFieldComponent;
|
|
448
464
|
components[componentName] = booleanFieldComponent;
|
|
449
465
|
break;
|
|
@@ -457,6 +473,7 @@ function generateFieldComponents(schema, fieldsMetadata, styleName) {
|
|
|
457
473
|
const metadataProps = createMetadataProps(fieldMeta);
|
|
458
474
|
return DateField({ ...metadataProps, ...props, name: typedPath }, context || { attrs: {} });
|
|
459
475
|
};
|
|
476
|
+
dateFieldComponent.inheritAttrs = false;
|
|
460
477
|
fields[typedPath] = dateFieldComponent;
|
|
461
478
|
components[componentName] = dateFieldComponent;
|
|
462
479
|
break;
|
|
@@ -509,6 +526,7 @@ var COMBOBOX_FIELD_PROP_NAMES = [
|
|
|
509
526
|
"disabled",
|
|
510
527
|
"readonly",
|
|
511
528
|
"class",
|
|
529
|
+
"classStrategy",
|
|
512
530
|
"label",
|
|
513
531
|
"hideLabel",
|
|
514
532
|
"description",
|
|
@@ -532,6 +550,7 @@ var SELECT_FIELD_PROP_NAMES = [
|
|
|
532
550
|
"disabled",
|
|
533
551
|
"readonly",
|
|
534
552
|
"class",
|
|
553
|
+
"classStrategy",
|
|
535
554
|
"label",
|
|
536
555
|
"hideLabel",
|
|
537
556
|
"description",
|
|
@@ -3215,13 +3234,17 @@ function createDaisyUIArrayField() {
|
|
|
3215
3234
|
}
|
|
3216
3235
|
)
|
|
3217
3236
|
] }),
|
|
3218
|
-
isItemCollapsed && /* @__PURE__ */
|
|
3237
|
+
isItemCollapsed && /* @__PURE__ */ jsx("div", { class: "px-1 sm:px-4 pb-2 sm:pb-3 border-t border-base-200/50", children: slots.itemPreview ? slots.itemPreview({
|
|
3238
|
+
item,
|
|
3239
|
+
index,
|
|
3240
|
+
fields: generateFieldsProxy(index)
|
|
3241
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3219
3242
|
showItemNumber && /* @__PURE__ */ jsxs("div", { class: "text-xs text-base-content/60 font-medium mb-1", children: [
|
|
3220
3243
|
"#",
|
|
3221
3244
|
index + 1
|
|
3222
3245
|
] }),
|
|
3223
3246
|
getItemPreview(item, index) && /* @__PURE__ */ jsx("div", { class: "font-semibold text-sm sm:text-base break-words leading-tight", children: getItemPreview(item, index) })
|
|
3224
|
-
] }),
|
|
3247
|
+
] }) }),
|
|
3225
3248
|
props.allowReordering && /* @__PURE__ */ jsxs("div", { class: "flex items-center justify-end gap-1 sm:gap-2 p-1 sm:p-3 sm:px-4 border-t border-base-200/50", children: [
|
|
3226
3249
|
/* @__PURE__ */ jsx(
|
|
3227
3250
|
"button",
|
|
@@ -3474,6 +3497,7 @@ function createDaisyUICheckboxField() {
|
|
|
3474
3497
|
return null;
|
|
3475
3498
|
}
|
|
3476
3499
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
3500
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
3477
3501
|
const inputProps = {
|
|
3478
3502
|
type: "checkbox",
|
|
3479
3503
|
checked: Boolean(formState.getValue(props.name)),
|
|
@@ -3488,19 +3512,20 @@ function createDaisyUICheckboxField() {
|
|
|
3488
3512
|
formState.validateField(props.name);
|
|
3489
3513
|
},
|
|
3490
3514
|
name: props.name,
|
|
3491
|
-
...
|
|
3515
|
+
...restAttrs
|
|
3492
3516
|
};
|
|
3493
3517
|
const hasErrors = formState.hasError(props.name);
|
|
3494
3518
|
const isTouched2 = formState.isTouched(props.name);
|
|
3495
3519
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
3496
|
-
const
|
|
3520
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
3521
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
3497
3522
|
"checkbox",
|
|
3498
3523
|
props.size ? `checkbox-${props.size}` : "",
|
|
3499
3524
|
props.variant ? `checkbox-${props.variant}` : "",
|
|
3500
3525
|
isTouched2 && !hasErrors ? "checkbox-success" : "",
|
|
3501
3526
|
isTouched2 && hasErrors ? "checkbox-error" : "",
|
|
3502
|
-
|
|
3503
|
-
].filter(Boolean).join(" ");
|
|
3527
|
+
consumerClass
|
|
3528
|
+
].flat().filter(Boolean).join(" ");
|
|
3504
3529
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
3505
3530
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
3506
3531
|
return /* @__PURE__ */ jsxs("div", { class: "form-control", children: [
|
|
@@ -3515,11 +3540,13 @@ function createDaisyUICheckboxField() {
|
|
|
3515
3540
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-sm text-error mt-1", children: formState.getError(props.name) })
|
|
3516
3541
|
] });
|
|
3517
3542
|
};
|
|
3543
|
+
DaisyUICheckboxField.inheritAttrs = false;
|
|
3518
3544
|
DaisyUICheckboxField.props = [
|
|
3519
3545
|
"name",
|
|
3520
3546
|
"disabled",
|
|
3521
3547
|
"readonly",
|
|
3522
3548
|
"class",
|
|
3549
|
+
"classStrategy",
|
|
3523
3550
|
"label",
|
|
3524
3551
|
"hideLabel",
|
|
3525
3552
|
"description",
|
|
@@ -3671,16 +3698,18 @@ function createDaisyUIComboboxField() {
|
|
|
3671
3698
|
}
|
|
3672
3699
|
return false;
|
|
3673
3700
|
});
|
|
3674
|
-
const
|
|
3701
|
+
const htmlAttrs = filterComponentPropsFromAttrs(propsDefinition, attrs);
|
|
3702
|
+
const { class: _attrsClass, ...restHtmlAttrs } = htmlAttrs ?? {};
|
|
3703
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
3704
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
3675
3705
|
"input",
|
|
3676
3706
|
"pr-10",
|
|
3677
3707
|
props.size ? `input-${props.size}` : "",
|
|
3678
3708
|
props.variant ? `input-${props.variant}` : "",
|
|
3679
3709
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
3680
3710
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
3681
|
-
|
|
3682
|
-
].filter(Boolean).join(" ");
|
|
3683
|
-
const htmlAttrs = filterComponentPropsFromAttrs(propsDefinition, attrs);
|
|
3711
|
+
consumerClass
|
|
3712
|
+
].flat().filter(Boolean).join(" ");
|
|
3684
3713
|
const inputProps = {
|
|
3685
3714
|
type: "text",
|
|
3686
3715
|
value: displayText.value,
|
|
@@ -3918,7 +3947,7 @@ function createDaisyUIComboboxField() {
|
|
|
3918
3947
|
}
|
|
3919
3948
|
},
|
|
3920
3949
|
name: props.name,
|
|
3921
|
-
...
|
|
3950
|
+
...restHtmlAttrs
|
|
3922
3951
|
};
|
|
3923
3952
|
return /* @__PURE__ */ jsxs("label", { ref: comboboxRoot, class: "floating-label", children: [
|
|
3924
3953
|
!props.hideLabel && /* @__PURE__ */ jsxs("span", { children: [
|
|
@@ -4060,6 +4089,7 @@ function createDaisyUIComboboxField() {
|
|
|
4060
4089
|
] })
|
|
4061
4090
|
] });
|
|
4062
4091
|
};
|
|
4092
|
+
DaisyUIComboboxField.inheritAttrs = false;
|
|
4063
4093
|
DaisyUIComboboxField.props = propsDefinition;
|
|
4064
4094
|
return DaisyUIComboboxField;
|
|
4065
4095
|
}
|
|
@@ -4071,6 +4101,7 @@ function createDaisyUICurrencyField() {
|
|
|
4071
4101
|
return null;
|
|
4072
4102
|
}
|
|
4073
4103
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4104
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4074
4105
|
const inputProps = {
|
|
4075
4106
|
type: "number",
|
|
4076
4107
|
value: formState.getValue(props.name),
|
|
@@ -4089,19 +4120,20 @@ function createDaisyUICurrencyField() {
|
|
|
4089
4120
|
formState.validateField(props.name);
|
|
4090
4121
|
},
|
|
4091
4122
|
name: props.name,
|
|
4092
|
-
...
|
|
4123
|
+
...restAttrs
|
|
4093
4124
|
};
|
|
4094
4125
|
const hasErrors = formState.hasError(props.name);
|
|
4095
4126
|
const isTouched2 = formState.isTouched(props.name);
|
|
4096
4127
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4097
|
-
const
|
|
4128
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4129
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4098
4130
|
"input",
|
|
4099
4131
|
props.size ? `input-${props.size}` : "",
|
|
4100
4132
|
props.variant ? `input-${props.variant}` : "",
|
|
4101
4133
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4102
4134
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4103
|
-
|
|
4104
|
-
].filter(Boolean).join(" ");
|
|
4135
|
+
consumerClass
|
|
4136
|
+
].flat().filter(Boolean).join(" ");
|
|
4105
4137
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4106
4138
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4107
4139
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -4127,6 +4159,7 @@ function createDaisyUICurrencyField() {
|
|
|
4127
4159
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
4128
4160
|
] });
|
|
4129
4161
|
};
|
|
4162
|
+
DaisyUICurrencyField.inheritAttrs = false;
|
|
4130
4163
|
DaisyUICurrencyField.props = [
|
|
4131
4164
|
"name",
|
|
4132
4165
|
"placeholder",
|
|
@@ -4136,6 +4169,7 @@ function createDaisyUICurrencyField() {
|
|
|
4136
4169
|
"disabled",
|
|
4137
4170
|
"readonly",
|
|
4138
4171
|
"class",
|
|
4172
|
+
"classStrategy",
|
|
4139
4173
|
"legend",
|
|
4140
4174
|
"description",
|
|
4141
4175
|
"required",
|
|
@@ -4171,6 +4205,7 @@ function createDaisyUIDateField() {
|
|
|
4171
4205
|
return null;
|
|
4172
4206
|
}
|
|
4173
4207
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4208
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4174
4209
|
const inputProps = {
|
|
4175
4210
|
type: "date",
|
|
4176
4211
|
value: formatDateValue(formState.getValue(props.name)),
|
|
@@ -4188,19 +4223,20 @@ function createDaisyUIDateField() {
|
|
|
4188
4223
|
formState.validateField(props.name);
|
|
4189
4224
|
},
|
|
4190
4225
|
name: props.name,
|
|
4191
|
-
...
|
|
4226
|
+
...restAttrs
|
|
4192
4227
|
};
|
|
4193
4228
|
const hasErrors = formState.hasError(props.name);
|
|
4194
4229
|
const isTouched2 = formState.isTouched(props.name);
|
|
4195
4230
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4196
|
-
const
|
|
4231
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4232
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4197
4233
|
"input",
|
|
4198
4234
|
props.size ? `input-${props.size}` : "",
|
|
4199
4235
|
props.variant ? `input-${props.variant}` : "",
|
|
4200
4236
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4201
4237
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4202
|
-
|
|
4203
|
-
].filter(Boolean).join(" ");
|
|
4238
|
+
consumerClass
|
|
4239
|
+
].flat().filter(Boolean).join(" ");
|
|
4204
4240
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4205
4241
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4206
4242
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -4225,6 +4261,7 @@ function createDaisyUIDateField() {
|
|
|
4225
4261
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
4226
4262
|
] });
|
|
4227
4263
|
};
|
|
4264
|
+
DaisyUIDateField.inheritAttrs = false;
|
|
4228
4265
|
DaisyUIDateField.props = [
|
|
4229
4266
|
"name",
|
|
4230
4267
|
"formatter",
|
|
@@ -4232,6 +4269,7 @@ function createDaisyUIDateField() {
|
|
|
4232
4269
|
"disabled",
|
|
4233
4270
|
"readonly",
|
|
4234
4271
|
"class",
|
|
4272
|
+
"classStrategy",
|
|
4235
4273
|
"label",
|
|
4236
4274
|
"hideLabel",
|
|
4237
4275
|
"description",
|
|
@@ -4270,6 +4308,7 @@ function createDaisyUIDateTimeLocalField() {
|
|
|
4270
4308
|
return null;
|
|
4271
4309
|
}
|
|
4272
4310
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4311
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4273
4312
|
const inputProps = {
|
|
4274
4313
|
type: "datetime-local",
|
|
4275
4314
|
value: formatDateTimeValue(formState.getValue(props.name)),
|
|
@@ -4286,19 +4325,20 @@ function createDaisyUIDateTimeLocalField() {
|
|
|
4286
4325
|
max: props.max,
|
|
4287
4326
|
step: props.step,
|
|
4288
4327
|
name: props.name,
|
|
4289
|
-
...
|
|
4328
|
+
...restAttrs
|
|
4290
4329
|
};
|
|
4291
4330
|
const hasErrors = formState.hasError(props.name);
|
|
4292
4331
|
const isTouched2 = formState.isTouched(props.name);
|
|
4293
4332
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4294
|
-
const
|
|
4333
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4334
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4295
4335
|
"input",
|
|
4296
4336
|
props.size ? `input-${props.size}` : "",
|
|
4297
4337
|
props.variant ? `input-${props.variant}` : "",
|
|
4298
4338
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4299
4339
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4300
|
-
|
|
4301
|
-
].filter(Boolean).join(" ");
|
|
4340
|
+
consumerClass
|
|
4341
|
+
].flat().filter(Boolean).join(" ");
|
|
4302
4342
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4303
4343
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4304
4344
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -4321,12 +4361,14 @@ function createDaisyUIDateTimeLocalField() {
|
|
|
4321
4361
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
4322
4362
|
] });
|
|
4323
4363
|
};
|
|
4364
|
+
DaisyUIDateTimeLocalField.inheritAttrs = false;
|
|
4324
4365
|
DaisyUIDateTimeLocalField.props = [
|
|
4325
4366
|
"name",
|
|
4326
4367
|
"placeholder",
|
|
4327
4368
|
"disabled",
|
|
4328
4369
|
"readonly",
|
|
4329
4370
|
"class",
|
|
4371
|
+
"classStrategy",
|
|
4330
4372
|
"label",
|
|
4331
4373
|
"hideLabel",
|
|
4332
4374
|
"description",
|
|
@@ -4347,6 +4389,7 @@ function createDaisyUIEmailField() {
|
|
|
4347
4389
|
return null;
|
|
4348
4390
|
}
|
|
4349
4391
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4392
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4350
4393
|
const inputProps = {
|
|
4351
4394
|
type: "email",
|
|
4352
4395
|
value: formState.getValue(props.name),
|
|
@@ -4361,19 +4404,20 @@ function createDaisyUIEmailField() {
|
|
|
4361
4404
|
// Use metadata autocomplete value if available, otherwise use props.autocomplete or default
|
|
4362
4405
|
autocomplete: fieldMetadata?.autocomplete || props.autocomplete || "email",
|
|
4363
4406
|
name: props.name,
|
|
4364
|
-
...
|
|
4407
|
+
...restAttrs
|
|
4365
4408
|
};
|
|
4366
4409
|
const hasErrors = formState.hasError(props.name);
|
|
4367
4410
|
const isTouched2 = formState.isTouched(props.name);
|
|
4368
4411
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4369
|
-
const
|
|
4412
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4413
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4370
4414
|
"input",
|
|
4371
4415
|
props.size ? `input-${props.size}` : "",
|
|
4372
4416
|
props.variant ? `input-${props.variant}` : "",
|
|
4373
4417
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4374
4418
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4375
|
-
|
|
4376
|
-
].filter(Boolean).join(" ");
|
|
4419
|
+
consumerClass
|
|
4420
|
+
].flat().filter(Boolean).join(" ");
|
|
4377
4421
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4378
4422
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4379
4423
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -4396,6 +4440,7 @@ function createDaisyUIEmailField() {
|
|
|
4396
4440
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
4397
4441
|
] });
|
|
4398
4442
|
};
|
|
4443
|
+
DaisyUIEmailField.inheritAttrs = false;
|
|
4399
4444
|
DaisyUIEmailField.props = [
|
|
4400
4445
|
"name",
|
|
4401
4446
|
"placeholder",
|
|
@@ -4403,6 +4448,7 @@ function createDaisyUIEmailField() {
|
|
|
4403
4448
|
"readonly",
|
|
4404
4449
|
"autocomplete",
|
|
4405
4450
|
"class",
|
|
4451
|
+
"classStrategy",
|
|
4406
4452
|
"label",
|
|
4407
4453
|
"hideLabel",
|
|
4408
4454
|
"description",
|
|
@@ -4420,6 +4466,7 @@ function createDaisyUIFileField() {
|
|
|
4420
4466
|
return null;
|
|
4421
4467
|
}
|
|
4422
4468
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4469
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4423
4470
|
const inputProps = {
|
|
4424
4471
|
type: "file",
|
|
4425
4472
|
onChange: (event) => {
|
|
@@ -4433,19 +4480,20 @@ function createDaisyUIFileField() {
|
|
|
4433
4480
|
accept: props.accept,
|
|
4434
4481
|
multiple: props.multiple,
|
|
4435
4482
|
name: props.name,
|
|
4436
|
-
...
|
|
4483
|
+
...restAttrs
|
|
4437
4484
|
};
|
|
4438
4485
|
const hasErrors = formState.hasError(props.name);
|
|
4439
4486
|
const isTouched2 = formState.isTouched(props.name);
|
|
4440
4487
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4441
|
-
const
|
|
4488
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4489
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4442
4490
|
"file-input",
|
|
4443
4491
|
props.size ? `file-input-${props.size}` : "",
|
|
4444
4492
|
props.variant ? `file-input-${props.variant}` : "",
|
|
4445
4493
|
isTouched2 && !hasErrors ? "file-input-success" : "",
|
|
4446
4494
|
isTouched2 && hasErrors ? "file-input-error" : "",
|
|
4447
|
-
|
|
4448
|
-
].filter(Boolean).join(" ");
|
|
4495
|
+
consumerClass
|
|
4496
|
+
].flat().filter(Boolean).join(" ");
|
|
4449
4497
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4450
4498
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4451
4499
|
return /* @__PURE__ */ jsxs("div", { class: "form-control", children: [
|
|
@@ -4453,16 +4501,27 @@ function createDaisyUIFileField() {
|
|
|
4453
4501
|
props.label || fieldMetadata.label,
|
|
4454
4502
|
fieldMetadata.isRequired && /* @__PURE__ */ jsx("span", { class: "text-error", children: " *" })
|
|
4455
4503
|
] }) }),
|
|
4456
|
-
/* @__PURE__ */ jsx(
|
|
4504
|
+
/* @__PURE__ */ jsx(
|
|
4505
|
+
"input",
|
|
4506
|
+
{
|
|
4507
|
+
class: inputClass,
|
|
4508
|
+
disabled: isDisabled,
|
|
4509
|
+
readonly: props.readonly,
|
|
4510
|
+
"data-testid": `${formState.storeName}-file-field-${String(props.name)}`,
|
|
4511
|
+
...inputProps
|
|
4512
|
+
}
|
|
4513
|
+
),
|
|
4457
4514
|
descriptionText && /* @__PURE__ */ jsx("p", { class: "text-sm mt-1", children: descriptionText }),
|
|
4458
4515
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-sm text-error mt-1", children: formState.getError(props.name) })
|
|
4459
4516
|
] });
|
|
4460
4517
|
};
|
|
4518
|
+
DaisyUIFileField.inheritAttrs = false;
|
|
4461
4519
|
DaisyUIFileField.props = [
|
|
4462
4520
|
"name",
|
|
4463
4521
|
"disabled",
|
|
4464
4522
|
"readonly",
|
|
4465
4523
|
"class",
|
|
4524
|
+
"classStrategy",
|
|
4466
4525
|
"label",
|
|
4467
4526
|
"hideLabel",
|
|
4468
4527
|
"description",
|
|
@@ -4634,6 +4693,7 @@ function createDaisyUINumberField() {
|
|
|
4634
4693
|
return null;
|
|
4635
4694
|
}
|
|
4636
4695
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4696
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4637
4697
|
const inputProps = {
|
|
4638
4698
|
type: "number",
|
|
4639
4699
|
value: formState.getValue(props.name),
|
|
@@ -4647,19 +4707,20 @@ function createDaisyUINumberField() {
|
|
|
4647
4707
|
formState.validateField(props.name);
|
|
4648
4708
|
},
|
|
4649
4709
|
name: props.name,
|
|
4650
|
-
...
|
|
4710
|
+
...restAttrs
|
|
4651
4711
|
};
|
|
4652
4712
|
const hasErrors = formState.hasError(props.name);
|
|
4653
4713
|
const isTouched2 = formState.isTouched(props.name);
|
|
4654
4714
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4655
|
-
const
|
|
4715
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4716
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4656
4717
|
"input",
|
|
4657
4718
|
props.size ? `input-${props.size}` : "",
|
|
4658
4719
|
props.variant ? `input-${props.variant}` : "",
|
|
4659
4720
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4660
4721
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4661
|
-
|
|
4662
|
-
].filter(Boolean).join(" ");
|
|
4722
|
+
consumerClass
|
|
4723
|
+
].flat().filter(Boolean).join(" ");
|
|
4663
4724
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4664
4725
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4665
4726
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -4685,6 +4746,7 @@ function createDaisyUINumberField() {
|
|
|
4685
4746
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
4686
4747
|
] });
|
|
4687
4748
|
};
|
|
4749
|
+
DaisyUINumberField.inheritAttrs = false;
|
|
4688
4750
|
DaisyUINumberField.props = [
|
|
4689
4751
|
"name",
|
|
4690
4752
|
"placeholder",
|
|
@@ -4694,6 +4756,7 @@ function createDaisyUINumberField() {
|
|
|
4694
4756
|
"disabled",
|
|
4695
4757
|
"readonly",
|
|
4696
4758
|
"class",
|
|
4759
|
+
"classStrategy",
|
|
4697
4760
|
"legend",
|
|
4698
4761
|
"description",
|
|
4699
4762
|
"required",
|
|
@@ -4710,6 +4773,7 @@ function createDaisyUIPasswordField() {
|
|
|
4710
4773
|
return null;
|
|
4711
4774
|
}
|
|
4712
4775
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4776
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4713
4777
|
const inputProps = {
|
|
4714
4778
|
type: "password",
|
|
4715
4779
|
value: formState.getValue(props.name),
|
|
@@ -4724,19 +4788,20 @@ function createDaisyUIPasswordField() {
|
|
|
4724
4788
|
// Use metadata autocomplete value if available, otherwise use props.autocomplete or default
|
|
4725
4789
|
autocomplete: fieldMetadata?.autocomplete || props.autocomplete || "current-password",
|
|
4726
4790
|
name: props.name,
|
|
4727
|
-
...
|
|
4791
|
+
...restAttrs
|
|
4728
4792
|
};
|
|
4729
4793
|
const hasErrors = formState.hasError(props.name);
|
|
4730
4794
|
const isTouched2 = formState.isTouched(props.name);
|
|
4731
4795
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4732
|
-
const
|
|
4796
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4797
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4733
4798
|
"input",
|
|
4734
4799
|
props.size ? `input-${props.size}` : "",
|
|
4735
4800
|
props.variant ? `input-${props.variant}` : "",
|
|
4736
4801
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4737
4802
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4738
|
-
|
|
4739
|
-
].filter(Boolean).join(" ");
|
|
4803
|
+
consumerClass
|
|
4804
|
+
].flat().filter(Boolean).join(" ");
|
|
4740
4805
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4741
4806
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4742
4807
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -4759,6 +4824,7 @@ function createDaisyUIPasswordField() {
|
|
|
4759
4824
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
4760
4825
|
] });
|
|
4761
4826
|
};
|
|
4827
|
+
DaisyUIPasswordField.inheritAttrs = false;
|
|
4762
4828
|
DaisyUIPasswordField.props = [
|
|
4763
4829
|
"name",
|
|
4764
4830
|
"placeholder",
|
|
@@ -4766,6 +4832,7 @@ function createDaisyUIPasswordField() {
|
|
|
4766
4832
|
"readonly",
|
|
4767
4833
|
"autocomplete",
|
|
4768
4834
|
"class",
|
|
4835
|
+
"classStrategy",
|
|
4769
4836
|
"label",
|
|
4770
4837
|
"hideLabel",
|
|
4771
4838
|
"description",
|
|
@@ -4868,6 +4935,7 @@ function createDaisyUIRangeField() {
|
|
|
4868
4935
|
}
|
|
4869
4936
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
4870
4937
|
const currentValue = formState.getValue(props.name);
|
|
4938
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4871
4939
|
const inputProps = {
|
|
4872
4940
|
type: "range",
|
|
4873
4941
|
value: currentValue,
|
|
@@ -4884,19 +4952,20 @@ function createDaisyUIRangeField() {
|
|
|
4884
4952
|
max: props.max ?? fieldMetadata.max,
|
|
4885
4953
|
step: props.step,
|
|
4886
4954
|
name: props.name,
|
|
4887
|
-
...
|
|
4955
|
+
...restAttrs
|
|
4888
4956
|
};
|
|
4889
4957
|
const hasErrors = formState.hasError(props.name);
|
|
4890
4958
|
const isTouched2 = formState.isTouched(props.name);
|
|
4891
4959
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4892
|
-
const
|
|
4960
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
4961
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4893
4962
|
"range",
|
|
4894
4963
|
props.size ? `range-${props.size}` : "",
|
|
4895
4964
|
props.variant ? `range-${props.variant}` : "",
|
|
4896
4965
|
isTouched2 && !hasErrors ? "range-success" : "",
|
|
4897
4966
|
isTouched2 && hasErrors ? "range-error" : "",
|
|
4898
|
-
|
|
4899
|
-
].filter(Boolean).join(" ");
|
|
4967
|
+
consumerClass
|
|
4968
|
+
].flat().filter(Boolean).join(" ");
|
|
4900
4969
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4901
4970
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4902
4971
|
return /* @__PURE__ */ jsxs("div", { class: "form-control", children: [
|
|
@@ -4912,11 +4981,13 @@ function createDaisyUIRangeField() {
|
|
|
4912
4981
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-sm text-error mt-1", children: formState.getError(props.name) })
|
|
4913
4982
|
] });
|
|
4914
4983
|
};
|
|
4984
|
+
DaisyUIRangeField.inheritAttrs = false;
|
|
4915
4985
|
DaisyUIRangeField.props = [
|
|
4916
4986
|
"name",
|
|
4917
4987
|
"disabled",
|
|
4918
4988
|
"readonly",
|
|
4919
4989
|
"class",
|
|
4990
|
+
"classStrategy",
|
|
4920
4991
|
"label",
|
|
4921
4992
|
"hideLabel",
|
|
4922
4993
|
"description",
|
|
@@ -4968,6 +5039,7 @@ function createDaisyUISearchField() {
|
|
|
4968
5039
|
return null;
|
|
4969
5040
|
}
|
|
4970
5041
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
5042
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
4971
5043
|
const inputProps = {
|
|
4972
5044
|
type: "search",
|
|
4973
5045
|
value: formState.getValue(props.name),
|
|
@@ -4981,19 +5053,20 @@ function createDaisyUISearchField() {
|
|
|
4981
5053
|
},
|
|
4982
5054
|
autocomplete: props.autocomplete,
|
|
4983
5055
|
name: props.name,
|
|
4984
|
-
...
|
|
5056
|
+
...restAttrs
|
|
4985
5057
|
};
|
|
4986
5058
|
const hasErrors = formState.hasError(props.name);
|
|
4987
5059
|
const isTouched2 = formState.isTouched(props.name);
|
|
4988
5060
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
4989
|
-
const
|
|
5061
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
5062
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
4990
5063
|
"input",
|
|
4991
5064
|
props.size ? `input-${props.size}` : "",
|
|
4992
5065
|
props.variant ? `input-${props.variant}` : "",
|
|
4993
5066
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
4994
5067
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
4995
|
-
|
|
4996
|
-
].filter(Boolean).join(" ");
|
|
5068
|
+
consumerClass
|
|
5069
|
+
].flat().filter(Boolean).join(" ");
|
|
4997
5070
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
4998
5071
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
4999
5072
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -5016,6 +5089,7 @@ function createDaisyUISearchField() {
|
|
|
5016
5089
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
5017
5090
|
] });
|
|
5018
5091
|
};
|
|
5092
|
+
DaisyUISearchField.inheritAttrs = false;
|
|
5019
5093
|
DaisyUISearchField.props = [
|
|
5020
5094
|
"name",
|
|
5021
5095
|
"placeholder",
|
|
@@ -5023,6 +5097,7 @@ function createDaisyUISearchField() {
|
|
|
5023
5097
|
"readonly",
|
|
5024
5098
|
"autocomplete",
|
|
5025
5099
|
"class",
|
|
5100
|
+
"classStrategy",
|
|
5026
5101
|
"label",
|
|
5027
5102
|
"hideLabel",
|
|
5028
5103
|
"description",
|
|
@@ -5122,6 +5197,7 @@ function createDaisyUISelectField() {
|
|
|
5122
5197
|
return props.placeholder;
|
|
5123
5198
|
});
|
|
5124
5199
|
const htmlAttrs = filterComponentPropsFromAttrs(propsDefinition, attrs);
|
|
5200
|
+
const { class: _attrsClass, ...restHtmlAttrs } = htmlAttrs ?? {};
|
|
5125
5201
|
const selectProps = {
|
|
5126
5202
|
value: formState.getValue(props.name),
|
|
5127
5203
|
onChange: (event) => {
|
|
@@ -5137,18 +5213,19 @@ function createDaisyUISelectField() {
|
|
|
5137
5213
|
formState.validateField(props.name);
|
|
5138
5214
|
},
|
|
5139
5215
|
name: props.name,
|
|
5140
|
-
...
|
|
5216
|
+
...restHtmlAttrs
|
|
5141
5217
|
};
|
|
5142
5218
|
const hasErrors = formState.hasError(props.name);
|
|
5143
5219
|
const isTouched2 = formState.isTouched(props.name);
|
|
5144
|
-
const
|
|
5220
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
5221
|
+
const selectClass = props.classStrategy === "replace" ? consumerClass : [
|
|
5145
5222
|
"select",
|
|
5146
5223
|
props.size ? `select-${props.size}` : "",
|
|
5147
5224
|
props.variant ? `select-${props.variant}` : "",
|
|
5148
5225
|
isTouched2 && !hasErrors ? "select-success" : "",
|
|
5149
5226
|
isTouched2 && hasErrors ? "select-error" : "",
|
|
5150
|
-
|
|
5151
|
-
].filter(Boolean).join(" ");
|
|
5227
|
+
consumerClass
|
|
5228
|
+
].flat().filter(Boolean).join(" ");
|
|
5152
5229
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
5153
5230
|
!props.hideLabel && /* @__PURE__ */ jsxs("span", { children: [
|
|
5154
5231
|
props.label || fieldMetadata.label,
|
|
@@ -5171,6 +5248,7 @@ function createDaisyUISelectField() {
|
|
|
5171
5248
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
5172
5249
|
] });
|
|
5173
5250
|
};
|
|
5251
|
+
DaisyUISelectField.inheritAttrs = false;
|
|
5174
5252
|
DaisyUISelectField.props = propsDefinition;
|
|
5175
5253
|
return DaisyUISelectField;
|
|
5176
5254
|
}
|
|
@@ -5241,6 +5319,7 @@ function createDaisyUITelField() {
|
|
|
5241
5319
|
return null;
|
|
5242
5320
|
}
|
|
5243
5321
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
5322
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
5244
5323
|
const inputProps = {
|
|
5245
5324
|
type: "tel",
|
|
5246
5325
|
value: formState.getValue(props.name),
|
|
@@ -5256,19 +5335,20 @@ function createDaisyUITelField() {
|
|
|
5256
5335
|
pattern: props.pattern || fieldMetadata.pattern?.toString().slice(1, -1),
|
|
5257
5336
|
// Convert RegExp to string pattern
|
|
5258
5337
|
name: props.name,
|
|
5259
|
-
...
|
|
5338
|
+
...restAttrs
|
|
5260
5339
|
};
|
|
5261
5340
|
const hasErrors = formState.hasError(props.name);
|
|
5262
5341
|
const isTouched2 = formState.isTouched(props.name);
|
|
5263
5342
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
5264
|
-
const
|
|
5343
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
5344
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
5265
5345
|
"input",
|
|
5266
5346
|
props.size ? `input-${props.size}` : "",
|
|
5267
5347
|
props.variant ? `input-${props.variant}` : "",
|
|
5268
5348
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
5269
5349
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
5270
|
-
|
|
5271
|
-
].filter(Boolean).join(" ");
|
|
5350
|
+
consumerClass
|
|
5351
|
+
].flat().filter(Boolean).join(" ");
|
|
5272
5352
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
5273
5353
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
5274
5354
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -5291,6 +5371,7 @@ function createDaisyUITelField() {
|
|
|
5291
5371
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
5292
5372
|
] });
|
|
5293
5373
|
};
|
|
5374
|
+
DaisyUITelField.inheritAttrs = false;
|
|
5294
5375
|
DaisyUITelField.props = [
|
|
5295
5376
|
"name",
|
|
5296
5377
|
"placeholder",
|
|
@@ -5298,6 +5379,7 @@ function createDaisyUITelField() {
|
|
|
5298
5379
|
"readonly",
|
|
5299
5380
|
"autocomplete",
|
|
5300
5381
|
"class",
|
|
5382
|
+
"classStrategy",
|
|
5301
5383
|
"label",
|
|
5302
5384
|
"hideLabel",
|
|
5303
5385
|
"description",
|
|
@@ -5349,6 +5431,7 @@ function createDaisyUITextareaField() {
|
|
|
5349
5431
|
});
|
|
5350
5432
|
}
|
|
5351
5433
|
};
|
|
5434
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
5352
5435
|
const textareaProps = {
|
|
5353
5436
|
value: formState.getValue(props.name),
|
|
5354
5437
|
onInput: async (event) => {
|
|
@@ -5363,19 +5446,20 @@ function createDaisyUITextareaField() {
|
|
|
5363
5446
|
formState.validateField(props.name);
|
|
5364
5447
|
},
|
|
5365
5448
|
name: props.name,
|
|
5366
|
-
...
|
|
5449
|
+
...restAttrs
|
|
5367
5450
|
};
|
|
5368
5451
|
const hasErrors = formState.hasError(props.name);
|
|
5369
5452
|
const isTouched2 = formState.isTouched(props.name);
|
|
5370
5453
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
5371
|
-
const
|
|
5454
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
5455
|
+
const textareaClass = props.classStrategy === "replace" ? consumerClass : [
|
|
5372
5456
|
"textarea",
|
|
5373
5457
|
props.size ? `textarea-${props.size}` : "",
|
|
5374
5458
|
props.variant ? `textarea-${props.variant}` : "",
|
|
5375
5459
|
isTouched2 && !hasErrors ? "textarea-success" : "",
|
|
5376
5460
|
isTouched2 && hasErrors ? "textarea-error" : "",
|
|
5377
|
-
|
|
5378
|
-
].filter(Boolean).join(" ");
|
|
5461
|
+
consumerClass
|
|
5462
|
+
].flat().filter(Boolean).join(" ");
|
|
5379
5463
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
5380
5464
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
5381
5465
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -5400,12 +5484,14 @@ function createDaisyUITextareaField() {
|
|
|
5400
5484
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
5401
5485
|
] });
|
|
5402
5486
|
};
|
|
5487
|
+
DaisyUITextareaField.inheritAttrs = false;
|
|
5403
5488
|
DaisyUITextareaField.props = [
|
|
5404
5489
|
"name",
|
|
5405
5490
|
"placeholder",
|
|
5406
5491
|
"disabled",
|
|
5407
5492
|
"readonly",
|
|
5408
5493
|
"class",
|
|
5494
|
+
"classStrategy",
|
|
5409
5495
|
"label",
|
|
5410
5496
|
"hideLabel",
|
|
5411
5497
|
"description",
|
|
@@ -5426,6 +5512,7 @@ function createDaisyUITextField() {
|
|
|
5426
5512
|
return null;
|
|
5427
5513
|
}
|
|
5428
5514
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
5515
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
5429
5516
|
const inputProps = {
|
|
5430
5517
|
type: "text",
|
|
5431
5518
|
value: formState.getValue(props.name),
|
|
@@ -5440,19 +5527,20 @@ function createDaisyUITextField() {
|
|
|
5440
5527
|
// Use metadata autocomplete value if available, otherwise use props.autocomplete
|
|
5441
5528
|
autocomplete: fieldMetadata?.autocomplete || props.autocomplete,
|
|
5442
5529
|
name: props.name,
|
|
5443
|
-
...
|
|
5530
|
+
...restAttrs
|
|
5444
5531
|
};
|
|
5445
5532
|
const hasErrors = formState.hasError(props.name);
|
|
5446
5533
|
const isTouched2 = formState.isTouched(props.name);
|
|
5447
5534
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
5448
|
-
const
|
|
5535
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
5536
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
5449
5537
|
"input",
|
|
5450
5538
|
props.size ? `input-${props.size}` : "",
|
|
5451
5539
|
props.variant ? `input-${props.variant}` : "",
|
|
5452
5540
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
5453
5541
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
5454
|
-
|
|
5455
|
-
].filter(Boolean).join(" ");
|
|
5542
|
+
consumerClass
|
|
5543
|
+
].flat().filter(Boolean).join(" ");
|
|
5456
5544
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
5457
5545
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
5458
5546
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -5475,6 +5563,7 @@ function createDaisyUITextField() {
|
|
|
5475
5563
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
5476
5564
|
] });
|
|
5477
5565
|
};
|
|
5566
|
+
DaisyUITextField.inheritAttrs = false;
|
|
5478
5567
|
DaisyUITextField.props = [
|
|
5479
5568
|
"name",
|
|
5480
5569
|
"placeholder",
|
|
@@ -5482,6 +5571,7 @@ function createDaisyUITextField() {
|
|
|
5482
5571
|
"readonly",
|
|
5483
5572
|
"autocomplete",
|
|
5484
5573
|
"class",
|
|
5574
|
+
"classStrategy",
|
|
5485
5575
|
"label",
|
|
5486
5576
|
"hideLabel",
|
|
5487
5577
|
"description",
|
|
@@ -5499,6 +5589,7 @@ function createDaisyUITimeField() {
|
|
|
5499
5589
|
return null;
|
|
5500
5590
|
}
|
|
5501
5591
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
5592
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
5502
5593
|
const inputProps = {
|
|
5503
5594
|
type: "time",
|
|
5504
5595
|
value: formatTimeValue(formState.getValue(props.name)),
|
|
@@ -5514,19 +5605,20 @@ function createDaisyUITimeField() {
|
|
|
5514
5605
|
max: props.max,
|
|
5515
5606
|
step: props.step,
|
|
5516
5607
|
name: props.name,
|
|
5517
|
-
...
|
|
5608
|
+
...restAttrs
|
|
5518
5609
|
};
|
|
5519
5610
|
const hasErrors = formState.hasError(props.name);
|
|
5520
5611
|
const isTouched2 = formState.isTouched(props.name);
|
|
5521
5612
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
5522
|
-
const
|
|
5613
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
5614
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
5523
5615
|
"input",
|
|
5524
5616
|
props.size ? `input-${props.size}` : "",
|
|
5525
5617
|
props.variant ? `input-${props.variant}` : "",
|
|
5526
5618
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
5527
5619
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
5528
|
-
|
|
5529
|
-
].filter(Boolean).join(" ");
|
|
5620
|
+
consumerClass
|
|
5621
|
+
].flat().filter(Boolean).join(" ");
|
|
5530
5622
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
5531
5623
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
5532
5624
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -5549,12 +5641,14 @@ function createDaisyUITimeField() {
|
|
|
5549
5641
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
5550
5642
|
] });
|
|
5551
5643
|
};
|
|
5644
|
+
DaisyUITimeField.inheritAttrs = false;
|
|
5552
5645
|
DaisyUITimeField.props = [
|
|
5553
5646
|
"name",
|
|
5554
5647
|
"placeholder",
|
|
5555
5648
|
"disabled",
|
|
5556
5649
|
"readonly",
|
|
5557
5650
|
"class",
|
|
5651
|
+
"classStrategy",
|
|
5558
5652
|
"label",
|
|
5559
5653
|
"hideLabel",
|
|
5560
5654
|
"description",
|
|
@@ -6062,6 +6156,7 @@ function createDaisyUIUrlField() {
|
|
|
6062
6156
|
return null;
|
|
6063
6157
|
}
|
|
6064
6158
|
const fieldMetadata = formState.fieldsMetadata[props.name] || {};
|
|
6159
|
+
const { class: _attrsClass, ...restAttrs } = attrs ?? {};
|
|
6065
6160
|
const inputProps = {
|
|
6066
6161
|
type: "url",
|
|
6067
6162
|
value: formState.getValue(props.name),
|
|
@@ -6077,19 +6172,20 @@ function createDaisyUIUrlField() {
|
|
|
6077
6172
|
pattern: props.pattern || fieldMetadata.pattern?.toString().slice(1, -1),
|
|
6078
6173
|
// Convert RegExp to string pattern
|
|
6079
6174
|
name: props.name,
|
|
6080
|
-
...
|
|
6175
|
+
...restAttrs
|
|
6081
6176
|
};
|
|
6082
6177
|
const hasErrors = formState.hasError(props.name);
|
|
6083
6178
|
const isTouched2 = formState.isTouched(props.name);
|
|
6084
6179
|
const isBeingPopulated = formState.state?.populatingFields?.[props.name] || false;
|
|
6085
|
-
const
|
|
6180
|
+
const consumerClass = [props.class, attrs.class].flat().filter(Boolean).join(" ");
|
|
6181
|
+
const inputClass = props.classStrategy === "replace" ? consumerClass : [
|
|
6086
6182
|
"input",
|
|
6087
6183
|
props.size ? `input-${props.size}` : "",
|
|
6088
6184
|
props.variant ? `input-${props.variant}` : "",
|
|
6089
6185
|
isTouched2 && !hasErrors ? "input-success" : "",
|
|
6090
6186
|
isTouched2 && hasErrors ? "input-error" : "",
|
|
6091
|
-
|
|
6092
|
-
].filter(Boolean).join(" ");
|
|
6187
|
+
consumerClass
|
|
6188
|
+
].flat().filter(Boolean).join(" ");
|
|
6093
6189
|
const isDisabled = props.disabled || isBeingPopulated;
|
|
6094
6190
|
const descriptionText = isBeingPopulated ? "Loading..." : props.description;
|
|
6095
6191
|
return /* @__PURE__ */ jsxs("label", { class: "floating-label", children: [
|
|
@@ -6112,6 +6208,7 @@ function createDaisyUIUrlField() {
|
|
|
6112
6208
|
isTouched2 && hasErrors && /* @__PURE__ */ jsx("p", { class: "text-error text-xs", children: formState.getError(props.name) })
|
|
6113
6209
|
] });
|
|
6114
6210
|
};
|
|
6211
|
+
DaisyUIUrlField.inheritAttrs = false;
|
|
6115
6212
|
DaisyUIUrlField.props = [
|
|
6116
6213
|
"name",
|
|
6117
6214
|
"placeholder",
|
|
@@ -6119,6 +6216,7 @@ function createDaisyUIUrlField() {
|
|
|
6119
6216
|
"readonly",
|
|
6120
6217
|
"autocomplete",
|
|
6121
6218
|
"class",
|
|
6219
|
+
"classStrategy",
|
|
6122
6220
|
"label",
|
|
6123
6221
|
"hideLabel",
|
|
6124
6222
|
"description",
|