kintone-pretty-fields 0.5.8 → 0.6.0
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 +2 -1
- package/dist/functions/formField.d.ts.map +1 -1
- package/dist/functions/utility.d.ts +5 -1
- package/dist/functions/utility.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -96
- package/dist/index.umd.cjs +1 -1
- package/package.json +5 -3
|
@@ -21,7 +21,6 @@ export declare const isTime: (field: kintonePrettyType.OneOf) => field is kinton
|
|
|
21
21
|
export declare const isDatetime: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.DateTime;
|
|
22
22
|
export declare const isLink: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Link;
|
|
23
23
|
export declare const isFile: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.File;
|
|
24
|
-
export declare const isLookup: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Lookup;
|
|
25
24
|
export declare const isSubtable: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Subtable<{
|
|
26
25
|
[fieldCode: string]: kintonePrettyType.InSubtable;
|
|
27
26
|
}>;
|
|
@@ -32,6 +31,8 @@ export declare const isReferenceTable: (field: kintonePrettyType.OneOf) => field
|
|
|
32
31
|
export declare const isCategory: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Category;
|
|
33
32
|
export declare const isStatus: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Status;
|
|
34
33
|
export declare const isStatusAssignee: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.StatusAssignee;
|
|
34
|
+
export declare const isLookup: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Lookup;
|
|
35
|
+
export declare const 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;
|
|
35
36
|
export declare const enableInSubtable: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.InSubtable;
|
|
36
37
|
export declare const isInSubtable: <T extends kintonePrettyType.InSubtable>(field: T) => field is T & {
|
|
37
38
|
table: string;
|
|
@@ -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,UAAW,kBAAkB,KAAK,4CAA4E,CAAC;AAC1I,eAAO,MAAM,SAAS,UAAW,kBAAkB,KAAK,uCAAiE,CAAC;AAC1H,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAmE,CAAC;AAC7H,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAK,8CAC5B,CAAC;AACpC,eAAO,MAAM,eAAe,UAAW,kBAAkB,KAAK,6CAC5B,CAAC;AACnC,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAoE,CAAC;AAC9H,eAAO,MAAM,QAAQ,UAAW,kBAAkB,KAAK,sCAA+D,CAAC;AACvH,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAoE,CAAC;AAC9H,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAoE,CAAC;AAC9H,eAAO,MAAM,YAAY,UAAW,kBAAkB,KAAK,0CAAwE,CAAC;AACpI,eAAO,MAAM,oBAAoB,UAAW,kBAAkB,KAAK,kDAC7B,CAAC;AACvC,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAmE,CAAC;AAC7H,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,
|
|
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,UAAW,kBAAkB,KAAK,4CAA4E,CAAC;AAC1I,eAAO,MAAM,SAAS,UAAW,kBAAkB,KAAK,uCAAiE,CAAC;AAC1H,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAmE,CAAC;AAC7H,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAK,8CAC5B,CAAC;AACpC,eAAO,MAAM,eAAe,UAAW,kBAAkB,KAAK,6CAC5B,CAAC;AACnC,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAoE,CAAC;AAC9H,eAAO,MAAM,QAAQ,UAAW,kBAAkB,KAAK,sCAA+D,CAAC;AACvH,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAoE,CAAC;AAC9H,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAoE,CAAC;AAC9H,eAAO,MAAM,YAAY,UAAW,kBAAkB,KAAK,0CAAwE,CAAC;AACpI,eAAO,MAAM,oBAAoB,UAAW,kBAAkB,KAAK,kDAC7B,CAAC;AACvC,eAAO,MAAM,aAAa,UAAW,kBAAkB,KAAK,2CAA0E,CAAC;AACvI,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAmE,CAAC;AAC7H,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,MAAM,UAAW,kBAAkB,KAAK,oCAA2D,CAAC;AACjH,eAAO,MAAM,UAAU,UACd,kBAAkB,KAAK;;EAC0F,CAAC;AAC3H,eAAO,MAAM,OAAO,UACX,kBAAkB,KAAK;;EACiF,CAAC;AAClH,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAK,8CAC7B,CAAC;AACnC,eAAO,MAAM,UAAU,UAAW,kBAAkB,KAAK,wCAAmE,CAAC;AAC7H,eAAO,MAAM,QAAQ,UAAW,kBAAkB,KAAK,sCAA+D,CAAC;AACvH,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAK,8CAC7B,CAAC;AAEnC,eAAO,MAAM,QAAQ,UAAW,kBAAkB,KAAK,sCAOtD,CAAC;AACF,eAAO,MAAM,YAAY,UAChB,kBAAkB,KAAK,yeAmC/B,CAAC;AACF,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAK,0CAsB9D,CAAC;AACF,eAAO,MAAM,YAAY;WAA6E,MAAM;CAA+B,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { KintoneRestAPIClient } from "@kintone/rest-api-client";
|
|
2
|
-
import { AppID, Lang } from "@kintone/rest-api-client/lib/src/client/types";
|
|
2
|
+
import { AppID, Lang, Layout, Properties } from "@kintone/rest-api-client/lib/src/client/types";
|
|
3
3
|
import { Spacer } from "@kintone/rest-api-client/lib/src/KintoneFields/types/fieldLayout";
|
|
4
4
|
import type * as kintonePrettyType from "../exportTypes/formField";
|
|
5
|
+
export declare const generateFields: (formFields: Properties, formLayouts: Layout) => {
|
|
6
|
+
fields: kintonePrettyType.OneOf[];
|
|
7
|
+
spacers: Spacer[];
|
|
8
|
+
};
|
|
5
9
|
declare const get: ({ client, app, lang, preview }: {
|
|
6
10
|
client: KintoneRestAPIClient;
|
|
7
11
|
app: AppID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/functions/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"utility.d.ts","sourceRoot":"","sources":["../../src/functions/utility.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,kEAAkE,CAAC;AAI1F,OAAO,KAAK,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAanE,eAAO,MAAM,cAAc,eAAgB,UAAU;;;CAwMpD,CAAC;AAEF,QAAA,MAAM,GAAG;YAAoD,oBAAoB;SAAO,KAAK;UAAQ,IAAI;aAAW,OAAO;;;;EAO1H,CAAC;AAEF,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ declare const kintonePrettyFields: {
|
|
|
22
22
|
isDatetime: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.DateTime;
|
|
23
23
|
isLink: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Link;
|
|
24
24
|
isFile: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.File;
|
|
25
|
-
isLookup: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Lookup;
|
|
26
25
|
isSubtable: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Subtable<{
|
|
27
26
|
[fieldCode: string]: kintonePrettyType.InSubtable;
|
|
28
27
|
}>;
|
|
@@ -33,6 +32,8 @@ declare const kintonePrettyFields: {
|
|
|
33
32
|
isCategory: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Category;
|
|
34
33
|
isStatus: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Status;
|
|
35
34
|
isStatusAssignee: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.StatusAssignee;
|
|
35
|
+
isLookup: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.Lookup;
|
|
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;
|
|
36
37
|
enableInSubtable: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.InSubtable;
|
|
37
38
|
isInSubtable: <T extends kintonePrettyType.InSubtable>(field: T) => field is T & {
|
|
38
39
|
table: string;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAGlE,QAAA,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAGlE,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,142 +1,143 @@
|
|
|
1
|
-
const
|
|
1
|
+
const v = (t) => t.type === "RECORD_NUMBER", z = (t) => t.type === "CREATOR", K = (t) => t.type === "CREATED_TIME", W = (t) => t.type === "MODIFIER", Z = (t) => t.type === "UPDATED_TIME", E = (t) => t.type === "SINGLE_LINE_TEXT", L = (t) => t.type === "MULTI_LINE_TEXT", S = (t) => t.type === "RICH_TEXT", l = (t) => t.type === "NUMBER", C = (t) => t.type === "CALC", m = (t) => t.type === "CHECK_BOX", R = (t) => t.type === "RADIO_BUTTON", g = (t) => t.type === "MULTI_SELECT", _ = (t) => t.type === "DROP_DOWN", b = (t) => t.type === "USER_SELECT", O = (t) => t.type === "ORGANIZATION_SELECT", I = (t) => t.type === "GROUP_SELECT", A = (t) => t.type === "DATE", D = (t) => t.type === "TIME", N = (t) => t.type === "DATETIME", F = (t) => t.type === "LINK", X = (t) => t.type === "FILE", Y = (t) => t.type === "SUBTABLE", q = (t) => t.type === "GROUP", w = (t) => t.type === "REFERENCE_TABLE", J = (t) => t.type === "CATEGORY", Q = (t) => t.type === "STATUS", V = (t) => t.type === "STATUS_ASSIGNEE", H = (t) => !!(E(t) && "lookup" in t || l(t) && "lookup" in t || C(t) && "lookup" in t || F(t) && "lookup" in t || v(t) && "lookup" in t), $ = (t) => !!(E(t) && "isLookupCopy" in t || L(t) && "isLookupCopy" in t || S(t) && "isLookupCopy" in t || l(t) && "isLookupCopy" in t || C(t) && "isLookupCopy" in t || m(t) && "isLookupCopy" in t || R(t) && "isLookupCopy" in t || g(t) && "isLookupCopy" in t || _(t) && "isLookupCopy" in t || b(t) && "isLookupCopy" in t || O(t) && "isLookupCopy" in t || I(t) && "isLookupCopy" in t || A(t) && "isLookupCopy" in t || D(t) && "isLookupCopy" in t || N(t) && "isLookupCopy" in t || F(t) && "isLookupCopy" in t), ee = (t) => E(t) || l(t) || C(t) || L(t) || S(t) || F(t) || m(t) || R(t) || _(t) || g(t) || X(t) || A(t) || D(t) || N(t) || b(t) || O(t) || I(t) || w(t) || H(t), te = (t) => t.table !== void 0, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2
2
|
__proto__: null,
|
|
3
|
-
enableInSubtable:
|
|
4
|
-
isCalc:
|
|
3
|
+
enableInSubtable: ee,
|
|
4
|
+
isCalc: C,
|
|
5
5
|
isCategory: J,
|
|
6
|
-
isCheckBox:
|
|
6
|
+
isCheckBox: m,
|
|
7
7
|
isCreatedTime: K,
|
|
8
8
|
isCreator: z,
|
|
9
|
-
isDate:
|
|
10
|
-
isDatetime:
|
|
11
|
-
isDropDown:
|
|
12
|
-
isFile:
|
|
9
|
+
isDate: A,
|
|
10
|
+
isDatetime: N,
|
|
11
|
+
isDropDown: _,
|
|
12
|
+
isFile: X,
|
|
13
13
|
isGroup: q,
|
|
14
|
-
isGroupSelect:
|
|
15
|
-
isInSubtable:
|
|
16
|
-
isLink:
|
|
17
|
-
isLookup:
|
|
14
|
+
isGroupSelect: I,
|
|
15
|
+
isInSubtable: te,
|
|
16
|
+
isLink: F,
|
|
17
|
+
isLookup: H,
|
|
18
|
+
isLookupCopy: $,
|
|
18
19
|
isModifier: W,
|
|
19
|
-
isMultiLineText:
|
|
20
|
-
isMultiSelect:
|
|
21
|
-
isNumber:
|
|
22
|
-
isOrganizationSelect:
|
|
23
|
-
isRadioButton:
|
|
24
|
-
isRecordNumber:
|
|
20
|
+
isMultiLineText: L,
|
|
21
|
+
isMultiSelect: g,
|
|
22
|
+
isNumber: l,
|
|
23
|
+
isOrganizationSelect: O,
|
|
24
|
+
isRadioButton: R,
|
|
25
|
+
isRecordNumber: v,
|
|
25
26
|
isReferenceTable: w,
|
|
26
|
-
isRichText:
|
|
27
|
-
isSingleLineText:
|
|
27
|
+
isRichText: S,
|
|
28
|
+
isSingleLineText: E,
|
|
28
29
|
isStatus: Q,
|
|
29
30
|
isStatusAssignee: V,
|
|
30
31
|
isSubtable: Y,
|
|
31
|
-
isTime:
|
|
32
|
+
isTime: D,
|
|
32
33
|
isUpdatedTime: Z,
|
|
33
|
-
isUserSelect:
|
|
34
|
+
isUserSelect: b
|
|
34
35
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
35
|
-
var ie = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
|
|
36
|
-
(function(t,
|
|
37
|
-
(function(
|
|
38
|
-
c
|
|
39
|
-
})(ie, function(
|
|
40
|
-
const
|
|
41
|
-
|
|
36
|
+
var ie = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, f = { exports: {} };
|
|
37
|
+
(function(t, c) {
|
|
38
|
+
(function(i, y) {
|
|
39
|
+
y(c);
|
|
40
|
+
})(ie, function(i) {
|
|
41
|
+
const y = 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" })), d = 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
|
+
i.guardFormField = y, i.guardFormLayout = d, i.guardRecord = T, Object.defineProperty(i, Symbol.toStringTag, { value: "Module" });
|
|
42
43
|
});
|
|
43
|
-
})(
|
|
44
|
-
var
|
|
45
|
-
const
|
|
44
|
+
})(f, f.exports);
|
|
45
|
+
var o = f.exports;
|
|
46
|
+
const U = (t) => Object.values(t).sort((c, i) => Number(c.index) - Number(i.index)).map(({ label: c }) => c), se = (t, c) => {
|
|
46
47
|
var P;
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
const T = Object.values(t).find(
|
|
50
|
-
T && T.enabled &&
|
|
51
|
-
const e = Object.values(t).find(
|
|
52
|
-
e && e.enabled &&
|
|
53
|
-
for (const p of
|
|
54
|
-
if (
|
|
48
|
+
const i = [], y = [], d = Object.values(t).find(o.guardFormField.isStatus);
|
|
49
|
+
d && d.enabled && i.push(d);
|
|
50
|
+
const T = Object.values(t).find(o.guardFormField.isStatusAssignee);
|
|
51
|
+
T && T.enabled && i.push(T);
|
|
52
|
+
const e = Object.values(t).find(o.guardFormField.isCategory);
|
|
53
|
+
e && e.enabled && i.push(e);
|
|
54
|
+
for (const p of c)
|
|
55
|
+
if (o.guardFormLayout.isRow(p))
|
|
55
56
|
for (const r of p.fields) {
|
|
56
|
-
if (
|
|
57
|
+
if (o.guardFormLayout.isLabel(r) || o.guardFormLayout.isHr(r))
|
|
57
58
|
continue;
|
|
58
|
-
if (
|
|
59
|
-
|
|
59
|
+
if (o.guardFormLayout.isSpacer(r)) {
|
|
60
|
+
y.push(r);
|
|
60
61
|
continue;
|
|
61
62
|
}
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
if (
|
|
65
|
-
const s =
|
|
66
|
-
|
|
63
|
+
const u = t[r.code];
|
|
64
|
+
if (!o.guardFormField.isSubtable(u) && !o.guardFormField.isGroup(u)) {
|
|
65
|
+
if (o.guardFormField.isCheckBox(u) || o.guardFormField.isDropDown(u) || o.guardFormField.isMultiSelect(u) || o.guardFormField.isRadioButton(u)) {
|
|
66
|
+
const s = U(u.options);
|
|
67
|
+
i.push({ ...u, sortedOptions: s });
|
|
67
68
|
continue;
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
+
i.push(u);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
|
-
else if (
|
|
73
|
-
const r = p.code,
|
|
74
|
-
if (!
|
|
73
|
+
else if (o.guardFormLayout.isSubtable(p)) {
|
|
74
|
+
const r = p.code, u = t[r];
|
|
75
|
+
if (!o.guardFormField.isSubtable(u))
|
|
75
76
|
continue;
|
|
76
77
|
const s = {};
|
|
77
|
-
for (const { code:
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
s[
|
|
78
|
+
for (const { code: M } of p.fields) {
|
|
79
|
+
const a = u.fields[M];
|
|
80
|
+
if (o.guardFormField.isCheckBox(a) || o.guardFormField.isDropDown(a) || o.guardFormField.isMultiSelect(a) || o.guardFormField.isRadioButton(a)) {
|
|
81
|
+
const n = U(a.options);
|
|
82
|
+
s[a.code] = { ...a, table: r, sortedOptions: n }, i.push({ ...a, table: r, sortedOptions: n });
|
|
82
83
|
continue;
|
|
83
84
|
}
|
|
84
|
-
s[
|
|
85
|
+
s[a.code] = { ...a, table: r }, i.push({ ...a, table: r });
|
|
85
86
|
}
|
|
86
|
-
|
|
87
|
-
} else if (
|
|
88
|
-
const r = p.code,
|
|
89
|
-
if (!
|
|
87
|
+
i.push({ ...u, fields: s });
|
|
88
|
+
} else if (o.guardFormLayout.isGroup(p)) {
|
|
89
|
+
const r = p.code, u = t[r];
|
|
90
|
+
if (!o.guardFormField.isGroup(u))
|
|
90
91
|
continue;
|
|
91
92
|
const s = {};
|
|
92
|
-
for (const
|
|
93
|
-
for (const
|
|
94
|
-
if (
|
|
93
|
+
for (const M of p.layout)
|
|
94
|
+
for (const a of M.fields) {
|
|
95
|
+
if (o.guardFormLayout.isLabel(a) || o.guardFormLayout.isHr(a))
|
|
95
96
|
continue;
|
|
96
|
-
if (
|
|
97
|
-
|
|
97
|
+
if (o.guardFormLayout.isSpacer(a)) {
|
|
98
|
+
y.push(a);
|
|
98
99
|
continue;
|
|
99
100
|
}
|
|
100
|
-
const
|
|
101
|
-
if (!
|
|
102
|
-
if (
|
|
103
|
-
const
|
|
104
|
-
s[
|
|
101
|
+
const n = t[a.code];
|
|
102
|
+
if (!o.guardFormField.isCategory(n) && !o.guardFormField.isStatus(n) && !o.guardFormField.isStatusAssignee(n) && !o.guardFormField.isSubtable(n) && !o.guardFormField.isGroup(n)) {
|
|
103
|
+
if (o.guardFormField.isCheckBox(n) || o.guardFormField.isDropDown(n) || o.guardFormField.isMultiSelect(n) || o.guardFormField.isRadioButton(n)) {
|
|
104
|
+
const j = U(n.options);
|
|
105
|
+
s[n.code] = { ...n, group: r, sortedOptions: j }, i.push({ ...n, group: r, sortedOptions: j });
|
|
105
106
|
continue;
|
|
106
107
|
}
|
|
107
|
-
s[
|
|
108
|
+
s[n.code] = { ...n, group: r }, i.push({ ...n, group: r });
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
+
i.push({ ...u, fields: s });
|
|
111
112
|
}
|
|
112
|
-
for (const p of Object.values(
|
|
113
|
-
if (
|
|
113
|
+
for (const p of Object.values(i))
|
|
114
|
+
if (o.guardFormField.isLookup(p)) {
|
|
114
115
|
if (p.lookup === null)
|
|
115
116
|
continue;
|
|
116
117
|
for (const r of p.lookup.fieldMappings) {
|
|
117
|
-
const
|
|
118
|
-
(s) =>
|
|
118
|
+
const u = (P = i.filter(
|
|
119
|
+
(s) => E(s) || l(s) || L(s) || S(s) || F(s) || m(s) || R(s) || _(s) || g(s) || A(s) || D(s) || N(s) || b(s) || O(s) || I(s)
|
|
119
120
|
)) == null ? void 0 : P.find((s) => s.code === r.field);
|
|
120
|
-
|
|
121
|
+
u && (u.isLookupCopy = !0);
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
const B = Object.values(t).find(
|
|
126
|
-
B && (
|
|
127
|
-
const G = Object.values(t).find(
|
|
128
|
-
G && (
|
|
129
|
-
const h = Object.values(t).find(
|
|
130
|
-
h && (
|
|
131
|
-
const x = Object.values(t).find(
|
|
132
|
-
return x && (
|
|
133
|
-
},
|
|
134
|
-
const [{ properties:
|
|
135
|
-
t.app.getFormFields({ app:
|
|
136
|
-
t.app.getFormLayout({ app:
|
|
124
|
+
const k = Object.values(t).find(o.guardFormField.isRecordNumber);
|
|
125
|
+
k && (i.some(o.guardFormField.isRecordNumber) || i.push(k));
|
|
126
|
+
const B = Object.values(t).find(o.guardFormField.isCreator);
|
|
127
|
+
B && (i.some(o.guardFormField.isCreator) || i.push(B));
|
|
128
|
+
const G = Object.values(t).find(o.guardFormField.isCreatedTime);
|
|
129
|
+
G && (i.some(o.guardFormField.isCreatedTime) || i.push(G));
|
|
130
|
+
const h = Object.values(t).find(o.guardFormField.isModifier);
|
|
131
|
+
h && (i.some(o.guardFormField.isModifier) || i.push(h));
|
|
132
|
+
const x = Object.values(t).find(o.guardFormField.isUpdatedTime);
|
|
133
|
+
return x && (i.some(o.guardFormField.isUpdatedTime) || i.push(x)), { fields: i, spacers: y };
|
|
134
|
+
}, re = async ({ client: t, app: c, lang: i, preview: y }) => {
|
|
135
|
+
const [{ properties: d }, { layout: T }] = await Promise.all([
|
|
136
|
+
t.app.getFormFields({ app: c, lang: i, preview: y }),
|
|
137
|
+
t.app.getFormLayout({ app: c, preview: y })
|
|
137
138
|
]);
|
|
138
|
-
return
|
|
139
|
-
},
|
|
139
|
+
return se(d, T);
|
|
140
|
+
}, ue = { get: re, ...oe };
|
|
140
141
|
export {
|
|
141
|
-
|
|
142
|
+
ue as kintonePrettyFields
|
|
142
143
|
};
|
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",z=t=>t.type==="CREATOR",W=t=>t.type==="CREATED_TIME",Z=t=>t.type==="MODIFIER",Y=t=>t.type==="UPDATED_TIME",F=t=>t.type==="SINGLE_LINE_TEXT",
|
|
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",z=t=>t.type==="CREATOR",W=t=>t.type==="CREATED_TIME",Z=t=>t.type==="MODIFIER",Y=t=>t.type==="UPDATED_TIME",F=t=>t.type==="SINGLE_LINE_TEXT",m=t=>t.type==="MULTI_LINE_TEXT",C=t=>t.type==="RICH_TEXT",L=t=>t.type==="NUMBER",R=t=>t.type==="CALC",g=t=>t.type==="CHECK_BOX",b=t=>t.type==="RADIO_BUTTON",_=t=>t.type==="MULTI_SELECT",O=t=>t.type==="DROP_DOWN",I=t=>t.type==="USER_SELECT",A=t=>t.type==="ORGANIZATION_SELECT",f=t=>t.type==="GROUP_SELECT",D=t=>t.type==="DATE",M=t=>t.type==="TIME",N=t=>t.type==="DATETIME",S=t=>t.type==="LINK",G=t=>t.type==="FILE",q=t=>t.type==="SUBTABLE",J=t=>t.type==="GROUP",h=t=>t.type==="REFERENCE_TABLE",Q=t=>t.type==="CATEGORY",V=t=>t.type==="STATUS",$=t=>t.type==="STATUS_ASSIGNEE",x=t=>!!(F(t)&&"lookup"in t||L(t)&&"lookup"in t||R(t)&&"lookup"in t||S(t)&&"lookup"in t||l(t)&&"lookup"in t),ee=Object.freeze(Object.defineProperty({__proto__:null,enableInSubtable:t=>F(t)||L(t)||R(t)||m(t)||C(t)||S(t)||g(t)||b(t)||O(t)||_(t)||G(t)||D(t)||M(t)||N(t)||I(t)||A(t)||f(t)||h(t)||x(t),isCalc:R,isCategory:Q,isCheckBox:g,isCreatedTime:W,isCreator:z,isDate:D,isDatetime:N,isDropDown:O,isFile:G,isGroup:J,isGroupSelect:f,isInSubtable:t=>t.table!==void 0,isLink:S,isLookup:x,isLookupCopy:t=>!!(F(t)&&"isLookupCopy"in t||m(t)&&"isLookupCopy"in t||C(t)&&"isLookupCopy"in t||L(t)&&"isLookupCopy"in t||R(t)&&"isLookupCopy"in t||g(t)&&"isLookupCopy"in t||b(t)&&"isLookupCopy"in t||_(t)&&"isLookupCopy"in t||O(t)&&"isLookupCopy"in t||I(t)&&"isLookupCopy"in t||A(t)&&"isLookupCopy"in t||f(t)&&"isLookupCopy"in t||D(t)&&"isLookupCopy"in t||M(t)&&"isLookupCopy"in t||N(t)&&"isLookupCopy"in t||S(t)&&"isLookupCopy"in t),isModifier:Z,isMultiLineText:m,isMultiSelect:_,isNumber:L,isOrganizationSelect:A,isRadioButton:b,isRecordNumber:l,isReferenceTable:h,isRichText:C,isSingleLineText:F,isStatus:V,isStatusAssignee:$,isSubtable:q,isTime:M,isUpdatedTime:Y,isUserSelect:I},Symbol.toStringTag,{value:"Module"}));var te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},U={exports:{}};(function(t,c){(function(i,y){y(c)})(te,function(i){const y=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"})),d=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"}));i.guardFormField=y,i.guardFormLayout=d,i.guardRecord=T,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})})})(U,U.exports);var o=U.exports;const k=t=>Object.values(t).sort((c,i)=>Number(c.index)-Number(i.index)).map(({label:c})=>c),oe=(t,c)=>{var H;const i=[],y=[],d=Object.values(t).find(o.guardFormField.isStatus);d&&d.enabled&&i.push(d);const T=Object.values(t).find(o.guardFormField.isStatusAssignee);T&&T.enabled&&i.push(T);const e=Object.values(t).find(o.guardFormField.isCategory);e&&e.enabled&&i.push(e);for(const p of c)if(o.guardFormLayout.isRow(p))for(const r of p.fields){if(o.guardFormLayout.isLabel(r)||o.guardFormLayout.isHr(r))continue;if(o.guardFormLayout.isSpacer(r)){y.push(r);continue}const u=t[r.code];if(!o.guardFormField.isSubtable(u)&&!o.guardFormField.isGroup(u)){if(o.guardFormField.isCheckBox(u)||o.guardFormField.isDropDown(u)||o.guardFormField.isMultiSelect(u)||o.guardFormField.isRadioButton(u)){const s=k(u.options);i.push({...u,sortedOptions:s});continue}i.push(u)}}else if(o.guardFormLayout.isSubtable(p)){const r=p.code,u=t[r];if(!o.guardFormField.isSubtable(u))continue;const s={};for(const{code:B}of p.fields){const a=u.fields[B];if(o.guardFormField.isCheckBox(a)||o.guardFormField.isDropDown(a)||o.guardFormField.isMultiSelect(a)||o.guardFormField.isRadioButton(a)){const n=k(a.options);s[a.code]={...a,table:r,sortedOptions:n},i.push({...a,table:r,sortedOptions:n});continue}s[a.code]={...a,table:r},i.push({...a,table:r})}i.push({...u,fields:s})}else if(o.guardFormLayout.isGroup(p)){const r=p.code,u=t[r];if(!o.guardFormField.isGroup(u))continue;const s={};for(const B of p.layout)for(const a of B.fields){if(o.guardFormLayout.isLabel(a)||o.guardFormLayout.isHr(a))continue;if(o.guardFormLayout.isSpacer(a)){y.push(a);continue}const n=t[a.code];if(!o.guardFormField.isCategory(n)&&!o.guardFormField.isStatus(n)&&!o.guardFormField.isStatusAssignee(n)&&!o.guardFormField.isSubtable(n)&&!o.guardFormField.isGroup(n)){if(o.guardFormField.isCheckBox(n)||o.guardFormField.isDropDown(n)||o.guardFormField.isMultiSelect(n)||o.guardFormField.isRadioButton(n)){const K=k(n.options);s[n.code]={...n,group:r,sortedOptions:K},i.push({...n,group:r,sortedOptions:K});continue}s[n.code]={...n,group:r},i.push({...n,group:r})}}i.push({...u,fields:s})}for(const p of Object.values(i))if(o.guardFormField.isLookup(p)){if(p.lookup===null)continue;for(const r of p.lookup.fieldMappings){const u=(H=i.filter(s=>F(s)||L(s)||m(s)||C(s)||S(s)||g(s)||b(s)||O(s)||_(s)||D(s)||M(s)||N(s)||I(s)||A(s)||f(s)))==null?void 0:H.find(s=>s.code===r.field);u&&(u.isLookupCopy=!0)}}const P=Object.values(t).find(o.guardFormField.isRecordNumber);P&&(i.some(o.guardFormField.isRecordNumber)||i.push(P));const j=Object.values(t).find(o.guardFormField.isCreator);j&&(i.some(o.guardFormField.isCreator)||i.push(j));const v=Object.values(t).find(o.guardFormField.isCreatedTime);v&&(i.some(o.guardFormField.isCreatedTime)||i.push(v));const X=Object.values(t).find(o.guardFormField.isModifier);X&&(i.some(o.guardFormField.isModifier)||i.push(X));const w=Object.values(t).find(o.guardFormField.isUpdatedTime);return w&&(i.some(o.guardFormField.isUpdatedTime)||i.push(w)),{fields:i,spacers:y}},ie={get:async({client:t,app:c,lang:i,preview:y})=>{const[{properties:d},{layout:T}]=await Promise.all([t.app.getFormFields({app:c,lang:i,preview:y}),t.app.getFormLayout({app:c,preview:y})]);return oe(d,T)},...ee};E.kintonePrettyFields=ie,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.
|
|
7
|
+
"version": "0.6.0",
|
|
8
8
|
"description": "Get kintone form fields in a pretty format.",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
"prebuild": "rimraf ./dist",
|
|
38
38
|
"build": "tsc && vite build",
|
|
39
39
|
"watch": "tsc && vite build --watch",
|
|
40
|
-
"prepare": "npm run build"
|
|
40
|
+
"prepare": "npm run build",
|
|
41
|
+
"test": "vitest"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|
|
43
44
|
"@kintone/rest-api-client": "^5.0.8",
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"prettier": "^3.2.5",
|
|
49
50
|
"rimraf": "^5.0.5",
|
|
50
51
|
"typescript": "^5.3.3",
|
|
51
|
-
"vite": "^5.1.3"
|
|
52
|
+
"vite": "^5.1.3",
|
|
53
|
+
"vitest": "^1.3.1"
|
|
52
54
|
}
|
|
53
55
|
}
|