@svgrid/enterprise 3.1.53 → 3.1.54
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/SvGridScheduler.svelte +21 -13
- package/dist/cdn/svgrid-enterprise.svelte-external.js +469 -468
- package/dist/designer/assets/{index-DV6s9i9V.js → index-B-FEnc0k.js} +420 -420
- package/dist/designer/assets/index-CokM34Zw.css +1 -0
- package/dist/designer/index.html +2 -2
- package/dist/fields/AttachmentCell.svelte +3 -2
- package/dist/fields/SvBaseAutomations.svelte +1 -1
- package/dist/fields/index.d.ts +1 -0
- package/dist/fields/index.js +1 -1
- package/dist/fields/messages/viewbar.d.ts +6 -0
- package/dist/fields/messages/viewbar.js +1 -1
- package/dist/fields/messages.svelte.d.ts +6 -0
- package/dist/fields/record-series.svelte.d.ts +50 -0
- package/dist/fields/record-series.svelte.js +1 -0
- package/dist/fields/view-model.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/node/studio.js +1 -1
- package/dist/scheduler-config.d.ts +45 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wc/scheduler-DUWXlkQa.js +160 -0
- package/dist/wc/sv-base-element.js +90 -90
- package/package.json +1 -1
- package/dist/designer/assets/index-DY182YW4.css +0 -1
- package/dist/wc/scheduler-B0UPSWNJ.js +0 -159
package/dist/node/studio.js
CHANGED
|
@@ -913,7 +913,7 @@ ${E}
|
|
|
913
913
|
@keyframes st-home-spin { to { transform: rotate(360deg); } }
|
|
914
914
|
</style>
|
|
915
915
|
`}}function Ka(e){for(const r of e)je(r);const t=new Map(e.map(r=>[r.name,r])),a=e.map(r=>{const o=Eu(r,t);return{schema:Fu(r,o),infos:o}});return{entries:a,seed:Du(a)}}function fo(e,t={}){const{entries:a,seed:r}=Ka(e),{file:o,needs:n}=em(a,r,t.sources,t.supabaseConn,t.serverMemory),i=[Lu(a),o];(n.supabase||t.supabaseAuth)&&!n.supabaseUrl&&(t.supabaseConn?.url||t.supabaseConn?.key)&&(n.supabaseUrl=t.supabaseConn.url,n.supabaseKey=t.supabaseConn.key),(n.supabase||t.supabaseAuth)&&i.push(tm(n));for(const s of n.sqlRoutes)i.push(Hu(s.schema,s.table,s.dialect,{access:t.accessEnabled,audit:t.auditEnabled,screenIds:t.screensByEntity?.get(s.schema.name)??[],triggers:t.triggers?.[s.schema.name],dbSchema:s.dbSchema,tenantField:t.tenantField&&t.tenantScoped?.(s.schema.name)!==!1?t.tenantField:void 0}));if(n.memoryRoutes.length){i.push(Gu(n.memoryRoutes));for(const s of n.memoryRoutes)i.push(Vu(s.schema,{access:t.accessEnabled,audit:t.auditEnabled,screenIds:t.screensByEntity?.get(s.schema.name)??[],triggers:t.triggers?.[s.schema.name],tenantField:t.tenantField&&t.tenantScoped?.(s.schema.name)!==!1?t.tenantField:void 0}))}return{files:i,prepared:a.map(s=>s.schema)}}function am(e){if(e.length===0)throw new Error("emitStudioApp: no schemas to emit");const{files:t,prepared:a}=fo(e),r=a.map(n=>{const i=z(n);return{href:`/${i.route}`,label:i.label}}),o={path:"src/custom.css",description:"Your custom styles (imported after app.css so it overrides).",userOwned:!0,contents:`/* Your custom styles. Imported after app.css, so these rules override the defaults. */
|
|
916
|
-
`};return[...t,...a.map(n=>Ni(n)),Mi(r),ji(r),o]}function rm(e){return e.fields.some(t=>!!t.when&&(!!t.when.visible||!!t.when.disabled||!!t.when.required))}var om="3.1.
|
|
916
|
+
`};return[...t,...a.map(n=>Ni(n)),Mi(r),ji(r),o]}function rm(e){return e.fields.some(t=>!!t.when&&(!!t.when.visible||!!t.when.disabled||!!t.when.required))}var om="3.1.54",nm="3.0.37",V=(e,t)=>e.some(a=>a.config.kind===t),qi=e=>`activeTab_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,aa=(e,t)=>`${e}-${t}`,zi=e=>`accOpen_${e.replace(/[^a-zA-Z0-9_$]/g,"_")}`,ra=(e,t)=>`${e}-s${t}`,oa=e=>`md_${e.replace(/[^a-zA-Z0-9]/g,"_")}_rows`;function im(e){switch(e.type){case"number":{const t=e.decimals;return t!=null?`{ type: 'number', options: { minimumFractionDigits: ${t}, maximumFractionDigits: ${t} } }`:"{ type: 'number' }"}case"currency":return`{ type: 'currency', currency: ${S(e.currency||"USD")} }`;case"percent":{const t=["type: 'percent'"];return e.valueIsPercentPoints&&t.push("valueIsPercentPoints: true"),e.decimals!=null&&t.push(`options: { minimumFractionDigits: ${e.decimals}, maximumFractionDigits: ${e.decimals} }`),`{ ${t.join(", ")} }`}case"date":case"datetime":return e.pattern?`{ type: '${e.type}', pattern: ${S(e.pattern)} }`:`{ type: '${e.type}' }`}}function sm(e,t,a,r){if(t.config.kind!=="grid")return`schemaToColumns(${e})`;const o=t.config,n=t.id.replace(/-/g,"_"),i=o.columns.filter(b=>b.show),s=new Set(i.map(b=>b.field)),d=new Set,l=i.map(b=>{const y=r?.get(b.field);return{c:b,col:y&&!s.has(y)?y:b.field}}).filter(b=>!d.has(b.col)&&!!d.add(b.col)),c=o.editing==="inline"?"":", editable: false";if(l.length===0)return c?`schemaToColumns(${e}).map((c) => ({ ...c${c} }))`:`schemaToColumns(${e})`;const p=l.map(b=>`'${b.col}'`),u=l.map(({c:b,col:y})=>{const w=[];return b.header&&w.push(`header: ${JSON.stringify(b.header)}`),b.width!=null&&w.push(`width: ${b.width}`),b.align&&w.push(`align: '${b.align}'`),b.aggregate&&w.push(`aggregate: '${b.aggregate}'`),o.treeData&&b.field===o.treeData.labelField&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(treeCell_${n}, { value: ctx.getValue(), row: ctx.row.original })`):b.cellType&&a?w.push(`cell: (ctx: CellContext<${a}>) => renderSnippet(${Gi(n,b.field)}, { value: ctx.getValue() })`):b.format&&w.push(`format: ${im(b.format)}`),w.length?`'${y}': { ${w.join(", ")} }`:null}).filter(b=>!!b),m=u.length?` const ov: Record<string, Partial<(typeof all)[number]>> = { ${u.join(", ")} };`:"",g=u.length?", ...(ov[String(c.field)] ?? {})":"",h=`[${p.join(", ")}].map((f) => all.find((c) => c.field === f)).filter((c): c is (typeof all)[number] => !!c)`;return`(() => { const all = schemaToColumns(${e});${m} return ${c||g?`${h}.map((c) => ({ ...c${c}${g} }))`:h} })()`}function Ae(e,t){const a=[`grid-column: span ${ei(e)}`,"min-width: 0"];t&&a.push(t);const r=ti(e.style);return r&&a.push(r),`style="${a.join("; ")}"`}var lm=e=>e&&e.replace(/[^#a-zA-Z0-9(),.%\s_-]/g,"").slice(0,40)||"var(--sg-accent)";function Ue(e,t){const a=[t,Xn(e)].filter(Boolean).join(" ");return a?` class="${a}"`:""}function Ha(e){const t=Ta(e.className);return t?` ${t}`:""}function dm(e){const t=Fe(e);if(t==="grid"){const a=ui(e),r=a.maxWidth?` max-width: ${a.maxWidth}px; margin-inline: auto;`:"";return` .st-screen { grid-template-columns: repeat(12, 1fr); gap: ${a.rowGap}px ${a.colGap}px; align-items: ${a.align};${r} }
|
|
917
917
|
@media (max-width: ${a.mobileBreakpoint}px) { .st-screen { grid-template-columns: 1fr; gap: 12px; } }
|
|
918
918
|
`}if(t==="stack"){const a=mi(e),r=a.maxWidth?` max-width: ${a.maxWidth}px;${a.align==="center"?" margin-inline: auto;":""}`:"",o=a.minHeight?`
|
|
919
919
|
.st-stack > * { min-height: ${a.minHeight}px; }`:"",n=a.dividers?`
|
|
@@ -17,6 +17,43 @@ import type { SchedulerAssignment } from './scheduler-assignments.js';
|
|
|
17
17
|
import type { ColumnReducer } from './scheduler-summary.js';
|
|
18
18
|
import type { ZoomLevel } from './scheduler-axis.js';
|
|
19
19
|
import type { SchedulerResourceGroup } from './scheduler-resource-tree.js';
|
|
20
|
+
/** An upcoming occurrence of a repeating row: which row, which occurrence (its day, 'YYYY-MM-DD'), and the row's values for it. */
|
|
21
|
+
export type SchedulerUpcomingOccurrence = {
|
|
22
|
+
rowId: string;
|
|
23
|
+
day: string;
|
|
24
|
+
values: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
/** What a move or a delete of an occurrence applies to. */
|
|
27
|
+
export type SchedulerUpcomingScope = 'occurrence' | 'following' | 'series';
|
|
28
|
+
/** Where an occurrence was put down: real instants, as `onEventMove` reports a row's move. */
|
|
29
|
+
export type SchedulerUpcomingMove<TData> = {
|
|
30
|
+
row: TData;
|
|
31
|
+
start: Date;
|
|
32
|
+
end: Date;
|
|
33
|
+
allDay: boolean;
|
|
34
|
+
fromResource?: string;
|
|
35
|
+
toResource?: string;
|
|
36
|
+
};
|
|
37
|
+
export type SchedulerUpcoming<TData> = {
|
|
38
|
+
/** Read only while this says so (read again when it changes). Default: always. */
|
|
39
|
+
enabled?: () => boolean;
|
|
40
|
+
/** Read again whenever this changes (a reactive counter). */
|
|
41
|
+
epoch?: () => number;
|
|
42
|
+
/** The id an occurrence's `rowId` names (default: the grid's `getRowId`). */
|
|
43
|
+
idOf?: (row: TData) => string;
|
|
44
|
+
/** The occurrences whose dates fall in [from, to]. Only the latest answer is kept; a failed one draws none. */
|
|
45
|
+
load(from: Date, to: Date): Promise<ReadonlyArray<SchedulerUpcomingOccurrence>> | ReadonlyArray<SchedulerUpcomingOccurrence>;
|
|
46
|
+
/** Clicked, or Enter on it. `row` is the repeating row. */
|
|
47
|
+
open(occurrence: SchedulerUpcomingOccurrence, row: TData): void;
|
|
48
|
+
/** Dropped elsewhere (or resized), after the scope is chosen. Without it, occurrences do not move. */
|
|
49
|
+
move?(occurrence: SchedulerUpcomingOccurrence, scope: SchedulerUpcomingScope, at: SchedulerUpcomingMove<TData>): void | Promise<void>;
|
|
50
|
+
/** Whether this repeating row's occurrences may move (asked before the scope). */
|
|
51
|
+
canMove?(row: TData): boolean;
|
|
52
|
+
/** Deleted, after the scope is chosen. Without it, occurrences are not deleted. */
|
|
53
|
+
remove?(occurrence: SchedulerUpcomingOccurrence, scope: SchedulerUpcomingScope): void | Promise<void>;
|
|
54
|
+
/** How long after the rows change to read again, in ms (default 250). */
|
|
55
|
+
debounce?: number;
|
|
56
|
+
};
|
|
20
57
|
export type SchedulerProConfig<TFeatures extends TableFeatures = TableFeatures, TData extends RowData = RowData> = SchedulerConfig<TFeatures, TData> & {
|
|
21
58
|
/**
|
|
22
59
|
* The resource a row belongs to, worked out from the row rather than read
|
|
@@ -130,6 +167,14 @@ export type SchedulerProConfig<TFeatures extends TableFeatures = TableFeatures,
|
|
|
130
167
|
* times alone, which makes whatever that handler makes (often a blank event).
|
|
131
168
|
*/
|
|
132
169
|
onEventDuplicate?: (source: TData, start: Date, end: Date, resourceId?: string, allDay?: boolean) => void;
|
|
170
|
+
/**
|
|
171
|
+
* Upcoming occurrences of repeating rows that are not rows of their own: the
|
|
172
|
+
* app reads them for the dates on screen, and they are drawn lighter beside
|
|
173
|
+
* the rows (only those of rows the calendar shows). Opening one, moving it
|
|
174
|
+
* or deleting it goes to the app, after "This event / This and following /
|
|
175
|
+
* All events" for a move or a delete.
|
|
176
|
+
*/
|
|
177
|
+
upcoming?: SchedulerUpcoming<TData>;
|
|
133
178
|
/**
|
|
134
179
|
* `false`: events move but keep their length - no edge grips. For records
|
|
135
180
|
* with one date (a start or a due date) there is no end to change.
|
package/dist/version.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* `version.test.ts` asserts this matches `package.json`, so the two cannot drift.
|
|
12
12
|
*/
|
|
13
|
-
export declare const SVGRID_VERSION = "3.1.
|
|
13
|
+
export declare const SVGRID_VERSION = "3.1.54";
|
|
14
14
|
/**
|
|
15
15
|
* The version of `@svgrid/grid`, which releases on its own line: enterprise is
|
|
16
16
|
* on 3.1.x while the grid is on 3.0.x.
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SVGRID_VERSION="3.1.
|
|
1
|
+
export const SVGRID_VERSION="3.1.54",GRID_VERSION="3.0.37";
|