opentiny 6.9.8 → 6.9.10

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.
@@ -14390,13 +14390,43 @@
14390
14390
  tag: 'div',
14391
14391
  classes: ['tox-form__group'].concat(extraClasses)
14392
14392
  });
14393
- const renderLabel$3 = (label, providersBackstage) => FormField.parts.label({
14394
- dom: {
14395
- tag: 'label',
14396
- classes: ['tox-label']
14397
- },
14398
- components: [text$2(providersBackstage.translate(label))]
14399
- });
14393
+ const renderLabel$3 = (label, tooltip, providersBackstage) => {
14394
+ const labelElement = {
14395
+ dom: {
14396
+ tag: 'label',
14397
+ classes: ['tox-label']
14398
+ },
14399
+ components: [text$2(providersBackstage.translate(label))]
14400
+ };
14401
+ if (tooltip.trim() === '') {
14402
+ return FormField.parts.label(labelElement);
14403
+ }
14404
+ const makeIcon = iconName => render$3(iconName, {
14405
+ tag: 'span',
14406
+ classes: [
14407
+ 'tox-icon',
14408
+ 'tox-label-tooltip-icon'
14409
+ ]
14410
+ }, providersBackstage.icons);
14411
+ const labelTooltip = {
14412
+ dom: {
14413
+ tag: 'div',
14414
+ classes: ['tox-label-tooltip']
14415
+ },
14416
+ components: [makeIcon('tooltip')],
14417
+ behaviours: derive$1([Tooltipping.config(providersBackstage.tooltips.getConfig({ tooltipText: providersBackstage.translate(tooltip) }))])
14418
+ };
14419
+ return FormField.parts.label({
14420
+ dom: {
14421
+ tag: 'div',
14422
+ classes: ['tox-form__label-container']
14423
+ },
14424
+ components: [
14425
+ labelElement,
14426
+ labelTooltip
14427
+ ]
14428
+ });
14429
+ };
14400
14430
 
14401
14431
  const formChangeEvent = generate$6('form-component-change');
14402
14432
  const formCloseEvent = generate$6('form-close');
@@ -14409,7 +14439,7 @@
14409
14439
  const formResizeEvent = generate$6('form-resize');
14410
14440
 
14411
14441
  const renderCollection = (spec, providersBackstage, initialData) => {
14412
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
14442
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
14413
14443
  const icons = providersBackstage.icons();
14414
14444
  const getIcon = icon => {
14415
14445
  var _a;
@@ -14763,7 +14793,7 @@
14763
14793
  ]),
14764
14794
  selectOnFocus: false
14765
14795
  });
14766
- const pLabel = spec.label.map(label => renderLabel$3(label, sharedBackstage.providers));
14796
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), sharedBackstage.providers));
14767
14797
  const emitSwatchChange = (colorBit, value) => {
14768
14798
  emitWith(colorBit, colorSwatchChangeEvent, { value });
14769
14799
  };
@@ -16437,7 +16467,7 @@
16437
16467
  ]
16438
16468
  }]
16439
16469
  });
16440
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
16470
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
16441
16471
  const pField = FormField.parts.field({ factory: { sketch: renderField } });
16442
16472
  return renderFormFieldWith(pLabel, pField, ['tox-form__group--stretched'], []);
16443
16473
  };
@@ -16658,7 +16688,7 @@
16658
16688
  ...spec.sandboxed ? { sandbox: 'allow-scripts allow-same-origin' } : {}
16659
16689
  };
16660
16690
  const sourcing = getDynamicSource(initialData, spec.streamContent);
16661
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
16691
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
16662
16692
  const factory = newSpec => craft(Optional.from(containerBorderedClass), {
16663
16693
  uid: newSpec.uid,
16664
16694
  dom: {
@@ -16819,6 +16849,34 @@
16819
16849
  },
16820
16850
  components: [text$2(backstageShared.providers.translate(spec.label))]
16821
16851
  };
16852
+ if (!spec.tooltip || spec.tooltip.getOr('') === '') {
16853
+ return label;
16854
+ }
16855
+ const makeIcon = iconName => render$3(iconName, {
16856
+ tag: 'span',
16857
+ classes: [
16858
+ 'tox-icon',
16859
+ 'tox-label-tooltip-icon'
16860
+ ]
16861
+ }, backstageShared.providers.icons);
16862
+ const labelTooltip = {
16863
+ dom: {
16864
+ tag: 'div',
16865
+ classes: ['tox-label-tooltip']
16866
+ },
16867
+ components: [makeIcon('tooltip')],
16868
+ behaviours: derive$1([Tooltipping.config(backstageShared.providers.tooltips.getConfig({ tooltipText: backstageShared.providers.translate(spec.tooltip.getOr('')) }))])
16869
+ };
16870
+ const labelContainer = {
16871
+ dom: {
16872
+ tag: 'div',
16873
+ classes: ['tox-form__label-container']
16874
+ },
16875
+ components: [
16876
+ label,
16877
+ labelTooltip
16878
+ ]
16879
+ };
16822
16880
  const comps = map$2(spec.items, backstageShared.interpreter);
16823
16881
  return {
16824
16882
  dom: {
@@ -16826,7 +16884,7 @@
16826
16884
  classes: ['tox-form__group']
16827
16885
  },
16828
16886
  components: [
16829
- label,
16887
+ labelContainer,
16830
16888
  ...comps
16831
16889
  ],
16832
16890
  behaviours: derive$1([
@@ -17150,7 +17208,7 @@
17150
17208
  const renderListBox = (spec, backstage, initialData) => {
17151
17209
  const providersBackstage = backstage.shared.providers;
17152
17210
  const initialItem = initialData.bind(value => findItemByValue(spec.items, value)).orThunk(() => head(spec.items).filter(isSingleListItem));
17153
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
17211
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
17154
17212
  const pField = FormField.parts.field({
17155
17213
  dom: {},
17156
17214
  factory: {
@@ -17281,7 +17339,7 @@
17281
17339
  text: providersBackstage.translate(item.text),
17282
17340
  value: item.value
17283
17341
  }));
17284
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
17342
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
17285
17343
  const pField = FormField.parts.field({
17286
17344
  dom: {},
17287
17345
  ...initialData.map(data => ({ data })).getOr({}),
@@ -17735,7 +17793,7 @@
17735
17793
  };
17736
17794
 
17737
17795
  const renderTextField = (spec, providersBackstage) => {
17738
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
17796
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
17739
17797
  const baseInputBehaviours = [
17740
17798
  Disabling.config({ disabled: () => spec.disabled || providersBackstage.isDisabled() }),
17741
17799
  receivingConfig(),
@@ -17817,6 +17875,7 @@
17817
17875
  name: spec.name,
17818
17876
  multiline: false,
17819
17877
  label: spec.label,
17878
+ tooltip: spec.tooltip,
17820
17879
  inputMode: spec.inputMode,
17821
17880
  placeholder: spec.placeholder,
17822
17881
  flex: false,
@@ -17830,6 +17889,7 @@
17830
17889
  name: spec.name,
17831
17890
  multiline: true,
17832
17891
  label: spec.label,
17892
+ tooltip: spec.tooltip,
17833
17893
  inputMode: Optional.none(),
17834
17894
  placeholder: spec.placeholder,
17835
17895
  flex: true,
@@ -19292,7 +19352,7 @@
19292
19352
  ...typeaheadSpec,
19293
19353
  factory: Typeahead
19294
19354
  });
19295
- const pLabel = spec.label.map(label => renderLabel$3(label, providersBackstage));
19355
+ const pLabel = spec.label.map(label => renderLabel$3(label, spec.tooltip.getOr(''), providersBackstage));
19296
19356
  const makeIcon = (name, errId, icon = name, label = name) => render$3(icon, {
19297
19357
  tag: 'div',
19298
19358
  classes: [
@@ -28775,7 +28835,10 @@
28775
28835
  type,
28776
28836
  name$1
28777
28837
  ];
28778
- const formComponentWithLabelFields = formComponentFields.concat([optionalLabel]);
28838
+ const formComponentWithLabelFields = formComponentFields.concat([
28839
+ optionalLabel,
28840
+ optionalTooltip
28841
+ ]);
28779
28842
 
28780
28843
  const checkboxFields = formComponentFields.concat([
28781
28844
  label,
@@ -28868,7 +28931,8 @@
28868
28931
  'start',
28869
28932
  'center',
28870
28933
  'end'
28871
- ])
28934
+ ]),
28935
+ optionalTooltip
28872
28936
  ];
28873
28937
 
28874
28938
  const listBoxSingleItemFields = [