@shwfed/config 2.3.19 → 2.3.20
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/module.json +1 -1
- package/dist/preview/assets/{config-BfiDa6j3.js → config-BvTObql_.js} +1 -1
- package/dist/preview/assets/{config-BmzbCaL9.js → config-BxK2md1E.js} +1 -1
- package/dist/preview/assets/{config-CI4d63Pa.js → config-C1OAS71Y.js} +1 -1
- package/dist/preview/assets/{config-RIqYuUkC.js → config-DRcqCBNE.js} +1 -1
- package/dist/preview/assets/{config-BQDXm2N4.js → config-DWBLNB9W.js} +1 -1
- package/dist/preview/assets/{config-CrffMahT.js → config-DYoY63Mh.js} +1 -1
- package/dist/preview/assets/{config-BZrnB31E.js → config-DqfJ6g2l.js} +1 -1
- package/dist/preview/assets/{config-BERbwRqR.js → config-DzmdQg_R.js} +1 -1
- package/dist/preview/assets/{config-B8qIrXw4.js → config-RpiYusco.js} +1 -1
- package/dist/preview/assets/{definition.vue_vue_type_script_setup_true_lang-DP6_YUR7.js → definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js} +1 -1
- package/dist/preview/assets/{index-X6To2gmZ.js → index--tX2oFUp.js} +83 -83
- package/dist/preview/assets/index-De3_lDfy.js +1 -0
- package/dist/preview/assets/{runtime-CpsOFZJU.js → runtime-BkoWPDvV.js} +1 -1
- package/dist/preview/assets/{runtime-BQsuM5NY.js → runtime-Cr5yIEMV.js} +1 -1
- package/dist/preview/assets/{runtime-CQPoA4Wr.js → runtime-DOg6e_3A.js} +1 -1
- package/dist/preview/assets/{runtime-DY65pO8M.js → runtime-DTh936s0.js} +1 -1
- package/dist/preview/assets/{runtime-DLe-_bzP.js → runtime-Hiqp76SC.js} +1 -1
- package/dist/preview/assets/{runtime-pkc99x6z.js → runtime-_Z4Jlev8.js} +1 -1
- package/dist/preview/assets/{runtime-ZprvETkX.js → runtime-_bbVL50J.js} +1 -1
- package/dist/preview/assets/{runtime-CKWbV48T.js → runtime-euPIe4uC.js} +1 -1
- package/dist/preview/assets/runtime-m4H1rd-d.js +1 -0
- package/dist/preview/index.html +1 -1
- package/dist/runtime/components/actions/buttons/2026-05-24/com.shwfed.actions.button.state.write/runtime.vue +2 -1
- package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +1 -1
- package/dist/runtime/components/form/utils/state.d.ts +25 -1
- package/dist/runtime/components/form/utils/state.js +4 -1
- package/dist/runtime/components/table/row-provider.vue +1 -1
- package/package.json +1 -1
- package/dist/preview/assets/index-CT6yD2gM.js +0 -1
- package/dist/preview/assets/runtime-DyCSllvl.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aK as e}from"./index--tX2oFUp.js";import{aL as r,aM as s,aN as t}from"./index--tX2oFUp.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as u,ae as l,e as i,u as p,$ as m,o as d,k as f,ag as _,ah as k,ak as g,al as w,am as x}from"./index
|
|
1
|
+
import{d as u,ae as l,e as i,u as p,$ as m,o as d,k as f,ag as _,ah as k,ak as g,al as w,am as x}from"./index--tX2oFUp.js";const B=u({name:"ShwfedMarkdownItemRuntime",__name:"runtime",props:{config:{}},setup(n){const s=n,{locale:o}=l(),t=x(),c=(e,a)=>g(e,{...w(t),...a}),r=m(()=>{const e=_(s.config.content,o.value)??"";return k(e,c)});return(e,a)=>(d(),i(p(f),{"data-slot":"buttons-markdown",source:r.value,class:"prose prose-sm prose-zinc px-1"},null,8,["source"]))}});export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f,ae as u,af as l,ag as g,ah as m,ai as p,aj as d,e as x,u as E,ak as _,al as h,am as k,an as w,o as C}from"./index
|
|
1
|
+
import{d as f,ae as u,af as l,ag as g,ah as m,ai as p,aj as d,e as x,u as E,ak as _,al as h,am as k,an as w,o as C}from"./index--tX2oFUp.js";import{_ as I}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const R=f({name:"ShwfedHttpRequestConfirmActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(s){const n=s,{locale:c}=u(),a=k(),t=(e,o)=>_(e,{...h(a),...o}),i=w(),r=l(function*(){const e=g(n.config.markdown,c.value)??"",o=m(e,t);(yield*p({content:o,icon:n.config.icon,color:n.config.color}))||(yield*d(n.config.expression,t,{messageExpression:n.config.messageExpression,resultExpression:n.config.resultExpression,channel:i,triggers:{success:n.config.onSuccess,warning:n.config.onWarning,error:n.config.onError,info:n.config.onInfo}}))});return(e,o)=>(C(),x(I,{"action-id":s.buttonId,effect:E(r)},null,8,["action-id","effect"]))}});export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";import{d as n,e as a,u as c,o as f,ap as i}from"./index--tX2oFUp.js";const p=n({name:"ShwfedPrototypeActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=i;return(r,s)=>(f(),a(o,{"action-id":e.buttonId,effect:c(t)},null,8,["action-id","effect"]))}});export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{_ as o}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";import{d as s,ao as c,aA as i,e as r,u as f,an as u,o as m}from"./index--tX2oFUp.js";const g=s({name:"ShwfedEventDispatchActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const n=e,t=u(),a=c(()=>i(t,n.config.triggers));return(p,d)=>(m(),r(o,{"action-id":e.buttonId,effect:f(a)},null,8,["action-id","effect"]))}});export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,ao as B,af as E,ar as r,aA as m,aB as S,aC as j,e as k,u as v,ak as x,al as C,an as L,am as b,o as R}from"./index
|
|
1
|
+
import{d as _,ao as B,af as E,ar as r,aA as m,aB as S,aC as j,e as k,u as v,ak as x,al as C,an as L,am as b,o as R}from"./index--tX2oFUp.js";import{_ as T}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const O=_({name:"ShwfedHttpDownloadActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(d){const c=d,g=b(),t=(e,n)=>x(e,{...C(g),...n}),l=L(),p=new Set(["success","error","warning","info"]);function f(e){const n=URL.createObjectURL(e),o=document.createElement("a");o.href=n,o.download=e.name,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(n)}const y=B(()=>E(function*(){const{template:e,messageExpression:n,resultExpression:o}=c.config,u=yield*t(e.request);if(!e.download){const s=yield*u.file();return yield*r(()=>f(s)),yield*m(l,c.config.onSuccess)}const a={json:yield*u.json()},i=o===void 0?"success":yield*S(t(o,a),s=>p.has(s)?s:"success");if(n!==void 0){const s=yield*t(n,a);yield*r(()=>j[i](s))}if(i==="success"||i==="info"){const h=yield*(yield*t(e.download,a)).file();yield*r(()=>f(h))}const w={success:c.config.onSuccess,warning:c.config.onWarning,error:c.config.onError,info:c.config.onInfo};return yield*m(l,w[i])}));return(e,n)=>(R(),k(T,{"action-id":d.buttonId,effect:v(y)},null,8,["action-id","effect"]))}});export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s,ae as B,as as E,af as _,ag as i,at as x,au as p,e as M,w as c,u as d,a0 as N,an as b,ar as k,o as w,f as L,av as T,g as u,aw as I,ax as z,a7 as H,am as S,ay as V,az as $}from"./index
|
|
1
|
+
import{d as s,ae as B,as as E,af as _,ag as i,at as x,au as p,e as M,w as c,u as d,a0 as N,an as b,ar as k,o as w,f as L,av as T,g as u,aw as I,ax as z,a7 as H,am as S,ay as V,az as $}from"./index--tX2oFUp.js";import{_ as A}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const K=s({name:"ShwfedModalLayoutActionRuntime",__name:"runtime",props:{buttonId:{},config:{},buttonTitle:{}},setup(t){const a=t,{locale:l}=B(),f=e=>{},r=S(),m=b(),o=N(null),v=E(a.buttonId,{close:()=>k(()=>{o.value?.()})},m),g=s({name:"ModalBoundaryBridge",setup(e,{slots:n}){return z(r),V($,v),()=>n.default?.()}}),h=(e,n)=>H()?.(e,n),C=_(function*(){const e=i(a.config.modalTitle,l.value)??i(a.buttonTitle,l.value)??"",{modal:n,close:y}=yield*x({title:e,width:a.config.modalWidth});o.value=()=>p(y()),yield*n,o.value=null});return(e,n)=>(w(),M(A,{"action-id":t.buttonId,effect:d(C)},{default:c(()=>[L("div",{style:T(t.config.modalMinHeight?`min-height: ${t.config.modalMinHeight}`:void 0)},[u(d(g),null,{default:c(()=>[u(I,{"slot-value":t.config.slot,configure:f,"find-entry":h},null,8,["slot-value"])]),_:1})],4)]),_:1},8,["action-id","effect"]))}});export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as i,ao as f,aq as r,ar as d,e as m,u,ak as l,al as p,am as _,o as g}from"./index
|
|
1
|
+
import{d as i,ao as f,aq as r,ar as d,e as m,u,ak as l,al as p,am as _,o as g}from"./index--tX2oFUp.js";import{_ as h}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const x=i({name:"ShwfedNavigationActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(e){const t=e,o=_(),c=(n,a)=>l(n,{...p(o),...a}),s=f(()=>r(c(t.config.url),n=>d(()=>{window.open(n,t.config.mode)})));return(n,a)=>(g(),m(h,{"action-id":e.buttonId,effect:u(s)},null,8,["action-id","effect"]))}});export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as r,ao as f,aj as u,e as p,u as g,ak as m,al as l,am as d,an as x,o as E}from"./index
|
|
1
|
+
import{d as r,ao as f,aj as u,e as p,u as g,ak as m,al as l,am as d,an as x,o as E}from"./index--tX2oFUp.js";import{_}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const k=r({name:"ShwfedHttpRequestActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(n){const e=n,t=d(),c=(s,o)=>m(s,{...l(t),...o}),i=x(),a=f(()=>u(e.config.expression,c,{messageExpression:e.config.messageExpression,resultExpression:e.config.resultExpression,channel:i,triggers:{success:e.config.onSuccess,warning:e.config.onWarning,error:e.config.onError,info:e.config.onInfo}}));return(s,o)=>(E(),p(_,{"action-id":n.buttonId,effect:g(a)},null,8,["action-id","effect"]))}});export{k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as l,aD as A,ao as g,aq as y,aA as _,e as h,u as S,ak as b,al as k,an as j,aE as C,o as B,am as E}from"./index--tX2oFUp.js";import{_ as O}from"./definition.vue_vue_type_script_setup_true_lang-C1rBrqyI.js";const F=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(r){const s=r,i=E(),f=(e,t)=>b(e,{...k(i),...t}),n=A(),o=n.kind==="form"&&n.parent?n.parent:n,u=j(),m=C((e,t,a)=>{if(Array.isArray(e[t])&&Array.isArray(a))return e[t]=a,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function p(e,t){return c(e)&&c(t)?m({...t},e):t}const d=g(()=>y(f(s.config.expression),e=>{for(const t of Object.keys(e)){const a=p(o.getAt(t),e[t]);o.setAt(t,a)}return _(u,s.config.onSuccess)}));return(e,t)=>(B(),h(O,{"action-id":r.buttonId,effect:S(d)},null,8,["action-id","effect"]))}});export{F as default};
|
package/dist/preview/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
`--primary`, the primary button variant renders as transparent. */
|
|
11
11
|
body { --primary: #009689; }
|
|
12
12
|
</style>
|
|
13
|
-
<script type="module" crossorigin src="./assets/index
|
|
13
|
+
<script type="module" crossorigin src="./assets/index--tX2oFUp.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="./assets/index-DomLsyPH.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -13,7 +13,8 @@ const props = defineProps({
|
|
|
13
13
|
});
|
|
14
14
|
const inherited = injectCELContext();
|
|
15
15
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
16
|
-
const
|
|
16
|
+
const nearestFormState = useFormState();
|
|
17
|
+
const formState = nearestFormState.kind === "form" && nearestFormState.parent ? nearestFormState.parent : nearestFormState;
|
|
17
18
|
const channel = useEventChannel();
|
|
18
19
|
const mergeObjects = createDefu((obj, key, value) => {
|
|
19
20
|
if (Array.isArray(obj[key]) && Array.isArray(value)) {
|
|
@@ -11,7 +11,7 @@ const props = defineProps({
|
|
|
11
11
|
unit: { type: Object, required: true },
|
|
12
12
|
index: { type: Number, required: true }
|
|
13
13
|
});
|
|
14
|
-
const formState = provideFormState(state);
|
|
14
|
+
const formState = provideFormState(state, "row");
|
|
15
15
|
provideCELContext({
|
|
16
16
|
item: {
|
|
17
17
|
type: "dyn",
|
|
@@ -8,7 +8,31 @@ export type FormState = Record<string, unknown>;
|
|
|
8
8
|
* bag intercepts this before delegating.
|
|
9
9
|
*/
|
|
10
10
|
export declare const SELF_BINDING: ".";
|
|
11
|
+
/**
|
|
12
|
+
* What kind of scope a bag represents.
|
|
13
|
+
*
|
|
14
|
+
* - `'form'`: a `<Form>` host — the user-facing record being edited.
|
|
15
|
+
* - `'row'`: a single record inside an array slot (a table row provider, a
|
|
16
|
+
* list-field row). Functionally a form bag with array-position context.
|
|
17
|
+
*
|
|
18
|
+
* Used by `state.write` to resolve "commit out of the form I'm in": it skips
|
|
19
|
+
* the nearest bag when it's `'form'`-kind, so a submit button living inside
|
|
20
|
+
* a modal-opened sub-form writes through to the row/outer form that opened
|
|
21
|
+
* it, not back into the about-to-close inner form. `'row'`-kind bags are
|
|
22
|
+
* never skipped — a row-level action button writing to its own row is the
|
|
23
|
+
* intended semantics (per-row "fill defaults / recalc this row").
|
|
24
|
+
*/
|
|
25
|
+
export type FormStateBagKind = 'form' | 'row';
|
|
11
26
|
export type FormStateBag = {
|
|
27
|
+
kind: FormStateBagKind;
|
|
28
|
+
/**
|
|
29
|
+
* The bag one scope up the inject chain, or `undefined` at the root. Set
|
|
30
|
+
* by `provideFormState` from whatever it inherits at provide time. Lets
|
|
31
|
+
* `state.write` walk past a `'form'`-kind nearest without a second
|
|
32
|
+
* inject — Vue exposes only the nearest, so the chain has to be threaded
|
|
33
|
+
* through the bags themselves.
|
|
34
|
+
*/
|
|
35
|
+
parent: FormStateBag | undefined;
|
|
12
36
|
state: Ref<unknown>;
|
|
13
37
|
getAt: (path: string) => unknown;
|
|
14
38
|
/**
|
|
@@ -41,5 +65,5 @@ export type FormStateBag = {
|
|
|
41
65
|
markDirty: (path: string) => void;
|
|
42
66
|
};
|
|
43
67
|
export declare const FORM_STATE_KEY: InjectionKey<FormStateBag>;
|
|
44
|
-
export declare function provideFormState(state: Ref<unknown
|
|
68
|
+
export declare function provideFormState(state: Ref<unknown>, kind?: FormStateBagKind): FormStateBag;
|
|
45
69
|
export declare function useFormState(): FormStateBag;
|
|
@@ -2,7 +2,8 @@ import { getProperty, setProperty } from "dot-prop";
|
|
|
2
2
|
import { inject, provide, ref } from "vue";
|
|
3
3
|
export const SELF_BINDING = ".";
|
|
4
4
|
export const FORM_STATE_KEY = Symbol("shwfed-form-state");
|
|
5
|
-
export function provideFormState(state) {
|
|
5
|
+
export function provideFormState(state, kind = "form") {
|
|
6
|
+
const parent = inject(FORM_STATE_KEY, void 0);
|
|
6
7
|
const dirty = ref(/* @__PURE__ */ new Set());
|
|
7
8
|
function write(path, value) {
|
|
8
9
|
const normalized = value === void 0 ? null : value;
|
|
@@ -18,6 +19,8 @@ export function provideFormState(state) {
|
|
|
18
19
|
if (!dirty.value.has(path)) dirty.value = new Set(dirty.value).add(path);
|
|
19
20
|
}
|
|
20
21
|
const bag = {
|
|
22
|
+
kind,
|
|
23
|
+
parent,
|
|
21
24
|
state,
|
|
22
25
|
getAt: (path) => path === SELF_BINDING ? state.value : getProperty(state.value, path),
|
|
23
26
|
setAt: (path, value) => {
|
|
@@ -39,7 +39,7 @@ provideCELContext({
|
|
|
39
39
|
});
|
|
40
40
|
const inherited = injectCELContext();
|
|
41
41
|
const $cel = (expression, context) => _rawCel(expression, { ...celBindings(inherited), ...context });
|
|
42
|
-
const formState = provideFormState(rowRef);
|
|
42
|
+
const formState = provideFormState(rowRef, "row");
|
|
43
43
|
useDerived({
|
|
44
44
|
fields: () => props.derivedColumns,
|
|
45
45
|
evaluate: (expression) => $cel(expression),
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aK as e}from"./index-X6To2gmZ.js";import{aL as r,aM as s,aN as t}from"./index-X6To2gmZ.js";export{r as TableConfig,s as createTableConfig,e as default,t as getColumnTechnicalKey};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as l,aD as p,ao as A,aq as g,aA as y,e as _,u as h,ak as b,al as S,an as j,aE as k,o as C,am as B}from"./index-X6To2gmZ.js";import{_ as E}from"./definition.vue_vue_type_script_setup_true_lang-DP6_YUR7.js";const D=l({name:"ShwfedStateWriteActionRuntime",__name:"runtime",props:{buttonId:{},config:{}},setup(a){const s=a,o=B(),i=(e,t)=>b(e,{...S(o),...t}),r=p(),f=j(),u=k((e,t,n)=>{if(Array.isArray(e[t])&&Array.isArray(n))return e[t]=n,!0});function c(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function m(e,t){return c(e)&&c(t)?u({...t},e):t}const d=A(()=>g(i(s.config.expression),e=>{for(const t of Object.keys(e)){const n=m(r.getAt(t),e[t]);r.setAt(t,n)}return y(f,s.config.onSuccess)}));return(e,t)=>(C(),_(E,{"action-id":a.buttonId,effect:h(d)},null,8,["action-id","effect"]))}});export{D as default};
|