@svgrid/enterprise 3.1.44 → 3.1.46
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/cdn/svgrid-enterprise.svelte-external.js +1 -1
- package/dist/designer/assets/{index-CltOvNJn.js → index-BBI_8Aky.js} +214 -214
- package/dist/designer/index.html +1 -1
- package/dist/fields/BaseTableView.svelte +3 -2
- package/dist/fields/BaseTabs.svelte +26 -6
- package/dist/fields/FieldEditor.svelte +1 -1
- package/dist/fields/FieldEditor.svelte.d.ts +3 -0
- package/dist/fields/FieldsHeaderEnd.svelte +1 -1
- package/dist/fields/FormulaInput.svelte +122 -0
- package/dist/fields/FormulaInput.svelte.d.ts +10 -0
- package/dist/fields/FormulaInputHarness.svelte +5 -0
- package/dist/fields/FormulaInputHarness.svelte.d.ts +11 -0
- package/dist/fields/NumberEditor.svelte +1 -1
- package/dist/fields/PasteFields.svelte +33 -0
- package/dist/fields/PasteFields.svelte.d.ts +6 -0
- package/dist/fields/PropertyInput.svelte +4 -8
- package/dist/fields/SvBase.svelte +1 -1
- package/dist/fields/SvBase.svelte.d.ts +7 -0
- package/dist/fields/SvBaseViewBar.svelte +2 -2
- package/dist/fields/barcode-scan.d.ts +15 -4
- package/dist/fields/barcode-scan.js +1 -1
- package/dist/fields/base-import.js +2 -2
- package/dist/fields/celebrate.d.ts +29 -0
- package/dist/fields/celebrate.js +1 -0
- package/dist/fields/cell-colors.svelte.d.ts +17 -0
- package/dist/fields/cell-colors.svelte.js +1 -0
- package/dist/fields/editor-request.svelte.d.ts +7 -0
- package/dist/fields/excel-habits.svelte.d.ts +98 -0
- package/dist/fields/excel-habits.svelte.js +1 -0
- package/dist/fields/formula-docs.d.ts +24 -0
- package/dist/fields/formula-docs.js +1 -0
- package/dist/fields/index.d.ts +2 -0
- package/dist/fields/index.js +1 -1
- package/dist/fields/messages/fields.d.ts +28 -0
- package/dist/fields/messages/fields.js +1 -1
- package/dist/fields/messages/record.d.ts +1 -0
- package/dist/fields/messages/record.js +1 -1
- package/dist/fields/messages/shell.d.ts +24 -0
- package/dist/fields/messages/shell.js +1 -1
- package/dist/fields/messages/viewbar.d.ts +9 -0
- package/dist/fields/messages/viewbar.js +1 -1
- package/dist/fields/messages.svelte.d.ts +62 -0
- package/dist/fields/view-model.d.ts +3 -0
- package/dist/fields/view-model.js +1 -1
- package/dist/fields/viewbar/ColorPanel.svelte +54 -2
- package/dist/fields/viewbar/ColorPanel.svelte.d.ts +3 -0
- package/dist/node/studio.js +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/dist/wc/sv-base-element.js +101 -96
- package/dist/wc/sv-sheet-element.js +43 -43
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import OptionsEditor from"./OptionsEditor.svelte";import{
|
|
2
|
+
import OptionsEditor from"./OptionsEditor.svelte";import{columnResolver,formulaError}from"./formula";import FormulaInput from"./FormulaInput.svelte";import{aiPromptError}from"./ai-prompt";import{getFieldUsers}from"./sources.svelte";import{bm}from"./messages.svelte";let{def,value,fieldType,ctx,onChange}=$props();const id=$derived(`sv-fed-${def.key}`);const choices=$derived(def.kind==="choice"?typeof def.choices==="function"?def.choices(ctx):def.choices:[]);const names=$derived(ctx.columns.map(c=>String(c.header??c.field??"")).filter(Boolean));const formulaMessage=$derived(!String(value??"").trim()?null:def.kind==="formula"?formulaError(String(value),columnResolver(ctx.columns,ctx.self)):def.kind==="prompt"?aiPromptError(String(value),ctx.columns,ctx.self):null);const areaPlaceholder=$derived(def.kind==="prompt"?def.placeholder??"":bm("fields.formulaPlaceholder"));const selectOptions=$derived((ctx.props.options??[]).map(o=>String(o.value)).filter(Boolean));let formulaEl=$state(null);const inputValue=e=>e.currentTarget.value;const checkedOf=e=>e.currentTarget.checked;const numberOf=e=>{const raw=inputValue(e);return raw===""?void 0:Number(raw)};function insertField(name){const token=`{${name}}`;const el=formulaEl;const text=String(value??"");if(!el)return onChange(text+token);const at=el.selectionStart??text.length;onChange(text.slice(0,at)+token+text.slice(el.selectionEnd??at));queueMicrotask(()=>{el.focus();el.setSelectionRange(at+token.length,at+token.length)})}const toggleIn=(list,v)=>{const arr=Array.isArray(list)?list:[];return arr.includes(v)?arr.filter(x=>x!==v):[...arr,v]};
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
{#if def.kind === 'checkbox'}
|
|
@@ -70,7 +70,9 @@ import OptionsEditor from"./OptionsEditor.svelte";import{FORMULA_FUNCTIONS,colum
|
|
|
70
70
|
{:else}
|
|
71
71
|
<input {id} class="sv-pi-input" placeholder={bm('fields.empty')} value={String(value ?? '')} oninput={(e) => onChange(inputValue(e) || undefined)} />
|
|
72
72
|
{/if}
|
|
73
|
-
{:else if def.kind === 'formula'
|
|
73
|
+
{:else if def.kind === 'formula'}
|
|
74
|
+
<FormulaInput {id} {value} {ctx} {onChange} />
|
|
75
|
+
{:else if def.kind === 'prompt'}
|
|
74
76
|
<textarea
|
|
75
77
|
{id}
|
|
76
78
|
bind:this={formulaEl}
|
|
@@ -87,12 +89,6 @@ import OptionsEditor from"./OptionsEditor.svelte";import{FORMULA_FUNCTIONS,colum
|
|
|
87
89
|
<div class="sv-pi-fields" aria-label={bm('fields.insertField')}>
|
|
88
90
|
{#each names as n (n)}<button type="button" onclick={() => insertField(n)}>{n}</button>{/each}
|
|
89
91
|
</div>
|
|
90
|
-
{#if def.kind === 'formula'}
|
|
91
|
-
<button type="button" class="sv-pi-more" aria-expanded={showFunctions} onclick={() => (showFunctions = !showFunctions)}>
|
|
92
|
-
{showFunctions ? bm('fields.hideFunctions') : bm('fields.functions')}
|
|
93
|
-
</button>
|
|
94
|
-
{#if showFunctions}<p class="sv-pi-functions">{FORMULA_FUNCTIONS.join(', ')}</p>{/if}
|
|
95
|
-
{/if}
|
|
96
92
|
{:else if def.kind === 'columns'}
|
|
97
93
|
<div {id} class="sv-pi-chips">
|
|
98
94
|
{#each ctx.columns as c (String(c.id ?? c.field))}
|