@guillotinaweb/react-gmi 0.24.0 → 0.24.1
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/components/fields/renderField.d.ts +7 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/react-gmi.esm.js +263 -237
- package/dist/react-gmi.esm.js.map +1 -1
- package/dist/react-gmi.js +264 -236
- package/dist/react-gmi.js.map +1 -1
- package/dist/react-gmi.modern.js +254 -227
- package/dist/react-gmi.modern.js.map +1 -1
- package/dist/react-gmi.umd.js +264 -236
- package/dist/react-gmi.umd.js.map +1 -1
- package/package.json +2 -1
package/dist/react-gmi.modern.js
CHANGED
|
@@ -3036,13 +3036,15 @@ function useVocabulary(vocabularyName, path) {
|
|
|
3036
3036
|
const plain = ['string', 'number', 'boolean'];
|
|
3037
3037
|
function RenderField({
|
|
3038
3038
|
value,
|
|
3039
|
-
Widget
|
|
3039
|
+
Widget,
|
|
3040
|
+
schema
|
|
3040
3041
|
}) {
|
|
3041
3042
|
if (value === null || value === undefined) return '';
|
|
3042
3043
|
|
|
3043
3044
|
if (Widget) {
|
|
3044
3045
|
return /*#__PURE__*/React.createElement(Widget, {
|
|
3045
|
-
value: value
|
|
3046
|
+
value: value,
|
|
3047
|
+
schema: schema
|
|
3046
3048
|
});
|
|
3047
3049
|
}
|
|
3048
3050
|
|
|
@@ -3084,6 +3086,55 @@ const FieldValue = ({
|
|
|
3084
3086
|
value: value
|
|
3085
3087
|
})));
|
|
3086
3088
|
|
|
3089
|
+
const DEFAULT_VALUE_NO_EDITABLE_FIELD = ' -- ';
|
|
3090
|
+
|
|
3091
|
+
const getDefaultValueEditableField = intl => {
|
|
3092
|
+
return intl.formatMessage({
|
|
3093
|
+
id: "default_value_editable_field",
|
|
3094
|
+
defaultMessage: [{
|
|
3095
|
+
"type": 0,
|
|
3096
|
+
"value": "Click to edit"
|
|
3097
|
+
}]
|
|
3098
|
+
});
|
|
3099
|
+
};
|
|
3100
|
+
|
|
3101
|
+
const VocabularyRenderField = ({
|
|
3102
|
+
schema,
|
|
3103
|
+
value,
|
|
3104
|
+
modifyContent
|
|
3105
|
+
}) => {
|
|
3106
|
+
var _schema$items;
|
|
3107
|
+
|
|
3108
|
+
const intl = useIntl();
|
|
3109
|
+
const DEFAULT_VALUE_EDITABLE_FIELD = getDefaultValueEditableField(intl);
|
|
3110
|
+
const vocabularyName = (schema == null ? void 0 : (_schema$items = schema.items) == null ? void 0 : _schema$items.vocabularyName) || (schema == null ? void 0 : schema.vocabularyName);
|
|
3111
|
+
const vocabulary = useVocabulary(vocabularyName);
|
|
3112
|
+
|
|
3113
|
+
const getRenderProps = () => {
|
|
3114
|
+
const renderProps = {
|
|
3115
|
+
value: value != null ? value : modifyContent ? DEFAULT_VALUE_EDITABLE_FIELD : DEFAULT_VALUE_NO_EDITABLE_FIELD
|
|
3116
|
+
};
|
|
3117
|
+
|
|
3118
|
+
if (schema != null && schema.vocabularyName) {
|
|
3119
|
+
var _vocabularyValue$titl;
|
|
3120
|
+
|
|
3121
|
+
const vocabularyValue = get$1(vocabulary, 'data.items', []).find(item => item.token === value);
|
|
3122
|
+
renderProps['value'] = (_vocabularyValue$titl = vocabularyValue == null ? void 0 : vocabularyValue.title) != null ? _vocabularyValue$titl : '';
|
|
3123
|
+
} else {
|
|
3124
|
+
var _renderProps$value;
|
|
3125
|
+
|
|
3126
|
+
renderProps['value'] = ((_renderProps$value = renderProps['value']) != null ? _renderProps$value : []).map(value => {
|
|
3127
|
+
var _get$find$title, _get$find;
|
|
3128
|
+
|
|
3129
|
+
return (_get$find$title = (_get$find = get$1(vocabulary, 'data.items', []).find(item => item.token === value)) == null ? void 0 : _get$find.title) != null ? _get$find$title : '';
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
return renderProps;
|
|
3134
|
+
};
|
|
3135
|
+
|
|
3136
|
+
return /*#__PURE__*/React.createElement(RenderField, getRenderProps());
|
|
3137
|
+
};
|
|
3087
3138
|
function RenderFieldComponent({
|
|
3088
3139
|
schema,
|
|
3089
3140
|
field,
|
|
@@ -3091,17 +3142,10 @@ function RenderFieldComponent({
|
|
|
3091
3142
|
modifyContent
|
|
3092
3143
|
}) {
|
|
3093
3144
|
const intl = useIntl();
|
|
3094
|
-
const DEFAULT_VALUE_EDITABLE_FIELD = intl
|
|
3095
|
-
id: "default_value_editable_field",
|
|
3096
|
-
defaultMessage: [{
|
|
3097
|
-
"type": 0,
|
|
3098
|
-
"value": "Click to edit"
|
|
3099
|
-
}]
|
|
3100
|
-
});
|
|
3101
|
-
const DEFAULT_VALUE_NO_EDITABLE_FIELD = ' -- ';
|
|
3145
|
+
const DEFAULT_VALUE_EDITABLE_FIELD = getDefaultValueEditableField(intl);
|
|
3102
3146
|
|
|
3103
3147
|
const getRenderProps = () => {
|
|
3104
|
-
var _schema$
|
|
3148
|
+
var _schema$items2;
|
|
3105
3149
|
|
|
3106
3150
|
const renderProps = {
|
|
3107
3151
|
value: val != null ? val : modifyContent ? DEFAULT_VALUE_EDITABLE_FIELD : DEFAULT_VALUE_NO_EDITABLE_FIELD
|
|
@@ -3119,33 +3163,214 @@ function RenderFieldComponent({
|
|
|
3119
3163
|
renderProps['value'] = (_val$toString = val == null ? void 0 : val.toString()) != null ? _val$toString : renderProps['value'];
|
|
3120
3164
|
} else if (val && (schema == null ? void 0 : schema.type) === 'datetime') {
|
|
3121
3165
|
renderProps['value'] = new Date(val).toLocaleString();
|
|
3122
|
-
} else if (schema != null && (_schema$
|
|
3123
|
-
|
|
3166
|
+
} else if (schema != null && (_schema$items2 = schema.items) != null && _schema$items2.vocabularyName || schema != null && schema.vocabularyName) {
|
|
3167
|
+
renderProps['Widget'] = VocabularyRenderField;
|
|
3168
|
+
renderProps['schema'] = schema;
|
|
3169
|
+
}
|
|
3124
3170
|
|
|
3125
|
-
|
|
3126
|
-
|
|
3171
|
+
return renderProps;
|
|
3172
|
+
};
|
|
3127
3173
|
|
|
3128
|
-
|
|
3129
|
-
|
|
3174
|
+
return /*#__PURE__*/React.createElement(RenderField, getRenderProps());
|
|
3175
|
+
}
|
|
3130
3176
|
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3177
|
+
const SelectVocabulary = React.forwardRef((_ref, ref) => {
|
|
3178
|
+
let {
|
|
3179
|
+
vocabularyName,
|
|
3180
|
+
className,
|
|
3181
|
+
classWrap,
|
|
3182
|
+
val,
|
|
3183
|
+
dataTest,
|
|
3184
|
+
multiple
|
|
3185
|
+
} = _ref,
|
|
3186
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["vocabularyName", "className", "classWrap", "val", "dataTest", "multiple"]);
|
|
3135
3187
|
|
|
3136
|
-
|
|
3137
|
-
var _get$find$title, _get$find;
|
|
3188
|
+
const vocabulary = useVocabulary(vocabularyName);
|
|
3138
3189
|
|
|
3139
|
-
|
|
3140
|
-
|
|
3190
|
+
const getOptions = () => {
|
|
3191
|
+
if (get$1(vocabulary, 'data.items', null)) {
|
|
3192
|
+
const vocData = vocabulary.data.items.map(item => {
|
|
3193
|
+
var _item$title$default;
|
|
3194
|
+
|
|
3195
|
+
return {
|
|
3196
|
+
text: (_item$title$default = item.title.default) != null ? _item$title$default : item.title,
|
|
3197
|
+
value: item.token
|
|
3198
|
+
};
|
|
3199
|
+
});
|
|
3200
|
+
return vocData;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3203
|
+
return [];
|
|
3204
|
+
};
|
|
3205
|
+
|
|
3206
|
+
const getProps = () => {
|
|
3207
|
+
if (multiple) {
|
|
3208
|
+
const currentValue = val || [];
|
|
3209
|
+
return {
|
|
3210
|
+
multiple: true,
|
|
3211
|
+
size: 5,
|
|
3212
|
+
value: currentValue,
|
|
3213
|
+
options: getOptions()
|
|
3214
|
+
};
|
|
3215
|
+
}
|
|
3216
|
+
|
|
3217
|
+
return {
|
|
3218
|
+
value: val != null ? val : '',
|
|
3219
|
+
appendDefault: true,
|
|
3220
|
+
options: getOptions()
|
|
3221
|
+
};
|
|
3222
|
+
};
|
|
3223
|
+
|
|
3224
|
+
if (vocabulary.data === undefined || vocabulary.loading) {
|
|
3225
|
+
return /*#__PURE__*/React.createElement("div", null);
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
return /*#__PURE__*/React.createElement(Select, _extends({}, getProps(), {
|
|
3229
|
+
className: className,
|
|
3230
|
+
classWrap: classWrap || 'is-fullwidth',
|
|
3231
|
+
dataTest: dataTest,
|
|
3232
|
+
ref: ref
|
|
3233
|
+
}, rest));
|
|
3234
|
+
});
|
|
3235
|
+
Select.propTypes = {
|
|
3236
|
+
error: PropTypes.string,
|
|
3237
|
+
disabled: PropTypes.bool,
|
|
3238
|
+
loading: PropTypes.bool,
|
|
3239
|
+
isSubmitted: PropTypes.bool,
|
|
3240
|
+
size: PropTypes.number,
|
|
3241
|
+
onChange: PropTypes.func,
|
|
3242
|
+
multiple: PropTypes.bool,
|
|
3243
|
+
className: PropTypes.string,
|
|
3244
|
+
vocabularyName: PropTypes.string
|
|
3245
|
+
};
|
|
3246
|
+
|
|
3247
|
+
const EditComponent = React.forwardRef((_ref, ref) => {
|
|
3248
|
+
let {
|
|
3249
|
+
schema,
|
|
3250
|
+
val,
|
|
3251
|
+
setValue,
|
|
3252
|
+
dataTest,
|
|
3253
|
+
className
|
|
3254
|
+
} = _ref,
|
|
3255
|
+
rest = _objectWithoutPropertiesLoose(_ref, ["schema", "val", "setValue", "dataTest", "className"]);
|
|
3256
|
+
|
|
3257
|
+
if ((schema == null ? void 0 : schema.widget) === 'textarea' || (schema == null ? void 0 : schema.widget) === 'richtext') {
|
|
3258
|
+
return /*#__PURE__*/React.createElement(Textarea, _extends({
|
|
3259
|
+
value: val || '',
|
|
3260
|
+
className: className,
|
|
3261
|
+
onChange: ev => setValue(ev),
|
|
3262
|
+
ref: ref,
|
|
3263
|
+
dataTest: dataTest
|
|
3264
|
+
}, rest));
|
|
3265
|
+
} else if ((schema == null ? void 0 : schema.type) === 'boolean') {
|
|
3266
|
+
return /*#__PURE__*/React.createElement(Checkbox, _extends({
|
|
3267
|
+
value: !!val,
|
|
3268
|
+
className: className,
|
|
3269
|
+
onChange: ev => setValue(ev),
|
|
3270
|
+
ref: ref,
|
|
3271
|
+
dataTest: dataTest
|
|
3272
|
+
}, rest));
|
|
3273
|
+
} else if ((schema == null ? void 0 : schema.type) === 'array') {
|
|
3274
|
+
if (schema.items && schema.items.type === 'string') {
|
|
3275
|
+
var _schema$items;
|
|
3276
|
+
|
|
3277
|
+
if (schema.items.vocabularyName) {
|
|
3278
|
+
return /*#__PURE__*/React.createElement(SelectVocabulary, _extends({
|
|
3279
|
+
vocabularyName: get$1(schema, 'items.vocabularyName', null),
|
|
3280
|
+
val: val || [],
|
|
3281
|
+
className: className,
|
|
3282
|
+
classWrap: "is-fullwidth",
|
|
3283
|
+
dataTest: dataTest
|
|
3284
|
+
}, rest, {
|
|
3285
|
+
onChange: setValue,
|
|
3286
|
+
multiple: true
|
|
3287
|
+
}));
|
|
3288
|
+
} else if (schema != null && (_schema$items = schema.items) != null && _schema$items.vocabulary) {
|
|
3289
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
3290
|
+
value: val || [],
|
|
3291
|
+
className: className,
|
|
3292
|
+
classWrap: "is-fullwidth",
|
|
3293
|
+
dataTest: dataTest,
|
|
3294
|
+
options: schema == null ? void 0 : schema.items.vocabulary.map(item => {
|
|
3295
|
+
return {
|
|
3296
|
+
text: item,
|
|
3297
|
+
value: item
|
|
3298
|
+
};
|
|
3299
|
+
}),
|
|
3300
|
+
multiple: true,
|
|
3301
|
+
onChange: setValue
|
|
3302
|
+
}, rest));
|
|
3141
3303
|
}
|
|
3142
3304
|
}
|
|
3143
3305
|
|
|
3144
|
-
return
|
|
3306
|
+
return /*#__PURE__*/React.createElement(InputList, _extends({
|
|
3307
|
+
value: val || [],
|
|
3308
|
+
className: className,
|
|
3309
|
+
onChange: ev => setValue(ev),
|
|
3310
|
+
ref: ref,
|
|
3311
|
+
dataTest: dataTest
|
|
3312
|
+
}, rest));
|
|
3313
|
+
} else if ((schema == null ? void 0 : schema.widget) === 'file') {
|
|
3314
|
+
return /*#__PURE__*/React.createElement(FileUpload, _extends({
|
|
3315
|
+
onChange: ev => setValue(ev),
|
|
3316
|
+
label: get$1(val, 'filename', null),
|
|
3317
|
+
dataTest: dataTest
|
|
3318
|
+
}, rest));
|
|
3319
|
+
} else if ((schema == null ? void 0 : schema.widget) === 'select' && schema.type === 'string') {
|
|
3320
|
+
if (schema != null && schema.vocabularyName) {
|
|
3321
|
+
return /*#__PURE__*/React.createElement(SelectVocabulary, _extends({
|
|
3322
|
+
val: val || '',
|
|
3323
|
+
className: className,
|
|
3324
|
+
appendDefault: true,
|
|
3325
|
+
classWrap: "is-fullwidth",
|
|
3326
|
+
dataTest: dataTest,
|
|
3327
|
+
onChange: setValue,
|
|
3328
|
+
vocabularyName: get$1(schema, 'vocabularyName', null)
|
|
3329
|
+
}, rest));
|
|
3330
|
+
}
|
|
3331
|
+
|
|
3332
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
3333
|
+
value: val || '',
|
|
3334
|
+
className: className,
|
|
3335
|
+
appendDefault: true,
|
|
3336
|
+
classWrap: "is-fullwidth",
|
|
3337
|
+
dataTest: dataTest,
|
|
3338
|
+
options: schema == null ? void 0 : schema.vocabulary.map(item => {
|
|
3339
|
+
return {
|
|
3340
|
+
text: item,
|
|
3341
|
+
value: item
|
|
3342
|
+
};
|
|
3343
|
+
}),
|
|
3344
|
+
onChange: setValue
|
|
3345
|
+
}, rest));
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3348
|
+
const getInputType = () => {
|
|
3349
|
+
switch (schema == null ? void 0 : schema.type) {
|
|
3350
|
+
case 'integer':
|
|
3351
|
+
return 'number';
|
|
3352
|
+
|
|
3353
|
+
case 'date':
|
|
3354
|
+
return 'date';
|
|
3355
|
+
|
|
3356
|
+
case 'datetime':
|
|
3357
|
+
return 'datetime-local';
|
|
3358
|
+
|
|
3359
|
+
default:
|
|
3360
|
+
return 'text';
|
|
3361
|
+
}
|
|
3145
3362
|
};
|
|
3146
3363
|
|
|
3147
|
-
return /*#__PURE__*/React.createElement(
|
|
3148
|
-
|
|
3364
|
+
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
3365
|
+
value: val || '',
|
|
3366
|
+
className: className,
|
|
3367
|
+
dataTest: dataTest,
|
|
3368
|
+
onChange: ev => setValue(ev),
|
|
3369
|
+
ref: ref,
|
|
3370
|
+
type: getInputType()
|
|
3371
|
+
}, rest));
|
|
3372
|
+
});
|
|
3373
|
+
EditComponent.displayName = 'EditComponent';
|
|
3149
3374
|
|
|
3150
3375
|
function IAttachment({
|
|
3151
3376
|
properties,
|
|
@@ -4620,76 +4845,6 @@ function SearchVocabularyLabels(props) {
|
|
|
4620
4845
|
return null;
|
|
4621
4846
|
}
|
|
4622
4847
|
|
|
4623
|
-
const SelectVocabulary = React.forwardRef((_ref, ref) => {
|
|
4624
|
-
let {
|
|
4625
|
-
vocabularyName,
|
|
4626
|
-
className,
|
|
4627
|
-
classWrap,
|
|
4628
|
-
val,
|
|
4629
|
-
dataTest,
|
|
4630
|
-
multiple
|
|
4631
|
-
} = _ref,
|
|
4632
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["vocabularyName", "className", "classWrap", "val", "dataTest", "multiple"]);
|
|
4633
|
-
|
|
4634
|
-
const vocabulary = useVocabulary(vocabularyName);
|
|
4635
|
-
|
|
4636
|
-
const getOptions = () => {
|
|
4637
|
-
if (get$1(vocabulary, 'data.items', null)) {
|
|
4638
|
-
const vocData = vocabulary.data.items.map(item => {
|
|
4639
|
-
var _item$title$default;
|
|
4640
|
-
|
|
4641
|
-
return {
|
|
4642
|
-
text: (_item$title$default = item.title.default) != null ? _item$title$default : item.title,
|
|
4643
|
-
value: item.token
|
|
4644
|
-
};
|
|
4645
|
-
});
|
|
4646
|
-
return vocData;
|
|
4647
|
-
}
|
|
4648
|
-
|
|
4649
|
-
return [];
|
|
4650
|
-
};
|
|
4651
|
-
|
|
4652
|
-
const getProps = () => {
|
|
4653
|
-
if (multiple) {
|
|
4654
|
-
const currentValue = val || [];
|
|
4655
|
-
return {
|
|
4656
|
-
multiple: true,
|
|
4657
|
-
size: 5,
|
|
4658
|
-
value: currentValue,
|
|
4659
|
-
options: getOptions()
|
|
4660
|
-
};
|
|
4661
|
-
}
|
|
4662
|
-
|
|
4663
|
-
return {
|
|
4664
|
-
value: val != null ? val : '',
|
|
4665
|
-
appendDefault: true,
|
|
4666
|
-
options: getOptions()
|
|
4667
|
-
};
|
|
4668
|
-
};
|
|
4669
|
-
|
|
4670
|
-
if (vocabulary.data === undefined || vocabulary.loading) {
|
|
4671
|
-
return /*#__PURE__*/React.createElement("div", null);
|
|
4672
|
-
}
|
|
4673
|
-
|
|
4674
|
-
return /*#__PURE__*/React.createElement(Select, _extends({}, getProps(), {
|
|
4675
|
-
className: className,
|
|
4676
|
-
classWrap: classWrap || 'is-fullwidth',
|
|
4677
|
-
dataTest: dataTest,
|
|
4678
|
-
ref: ref
|
|
4679
|
-
}, rest));
|
|
4680
|
-
});
|
|
4681
|
-
Select.propTypes = {
|
|
4682
|
-
error: PropTypes.string,
|
|
4683
|
-
disabled: PropTypes.bool,
|
|
4684
|
-
loading: PropTypes.bool,
|
|
4685
|
-
isSubmitted: PropTypes.bool,
|
|
4686
|
-
size: PropTypes.number,
|
|
4687
|
-
onChange: PropTypes.func,
|
|
4688
|
-
multiple: PropTypes.bool,
|
|
4689
|
-
className: PropTypes.string,
|
|
4690
|
-
vocabularyName: PropTypes.string
|
|
4691
|
-
};
|
|
4692
|
-
|
|
4693
4848
|
const initialState$1 = {
|
|
4694
4849
|
page: 0,
|
|
4695
4850
|
items: [],
|
|
@@ -7364,134 +7519,6 @@ const buildPaths = segments => {
|
|
|
7364
7519
|
return results;
|
|
7365
7520
|
};
|
|
7366
7521
|
|
|
7367
|
-
const EditComponent = React.forwardRef((_ref, ref) => {
|
|
7368
|
-
let {
|
|
7369
|
-
schema,
|
|
7370
|
-
val,
|
|
7371
|
-
setValue,
|
|
7372
|
-
dataTest,
|
|
7373
|
-
className
|
|
7374
|
-
} = _ref,
|
|
7375
|
-
rest = _objectWithoutPropertiesLoose(_ref, ["schema", "val", "setValue", "dataTest", "className"]);
|
|
7376
|
-
|
|
7377
|
-
if ((schema == null ? void 0 : schema.widget) === 'textarea' || (schema == null ? void 0 : schema.widget) === 'richtext') {
|
|
7378
|
-
return /*#__PURE__*/React.createElement(Textarea, _extends({
|
|
7379
|
-
value: val || '',
|
|
7380
|
-
className: className,
|
|
7381
|
-
onChange: ev => setValue(ev),
|
|
7382
|
-
ref: ref,
|
|
7383
|
-
dataTest: dataTest
|
|
7384
|
-
}, rest));
|
|
7385
|
-
} else if ((schema == null ? void 0 : schema.type) === 'boolean') {
|
|
7386
|
-
return /*#__PURE__*/React.createElement(Checkbox, _extends({
|
|
7387
|
-
value: !!val,
|
|
7388
|
-
className: className,
|
|
7389
|
-
onChange: ev => setValue(ev),
|
|
7390
|
-
ref: ref,
|
|
7391
|
-
dataTest: dataTest
|
|
7392
|
-
}, rest));
|
|
7393
|
-
} else if ((schema == null ? void 0 : schema.type) === 'array') {
|
|
7394
|
-
if (schema.items && schema.items.type === 'string') {
|
|
7395
|
-
var _schema$items;
|
|
7396
|
-
|
|
7397
|
-
if (schema.items.vocabularyName) {
|
|
7398
|
-
return /*#__PURE__*/React.createElement(SelectVocabulary, _extends({
|
|
7399
|
-
vocabularyName: get$1(schema, 'items.vocabularyName', null),
|
|
7400
|
-
val: val || [],
|
|
7401
|
-
className: className,
|
|
7402
|
-
classWrap: "is-fullwidth",
|
|
7403
|
-
dataTest: dataTest
|
|
7404
|
-
}, rest, {
|
|
7405
|
-
onChange: setValue,
|
|
7406
|
-
multiple: true
|
|
7407
|
-
}));
|
|
7408
|
-
} else if (schema != null && (_schema$items = schema.items) != null && _schema$items.vocabulary) {
|
|
7409
|
-
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
7410
|
-
value: val || [],
|
|
7411
|
-
className: className,
|
|
7412
|
-
classWrap: "is-fullwidth",
|
|
7413
|
-
dataTest: dataTest,
|
|
7414
|
-
options: schema == null ? void 0 : schema.items.vocabulary.map(item => {
|
|
7415
|
-
return {
|
|
7416
|
-
text: item,
|
|
7417
|
-
value: item
|
|
7418
|
-
};
|
|
7419
|
-
}),
|
|
7420
|
-
multiple: true,
|
|
7421
|
-
onChange: setValue
|
|
7422
|
-
}, rest));
|
|
7423
|
-
}
|
|
7424
|
-
}
|
|
7425
|
-
|
|
7426
|
-
return /*#__PURE__*/React.createElement(InputList, _extends({
|
|
7427
|
-
value: val || [],
|
|
7428
|
-
className: className,
|
|
7429
|
-
onChange: ev => setValue(ev),
|
|
7430
|
-
ref: ref,
|
|
7431
|
-
dataTest: dataTest
|
|
7432
|
-
}, rest));
|
|
7433
|
-
} else if ((schema == null ? void 0 : schema.widget) === 'file') {
|
|
7434
|
-
return /*#__PURE__*/React.createElement(FileUpload, _extends({
|
|
7435
|
-
onChange: ev => setValue(ev),
|
|
7436
|
-
label: get$1(val, 'filename', null),
|
|
7437
|
-
dataTest: dataTest
|
|
7438
|
-
}, rest));
|
|
7439
|
-
} else if ((schema == null ? void 0 : schema.widget) === 'select' && schema.type === 'string') {
|
|
7440
|
-
if (schema != null && schema.vocabularyName) {
|
|
7441
|
-
return /*#__PURE__*/React.createElement(SelectVocabulary, _extends({
|
|
7442
|
-
val: val || '',
|
|
7443
|
-
className: className,
|
|
7444
|
-
appendDefault: true,
|
|
7445
|
-
classWrap: "is-fullwidth",
|
|
7446
|
-
dataTest: dataTest,
|
|
7447
|
-
onChange: setValue,
|
|
7448
|
-
vocabularyName: get$1(schema, 'vocabularyName', null)
|
|
7449
|
-
}, rest));
|
|
7450
|
-
}
|
|
7451
|
-
|
|
7452
|
-
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
7453
|
-
value: val || '',
|
|
7454
|
-
className: className,
|
|
7455
|
-
appendDefault: true,
|
|
7456
|
-
classWrap: "is-fullwidth",
|
|
7457
|
-
dataTest: dataTest,
|
|
7458
|
-
options: schema == null ? void 0 : schema.vocabulary.map(item => {
|
|
7459
|
-
return {
|
|
7460
|
-
text: item,
|
|
7461
|
-
value: item
|
|
7462
|
-
};
|
|
7463
|
-
}),
|
|
7464
|
-
onChange: setValue
|
|
7465
|
-
}, rest));
|
|
7466
|
-
}
|
|
7467
|
-
|
|
7468
|
-
const getInputType = () => {
|
|
7469
|
-
switch (schema == null ? void 0 : schema.type) {
|
|
7470
|
-
case 'integer':
|
|
7471
|
-
return 'number';
|
|
7472
|
-
|
|
7473
|
-
case 'date':
|
|
7474
|
-
return 'date';
|
|
7475
|
-
|
|
7476
|
-
case 'datetime':
|
|
7477
|
-
return 'datetime-local';
|
|
7478
|
-
|
|
7479
|
-
default:
|
|
7480
|
-
return 'text';
|
|
7481
|
-
}
|
|
7482
|
-
};
|
|
7483
|
-
|
|
7484
|
-
return /*#__PURE__*/React.createElement(Input, _extends({
|
|
7485
|
-
value: val || '',
|
|
7486
|
-
className: className,
|
|
7487
|
-
dataTest: dataTest,
|
|
7488
|
-
onChange: ev => setValue(ev),
|
|
7489
|
-
ref: ref,
|
|
7490
|
-
type: getInputType()
|
|
7491
|
-
}, rest));
|
|
7492
|
-
});
|
|
7493
|
-
EditComponent.displayName = 'EditComponent';
|
|
7494
|
-
|
|
7495
7522
|
let registry = {
|
|
7496
7523
|
paths: {},
|
|
7497
7524
|
views: {
|
|
@@ -11101,5 +11128,5 @@ class Auth {
|
|
|
11101
11128
|
|
|
11102
11129
|
}
|
|
11103
11130
|
|
|
11104
|
-
export { AddItem, AddPermission, AllItemsCheckbox, ApplicationCtx, Auth, AuthContext, BaseForm, BehaviorNotImplemented, BehaviorsView, Button, Checkbox, ClientContext, ClientProvider, Config, Confirm, ContainerCtx, ContextToolbar, CreateButton, CreateContainer, DatabaseCtx, Delete, DownloadField, EditableField, EmailInput, FileUpload, Flash, FolderCtx, Form, FormBuilder, GroupCtx, GroupToolbar, GroupsCtx, Guillotina, GuillotinaClient, IAttachment, IImageAttachment, IMultiAttachment, IMultiImageAttachment, IMultiImageOrderedAttachment, IWorkflow, Icon, Input, InputList, Item, ItemCheckbox, ItemCtx, ItemModel, ItemTitle, ItemsActionsDropdown, ItemsActionsProvider, Layout, Link, Loading, Login, Modal, NotAllowed, Notification, Pagination, PanelActions, PanelAddons, PanelBehaviors, PanelItems, PanelNotImplemented, PanelPermissions, PanelProperties, PasswordInput, Path, PathTree, PermissionPrinperm, PermissionPrinrole, PermissionRoleperm, Permissions, PropertiesButtonView, PropertiesView, REGEX_EMAIL, REGEX_HEX_COLOR, REGEX_NUMBER, REGEX_URL, RItem, RemoveItems, RenderField, RenderFieldComponent, RequiredFieldsForm, RestClient, SearchInput, SearchLabels, SearchOptionsLabels, SearchVocabularyLabels, Select, Sharing, Table, TabsPanel, Tag, TagsWidget, TdLink, Textarea, TraversalContext, TraversalProvider, UserCtx, UserForm, UsersCtx, UsersToolbar, base64ToArrayBuffer, buildQs, classnames, defaultComponent, formatDate, generateUID, get$1 as get, getActionsObject, getClient, getNewId, isEmail, isEmpty, isHexColor, isNumber, isURL, lightFileReader, maxLength, messages$4 as messages, minLength, noop, notEmpty, parser, sleep, stringToSlug, toQueryString, useConfig, useCrudContext, useGuillotinaClient, useLocation, useRegistry, useRemoteField, useTraversal, useVocabulary };
|
|
11131
|
+
export { AddItem, AddPermission, AllItemsCheckbox, ApplicationCtx, Auth, AuthContext, BaseForm, BehaviorNotImplemented, BehaviorsView, Button, Checkbox, ClientContext, ClientProvider, Config, Confirm, ContainerCtx, ContextToolbar, CreateButton, CreateContainer, DatabaseCtx, Delete, DownloadField, EditComponent, EditableField, EmailInput, FileUpload, Flash, FolderCtx, Form, FormBuilder, GroupCtx, GroupToolbar, GroupsCtx, Guillotina, GuillotinaClient, IAttachment, IImageAttachment, IMultiAttachment, IMultiImageAttachment, IMultiImageOrderedAttachment, IWorkflow, Icon, Input, InputList, Item, ItemCheckbox, ItemCtx, ItemModel, ItemTitle, ItemsActionsDropdown, ItemsActionsProvider, Layout, Link, Loading, Login, Modal, NotAllowed, Notification, Pagination, PanelActions, PanelAddons, PanelBehaviors, PanelItems, PanelNotImplemented, PanelPermissions, PanelProperties, PasswordInput, Path, PathTree, PermissionPrinperm, PermissionPrinrole, PermissionRoleperm, Permissions, PropertiesButtonView, PropertiesView, REGEX_EMAIL, REGEX_HEX_COLOR, REGEX_NUMBER, REGEX_URL, RItem, RemoveItems, RenderField, RenderFieldComponent, RequiredFieldsForm, RestClient, SearchInput, SearchLabels, SearchOptionsLabels, SearchVocabularyLabels, Select, Sharing, Table, TabsPanel, Tag, TagsWidget, TdLink, Textarea, TraversalContext, TraversalProvider, UserCtx, UserForm, UsersCtx, UsersToolbar, VocabularyRenderField, base64ToArrayBuffer, buildQs, classnames, defaultComponent, formatDate, generateUID, get$1 as get, getActionsObject, getClient, getNewId, isEmail, isEmpty, isHexColor, isNumber, isURL, lightFileReader, maxLength, messages$4 as messages, minLength, noop, notEmpty, parser, sleep, stringToSlug, toQueryString, useConfig, useCrudContext, useGuillotinaClient, useLocation, useRegistry, useRemoteField, useTraversal, useVocabulary };
|
|
11105
11132
|
//# sourceMappingURL=react-gmi.modern.js.map
|