labellife-design-tool 2.2.7 → 2.2.8

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.
@@ -27,6 +27,9 @@ var CloseIcon = require('@mui/icons-material/Close');
27
27
  var InputIcon = require('@mui/icons-material/Input');
28
28
  var CalendarTodayIcon = require('@mui/icons-material/CalendarToday');
29
29
  var NumbersIcon = require('@mui/icons-material/Numbers');
30
+ var RadioButtonCheckedIcon = require('@mui/icons-material/RadioButtonChecked');
31
+ var FormatListBulletedIcon = require('@mui/icons-material/FormatListBulleted');
32
+ var AddIcon = require('@mui/icons-material/Add');
30
33
 
31
34
  function _arrayLikeToArray(r, a) {
32
35
  (null == a || a > r.length) && (a = r.length);
@@ -4639,7 +4642,7 @@ function ImagesGrid(_ref) {
4639
4642
  });
4640
4643
  }
4641
4644
 
4642
- var _excluded = ["inputField", "promptText", "inputType", "required", "placeholder"];
4645
+ var _excluded = ["inputField", "promptText", "inputType", "required", "placeholder", "options", "minSelections", "maxSelections"];
4643
4646
  var IMAGE_PLACEHOLDER_SRC = "data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"400\" height=\"400\" viewBox=\"0 0 400 400\">\n <rect width=\"400\" height=\"400\" fill=\"#f0f2f5\" rx=\"12\"/>\n <rect x=\"110\" y=\"90\" width=\"180\" height=\"145\" rx=\"10\" fill=\"#dde1e7\"/>\n <circle cx=\"158\" cy=\"135\" r=\"22\" fill=\"#f0f2f5\"/>\n <polygon points=\"110,235 168,163 210,205 250,163 290,235\" fill=\"#c8cdd6\"/>\n <rect x=\"140\" y=\"268\" width=\"120\" height=\"14\" rx=\"7\" fill=\"#c8cdd6\"/>\n <rect x=\"160\" y=\"292\" width=\"80\" height=\"10\" rx=\"5\" fill=\"#dde1e7\"/>\n </svg>"));
4644
4647
 
4645
4648
  // ── Date formatting helpers ──────────────────────────────────────────
@@ -4681,12 +4684,84 @@ function formatDate(date, format) {
4681
4684
  }
4682
4685
  }
4683
4686
 
4687
+ // ── Options list editor ──────────────────────────────────────────────
4688
+ var OptionsEditor = function OptionsEditor(_ref) {
4689
+ var options = _ref.options,
4690
+ _onChange = _ref.onChange;
4691
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4692
+ sx: {
4693
+ ml: 6.5,
4694
+ mr: 1,
4695
+ display: 'flex',
4696
+ flexDirection: 'column',
4697
+ gap: 0.75
4698
+ },
4699
+ children: [options.map(function (opt, i) {
4700
+ return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4701
+ sx: {
4702
+ display: 'flex',
4703
+ gap: 0.5,
4704
+ alignItems: 'center'
4705
+ },
4706
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.TextField, {
4707
+ size: "small",
4708
+ value: opt,
4709
+ onChange: function onChange(e) {
4710
+ var next = _toConsumableArray(options);
4711
+ next[i] = e.target.value;
4712
+ _onChange(next);
4713
+ },
4714
+ placeholder: "Option ".concat(i + 1),
4715
+ sx: {
4716
+ flex: 1,
4717
+ '& .MuiInputBase-input': {
4718
+ fontSize: 12,
4719
+ py: 0.75
4720
+ }
4721
+ }
4722
+ }), /*#__PURE__*/jsxRuntime.jsx(material.IconButton, {
4723
+ size: "small",
4724
+ onClick: function onClick() {
4725
+ return _onChange(options.filter(function (_, j) {
4726
+ return j !== i;
4727
+ }));
4728
+ },
4729
+ disabled: options.length <= 1,
4730
+ sx: {
4731
+ color: '#bbb',
4732
+ '&:hover': {
4733
+ color: '#e57373'
4734
+ }
4735
+ },
4736
+ children: /*#__PURE__*/jsxRuntime.jsx(DeleteIcon, {
4737
+ fontSize: "small"
4738
+ })
4739
+ })]
4740
+ }, i);
4741
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Button, {
4742
+ size: "small",
4743
+ startIcon: /*#__PURE__*/jsxRuntime.jsx(AddIcon, {}),
4744
+ onClick: function onClick() {
4745
+ return _onChange([].concat(_toConsumableArray(options), ['']));
4746
+ },
4747
+ sx: {
4748
+ alignSelf: 'flex-start',
4749
+ fontSize: 11,
4750
+ textTransform: 'none',
4751
+ color: '#0d83cd',
4752
+ p: 0.5
4753
+ },
4754
+ children: "Add option"
4755
+ })]
4756
+ });
4757
+ };
4758
+
4684
4759
  // ── Card component ───────────────────────────────────────────────────
4685
- var InputFieldCard = function InputFieldCard(_ref) {
4686
- var icon = _ref.icon,
4687
- label = _ref.label,
4688
- description = _ref.description,
4689
- onClick = _ref.onClick;
4760
+ var InputFieldCard = function InputFieldCard(_ref2) {
4761
+ var icon = _ref2.icon,
4762
+ label = _ref2.label,
4763
+ description = _ref2.description,
4764
+ onClick = _ref2.onClick;
4690
4765
  return /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
4691
4766
  onClick: onClick,
4692
4767
  sx: {
@@ -4742,8 +4817,8 @@ var InputFieldCard = function InputFieldCard(_ref) {
4742
4817
  };
4743
4818
 
4744
4819
  // ── Panel content ────────────────────────────────────────────────────
4745
- var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
4746
- var store = _ref2.store;
4820
+ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref3) {
4821
+ var store = _ref3.store;
4747
4822
  var _useState = react.useState('MM-DD-YYYY'),
4748
4823
  _useState2 = _slicedToArray(_useState, 2),
4749
4824
  dateFormat = _useState2[0],
@@ -4780,6 +4855,34 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
4780
4855
  _useState16 = _slicedToArray(_useState15, 2),
4781
4856
  imageRequired = _useState16[0],
4782
4857
  setImageRequired = _useState16[1];
4858
+ var _useState17 = react.useState(''),
4859
+ _useState18 = _slicedToArray(_useState17, 2),
4860
+ radioPrompt = _useState18[0],
4861
+ setRadioPrompt = _useState18[1];
4862
+ var _useState19 = react.useState(false),
4863
+ _useState20 = _slicedToArray(_useState19, 2),
4864
+ radioRequired = _useState20[0],
4865
+ setRadioRequired = _useState20[1];
4866
+ var _useState21 = react.useState(['Option 1', 'Option 2']),
4867
+ _useState22 = _slicedToArray(_useState21, 2),
4868
+ radioOptions = _useState22[0],
4869
+ setRadioOptions = _useState22[1];
4870
+ var _useState23 = react.useState(''),
4871
+ _useState24 = _slicedToArray(_useState23, 2),
4872
+ listPrompt = _useState24[0],
4873
+ setListPrompt = _useState24[1];
4874
+ var _useState25 = react.useState(0),
4875
+ _useState26 = _slicedToArray(_useState25, 2),
4876
+ listMinSelections = _useState26[0],
4877
+ setListMinSelections = _useState26[1];
4878
+ var _useState27 = react.useState(2),
4879
+ _useState28 = _slicedToArray(_useState27, 2),
4880
+ listMaxSelections = _useState28[0],
4881
+ setListMaxSelections = _useState28[1];
4882
+ var _useState29 = react.useState(['Option 1', 'Option 2']),
4883
+ _useState30 = _slicedToArray(_useState29, 2),
4884
+ listOptions = _useState30[0],
4885
+ setListOptions = _useState30[1];
4783
4886
  var addInputElement = function addInputElement(inputType) {
4784
4887
  var extra = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4785
4888
  var page = store.activePage;
@@ -4822,6 +4925,16 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
4822
4925
  placeholder = t('sidePanel.inputFields.integerPlaceholder', 'Enter number');
4823
4926
  defaultPrompt = t('sidePanel.inputFields.defaultIntegerPrompt', 'Please enter a number');
4824
4927
  break;
4928
+ case 'radio':
4929
+ dummyText = (extra.options || []).filter(Boolean)[0] || 'Option 1';
4930
+ placeholder = t('sidePanel.inputFields.radioPlaceholder', 'Select an option');
4931
+ defaultPrompt = t('sidePanel.inputFields.defaultRadioPrompt', 'Please select an option');
4932
+ break;
4933
+ case 'list':
4934
+ dummyText = (extra.options || []).filter(Boolean).slice(0, 2).join(', ') || 'Option 1, Option 2';
4935
+ placeholder = t('sidePanel.inputFields.listPlaceholder', 'Select options');
4936
+ defaultPrompt = t('sidePanel.inputFields.defaultListPrompt', 'Please select options');
4937
+ break;
4825
4938
  default:
4826
4939
  dummyText = 'Input';
4827
4940
  placeholder = 'Input';
@@ -4840,7 +4953,7 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
4840
4953
  fontFamily: 'Roboto',
4841
4954
  align: 'center',
4842
4955
  fill: '#333333',
4843
- custom: _objectSpread2({
4956
+ custom: _objectSpread2(_objectSpread2(_objectSpread2({
4844
4957
  inputField: true,
4845
4958
  inputType: inputType,
4846
4959
  placeholder: placeholder,
@@ -4848,6 +4961,11 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
4848
4961
  required: extra.required || false
4849
4962
  }, inputType === 'date' ? {
4850
4963
  dateFormat: extra.dateFormat || 'MM-DD-YYYY'
4964
+ } : {}), ['radio', 'list'].includes(inputType) ? {
4965
+ options: (extra.options || []).filter(Boolean)
4966
+ } : {}), inputType === 'list' ? {
4967
+ minSelections: extra.minSelections || 0,
4968
+ maxSelections: extra.maxSelections || 0
4851
4969
  } : {})
4852
4970
  });
4853
4971
  }
@@ -5089,6 +5207,138 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
5089
5207
  sx: {
5090
5208
  ml: 5.5
5091
5209
  }
5210
+ }), /*#__PURE__*/jsxRuntime.jsx(InputFieldCard, {
5211
+ icon: /*#__PURE__*/jsxRuntime.jsx(RadioButtonCheckedIcon, {
5212
+ fontSize: "small"
5213
+ }),
5214
+ label: t('sidePanel.inputFields.radioInput', 'Radio Input'),
5215
+ description: t('sidePanel.inputFields.radioInputDesc', 'Single option selection'),
5216
+ onClick: function onClick() {
5217
+ return addInputElement('radio', {
5218
+ promptText: radioPrompt,
5219
+ required: radioRequired,
5220
+ options: radioOptions
5221
+ });
5222
+ }
5223
+ }), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
5224
+ size: "small",
5225
+ placeholder: t('sidePanel.inputFields.promptTextHint', 'Prompt text shown to user...'),
5226
+ value: radioPrompt,
5227
+ onChange: function onChange(e) {
5228
+ return setRadioPrompt(e.target.value);
5229
+ },
5230
+ sx: {
5231
+ ml: 6.5,
5232
+ mr: 1,
5233
+ '& .MuiInputBase-input': {
5234
+ fontSize: 12,
5235
+ py: 0.75
5236
+ }
5237
+ }
5238
+ }), /*#__PURE__*/jsxRuntime.jsx(material.FormControlLabel, {
5239
+ control: /*#__PURE__*/jsxRuntime.jsx(material.Checkbox, {
5240
+ size: "small",
5241
+ checked: radioRequired,
5242
+ onChange: function onChange(e) {
5243
+ return setRadioRequired(e.target.checked);
5244
+ }
5245
+ }),
5246
+ label: /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
5247
+ sx: {
5248
+ fontSize: 12
5249
+ },
5250
+ children: t('sidePanel.inputFields.required', 'Required')
5251
+ }),
5252
+ sx: {
5253
+ ml: 5.5
5254
+ }
5255
+ }), /*#__PURE__*/jsxRuntime.jsx(OptionsEditor, {
5256
+ options: radioOptions,
5257
+ onChange: setRadioOptions
5258
+ }), /*#__PURE__*/jsxRuntime.jsx(InputFieldCard, {
5259
+ icon: /*#__PURE__*/jsxRuntime.jsx(FormatListBulletedIcon, {
5260
+ fontSize: "small"
5261
+ }),
5262
+ label: t('sidePanel.inputFields.listInput', 'List Input'),
5263
+ description: t('sidePanel.inputFields.listInputDesc', 'Multiple option selection'),
5264
+ onClick: function onClick() {
5265
+ return addInputElement('list', {
5266
+ promptText: listPrompt,
5267
+ minSelections: listMinSelections,
5268
+ maxSelections: listMaxSelections,
5269
+ options: listOptions
5270
+ });
5271
+ }
5272
+ }), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
5273
+ size: "small",
5274
+ placeholder: t('sidePanel.inputFields.promptTextHint', 'Prompt text shown to user...'),
5275
+ value: listPrompt,
5276
+ onChange: function onChange(e) {
5277
+ return setListPrompt(e.target.value);
5278
+ },
5279
+ sx: {
5280
+ ml: 6.5,
5281
+ mr: 1,
5282
+ '& .MuiInputBase-input': {
5283
+ fontSize: 12,
5284
+ py: 0.75
5285
+ }
5286
+ }
5287
+ }), /*#__PURE__*/jsxRuntime.jsx(OptionsEditor, {
5288
+ options: listOptions,
5289
+ onChange: setListOptions
5290
+ }), /*#__PURE__*/jsxRuntime.jsxs(material.Box, {
5291
+ sx: {
5292
+ display: 'flex',
5293
+ gap: 1,
5294
+ ml: 6.5,
5295
+ mr: 1
5296
+ },
5297
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.TextField, {
5298
+ size: "small",
5299
+ type: "number",
5300
+ label: t('sidePanel.inputFields.minSelections', 'Min select'),
5301
+ value: listMinSelections,
5302
+ onChange: function onChange(e) {
5303
+ return setListMinSelections(Math.max(0, parseInt(e.target.value) || 0));
5304
+ },
5305
+ inputProps: {
5306
+ min: 0
5307
+ },
5308
+ sx: {
5309
+ flex: 1,
5310
+ '& .MuiInputBase-input': {
5311
+ fontSize: 12,
5312
+ py: 0.75
5313
+ }
5314
+ }
5315
+ }), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
5316
+ size: "small",
5317
+ type: "number",
5318
+ label: t('sidePanel.inputFields.maxSelections', 'Max select'),
5319
+ value: listMaxSelections,
5320
+ onChange: function onChange(e) {
5321
+ return setListMaxSelections(Math.max(0, parseInt(e.target.value) || 0));
5322
+ },
5323
+ inputProps: {
5324
+ min: 0
5325
+ },
5326
+ sx: {
5327
+ flex: 1,
5328
+ '& .MuiInputBase-input': {
5329
+ fontSize: 12,
5330
+ py: 0.75
5331
+ }
5332
+ }
5333
+ })]
5334
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
5335
+ variant: "caption",
5336
+ sx: {
5337
+ ml: 6.5,
5338
+ color: '#999',
5339
+ fontSize: 10
5340
+ },
5341
+ children: listMinSelections > 0 ? "Required \xB7 min ".concat(listMinSelections).concat(listMaxSelections > 0 ? ", max ".concat(listMaxSelections) : ', no max') : "Optional \xB7 max ".concat(listMaxSelections > 0 ? listMaxSelections : '∞')
5092
5342
  })]
5093
5343
  }), /*#__PURE__*/jsxRuntime.jsx(material.Divider, {
5094
5344
  sx: {
@@ -5118,21 +5368,33 @@ var InputFieldsPanelContent = mobxReactLite.observer(function (_ref2) {
5118
5368
  });
5119
5369
 
5120
5370
  // ── Mark-as-variable sub-form ─────────────────────────────────────────
5121
- var MarkAsVariableForm = mobxReactLite.observer(function (_ref3) {
5371
+ var MarkAsVariableForm = mobxReactLite.observer(function (_ref4) {
5122
5372
  var _selectedElement$cust;
5123
- var store = _ref3.store;
5124
- var _useState17 = react.useState(''),
5125
- _useState18 = _slicedToArray(_useState17, 2),
5126
- markLabel = _useState18[0],
5127
- setMarkLabel = _useState18[1];
5128
- var _useState19 = react.useState(false),
5129
- _useState20 = _slicedToArray(_useState19, 2),
5130
- markRequired = _useState20[0],
5131
- setMarkRequired = _useState20[1];
5132
- var _useState21 = react.useState('text'),
5133
- _useState22 = _slicedToArray(_useState21, 2),
5134
- markInputType = _useState22[0],
5135
- setMarkInputType = _useState22[1];
5373
+ var store = _ref4.store;
5374
+ var _useState31 = react.useState(''),
5375
+ _useState32 = _slicedToArray(_useState31, 2),
5376
+ markLabel = _useState32[0],
5377
+ setMarkLabel = _useState32[1];
5378
+ var _useState33 = react.useState(false),
5379
+ _useState34 = _slicedToArray(_useState33, 2),
5380
+ markRequired = _useState34[0],
5381
+ setMarkRequired = _useState34[1];
5382
+ var _useState35 = react.useState('text'),
5383
+ _useState36 = _slicedToArray(_useState35, 2),
5384
+ markInputType = _useState36[0],
5385
+ setMarkInputType = _useState36[1];
5386
+ var _useState37 = react.useState(['Option 1', 'Option 2']),
5387
+ _useState38 = _slicedToArray(_useState37, 2),
5388
+ markOptions = _useState38[0],
5389
+ setMarkOptions = _useState38[1];
5390
+ var _useState39 = react.useState(0),
5391
+ _useState40 = _slicedToArray(_useState39, 2),
5392
+ markMinSelections = _useState40[0],
5393
+ setMarkMinSelections = _useState40[1];
5394
+ var _useState41 = react.useState(2),
5395
+ _useState42 = _slicedToArray(_useState41, 2),
5396
+ markMaxSelections = _useState42[0],
5397
+ setMarkMaxSelections = _useState42[1];
5136
5398
  var selectedIds = store.selectedElementsIds || [];
5137
5399
  var selectedElement = selectedIds.length === 1 ? store.getElementById(selectedIds[0]) : null;
5138
5400
  var isImageElement = (selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.type) === 'image';
@@ -5141,37 +5403,52 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref3) {
5141
5403
  var isAlreadyVariable = !!(selectedElement !== null && selectedElement !== void 0 && (_selectedElement$cust = selectedElement.custom) !== null && _selectedElement$cust !== void 0 && _selectedElement$cust.inputField);
5142
5404
  react.useEffect(function () {
5143
5405
  if (selectedElement && isSupportedElement) {
5144
- var _selectedElement$cust2, _selectedElement$cust3, _selectedElement$cust4;
5406
+ var _selectedElement$cust2, _selectedElement$cust3, _selectedElement$cust4, _selectedElement$cust5, _selectedElement$cust6, _selectedElement$cust7;
5145
5407
  setMarkLabel(((_selectedElement$cust2 = selectedElement.custom) === null || _selectedElement$cust2 === void 0 ? void 0 : _selectedElement$cust2.promptText) || '');
5146
5408
  setMarkRequired(!!((_selectedElement$cust3 = selectedElement.custom) !== null && _selectedElement$cust3 !== void 0 && _selectedElement$cust3.required));
5147
5409
  setMarkInputType(isImageElement ? 'image' : ((_selectedElement$cust4 = selectedElement.custom) === null || _selectedElement$cust4 === void 0 ? void 0 : _selectedElement$cust4.inputType) || 'text');
5410
+ setMarkOptions(((_selectedElement$cust5 = selectedElement.custom) === null || _selectedElement$cust5 === void 0 ? void 0 : _selectedElement$cust5.options) || ['Option 1', 'Option 2']);
5411
+ setMarkMinSelections(((_selectedElement$cust6 = selectedElement.custom) === null || _selectedElement$cust6 === void 0 ? void 0 : _selectedElement$cust6.minSelections) || 0);
5412
+ setMarkMaxSelections(((_selectedElement$cust7 = selectedElement.custom) === null || _selectedElement$cust7 === void 0 ? void 0 : _selectedElement$cust7.maxSelections) || 2);
5148
5413
  } else {
5149
5414
  setMarkLabel('');
5150
5415
  setMarkRequired(false);
5151
5416
  setMarkInputType('text');
5417
+ setMarkOptions(['Option 1', 'Option 2']);
5418
+ setMarkMinSelections(0);
5419
+ setMarkMaxSelections(2);
5152
5420
  }
5153
5421
  }, [selectedElement === null || selectedElement === void 0 ? void 0 : selectedElement.id]);
5154
5422
  var handleMark = function handleMark() {
5155
5423
  if (!selectedElement || !markLabel.trim()) return;
5424
+ var effectiveType = isImageElement ? 'image' : markInputType;
5156
5425
  selectedElement.set({
5157
- custom: _objectSpread2(_objectSpread2({}, selectedElement.custom), {}, {
5426
+ custom: _objectSpread2(_objectSpread2(_objectSpread2({}, selectedElement.custom), {}, {
5158
5427
  inputField: true,
5159
5428
  promptText: markLabel.trim(),
5160
- inputType: isImageElement ? 'image' : markInputType,
5429
+ inputType: effectiveType,
5161
5430
  required: markRequired
5162
- })
5431
+ }, ['radio', 'list'].includes(effectiveType) ? {
5432
+ options: markOptions.filter(Boolean)
5433
+ } : {}), effectiveType === 'list' ? {
5434
+ minSelections: markMinSelections,
5435
+ maxSelections: markMaxSelections
5436
+ } : {})
5163
5437
  });
5164
5438
  store.history.addUndoState();
5165
5439
  };
5166
5440
  var handleUnmark = function handleUnmark() {
5167
5441
  if (!selectedElement) return;
5168
- var _ref4 = selectedElement.custom || {};
5169
- _ref4.inputField;
5170
- _ref4.promptText;
5171
- _ref4.inputType;
5172
- _ref4.required;
5173
- _ref4.placeholder;
5174
- var rest = _objectWithoutProperties(_ref4, _excluded);
5442
+ var _ref5 = selectedElement.custom || {};
5443
+ _ref5.inputField;
5444
+ _ref5.promptText;
5445
+ _ref5.inputType;
5446
+ _ref5.required;
5447
+ _ref5.placeholder;
5448
+ _ref5.options;
5449
+ _ref5.minSelections;
5450
+ _ref5.maxSelections;
5451
+ var rest = _objectWithoutProperties(_ref5, _excluded);
5175
5452
  selectedElement.set({
5176
5453
  custom: rest
5177
5454
  });
@@ -5296,9 +5573,84 @@ var MarkAsVariableForm = mobxReactLite.observer(function (_ref3) {
5296
5573
  fontSize: 12
5297
5574
  },
5298
5575
  children: t('sidePanel.inputFields.dateInput', 'Date Input')
5576
+ }), /*#__PURE__*/jsxRuntime.jsx(material.MenuItem, {
5577
+ value: "radio",
5578
+ sx: {
5579
+ fontSize: 12
5580
+ },
5581
+ children: t('sidePanel.inputFields.radioInput', 'Radio Input')
5582
+ }), /*#__PURE__*/jsxRuntime.jsx(material.MenuItem, {
5583
+ value: "list",
5584
+ sx: {
5585
+ fontSize: 12
5586
+ },
5587
+ children: t('sidePanel.inputFields.listInput', 'List Input')
5299
5588
  })]
5300
5589
  })]
5301
- }), /*#__PURE__*/jsxRuntime.jsx(material.FormControlLabel, {
5590
+ }), isTextElement && (markInputType === 'radio' || markInputType === 'list') && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5591
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.Typography, {
5592
+ variant: "caption",
5593
+ sx: {
5594
+ color: '#888',
5595
+ fontSize: 11
5596
+ },
5597
+ children: "Options"
5598
+ }), /*#__PURE__*/jsxRuntime.jsx(OptionsEditor, {
5599
+ options: markOptions,
5600
+ onChange: setMarkOptions
5601
+ })]
5602
+ }), isTextElement && markInputType === 'list' && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
5603
+ children: [/*#__PURE__*/jsxRuntime.jsxs(material.Box, {
5604
+ sx: {
5605
+ display: 'flex',
5606
+ gap: 1
5607
+ },
5608
+ children: [/*#__PURE__*/jsxRuntime.jsx(material.TextField, {
5609
+ size: "small",
5610
+ type: "number",
5611
+ label: t('sidePanel.inputFields.minSelections', 'Min select'),
5612
+ value: markMinSelections,
5613
+ onChange: function onChange(e) {
5614
+ return setMarkMinSelections(Math.max(0, parseInt(e.target.value) || 0));
5615
+ },
5616
+ inputProps: {
5617
+ min: 0
5618
+ },
5619
+ sx: {
5620
+ flex: 1,
5621
+ '& .MuiInputBase-input': {
5622
+ fontSize: 12,
5623
+ py: 0.75
5624
+ }
5625
+ }
5626
+ }), /*#__PURE__*/jsxRuntime.jsx(material.TextField, {
5627
+ size: "small",
5628
+ type: "number",
5629
+ label: t('sidePanel.inputFields.maxSelections', 'Max select'),
5630
+ value: markMaxSelections,
5631
+ onChange: function onChange(e) {
5632
+ return setMarkMaxSelections(Math.max(0, parseInt(e.target.value) || 0));
5633
+ },
5634
+ inputProps: {
5635
+ min: 0
5636
+ },
5637
+ sx: {
5638
+ flex: 1,
5639
+ '& .MuiInputBase-input': {
5640
+ fontSize: 12,
5641
+ py: 0.75
5642
+ }
5643
+ }
5644
+ })]
5645
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Typography, {
5646
+ variant: "caption",
5647
+ sx: {
5648
+ color: '#999',
5649
+ fontSize: 10
5650
+ },
5651
+ children: markMinSelections > 0 ? "Required \xB7 min ".concat(markMinSelections).concat(markMaxSelections > 0 ? ", max ".concat(markMaxSelections) : ', no max') : "Optional \xB7 max ".concat(markMaxSelections > 0 ? markMaxSelections : '∞')
5652
+ })]
5653
+ }), (!isTextElement || markInputType !== 'list') && /*#__PURE__*/jsxRuntime.jsx(material.FormControlLabel, {
5302
5654
  control: /*#__PURE__*/jsxRuntime.jsx(material.Checkbox, {
5303
5655
  size: "small",
5304
5656
  checked: markRequired,