@atscript/vue-form 0.1.203 → 0.1.205
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/{_editing-hold-Bj0kZjCr.cjs → _editing-hold-D2uqwszu.cjs} +3 -3
- package/dist/{_editing-hold-C6emgUTM.mjs → _editing-hold-D_X5gXHh.mjs} +3 -3
- package/dist/_shape-7OdPsQao.cjs +56 -0
- package/dist/_shape-A661ZxnJ.mjs +39 -0
- package/dist/{as-action-B69WsGIB.mjs → as-action-kBskX68v.mjs} +8 -0
- package/dist/{as-action-B3NIgGTV.cjs → as-action-rT6WXLph.cjs} +8 -0
- package/dist/as-action.cjs +1 -1
- package/dist/as-action.d.cts +1 -1
- package/dist/as-action.d.mts +1 -1
- package/dist/as-action.mjs +1 -1
- package/dist/{as-action.vue-Cz7I0w6k.d.mts → as-action.vue-B7RrjGhF.d.cts} +1 -1
- package/dist/{as-action.vue-CzG-4mHk.d.cts → as-action.vue-Dtez-EWu.d.mts} +1 -1
- package/dist/{as-array-CWuMR-2P.cjs → as-array-C5lqDDLN.cjs} +14 -6
- package/dist/{as-array-dttDB3Rg.mjs → as-array-Tt_4kl5r.mjs} +14 -6
- package/dist/{as-array-clear-btn-CRfCFJ73.mjs → as-array-clear-btn-DGUQY_7_.mjs} +1 -1
- package/dist/{as-array-clear-btn-BX3HSWel.cjs → as-array-clear-btn-Dk88CYmS.cjs} +1 -1
- package/dist/as-array.cjs +1 -1
- package/dist/as-array.d.cts +1 -1
- package/dist/as-array.d.mts +1 -1
- package/dist/as-array.mjs +1 -1
- package/dist/{as-array.vue-BspRfMHl.d.cts → as-array.vue-Ca_xan2n.d.mts} +1 -1
- package/dist/{as-array.vue-DTrR21eK.d.mts → as-array.vue-Dp_zd3ZM.d.cts} +1 -1
- package/dist/{as-checkbox-BS0fjlQC.mjs → as-checkbox-CCX9E19U.mjs} +14 -4
- package/dist/{as-checkbox-DyA1ncSp.cjs → as-checkbox-D7NywgIa.cjs} +14 -4
- package/dist/as-checkbox.cjs +1 -1
- package/dist/as-checkbox.d.cts +1 -1
- package/dist/as-checkbox.d.mts +1 -1
- package/dist/as-checkbox.mjs +1 -1
- package/dist/{as-checkbox.vue-CcifJWeG.d.mts → as-checkbox.vue-BClSBx1g.d.mts} +1 -1
- package/dist/{as-checkbox.vue-CliEtXzy.d.cts → as-checkbox.vue-Bf3qqcKu.d.cts} +1 -1
- package/dist/{as-collapsible-B0im1dAa.cjs → as-collapsible-CTOLQ3IK.cjs} +1 -1
- package/dist/{as-collapsible-B4Vb0XIR.mjs → as-collapsible-CvBoWb0D.mjs} +1 -1
- package/dist/as-collapsible.cjs +1 -1
- package/dist/as-collapsible.d.cts +1 -1
- package/dist/as-collapsible.d.mts +1 -1
- package/dist/as-collapsible.mjs +1 -1
- package/dist/{as-collapsible.vue-DmfY2xZi.d.mts → as-collapsible.vue-BXdpM7_K.d.cts} +1 -1
- package/dist/{as-collapsible.vue-c4kJaqr8.d.cts → as-collapsible.vue-CUhn1EVX.d.mts} +1 -1
- package/dist/{as-date-Wk0mReg2.mjs → as-date-3haOaiAG.mjs} +12 -4
- package/dist/{as-date-bI28vJja.cjs → as-date-Ubw_1-Ai.cjs} +12 -4
- package/dist/as-date.cjs +1 -1
- package/dist/as-date.d.cts +1 -1
- package/dist/as-date.d.mts +1 -1
- package/dist/as-date.mjs +1 -1
- package/dist/{as-date.vue-DlZIPl1M.d.cts → as-date.vue-B5NWZ5ON.d.cts} +1 -1
- package/dist/{as-date.vue-HBqgKpbV.d.mts → as-date.vue-CJQOrfj3.d.mts} +1 -1
- package/dist/{as-datetime-Ca-23Nrq.cjs → as-datetime--7bl-yGW.cjs} +12 -4
- package/dist/{as-datetime-F2PdaCh1.mjs → as-datetime-BTekpasP.mjs} +12 -4
- package/dist/as-datetime.cjs +1 -1
- package/dist/as-datetime.d.cts +1 -1
- package/dist/as-datetime.d.mts +1 -1
- package/dist/as-datetime.mjs +1 -1
- package/dist/{as-datetime.vue-BOewNSCq.d.mts → as-datetime.vue-BvmFdGxe.d.cts} +1 -1
- package/dist/{as-datetime.vue-CTkKY2Cc.d.cts → as-datetime.vue-CzMz_RUy.d.mts} +1 -1
- package/dist/{as-decimal-4zD1qPmT.mjs → as-decimal-7CIE6UKX.mjs} +21 -4
- package/dist/{as-decimal-CYIBnc-k.cjs → as-decimal-DWPRXsYY.cjs} +21 -4
- package/dist/as-decimal.cjs +1 -1
- package/dist/as-decimal.d.cts +1 -1
- package/dist/as-decimal.d.mts +1 -1
- package/dist/as-decimal.mjs +1 -1
- package/dist/{as-decimal.vue-C6SpdtjD.d.cts → as-decimal.vue-DdVqHtMT.d.cts} +1 -1
- package/dist/{as-decimal.vue-DmjoBpWm.d.mts → as-decimal.vue-DyDt1ds0.d.mts} +1 -1
- package/dist/{as-field-BdFUGqKv.cjs → as-field-DAClnYiP.cjs} +13 -5
- package/dist/{as-field-U_EtrpNj.mjs → as-field-jh5AWref.mjs} +14 -6
- package/dist/{as-field-shell-ha1iaJnK.cjs → as-field-shell-Cu8jxZYj.cjs} +17 -7
- package/dist/{as-field-shell-DQ30etIq.mjs → as-field-shell-DPzfvPo0.mjs} +17 -7
- package/dist/as-field-shell.cjs +1 -1
- package/dist/as-field-shell.d.cts +1 -1
- package/dist/as-field-shell.d.mts +1 -1
- package/dist/as-field-shell.mjs +1 -1
- package/dist/{as-field-shell.vue-CVDPz5RX.d.cts → as-field-shell.vue-CPy2uA-b.d.mts} +1 -1
- package/dist/{as-field-shell.vue-Dj34leHW.d.mts → as-field-shell.vue-D-8AWUGW.d.cts} +1 -1
- package/dist/as-field.cjs +1 -1
- package/dist/as-field.mjs +1 -1
- package/dist/{as-form-WhZH4ozr.mjs → as-form-B8d1MVTB.mjs} +35 -7
- package/dist/{as-form-Dfrq97Tv.cjs → as-form-r5pkXt5U.cjs} +34 -6
- package/dist/as-form.cjs +1 -1
- package/dist/as-form.d.cts +1 -1
- package/dist/as-form.d.mts +1 -1
- package/dist/as-form.mjs +1 -1
- package/dist/{as-form.vue-DEGb6oP3.d.cts → as-form.vue-BSY6AhPz.d.mts} +27 -9
- package/dist/{as-form.vue-D7J9Mm_V.d.mts → as-form.vue-bt-v037w.d.cts} +27 -9
- package/dist/{as-input-Cr2zcWgm.cjs → as-input-BTbu0eF-.cjs} +10 -2
- package/dist/{as-input-control-Wygcey6h.mjs → as-input-control-1igViaqC.mjs} +12 -5
- package/dist/{as-input-control-D8xoJfr7.cjs → as-input-control-uJpmle-G.cjs} +12 -5
- package/dist/{as-input-Du26WjkP.mjs → as-input-tKw19JnF.mjs} +10 -2
- package/dist/as-input.cjs +1 -1
- package/dist/as-input.d.cts +1 -1
- package/dist/as-input.d.mts +1 -1
- package/dist/as-input.mjs +1 -1
- package/dist/{as-input.vue-CTeXkWxQ.d.mts → as-input.vue-CuC3DYeR.d.cts} +1 -1
- package/dist/{as-input.vue-D-cM4wBe.d.cts → as-input.vue-DawR7pA-.d.mts} +1 -1
- package/dist/{as-iterator-BvL2pCKj.mjs → as-iterator-B1o83rKV.mjs} +2 -2
- package/dist/{as-iterator-BgYp1qj4.cjs → as-iterator-q_w9HBHt.cjs} +2 -2
- package/dist/as-iterator.cjs +1 -1
- package/dist/as-iterator.mjs +1 -1
- package/dist/{as-multi-select-CNRqlh1o.cjs → as-multi-select-DPQ9_Qf1.cjs} +9 -1
- package/dist/{as-multi-select-C9yGmtWR.mjs → as-multi-select-DhOlsgdq.mjs} +9 -1
- package/dist/as-multi-select.cjs +1 -1
- package/dist/as-multi-select.d.cts +1 -1
- package/dist/as-multi-select.d.mts +1 -1
- package/dist/as-multi-select.mjs +1 -1
- package/dist/{as-multi-select.vue-CvZHtvck.d.cts → as-multi-select.vue-CXC47PBk.d.cts} +1 -1
- package/dist/{as-multi-select.vue-DVSSEboS.d.mts → as-multi-select.vue-CbVBJq8N.d.mts} +1 -1
- package/dist/{as-number-DEkR-Oud.cjs → as-number-CJmX5rb1.cjs} +11 -4
- package/dist/{as-number-CsoSsIJ8.mjs → as-number-CVjNUjiS.mjs} +11 -4
- package/dist/as-number.cjs +1 -1
- package/dist/as-number.d.cts +1 -1
- package/dist/as-number.d.mts +1 -1
- package/dist/as-number.mjs +1 -1
- package/dist/{as-number.vue-7XSQA1oV.d.cts → as-number.vue-BdNvLZca.d.mts} +1 -1
- package/dist/{as-number.vue-CEcDCyhs.d.mts → as-number.vue-hJuiJJ70.d.cts} +1 -1
- package/dist/{as-object-DIEi_L2T.mjs → as-object-DY5IEc94.mjs} +12 -4
- package/dist/{as-object-DZHwEfd8.cjs → as-object-Dq5CPM3i.cjs} +12 -4
- package/dist/as-object.cjs +1 -1
- package/dist/as-object.d.cts +1 -1
- package/dist/as-object.d.mts +1 -1
- package/dist/as-object.mjs +1 -1
- package/dist/{as-object.vue-eoznJfgx.d.mts → as-object.vue-DHFGLetx.d.cts} +1 -1
- package/dist/{as-object.vue-l5nTngPG.d.cts → as-object.vue-DVK_BKOL.d.mts} +1 -1
- package/dist/{as-paragraph-wAHRsd_e.cjs → as-paragraph-CaytophZ.cjs} +8 -0
- package/dist/{as-paragraph-B49pXlhP.mjs → as-paragraph-ChOqmJe2.mjs} +8 -0
- package/dist/as-paragraph.cjs +1 -1
- package/dist/as-paragraph.d.cts +1 -1
- package/dist/as-paragraph.d.mts +1 -1
- package/dist/as-paragraph.mjs +1 -1
- package/dist/{as-paragraph.vue-BRByQ1K4.d.cts → as-paragraph.vue-6mBonWFb.d.mts} +1 -1
- package/dist/{as-paragraph.vue-CwNr9kox.d.mts → as-paragraph.vue-B_aPmK-B.d.cts} +1 -1
- package/dist/{as-radio-Bn14VyaN.mjs → as-radio-BW9K8h6V.mjs} +9 -1
- package/dist/{as-radio-CvIgHH9G.cjs → as-radio-C6PnEdjD.cjs} +9 -1
- package/dist/as-radio.cjs +1 -1
- package/dist/as-radio.d.cts +1 -1
- package/dist/as-radio.d.mts +1 -1
- package/dist/as-radio.mjs +1 -1
- package/dist/{as-radio.vue-CmOKjYGn.d.cts → as-radio.vue-BFxeAHfl.d.mts} +1 -1
- package/dist/{as-radio.vue-rTZDD-Um.d.mts → as-radio.vue-B_tDoVl1.d.cts} +1 -1
- package/dist/{as-ref-DhWEKsYJ.mjs → as-ref-CXtYo-UZ.mjs} +14 -7
- package/dist/{as-ref-BNESufCy.cjs → as-ref-DTsWT_zU.cjs} +14 -7
- package/dist/as-ref.cjs +1 -1
- package/dist/as-ref.d.cts +1 -1
- package/dist/as-ref.d.mts +1 -1
- package/dist/as-ref.mjs +1 -1
- package/dist/{as-ref.vue-C1Qg56oh.d.cts → as-ref.vue-CqFDKTYk.d.mts} +1 -1
- package/dist/{as-ref.vue-CRUzXTRQ.d.mts → as-ref.vue-gCsaCDQx.d.cts} +1 -1
- package/dist/{as-select-Csr2229O.mjs → as-select-CbZNupL6.mjs} +22 -9
- package/dist/{as-select-COxfMWYf.cjs → as-select-DOvo86Oc.cjs} +21 -8
- package/dist/as-select.cjs +1 -1
- package/dist/as-select.d.cts +1 -1
- package/dist/as-select.d.mts +1 -1
- package/dist/as-select.mjs +1 -1
- package/dist/{as-select.vue-DlQ93_AO.d.cts → as-select.vue-BN3zvSGs.d.mts} +1 -1
- package/dist/{as-select.vue-DnfV-12W.d.mts → as-select.vue-Bh7ppdg9.d.cts} +1 -1
- package/dist/{as-time-YMnd789f.mjs → as-time-BDpnkjy8.mjs} +11 -4
- package/dist/{as-time-e40w14c7.cjs → as-time-CfnhY3Pf.cjs} +11 -4
- package/dist/as-time.cjs +1 -1
- package/dist/as-time.d.cts +1 -1
- package/dist/as-time.d.mts +1 -1
- package/dist/as-time.mjs +1 -1
- package/dist/{as-time.vue-DAuXlrGs.d.cts → as-time.vue-C-ruJhmX.d.mts} +1 -1
- package/dist/{as-time.vue-PRLKRy84.d.mts → as-time.vue-C_0z-HOS.d.cts} +1 -1
- package/dist/{as-tuple-BjMI93bC.mjs → as-tuple--wL64cCu.mjs} +13 -5
- package/dist/{as-tuple-Bb-sQh6T.cjs → as-tuple-C5_dcvsH.cjs} +13 -5
- package/dist/as-tuple.cjs +1 -1
- package/dist/as-tuple.d.cts +1 -1
- package/dist/as-tuple.d.mts +1 -1
- package/dist/as-tuple.mjs +1 -1
- package/dist/{as-tuple.vue-Chqi1IO6.d.mts → as-tuple.vue-BDiSN-np.d.cts} +1 -1
- package/dist/{as-tuple.vue-DEL4sOwq.d.cts → as-tuple.vue-CGWun6Iw.d.mts} +1 -1
- package/dist/{as-union-D6JPYyYf.cjs → as-union-D3NoKN1H.cjs} +14 -3
- package/dist/{as-union-D7FONvHe.mjs → as-union-DAnpGBeK.mjs} +15 -4
- package/dist/as-union.cjs +1 -1
- package/dist/as-union.d.cts +1 -1
- package/dist/as-union.d.mts +1 -1
- package/dist/as-union.mjs +1 -1
- package/dist/{as-union.vue-BCdmqdYk.d.mts → as-union.vue-BpcREl7L.d.mts} +1 -1
- package/dist/{as-union.vue-CKGLn4ni.d.cts → as-union.vue-DuUeLY1X.d.cts} +1 -1
- package/dist/{as-variant-picker-VixxxnXA.mjs → as-variant-picker-CihlFH-c.mjs} +1 -1
- package/dist/{as-variant-picker-13N8TxuF.cjs → as-variant-picker-CpCxKFtT.cjs} +1 -1
- package/dist/index.cjs +56 -26
- package/dist/index.d.cts +22 -22
- package/dist/index.d.mts +22 -22
- package/dist/index.mjs +28 -28
- package/dist/{types-ChQuWLmd.d.mts → types-271BUWyf.d.mts} +29 -3
- package/dist/{types-BmF8iDTN.d.cts → types-DbjorSCn.d.cts} +29 -3
- package/dist/{use-as-date-CAmqx1O7.cjs → use-as-date-BigwPKEs.cjs} +13 -3
- package/dist/{use-as-date-CpXG9klN.mjs → use-as-date-iSu5NS79.mjs} +13 -3
- package/dist/{use-as-model-texts-BNO2SFQF.cjs → use-as-model-texts-C3V56UDt.cjs} +1 -1
- package/dist/{use-as-model-texts-BTFyHNqS.mjs → use-as-model-texts-Cpx5bHJQ.mjs} +1 -1
- package/dist/{use-as-value-help-LDhcfxFi.cjs → use-as-value-help-CQMUkP1r.cjs} +4 -2
- package/dist/{use-as-value-help-LQWMkS5m.mjs → use-as-value-help-DE8KCbqo.mjs} +4 -2
- package/dist/{use-form-context-p2PucQHk.mjs → use-form-context-0FtVVTvf.mjs} +2 -1
- package/dist/{use-form-context-d0IcFey0.cjs → use-form-context-U6vg1uqK.cjs} +7 -0
- package/package.json +10 -10
- package/dist/_shape-BDO-1MzF.cjs +0 -87
- package/dist/_shape-DhwW2SvD.mjs +0 -58
package/dist/_shape-BDO-1MzF.cjs
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
//#region src/composables/_shape.ts
|
|
2
|
-
/**
|
|
3
|
-
* Match the input shape on commit: `null`/`undefined` model → write the
|
|
4
|
-
* canonical string (first-ever commit); pre-existing string → string;
|
|
5
|
-
* pre-existing number → number (caller opted into float; the precision
|
|
6
|
-
* loss is on them).
|
|
7
|
-
*
|
|
8
|
-
* Shared by `useAsDecimal` and `useAsNumber`. Not exported from the
|
|
9
|
-
* package barrel — internal helper, no public surface.
|
|
10
|
-
*/
|
|
11
|
-
function preserveShape(original, normalized) {
|
|
12
|
-
if (original === null || original === void 0) return normalized;
|
|
13
|
-
if (typeof original === "string") return normalized;
|
|
14
|
-
return Number(normalized);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* The value an emptied input commits: `undefined` (omitted) on an optional
|
|
18
|
-
* field — `null` is not a value of `name?: T`, and atscript >= 0.1.103
|
|
19
|
-
* rejects it there when the field also carries `@meta.required` — else
|
|
20
|
-
* `null`. Shared by the number / decimal / date / datetime / time inputs and
|
|
21
|
-
* the native number input of the text control.
|
|
22
|
-
*/
|
|
23
|
-
function committedValue(value, optional) {
|
|
24
|
-
return value === null && optional ? void 0 : value;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The value an emptied text input commits: `undefined` (omitted) on an
|
|
28
|
-
* optional field, like {@link committedValue}; `""` on a required one. Used by
|
|
29
|
-
* the text control (which also renders the reference input's plain-text
|
|
30
|
-
* fallback).
|
|
31
|
-
*/
|
|
32
|
-
function committedText(value, optional) {
|
|
33
|
-
return value === "" && optional ? void 0 : value;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The value an emptied reference commits — the picker's "×" and the empty
|
|
37
|
-
* option of a dropdown bound to a dictionary: `undefined` on an optional
|
|
38
|
-
* field; else `""` for a string key and `null` for any other (a number id).
|
|
39
|
-
*/
|
|
40
|
-
function emptiedKey(type, optional) {
|
|
41
|
-
return type?.kind === "" && type.designType === "string" ? committedText("", optional) : committedValue(null, optional);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The one loaded row holding `value` in `field` — `undefined` when none does or
|
|
45
|
-
* when several do (a dictionary whose key has more members than the committed
|
|
46
|
-
* field): the value is then committed without a row, so no fill guesses one.
|
|
47
|
-
*/
|
|
48
|
-
function soleRow(rows, field, value) {
|
|
49
|
-
let found;
|
|
50
|
-
for (const row of rows) {
|
|
51
|
-
if (row[field] !== value) continue;
|
|
52
|
-
if (found) return void 0;
|
|
53
|
-
found = row;
|
|
54
|
-
}
|
|
55
|
-
return found;
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
Object.defineProperty(exports, "committedText", {
|
|
59
|
-
enumerable: true,
|
|
60
|
-
get: function() {
|
|
61
|
-
return committedText;
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
Object.defineProperty(exports, "committedValue", {
|
|
65
|
-
enumerable: true,
|
|
66
|
-
get: function() {
|
|
67
|
-
return committedValue;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
Object.defineProperty(exports, "emptiedKey", {
|
|
71
|
-
enumerable: true,
|
|
72
|
-
get: function() {
|
|
73
|
-
return emptiedKey;
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(exports, "preserveShape", {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function() {
|
|
79
|
-
return preserveShape;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
Object.defineProperty(exports, "soleRow", {
|
|
83
|
-
enumerable: true,
|
|
84
|
-
get: function() {
|
|
85
|
-
return soleRow;
|
|
86
|
-
}
|
|
87
|
-
});
|
package/dist/_shape-DhwW2SvD.mjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
//#region src/composables/_shape.ts
|
|
2
|
-
/**
|
|
3
|
-
* Match the input shape on commit: `null`/`undefined` model → write the
|
|
4
|
-
* canonical string (first-ever commit); pre-existing string → string;
|
|
5
|
-
* pre-existing number → number (caller opted into float; the precision
|
|
6
|
-
* loss is on them).
|
|
7
|
-
*
|
|
8
|
-
* Shared by `useAsDecimal` and `useAsNumber`. Not exported from the
|
|
9
|
-
* package barrel — internal helper, no public surface.
|
|
10
|
-
*/
|
|
11
|
-
function preserveShape(original, normalized) {
|
|
12
|
-
if (original === null || original === void 0) return normalized;
|
|
13
|
-
if (typeof original === "string") return normalized;
|
|
14
|
-
return Number(normalized);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* The value an emptied input commits: `undefined` (omitted) on an optional
|
|
18
|
-
* field — `null` is not a value of `name?: T`, and atscript >= 0.1.103
|
|
19
|
-
* rejects it there when the field also carries `@meta.required` — else
|
|
20
|
-
* `null`. Shared by the number / decimal / date / datetime / time inputs and
|
|
21
|
-
* the native number input of the text control.
|
|
22
|
-
*/
|
|
23
|
-
function committedValue(value, optional) {
|
|
24
|
-
return value === null && optional ? void 0 : value;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* The value an emptied text input commits: `undefined` (omitted) on an
|
|
28
|
-
* optional field, like {@link committedValue}; `""` on a required one. Used by
|
|
29
|
-
* the text control (which also renders the reference input's plain-text
|
|
30
|
-
* fallback).
|
|
31
|
-
*/
|
|
32
|
-
function committedText(value, optional) {
|
|
33
|
-
return value === "" && optional ? void 0 : value;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* The value an emptied reference commits — the picker's "×" and the empty
|
|
37
|
-
* option of a dropdown bound to a dictionary: `undefined` on an optional
|
|
38
|
-
* field; else `""` for a string key and `null` for any other (a number id).
|
|
39
|
-
*/
|
|
40
|
-
function emptiedKey(type, optional) {
|
|
41
|
-
return type?.kind === "" && type.designType === "string" ? committedText("", optional) : committedValue(null, optional);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The one loaded row holding `value` in `field` — `undefined` when none does or
|
|
45
|
-
* when several do (a dictionary whose key has more members than the committed
|
|
46
|
-
* field): the value is then committed without a row, so no fill guesses one.
|
|
47
|
-
*/
|
|
48
|
-
function soleRow(rows, field, value) {
|
|
49
|
-
let found;
|
|
50
|
-
for (const row of rows) {
|
|
51
|
-
if (row[field] !== value) continue;
|
|
52
|
-
if (found) return void 0;
|
|
53
|
-
found = row;
|
|
54
|
-
}
|
|
55
|
-
return found;
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
export { soleRow as a, preserveShape as i, committedValue as n, emptiedKey as r, committedText as t };
|