kintone-pretty-fields 0.10.2 → 0.10.3
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/functions/formField.d.ts.map +1 -1
- package/dist/functions/utility.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +19 -22
- package/dist/index.umd.cjs +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formField.d.ts","sourceRoot":"","sources":["../../src/functions/formField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAEnE,eAAO,MAAM,cAAc,UACnB,
|
|
1
|
+
{"version":3,"file":"formField.d.ts","sourceRoot":"","sources":["../../src/functions/formField.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAEnE,eAAO,MAAM,cAAc,UACnB,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,YAA8C,CAAC;AAC7E,eAAO,MAAM,SAAS,UACd,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,OAAmC,CAAC;AAClE,eAAO,MAAM,aAAa,UAClB,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,UAAU,UACf,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAqC,CAAC;AACpE,eAAO,MAAM,aAAa,UAClB,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,UACrB,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,cACI,CAAC;AACnC,eAAO,MAAM,eAAe,UACpB,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,C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3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/functions/utility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAInE,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;AACpD,KAAK,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAY7B,QAAA,MAAM,cAAc,eACP;IACX,CAAC,SAAS,EAAE,MAAM,GAAG,wBAAwB,CAAC,KAAK,CAAC;CACpD,eACY,iBAAiB,CAAC,KAAK,EAAE;;;CAgOtC,CAAC;AAEF,QAAA,MAAM,GAAG,oCAKN;IACF,MAAM,EAAE,oBAAoB,CAAC;IAC7B,GAAG,EAAE,KAAK,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CACjB;;;EAQA,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ declare const kintonePrettyFields: {
|
|
|
35
35
|
isLookup: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Lookup;
|
|
36
36
|
isLookupCopy: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.SingleLineText | kintonePrettyType.MultiLineText | kintonePrettyType.RichText | kintonePrettyType.Number | kintonePrettyType.Calc | kintonePrettyType.CheckBox | kintonePrettyType.RadioButton | kintonePrettyType.MultiSelect | kintonePrettyType.Dropdown | kintonePrettyType.UserSelect | kintonePrettyType.OrganizationSelect | kintonePrettyType.GroupSelect | kintonePrettyType.Date | kintonePrettyType.Time | kintonePrettyType.DateTime | kintonePrettyType.Link;
|
|
37
37
|
isInGroup: <T extends kintonePrettyType.OneOf>(field: T) => field is Extract<T, kintonePrettyType.InGroup>;
|
|
38
|
-
isInSubtable: <
|
|
39
|
-
isNotInSubtable: <
|
|
38
|
+
isInSubtable: <T extends kintonePrettyType.OneOf>(field: T) => field is Extract<T, kintonePrettyType.InSubtable>;
|
|
39
|
+
isNotInSubtable: <T extends kintonePrettyType.OneOf>(field: T) => field is T;
|
|
40
40
|
/**
|
|
41
41
|
* kintone アプリのフィールドを取得します。
|
|
42
42
|
* @deprecated getFields関数を利用してください。
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
const X = (t) => t.type === "RECORD_NUMBER", H = (t) => t.type === "CREATOR", z = (t) => t.type === "CREATED_TIME", K = (t) => t.type === "MODIFIER", W = (t) => t.type === "UPDATED_TIME", E = (t) => t.type === "SINGLE_LINE_TEXT",
|
|
1
|
+
const X = (t) => t.type === "RECORD_NUMBER", H = (t) => t.type === "CREATOR", z = (t) => t.type === "CREATED_TIME", K = (t) => t.type === "MODIFIER", W = (t) => t.type === "UPDATED_TIME", E = (t) => t.type === "SINGLE_LINE_TEXT", R = (t) => t.type === "MULTI_LINE_TEXT", m = (t) => t.type === "RICH_TEXT", l = (t) => t.type === "NUMBER", _ = (t) => t.type === "CALC", g = (t) => t.type === "CHECK_BOX", I = (t) => t.type === "RADIO_BUTTON", b = (t) => t.type === "MULTI_SELECT", O = (t) => t.type === "DROP_DOWN", A = (t) => t.type === "USER_SELECT", f = (t) => t.type === "ORGANIZATION_SELECT", D = (t) => t.type === "GROUP_SELECT", N = (t) => t.type === "DATE", M = (t) => t.type === "TIME", U = (t) => t.type === "DATETIME", L = (t) => t.type === "LINK", Z = (t) => t.type === "FILE", Y = (t) => t.type === "SUBTABLE", V = (t) => t.type === "GROUP", q = (t) => t.type === "REFERENCE_TABLE", J = (t) => t.type === "CATEGORY", Q = (t) => t.type === "STATUS", $ = (t) => t.type === "STATUS_ASSIGNEE", ee = (t) => !!(E(t) && "lookup" in t || l(t) && "lookup" in t || _(t) && "lookup" in t || L(t) && "lookup" in t || X(t) && "lookup" in t), te = (t) => !!(E(t) && "isLookupCopy" in t || R(t) && "isLookupCopy" in t || m(t) && "isLookupCopy" in t || l(t) && "isLookupCopy" in t || _(t) && "isLookupCopy" in t || g(t) && "isLookupCopy" in t || I(t) && "isLookupCopy" in t || b(t) && "isLookupCopy" in t || O(t) && "isLookupCopy" in t || A(t) && "isLookupCopy" in t || f(t) && "isLookupCopy" in t || D(t) && "isLookupCopy" in t || N(t) && "isLookupCopy" in t || M(t) && "isLookupCopy" in t || U(t) && "isLookupCopy" in t || L(t) && "isLookupCopy" in t), ie = (t) => "group" in t, oe = (t) => "table" in t, se = (t) => !("table" in t), re = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2
2
|
__proto__: null,
|
|
3
|
-
isCalc:
|
|
4
|
-
isCategory:
|
|
5
|
-
isCheckBox:
|
|
3
|
+
isCalc: _,
|
|
4
|
+
isCategory: J,
|
|
5
|
+
isCheckBox: g,
|
|
6
6
|
isCreatedTime: z,
|
|
7
7
|
isCreator: H,
|
|
8
|
-
isDate:
|
|
8
|
+
isDate: N,
|
|
9
9
|
isDatetime: U,
|
|
10
|
-
isDropDown:
|
|
10
|
+
isDropDown: O,
|
|
11
11
|
isFile: Z,
|
|
12
|
-
isGroup:
|
|
13
|
-
isGroupSelect:
|
|
12
|
+
isGroup: V,
|
|
13
|
+
isGroupSelect: D,
|
|
14
14
|
isInGroup: ie,
|
|
15
15
|
isInSubtable: oe,
|
|
16
16
|
isLink: L,
|
|
17
17
|
isLookup: ee,
|
|
18
18
|
isLookupCopy: te,
|
|
19
19
|
isModifier: K,
|
|
20
|
-
isMultiLineText:
|
|
21
|
-
isMultiSelect:
|
|
20
|
+
isMultiLineText: R,
|
|
21
|
+
isMultiSelect: b,
|
|
22
22
|
isNotInSubtable: se,
|
|
23
23
|
isNumber: l,
|
|
24
24
|
isOrganizationSelect: f,
|
|
25
|
-
isRadioButton:
|
|
25
|
+
isRadioButton: I,
|
|
26
26
|
isRecordNumber: X,
|
|
27
|
-
isReferenceTable:
|
|
28
|
-
isRichText:
|
|
27
|
+
isReferenceTable: q,
|
|
28
|
+
isRichText: m,
|
|
29
29
|
isSingleLineText: E,
|
|
30
|
-
isStatus:
|
|
30
|
+
isStatus: Q,
|
|
31
31
|
isStatusAssignee: $,
|
|
32
32
|
isSubtable: Y,
|
|
33
33
|
isTime: M,
|
|
@@ -39,7 +39,7 @@ var ue = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : t
|
|
|
39
39
|
(function(o, d) {
|
|
40
40
|
d(c);
|
|
41
41
|
})(ue, function(o) {
|
|
42
|
-
const d = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: (e) => e.type === "CALC", isCategory: (e) => e.type === "CATEGORY", isCheckBox: (e) => e.type === "CHECK_BOX", isCreatedTime: (e) => e.type === "CREATED_TIME", isCreator: (e) => e.type === "CREATOR", isDate: (e) => e.type === "DATE", isDatetime: (e) => e.type === "DATETIME", isDropDown: (e) => e.type === "DROP_DOWN", isFile: (e) => e.type === "FILE", isGroup: (e) => e.type === "GROUP", isGroupSelect: (e) => e.type === "GROUP_SELECT", isLink: (e) => e.type === "LINK", isLookup: (e) => (e.type === "SINGLE_LINE_TEXT" || e.type === "NUMBER") && "lookup" in e, isModifier: (e) => e.type === "MODIFIER", isMultiLineText: (e) => e.type === "MULTI_LINE_TEXT", isMultiSelect: (e) => e.type === "MULTI_SELECT", isNumber: (e) => e.type === "NUMBER", isOrganizationSelect: (e) => e.type === "ORGANIZATION_SELECT", isRadioButton: (e) => e.type === "RADIO_BUTTON", isRecordNumber: (e) => e.type === "RECORD_NUMBER", isReferenceTable: (e) => e.type === "REFERENCE_TABLE", isRichText: (e) => e.type === "RICH_TEXT", isSingleLineText: (e) => e.type === "SINGLE_LINE_TEXT", isStatus: (e) => e.type === "STATUS", isStatusAssignee: (e) => e.type === "STATUS_ASSIGNEE", isSubtable: (e) => e.type === "SUBTABLE", isTime: (e) => e.type === "TIME", isUpdatedTime: (e) => e.type === "UPDATED_TIME", isUserSelect: (e) => e.type === "USER_SELECT" }, Symbol.toStringTag, { value: "Module" })), y = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: (e) => e.type === "CALC", isCheckBox: (e) => e.type === "CHECK_BOX", isCreatedTime: (e) => e.type === "CREATED_TIME", isCreator: (e) => e.type === "CREATOR", isDate: (e) => e.type === "DATE", isDatetime: (e) => e.type === "DATETIME", isDropDown: (e) => e.type === "DROP_DOWN", isFile: (e) => e.type === "FILE", isGroup: (e) => e.type === "GROUP", isGroupSelect: (e) => e.type === "GROUP_SELECT", isHr: (e) => e.type === "HR", isLabel: (e) => e.type === "LABEL", isLink: (e) => e.type === "LINK", isModifier: (e) => e.type === "MODIFIER", isMultiLineText: (e) => e.type === "MULTI_LINE_TEXT", isMultiSelect: (e) => e.type === "MULTI_SELECT", isNumber: (e) => e.type === "NUMBER", isOrganizationSelect: (e) => e.type === "ORGANIZATION_SELECT", isRadioButon: (e) => e.type === "RADIO_BUTTON", isRecordNumber: (e) => e.type === "RECORD_NUMBER", isReferenceTable: (e) => e.type === "REFERENCE_TABLE", isRichText: (e) => e.type === "RICH_TEXT", isRow: (e) => e.type === "ROW", isSingleLineText: (e) => e.type === "SINGLE_LINE_TEXT", isSpacer: (e) => e.type === "SPACER", isSubtable: (e) => e.type === "SUBTABLE", isTime: (e) => e.type === "TIME", isUpdatedTime: (e) => e.type === "UPDATED_TIME", isUserSelect: (e) => e.type === "USER_SELECT" }, Symbol.toStringTag, { value: "Module" })), T = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: (e) => e.type === "CALC", isCategory: (e) => e.type === "CATEGORY", isCheckBox: (e) => e.type === "CHECK_BOX", isCreatedTime: (e) => e.type === "CREATED_TIME", isCreator: (e) => e.type === "CREATOR", isDate: (e) => e.type === "DATE", isDatetime: (e) => e.type === "DATETIME", isDropDown: (e) => e.type === "DROP_DOWN", isFile: (e) => e.type === "FILE", isGroupSelect: (e) => e.type === "GROUP_SELECT", isLink: (e) => e.type === "LINK", isModifier: (e) => e.type === "MODIFIER", isMultiLineText: (e) => e.type === "MULTI_LINE_TEXT", isMultiSelect: (e) => e.type === "MULTI_SELECT", isNumber: (e) => e.type === "NUMBER", isOrganizationSelect: (e) => e.type === "ORGANIZATION_SELECT", isRadioButton: (e) => e.type === "RADIO_BUTTON", isRecordNumber: (e) => e.type === "RECORD_NUMBER", isRichText: (e) => e.type === "RICH_TEXT", isSingleLineText: (e) => e.type === "SINGLE_LINE_TEXT", isStatus: (e) => e.type === "STATUS", isStatusAssignee: (e) => e.type === "STATUS_ASSIGNEE", isSubtable: (e) => e.type === "SUBTABLE", isTime: (e) => e.type === "TIME", isUpdatedTime: (e) => e.type === "UPDATED_TIME", isUserSelect: (e) => e.type === "USER_SELECT" }, Symbol.toStringTag, { value: "Module" }));
|
|
42
|
+
const d = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: (e) => e.type === "CALC", isCategory: (e) => e.type === "CATEGORY", isCheckBox: (e) => e.type === "CHECK_BOX", isCreatedTime: (e) => e.type === "CREATED_TIME", isCreator: (e) => e.type === "CREATOR", isDate: (e) => e.type === "DATE", isDatetime: (e) => e.type === "DATETIME", isDropDown: (e) => e.type === "DROP_DOWN", isFile: (e) => e.type === "FILE", isGroup: (e) => e.type === "GROUP", isGroupSelect: (e) => e.type === "GROUP_SELECT", isLink: (e) => e.type === "LINK", isLookup: (e) => (e.type === "SINGLE_LINE_TEXT" || e.type === "NUMBER") && "lookup" in e, isModifier: (e) => e.type === "MODIFIER", isMultiLineText: (e) => e.type === "MULTI_LINE_TEXT", isMultiSelect: (e) => e.type === "MULTI_SELECT", isNumber: (e) => e.type === "NUMBER", isOrganizationSelect: (e) => e.type === "ORGANIZATION_SELECT", isRadioButton: (e) => e.type === "RADIO_BUTTON", isRecordNumber: (e) => e.type === "RECORD_NUMBER", isReferenceTable: (e) => e.type === "REFERENCE_TABLE", isRichText: (e) => e.type === "RICH_TEXT", isSingleLineText: (e) => e.type === "SINGLE_LINE_TEXT", isStatus: (e) => e.type === "STATUS", isStatusAssignee: (e) => e.type === "STATUS_ASSIGNEE", isSubtable: (e) => e.type === "SUBTABLE", isTime: (e) => e.type === "TIME", isUpdatedTime: (e) => e.type === "UPDATED_TIME", isUserSelect: (e) => e.type === "USER_SELECT" }, Symbol.toStringTag, { value: "Module" })), y = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: (e) => e.type === "CALC", isCheckBox: (e) => e.type === "CHECK_BOX", isCreatedTime: (e) => e.type === "CREATED_TIME", isCreator: (e) => e.type === "CREATOR", isDate: (e) => e.type === "DATE", isDatetime: (e) => e.type === "DATETIME", isDropDown: (e) => e.type === "DROP_DOWN", isFile: (e) => e.type === "FILE", isGroup: (e) => e.type === "GROUP", isGroupSelect: (e) => e.type === "GROUP_SELECT", isHr: (e) => e.type === "HR", isLabel: (e) => e.type === "LABEL", isLink: (e) => e.type === "LINK", isModifier: (e) => e.type === "MODIFIER", isMultiLineText: (e) => e.type === "MULTI_LINE_TEXT", isMultiSelect: (e) => e.type === "MULTI_SELECT", isNumber: (e) => e.type === "NUMBER", isOrganizationSelect: (e) => e.type === "ORGANIZATION_SELECT", isRadioButon: (e) => e.type === "RADIO_BUTTON", isRecordNumber: (e) => e.type === "RECORD_NUMBER", isReferenceTable: (e) => e.type === "REFERENCE_TABLE", isRichText: (e) => e.type === "RICH_TEXT", isRow: (e) => e.type === "ROW", isSingleLineText: (e) => e.type === "SINGLE_LINE_TEXT", isSpacer: (e) => e.type === "SPACER", isSubtable: (e) => e.type === "SUBTABLE", isTime: (e) => e.type === "TIME", isUpdatedTime: (e) => e.type === "UPDATED_TIME", isUserSelect: (e) => e.type === "USER_SELECT" }, Symbol.toStringTag, { value: "Module" })), T = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: (e) => e.type === "CALC", isCategory: (e) => e.type === "CATEGORY", isCheckBox: (e) => e.type === "CHECK_BOX", isCreatedTime: (e) => e.type === "CREATED_TIME", isCreator: (e) => e.type === "CREATOR", isDate: (e) => e.type === "DATE", isDatetime: (e) => e.type === "DATETIME", isDropDown: (e) => e.type === "DROP_DOWN", isFile: (e) => e.type === "FILE", isGroupSelect: (e) => e.type === "GROUP_SELECT", isID: (e) => e.type === "__ID__", isLink: (e) => e.type === "LINK", isModifier: (e) => e.type === "MODIFIER", isMultiLineText: (e) => e.type === "MULTI_LINE_TEXT", isMultiSelect: (e) => e.type === "MULTI_SELECT", isNumber: (e) => e.type === "NUMBER", isOrganizationSelect: (e) => e.type === "ORGANIZATION_SELECT", isRadioButton: (e) => e.type === "RADIO_BUTTON", isRecordNumber: (e) => e.type === "RECORD_NUMBER", isRevision: (e) => e.type === "__REVISION__", isRichText: (e) => e.type === "RICH_TEXT", isSingleLineText: (e) => e.type === "SINGLE_LINE_TEXT", isStatus: (e) => e.type === "STATUS", isStatusAssignee: (e) => e.type === "STATUS_ASSIGNEE", isSubtable: (e) => e.type === "SUBTABLE", isTime: (e) => e.type === "TIME", isUpdatedTime: (e) => e.type === "UPDATED_TIME", isUserSelect: (e) => e.type === "USER_SELECT" }, Symbol.toStringTag, { value: "Module" }));
|
|
43
43
|
o.guardFormField = d, o.guardFormLayout = y, o.guardRecord = T, Object.defineProperty(o, Symbol.toStringTag, { value: "Module" });
|
|
44
44
|
});
|
|
45
45
|
})(F, F.exports);
|
|
@@ -79,8 +79,7 @@ const C = (t) => Object.values(t).sort((c, o) => Number(c.index) - Number(o.inde
|
|
|
79
79
|
}
|
|
80
80
|
else if (i.guardFormLayout.isSubtable(p)) {
|
|
81
81
|
const r = p.code, u = t[r];
|
|
82
|
-
if (!i.guardFormField.isSubtable(u))
|
|
83
|
-
continue;
|
|
82
|
+
if (!i.guardFormField.isSubtable(u)) continue;
|
|
84
83
|
const s = {};
|
|
85
84
|
for (const { code: S } of p.fields) {
|
|
86
85
|
const a = u.fields[S];
|
|
@@ -98,8 +97,7 @@ const C = (t) => Object.values(t).sort((c, o) => Number(c.index) - Number(o.inde
|
|
|
98
97
|
o.push({ ...u, fields: s });
|
|
99
98
|
} else if (i.guardFormLayout.isGroup(p)) {
|
|
100
99
|
const r = p.code, u = t[r];
|
|
101
|
-
if (!i.guardFormField.isGroup(u))
|
|
102
|
-
continue;
|
|
100
|
+
if (!i.guardFormField.isGroup(u)) continue;
|
|
103
101
|
const s = {};
|
|
104
102
|
for (const S of p.layout)
|
|
105
103
|
for (const a of S.fields) {
|
|
@@ -127,11 +125,10 @@ const C = (t) => Object.values(t).sort((c, o) => Number(c.index) - Number(o.inde
|
|
|
127
125
|
}
|
|
128
126
|
for (const p of Object.values(o))
|
|
129
127
|
if (i.guardFormField.isLookup(p)) {
|
|
130
|
-
if (p.lookup === null)
|
|
131
|
-
continue;
|
|
128
|
+
if (p.lookup === null) continue;
|
|
132
129
|
for (const r of p.lookup.fieldMappings) {
|
|
133
130
|
const u = (P = o.filter(
|
|
134
|
-
(s) => E(s) || l(s) ||
|
|
131
|
+
(s) => E(s) || l(s) || R(s) || m(s) || L(s) || g(s) || I(s) || O(s) || b(s) || N(s) || M(s) || U(s) || A(s) || f(s) || D(s)
|
|
135
132
|
)) == null ? void 0 : P.find((s) => s.code === r.field);
|
|
136
133
|
u && (u.isLookupCopy = !0);
|
|
137
134
|
}
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(E,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(E=typeof globalThis<"u"?globalThis:E||self,l(E.KintonePrettyFields={}))})(this,function(E){"use strict";const l=t=>t.type==="RECORD_NUMBER",K=t=>t.type==="CREATOR",z=t=>t.type==="CREATED_TIME",W=t=>t.type==="MODIFIER",Z=t=>t.type==="UPDATED_TIME",S=t=>t.type==="SINGLE_LINE_TEXT",C=t=>t.type==="MULTI_LINE_TEXT",m=t=>t.type==="RICH_TEXT",L=t=>t.type==="NUMBER",R=t=>t.type==="CALC",
|
|
1
|
+
(function(E,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(E=typeof globalThis<"u"?globalThis:E||self,l(E.KintonePrettyFields={}))})(this,function(E){"use strict";const l=t=>t.type==="RECORD_NUMBER",K=t=>t.type==="CREATOR",z=t=>t.type==="CREATED_TIME",W=t=>t.type==="MODIFIER",Z=t=>t.type==="UPDATED_TIME",S=t=>t.type==="SINGLE_LINE_TEXT",C=t=>t.type==="MULTI_LINE_TEXT",m=t=>t.type==="RICH_TEXT",L=t=>t.type==="NUMBER",R=t=>t.type==="CALC",_=t=>t.type==="CHECK_BOX",g=t=>t.type==="RADIO_BUTTON",b=t=>t.type==="MULTI_SELECT",I=t=>t.type==="DROP_DOWN",f=t=>t.type==="USER_SELECT",O=t=>t.type==="ORGANIZATION_SELECT",A=t=>t.type==="GROUP_SELECT",N=t=>t.type==="DATE",D=t=>t.type==="TIME",M=t=>t.type==="DATETIME",F=t=>t.type==="LINK",Y=Object.freeze(Object.defineProperty({__proto__:null,isCalc:R,isCategory:t=>t.type==="CATEGORY",isCheckBox:_,isCreatedTime:z,isCreator:K,isDate:N,isDatetime:M,isDropDown:I,isFile:t=>t.type==="FILE",isGroup:t=>t.type==="GROUP",isGroupSelect:A,isInGroup:t=>"group"in t,isInSubtable:t=>"table"in t,isLink:F,isLookup:t=>!!(S(t)&&"lookup"in t||L(t)&&"lookup"in t||R(t)&&"lookup"in t||F(t)&&"lookup"in t||l(t)&&"lookup"in t),isLookupCopy:t=>!!(S(t)&&"isLookupCopy"in t||C(t)&&"isLookupCopy"in t||m(t)&&"isLookupCopy"in t||L(t)&&"isLookupCopy"in t||R(t)&&"isLookupCopy"in t||_(t)&&"isLookupCopy"in t||g(t)&&"isLookupCopy"in t||b(t)&&"isLookupCopy"in t||I(t)&&"isLookupCopy"in t||f(t)&&"isLookupCopy"in t||O(t)&&"isLookupCopy"in t||A(t)&&"isLookupCopy"in t||N(t)&&"isLookupCopy"in t||D(t)&&"isLookupCopy"in t||M(t)&&"isLookupCopy"in t||F(t)&&"isLookupCopy"in t),isModifier:W,isMultiLineText:C,isMultiSelect:b,isNotInSubtable:t=>!("table"in t),isNumber:L,isOrganizationSelect:O,isRadioButton:g,isRecordNumber:l,isReferenceTable:t=>t.type==="REFERENCE_TABLE",isRichText:m,isSingleLineText:S,isStatus:t=>t.type==="STATUS",isStatusAssignee:t=>t.type==="STATUS_ASSIGNEE",isSubtable:t=>t.type==="SUBTABLE",isTime:D,isUpdatedTime:Z,isUserSelect:f},Symbol.toStringTag,{value:"Module"}));var V=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},U={exports:{}};(function(t,d){(function(o,c){c(d)})(V,function(o){const c=Object.freeze(Object.defineProperty({__proto__:null,isCalc:e=>e.type==="CALC",isCategory:e=>e.type==="CATEGORY",isCheckBox:e=>e.type==="CHECK_BOX",isCreatedTime:e=>e.type==="CREATED_TIME",isCreator:e=>e.type==="CREATOR",isDate:e=>e.type==="DATE",isDatetime:e=>e.type==="DATETIME",isDropDown:e=>e.type==="DROP_DOWN",isFile:e=>e.type==="FILE",isGroup:e=>e.type==="GROUP",isGroupSelect:e=>e.type==="GROUP_SELECT",isLink:e=>e.type==="LINK",isLookup:e=>(e.type==="SINGLE_LINE_TEXT"||e.type==="NUMBER")&&"lookup"in e,isModifier:e=>e.type==="MODIFIER",isMultiLineText:e=>e.type==="MULTI_LINE_TEXT",isMultiSelect:e=>e.type==="MULTI_SELECT",isNumber:e=>e.type==="NUMBER",isOrganizationSelect:e=>e.type==="ORGANIZATION_SELECT",isRadioButton:e=>e.type==="RADIO_BUTTON",isRecordNumber:e=>e.type==="RECORD_NUMBER",isReferenceTable:e=>e.type==="REFERENCE_TABLE",isRichText:e=>e.type==="RICH_TEXT",isSingleLineText:e=>e.type==="SINGLE_LINE_TEXT",isStatus:e=>e.type==="STATUS",isStatusAssignee:e=>e.type==="STATUS_ASSIGNEE",isSubtable:e=>e.type==="SUBTABLE",isTime:e=>e.type==="TIME",isUpdatedTime:e=>e.type==="UPDATED_TIME",isUserSelect:e=>e.type==="USER_SELECT"},Symbol.toStringTag,{value:"Module"})),y=Object.freeze(Object.defineProperty({__proto__:null,isCalc:e=>e.type==="CALC",isCheckBox:e=>e.type==="CHECK_BOX",isCreatedTime:e=>e.type==="CREATED_TIME",isCreator:e=>e.type==="CREATOR",isDate:e=>e.type==="DATE",isDatetime:e=>e.type==="DATETIME",isDropDown:e=>e.type==="DROP_DOWN",isFile:e=>e.type==="FILE",isGroup:e=>e.type==="GROUP",isGroupSelect:e=>e.type==="GROUP_SELECT",isHr:e=>e.type==="HR",isLabel:e=>e.type==="LABEL",isLink:e=>e.type==="LINK",isModifier:e=>e.type==="MODIFIER",isMultiLineText:e=>e.type==="MULTI_LINE_TEXT",isMultiSelect:e=>e.type==="MULTI_SELECT",isNumber:e=>e.type==="NUMBER",isOrganizationSelect:e=>e.type==="ORGANIZATION_SELECT",isRadioButon:e=>e.type==="RADIO_BUTTON",isRecordNumber:e=>e.type==="RECORD_NUMBER",isReferenceTable:e=>e.type==="REFERENCE_TABLE",isRichText:e=>e.type==="RICH_TEXT",isRow:e=>e.type==="ROW",isSingleLineText:e=>e.type==="SINGLE_LINE_TEXT",isSpacer:e=>e.type==="SPACER",isSubtable:e=>e.type==="SUBTABLE",isTime:e=>e.type==="TIME",isUpdatedTime:e=>e.type==="UPDATED_TIME",isUserSelect:e=>e.type==="USER_SELECT"},Symbol.toStringTag,{value:"Module"})),T=Object.freeze(Object.defineProperty({__proto__:null,isCalc:e=>e.type==="CALC",isCategory:e=>e.type==="CATEGORY",isCheckBox:e=>e.type==="CHECK_BOX",isCreatedTime:e=>e.type==="CREATED_TIME",isCreator:e=>e.type==="CREATOR",isDate:e=>e.type==="DATE",isDatetime:e=>e.type==="DATETIME",isDropDown:e=>e.type==="DROP_DOWN",isFile:e=>e.type==="FILE",isGroupSelect:e=>e.type==="GROUP_SELECT",isID:e=>e.type==="__ID__",isLink:e=>e.type==="LINK",isModifier:e=>e.type==="MODIFIER",isMultiLineText:e=>e.type==="MULTI_LINE_TEXT",isMultiSelect:e=>e.type==="MULTI_SELECT",isNumber:e=>e.type==="NUMBER",isOrganizationSelect:e=>e.type==="ORGANIZATION_SELECT",isRadioButton:e=>e.type==="RADIO_BUTTON",isRecordNumber:e=>e.type==="RECORD_NUMBER",isRevision:e=>e.type==="__REVISION__",isRichText:e=>e.type==="RICH_TEXT",isSingleLineText:e=>e.type==="SINGLE_LINE_TEXT",isStatus:e=>e.type==="STATUS",isStatusAssignee:e=>e.type==="STATUS_ASSIGNEE",isSubtable:e=>e.type==="SUBTABLE",isTime:e=>e.type==="TIME",isUpdatedTime:e=>e.type==="UPDATED_TIME",isUserSelect:e=>e.type==="USER_SELECT"},Symbol.toStringTag,{value:"Module"}));o.guardFormField=c,o.guardFormLayout=y,o.guardRecord=T,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})})})(U,U.exports);var i=U.exports;const k=t=>Object.values(t).sort((d,o)=>Number(d.index)-Number(o.index)).map(({label:d})=>d),G=(t,d)=>{var w;const o=[],c=[],y=Object.values(t).find(i.guardFormField.isStatus);y!=null&&y.enabled&&o.push(y);const T=Object.values(t).find(i.guardFormField.isStatusAssignee);T!=null&&T.enabled&&o.push(T);const e=Object.values(t).find(i.guardFormField.isCategory);e!=null&&e.enabled&&o.push(e);for(const p of d)if(i.guardFormLayout.isRow(p))for(const r of p.fields){if(i.guardFormLayout.isLabel(r)||i.guardFormLayout.isHr(r))continue;if(i.guardFormLayout.isSpacer(r)){c.push(r);continue}const u=t[r.code];if(!i.guardFormField.isSubtable(u)&&!i.guardFormField.isGroup(u)){if(i.guardFormField.isCheckBox(u)||i.guardFormField.isDropDown(u)||i.guardFormField.isMultiSelect(u)||i.guardFormField.isRadioButton(u)){const s=k(u.options);o.push({...u,sortedOptions:s});continue}o.push(u)}}else if(i.guardFormLayout.isSubtable(p)){const r=p.code,u=t[r];if(!i.guardFormField.isSubtable(u))continue;const s={};for(const{code:B}of p.fields){const a=u.fields[B];if(i.guardFormField.isCheckBox(a)||i.guardFormField.isDropDown(a)||i.guardFormField.isMultiSelect(a)||i.guardFormField.isRadioButton(a)){const n=k(a.options);s[a.code]={...a,table:r,sortedOptions:n},o.push({...a,table:r,sortedOptions:n});continue}s[a.code]={...a,table:r},o.push({...a,table:r})}o.push({...u,fields:s})}else if(i.guardFormLayout.isGroup(p)){const r=p.code,u=t[r];if(!i.guardFormField.isGroup(u))continue;const s={};for(const B of p.layout)for(const a of B.fields){if(i.guardFormLayout.isLabel(a)||i.guardFormLayout.isHr(a))continue;if(i.guardFormLayout.isSpacer(a)){c.push({...a,group:r});continue}const n=t[a.code];if(!i.guardFormField.isCategory(n)&&!i.guardFormField.isStatus(n)&&!i.guardFormField.isStatusAssignee(n)&&!i.guardFormField.isSubtable(n)&&!i.guardFormField.isGroup(n)){if(i.guardFormField.isCheckBox(n)||i.guardFormField.isDropDown(n)||i.guardFormField.isMultiSelect(n)||i.guardFormField.isRadioButton(n)){const H=k(n.options);s[n.code]={...n,group:r,sortedOptions:H},o.push({...n,group:r,sortedOptions:H});continue}s[n.code]={...n,group:r},o.push({...n,group:r})}}o.push({...u,fields:s})}for(const p of Object.values(o))if(i.guardFormField.isLookup(p)){if(p.lookup===null)continue;for(const r of p.lookup.fieldMappings){const u=(w=o.filter(s=>S(s)||L(s)||C(s)||m(s)||F(s)||_(s)||g(s)||I(s)||b(s)||N(s)||D(s)||M(s)||f(s)||O(s)||A(s)))==null?void 0:w.find(s=>s.code===r.field);u&&(u.isLookupCopy=!0)}}const x=Object.values(t).find(i.guardFormField.isRecordNumber);x&&(o.some(i.guardFormField.isRecordNumber)||o.push(x));const P=Object.values(t).find(i.guardFormField.isCreator);P&&(o.some(i.guardFormField.isCreator)||o.push(P));const j=Object.values(t).find(i.guardFormField.isCreatedTime);j&&(o.some(i.guardFormField.isCreatedTime)||o.push(j));const v=Object.values(t).find(i.guardFormField.isModifier);v&&(o.some(i.guardFormField.isModifier)||o.push(v));const X=Object.values(t).find(i.guardFormField.isUpdatedTime);return X&&(o.some(i.guardFormField.isUpdatedTime)||o.push(X)),{fields:o,spacers:c}},h=async({client:t,app:d,lang:o,preview:c})=>{const[{properties:y},{layout:T}]=await Promise.all([t.app.getFormFields({app:d,lang:o,preview:c}),t.app.getFormLayout({app:d,preview:c})]);return G(y,T)},q={get:h,getFields:h,generateFields:G,...Y};E.kintonePrettyFields=q,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.10.
|
|
7
|
+
"version": "0.10.3",
|
|
8
8
|
"description": "Get kintone form fields in a pretty format.",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"check": "biome check --apply ./src ./tests"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@kintone/rest-api-client": "^5.
|
|
46
|
-
"kintone-typeguard": "^0.
|
|
45
|
+
"@kintone/rest-api-client": "^5.5.2",
|
|
46
|
+
"kintone-typeguard": "^0.14.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@biomejs/biome": "1.8.
|
|
50
|
-
"@types/node": "^20.
|
|
51
|
-
"rimraf": "^5.0.
|
|
52
|
-
"typescript": "^5.
|
|
53
|
-
"vite": "^5.1
|
|
54
|
-
"vitest": "^1.
|
|
49
|
+
"@biomejs/biome": "1.8.2",
|
|
50
|
+
"@types/node": "^20.14.8",
|
|
51
|
+
"rimraf": "^5.0.7",
|
|
52
|
+
"typescript": "^5.5.2",
|
|
53
|
+
"vite": "^5.3.1",
|
|
54
|
+
"vitest": "^1.6.0"
|
|
55
55
|
}
|
|
56
56
|
}
|