kintone-pretty-fields 0.5.9 → 0.7.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/README.md CHANGED
@@ -128,7 +128,7 @@ console.log({ fields, spacers });
128
128
  const checkBoxFields = fields.filter(kintonePrettyFields.isCheckBox);
129
129
  console.log(checkBoxFields);
130
130
 
131
- const inSubtableFields = fields.filter(kintonePrettyFields.enableInSubtable).filter(kintonePrettyFields.isInSubtable);
131
+ const inSubtableFields = fields.filter(kintonePrettyFields.isInSubtable);
132
132
  console.log(inSubtableFields);
133
133
 
134
134
  const myFunction1 = (fields: kintonePrettyType.OneOf[]) => {
@@ -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,8 +31,12 @@ 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;
35
- export declare const enableInSubtable: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.InSubtable;
36
- export declare const isInSubtable: <T extends kintonePrettyType.InSubtable>(field: T) => field is T & {
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;
36
+ export declare const isInGroup: <T extends kintonePrettyType.OneOf>(field: T) => field is T & {
37
+ group: string;
38
+ };
39
+ export declare const isInSubtable: <T extends kintonePrettyType.OneOf>(field: T) => field is T & {
37
40
  table: string;
38
41
  };
39
42
  //# sourceMappingURL=formField.d.ts.map
@@ -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,QAAQ,UAAW,kBAAkB,KAAK,sCAOtD,CAAC;AACF,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;AACnC,eAAO,MAAM,gBAAgB,UAAW,kBAAkB,KAAK,0CAsB9D,CAAC;AACF,eAAO,MAAM,YAAY;WAA6E,MAAM;CAA+B,CAAC"}
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,SAAS;WAAwE,MAAM;CAAsB,CAAC;AAC3H,eAAO,MAAM,YAAY;WAAwE,MAAM;CAAsB,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,8 +32,12 @@ 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;
36
- enableInSubtable: (field: kintonePrettyType.OneOf) => field is kintonePrettyType.InSubtable;
37
- isInSubtable: <T extends kintonePrettyType.InSubtable>(field: T) => field is T & {
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;
37
+ isInGroup: <T extends kintonePrettyType.OneOf>(field: T) => field is T & {
38
+ group: string;
39
+ };
40
+ isInSubtable: <T_1 extends kintonePrettyType.OneOf>(field: T_1) => field is T_1 & {
38
41
  table: string;
39
42
  };
40
43
  get: ({ client, app, lang, preview }: {
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAqC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
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,51 +1,52 @@
1
- const H = (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", m = (t) => t.type === "MULTI_LINE_TEXT", R = (t) => t.type === "RICH_TEXT", L = (t) => t.type === "NUMBER", j = (t) => t.type === "CALC", C = (t) => t.type === "CHECK_BOX", _ = (t) => t.type === "RADIO_BUTTON", g = (t) => t.type === "MULTI_SELECT", b = (t) => t.type === "DROP_DOWN", O = (t) => t.type === "USER_SELECT", I = (t) => t.type === "ORGANIZATION_SELECT", A = (t) => t.type === "GROUP_SELECT", N = (t) => t.type === "DATE", f = (t) => t.type === "TIME", D = (t) => t.type === "DATETIME", M = (t) => t.type === "LINK", v = (t) => t.type === "FILE", X = (t) => t.type === "SINGLE_LINE_TEXT" && "lookup" in t || t.type === "NUMBER" && "lookup" in t || t.type === "CALC" && "lookup" in t || t.type === "LINK" && "lookup" in t || t.type === "RECORD_NUMBER" && "lookup" in t, 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", $ = (t) => S(t) || L(t) || j(t) || m(t) || R(t) || M(t) || C(t) || _(t) || b(t) || g(t) || v(t) || N(t) || f(t) || D(t) || O(t) || I(t) || A(t) || w(t) || X(t), ee = (t) => t.table !== void 0, te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1
+ const v = (t) => t.type === "RECORD_NUMBER", X = (t) => t.type === "CREATOR", w = (t) => t.type === "CREATED_TIME", H = (t) => t.type === "MODIFIER", z = (t) => t.type === "UPDATED_TIME", E = (t) => t.type === "SINGLE_LINE_TEXT", m = (t) => t.type === "MULTI_LINE_TEXT", R = (t) => t.type === "RICH_TEXT", l = (t) => t.type === "NUMBER", g = (t) => t.type === "CALC", _ = (t) => t.type === "CHECK_BOX", O = (t) => t.type === "RADIO_BUTTON", b = (t) => t.type === "MULTI_SELECT", I = (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", F = (t) => t.type === "LINK", K = (t) => t.type === "FILE", W = (t) => t.type === "SUBTABLE", Z = (t) => t.type === "GROUP", Y = (t) => t.type === "REFERENCE_TABLE", q = (t) => t.type === "CATEGORY", J = (t) => t.type === "STATUS", Q = (t) => t.type === "STATUS_ASSIGNEE", V = (t) => !!(E(t) && "lookup" in t || l(t) && "lookup" in t || g(t) && "lookup" in t || F(t) && "lookup" in t || v(t) && "lookup" in t), $ = (t) => !!(E(t) && "isLookupCopy" in t || m(t) && "isLookupCopy" in t || R(t) && "isLookupCopy" in t || l(t) && "isLookupCopy" in t || g(t) && "isLookupCopy" in t || _(t) && "isLookupCopy" in t || O(t) && "isLookupCopy" in t || b(t) && "isLookupCopy" in t || I(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 || F(t) && "isLookupCopy" in t), ee = (t) => "group" in t, te = (t) => "table" in t, ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2
2
  __proto__: null,
3
- enableInSubtable: $,
4
- isCalc: j,
5
- isCategory: J,
6
- isCheckBox: C,
7
- isCreatedTime: z,
8
- isCreator: K,
3
+ isCalc: g,
4
+ isCategory: q,
5
+ isCheckBox: _,
6
+ isCreatedTime: w,
7
+ isCreator: X,
9
8
  isDate: N,
10
- isDatetime: D,
11
- isDropDown: b,
12
- isFile: v,
13
- isGroup: q,
14
- isGroupSelect: A,
15
- isInSubtable: ee,
16
- isLink: M,
17
- isLookup: X,
18
- isModifier: W,
9
+ isDatetime: U,
10
+ isDropDown: I,
11
+ isFile: K,
12
+ isGroup: Z,
13
+ isGroupSelect: D,
14
+ isInGroup: ee,
15
+ isInSubtable: te,
16
+ isLink: F,
17
+ isLookup: V,
18
+ isLookupCopy: $,
19
+ isModifier: H,
19
20
  isMultiLineText: m,
20
- isMultiSelect: g,
21
- isNumber: L,
22
- isOrganizationSelect: I,
23
- isRadioButton: _,
24
- isRecordNumber: H,
25
- isReferenceTable: w,
21
+ isMultiSelect: b,
22
+ isNumber: l,
23
+ isOrganizationSelect: f,
24
+ isRadioButton: O,
25
+ isRecordNumber: v,
26
+ isReferenceTable: Y,
26
27
  isRichText: R,
27
- isSingleLineText: S,
28
- isStatus: Q,
29
- isStatusAssignee: V,
30
- isSubtable: Y,
31
- isTime: f,
32
- isUpdatedTime: Z,
33
- isUserSelect: O
28
+ isSingleLineText: E,
29
+ isStatus: J,
30
+ isStatusAssignee: Q,
31
+ isSubtable: W,
32
+ isTime: M,
33
+ isUpdatedTime: z,
34
+ isUserSelect: A
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 : {}, F = { exports: {} };
36
+ var oe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, S = { exports: {} };
36
37
  (function(t, d) {
37
38
  (function(o, c) {
38
39
  c(d);
39
- })(ie, function(o) {
40
- 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" })), E = 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" }));
41
- o.guardFormField = c, o.guardFormLayout = E, o.guardRecord = T, Object.defineProperty(o, Symbol.toStringTag, { value: "Module" });
40
+ })(oe, function(o) {
41
+ 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", 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
+ o.guardFormField = c, o.guardFormLayout = y, o.guardRecord = T, Object.defineProperty(o, Symbol.toStringTag, { value: "Module" });
42
43
  });
43
- })(F, F.exports);
44
- var i = F.exports;
45
- const l = (t) => Object.values(t).sort((d, o) => Number(d.index) - Number(o.index)).map(({ label: d }) => d), oe = (t, d) => {
46
- var k;
47
- const o = [], c = [], E = Object.values(t).find(i.guardFormField.isStatus);
48
- E && E.enabled && o.push(E);
44
+ })(S, S.exports);
45
+ var i = S.exports;
46
+ const C = (t) => Object.values(t).sort((d, o) => Number(d.index) - Number(o.index)).map(({ label: d }) => d), se = (t, d) => {
47
+ var P;
48
+ const o = [], c = [], y = Object.values(t).find(i.guardFormField.isStatus);
49
+ y && y.enabled && o.push(y);
49
50
  const T = Object.values(t).find(i.guardFormField.isStatusAssignee);
50
51
  T && T.enabled && o.push(T);
51
52
  const e = Object.values(t).find(i.guardFormField.isCategory);
@@ -59,69 +60,69 @@ const l = (t) => Object.values(t).sort((d, o) => Number(d.index) - Number(o.inde
59
60
  c.push(r);
60
61
  continue;
61
62
  }
62
- const n = t[r.code];
63
- if (!i.guardFormField.isSubtable(n) && !i.guardFormField.isGroup(n)) {
64
- if (i.guardFormField.isCheckBox(n) || i.guardFormField.isDropDown(n) || i.guardFormField.isMultiSelect(n) || i.guardFormField.isRadioButton(n)) {
65
- const s = l(n.options);
66
- o.push({ ...n, sortedOptions: s });
63
+ const u = t[r.code];
64
+ if (!i.guardFormField.isSubtable(u) && !i.guardFormField.isGroup(u)) {
65
+ if (i.guardFormField.isCheckBox(u) || i.guardFormField.isDropDown(u) || i.guardFormField.isMultiSelect(u) || i.guardFormField.isRadioButton(u)) {
66
+ const s = C(u.options);
67
+ o.push({ ...u, sortedOptions: s });
67
68
  continue;
68
69
  }
69
- o.push(n);
70
+ o.push(u);
70
71
  }
71
72
  }
72
73
  else if (i.guardFormLayout.isSubtable(p)) {
73
- const r = p.code, n = t[r];
74
- if (!i.guardFormField.isSubtable(n))
74
+ const r = p.code, u = t[r];
75
+ if (!i.guardFormField.isSubtable(u))
75
76
  continue;
76
77
  const s = {};
77
- for (const { code: y } of p.fields) {
78
- const a = n.fields[y];
78
+ for (const { code: L } of p.fields) {
79
+ const a = u.fields[L];
79
80
  if (i.guardFormField.isCheckBox(a) || i.guardFormField.isDropDown(a) || i.guardFormField.isMultiSelect(a) || i.guardFormField.isRadioButton(a)) {
80
- const u = l(a.options);
81
- s[a.code] = { ...a, table: r, sortedOptions: u }, o.push({ ...a, table: r, sortedOptions: u });
81
+ const n = C(a.options);
82
+ s[a.code] = { ...a, table: r, sortedOptions: n }, o.push({ ...a, table: r, sortedOptions: n });
82
83
  continue;
83
84
  }
84
85
  s[a.code] = { ...a, table: r }, o.push({ ...a, table: r });
85
86
  }
86
- o.push({ ...n, fields: s });
87
+ o.push({ ...u, fields: s });
87
88
  } else if (i.guardFormLayout.isGroup(p)) {
88
- const r = p.code, n = t[r];
89
- if (!i.guardFormField.isGroup(n))
89
+ const r = p.code, u = t[r];
90
+ if (!i.guardFormField.isGroup(u))
90
91
  continue;
91
92
  const s = {};
92
- for (const y of p.layout)
93
- for (const a of y.fields) {
93
+ for (const L of p.layout)
94
+ for (const a of L.fields) {
94
95
  if (i.guardFormLayout.isLabel(a) || i.guardFormLayout.isHr(a))
95
96
  continue;
96
97
  if (i.guardFormLayout.isSpacer(a)) {
97
98
  c.push(a);
98
99
  continue;
99
100
  }
100
- const u = t[a.code];
101
- if (!i.guardFormField.isCategory(u) && !i.guardFormField.isStatus(u) && !i.guardFormField.isStatusAssignee(u) && !i.guardFormField.isSubtable(u) && !i.guardFormField.isGroup(u)) {
102
- if (i.guardFormField.isCheckBox(u) || i.guardFormField.isDropDown(u) || i.guardFormField.isMultiSelect(u) || i.guardFormField.isRadioButton(u)) {
103
- const P = l(u.options);
104
- s[u.code] = { ...u, group: r, sortedOptions: P }, o.push({ ...u, group: r, sortedOptions: P });
101
+ const n = t[a.code];
102
+ if (!i.guardFormField.isCategory(n) && !i.guardFormField.isStatus(n) && !i.guardFormField.isStatusAssignee(n) && !i.guardFormField.isSubtable(n) && !i.guardFormField.isGroup(n)) {
103
+ if (i.guardFormField.isCheckBox(n) || i.guardFormField.isDropDown(n) || i.guardFormField.isMultiSelect(n) || i.guardFormField.isRadioButton(n)) {
104
+ const j = C(n.options);
105
+ s[n.code] = { ...n, group: r, sortedOptions: j }, o.push({ ...n, group: r, sortedOptions: j });
105
106
  continue;
106
107
  }
107
- s[u.code] = { ...u, group: r }, o.push({ ...u, group: r });
108
+ s[n.code] = { ...n, group: r }, o.push({ ...n, group: r });
108
109
  }
109
110
  }
110
- o.push({ ...n, fields: s });
111
+ o.push({ ...u, fields: s });
111
112
  }
112
113
  for (const p of Object.values(o))
113
114
  if (i.guardFormField.isLookup(p)) {
114
115
  if (p.lookup === null)
115
116
  continue;
116
117
  for (const r of p.lookup.fieldMappings) {
117
- const n = (k = o.filter(
118
- (s) => S(s) || L(s) || m(s) || R(s) || M(s) || C(s) || _(s) || b(s) || g(s) || N(s) || f(s) || D(s) || O(s) || I(s) || A(s)
119
- )) == null ? void 0 : k.find((s) => s.code === r.field);
120
- n && (n.isLookupCopy = !0);
118
+ const u = (P = o.filter(
119
+ (s) => E(s) || l(s) || m(s) || R(s) || F(s) || _(s) || O(s) || I(s) || b(s) || N(s) || M(s) || U(s) || A(s) || f(s) || D(s)
120
+ )) == null ? void 0 : P.find((s) => s.code === r.field);
121
+ u && (u.isLookupCopy = !0);
121
122
  }
122
123
  }
123
- const U = Object.values(t).find(i.guardFormField.isRecordNumber);
124
- U && (o.some(i.guardFormField.isRecordNumber) || o.push(U));
124
+ const k = Object.values(t).find(i.guardFormField.isRecordNumber);
125
+ k && (o.some(i.guardFormField.isRecordNumber) || o.push(k));
125
126
  const B = Object.values(t).find(i.guardFormField.isCreator);
126
127
  B && (o.some(i.guardFormField.isCreator) || o.push(B));
127
128
  const G = Object.values(t).find(i.guardFormField.isCreatedTime);
@@ -130,13 +131,13 @@ const l = (t) => Object.values(t).sort((d, o) => Number(d.index) - Number(o.inde
130
131
  h && (o.some(i.guardFormField.isModifier) || o.push(h));
131
132
  const x = Object.values(t).find(i.guardFormField.isUpdatedTime);
132
133
  return x && (o.some(i.guardFormField.isUpdatedTime) || o.push(x)), { fields: o, spacers: c };
133
- }, se = async ({ client: t, app: d, lang: o, preview: c }) => {
134
- const [{ properties: E }, { layout: T }] = await Promise.all([
134
+ }, re = async ({ client: t, app: d, lang: o, preview: c }) => {
135
+ const [{ properties: y }, { layout: T }] = await Promise.all([
135
136
  t.app.getFormFields({ app: d, lang: o, preview: c }),
136
137
  t.app.getFormLayout({ app: d, preview: c })
137
138
  ]);
138
- return oe(E, T);
139
- }, re = { get: se, ...te };
139
+ return se(y, T);
140
+ }, ue = { get: re, ...ie };
140
141
  export {
141
- re as kintonePrettyFields
142
+ ue as kintonePrettyFields
142
143
  };
@@ -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",S=t=>t.type==="MULTI_LINE_TEXT",m=t=>t.type==="RICH_TEXT",R=t=>t.type==="NUMBER",G=t=>t.type==="CALC",L=t=>t.type==="CHECK_BOX",g=t=>t.type==="RADIO_BUTTON",C=t=>t.type==="MULTI_SELECT",_=t=>t.type==="DROP_DOWN",b=t=>t.type==="USER_SELECT",I=t=>t.type==="ORGANIZATION_SELECT",O=t=>t.type==="GROUP_SELECT",f=t=>t.type==="DATE",A=t=>t.type==="TIME",N=t=>t.type==="DATETIME",M=t=>t.type==="LINK",h=t=>t.type==="FILE",x=t=>t.type==="SINGLE_LINE_TEXT"&&"lookup"in t||t.type==="NUMBER"&&"lookup"in t||t.type==="CALC"&&"lookup"in t||t.type==="LINK"&&"lookup"in t||t.type==="RECORD_NUMBER"&&"lookup"in t,q=t=>t.type==="SUBTABLE",J=t=>t.type==="GROUP",k=t=>t.type==="REFERENCE_TABLE",Q=Object.freeze(Object.defineProperty({__proto__:null,enableInSubtable:t=>F(t)||R(t)||G(t)||S(t)||m(t)||M(t)||L(t)||g(t)||_(t)||C(t)||h(t)||f(t)||A(t)||N(t)||b(t)||I(t)||O(t)||k(t)||x(t),isCalc:G,isCategory:t=>t.type==="CATEGORY",isCheckBox:L,isCreatedTime:W,isCreator:z,isDate:f,isDatetime:N,isDropDown:_,isFile:h,isGroup:J,isGroupSelect:O,isInSubtable:t=>t.table!==void 0,isLink:M,isLookup:x,isModifier:Z,isMultiLineText:S,isMultiSelect:C,isNumber:R,isOrganizationSelect:I,isRadioButton:g,isRecordNumber:l,isReferenceTable:k,isRichText:m,isSingleLineText:F,isStatus:t=>t.type==="STATUS",isStatusAssignee:t=>t.type==="STATUS_ASSIGNEE",isSubtable:q,isTime:A,isUpdatedTime:Y,isUserSelect:b},Symbol.toStringTag,{value:"Module"}));var V=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},D={exports:{}};(function(t,a){(function(o,c){c(a)})(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",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"}));o.guardFormField=c,o.guardFormLayout=y,o.guardRecord=T,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})})})(D,D.exports);var i=D.exports;const U=t=>Object.values(t).sort((a,o)=>Number(a.index)-Number(o.index)).map(({label:a})=>a),$=(t,a)=>{var H;const o=[],c=[],y=Object.values(t).find(i.guardFormField.isStatus);y&&y.enabled&&o.push(y);const T=Object.values(t).find(i.guardFormField.isStatusAssignee);T&&T.enabled&&o.push(T);const e=Object.values(t).find(i.guardFormField.isCategory);e&&e.enabled&&o.push(e);for(const p of a)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 n=t[r.code];if(!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 s=U(n.options);o.push({...n,sortedOptions:s});continue}o.push(n)}}else if(i.guardFormLayout.isSubtable(p)){const r=p.code,n=t[r];if(!i.guardFormField.isSubtable(n))continue;const s={};for(const{code:B}of p.fields){const d=n.fields[B];if(i.guardFormField.isCheckBox(d)||i.guardFormField.isDropDown(d)||i.guardFormField.isMultiSelect(d)||i.guardFormField.isRadioButton(d)){const u=U(d.options);s[d.code]={...d,table:r,sortedOptions:u},o.push({...d,table:r,sortedOptions:u});continue}s[d.code]={...d,table:r},o.push({...d,table:r})}o.push({...n,fields:s})}else if(i.guardFormLayout.isGroup(p)){const r=p.code,n=t[r];if(!i.guardFormField.isGroup(n))continue;const s={};for(const B of p.layout)for(const d of B.fields){if(i.guardFormLayout.isLabel(d)||i.guardFormLayout.isHr(d))continue;if(i.guardFormLayout.isSpacer(d)){c.push(d);continue}const u=t[d.code];if(!i.guardFormField.isCategory(u)&&!i.guardFormField.isStatus(u)&&!i.guardFormField.isStatusAssignee(u)&&!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 K=U(u.options);s[u.code]={...u,group:r,sortedOptions:K},o.push({...u,group:r,sortedOptions:K});continue}s[u.code]={...u,group:r},o.push({...u,group:r})}}o.push({...n,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 n=(H=o.filter(s=>F(s)||R(s)||S(s)||m(s)||M(s)||L(s)||g(s)||_(s)||C(s)||f(s)||A(s)||N(s)||b(s)||I(s)||O(s)))==null?void 0:H.find(s=>s.code===r.field);n&&(n.isLookupCopy=!0)}}const P=Object.values(t).find(i.guardFormField.isRecordNumber);P&&(o.some(i.guardFormField.isRecordNumber)||o.push(P));const j=Object.values(t).find(i.guardFormField.isCreator);j&&(o.some(i.guardFormField.isCreator)||o.push(j));const v=Object.values(t).find(i.guardFormField.isCreatedTime);v&&(o.some(i.guardFormField.isCreatedTime)||o.push(v));const X=Object.values(t).find(i.guardFormField.isModifier);X&&(o.some(i.guardFormField.isModifier)||o.push(X));const w=Object.values(t).find(i.guardFormField.isUpdatedTime);return w&&(o.some(i.guardFormField.isUpdatedTime)||o.push(w)),{fields:o,spacers:c}},ee={get:async({client:t,app:a,lang:o,preview:c})=>{const[{properties:y},{layout:T}]=await Promise.all([t.app.getFormFields({app:a,lang:o,preview:c}),t.app.getFormLayout({app:a,preview:c})]);return $(y,T)},...Q};E.kintonePrettyFields=ee,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
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",w=t=>t.type==="CREATOR",H=t=>t.type==="CREATED_TIME",K=t=>t.type==="MODIFIER",z=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",_=t=>t.type==="RADIO_BUTTON",b=t=>t.type==="MULTI_SELECT",f=t=>t.type==="DROP_DOWN",O=t=>t.type==="USER_SELECT",I=t=>t.type==="ORGANIZATION_SELECT",A=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",W=Object.freeze(Object.defineProperty({__proto__:null,isCalc:R,isCategory:t=>t.type==="CATEGORY",isCheckBox:g,isCreatedTime:H,isCreator:w,isDate:D,isDatetime:N,isDropDown:f,isFile:t=>t.type==="FILE",isGroup:t=>t.type==="GROUP",isGroupSelect:A,isInGroup:t=>"group"in t,isInSubtable:t=>"table"in t,isLink:S,isLookup: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),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||_(t)&&"isLookupCopy"in t||b(t)&&"isLookupCopy"in t||f(t)&&"isLookupCopy"in t||O(t)&&"isLookupCopy"in t||I(t)&&"isLookupCopy"in t||A(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:K,isMultiLineText:m,isMultiSelect:b,isNumber:L,isOrganizationSelect:I,isRadioButton:_,isRecordNumber:l,isReferenceTable:t=>t.type==="REFERENCE_TABLE",isRichText:C,isSingleLineText:F,isStatus:t=>t.type==="STATUS",isStatusAssignee:t=>t.type==="STATUS_ASSIGNEE",isSubtable:t=>t.type==="SUBTABLE",isTime:M,isUpdatedTime:z,isUserSelect:O},Symbol.toStringTag,{value:"Module"}));var Z=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)})(Z,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",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"}));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),Y=(t,d)=>{var v;const o=[],c=[],y=Object.values(t).find(i.guardFormField.isStatus);y&&y.enabled&&o.push(y);const T=Object.values(t).find(i.guardFormField.isStatusAssignee);T&&T.enabled&&o.push(T);const e=Object.values(t).find(i.guardFormField.isCategory);e&&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);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 X=k(n.options);s[n.code]={...n,group:r,sortedOptions:X},o.push({...n,group:r,sortedOptions:X});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=(v=o.filter(s=>F(s)||L(s)||m(s)||C(s)||S(s)||g(s)||_(s)||f(s)||b(s)||D(s)||M(s)||N(s)||O(s)||I(s)||A(s)))==null?void 0:v.find(s=>s.code===r.field);u&&(u.isLookupCopy=!0)}}const G=Object.values(t).find(i.guardFormField.isRecordNumber);G&&(o.some(i.guardFormField.isRecordNumber)||o.push(G));const h=Object.values(t).find(i.guardFormField.isCreator);h&&(o.some(i.guardFormField.isCreator)||o.push(h));const x=Object.values(t).find(i.guardFormField.isCreatedTime);x&&(o.some(i.guardFormField.isCreatedTime)||o.push(x));const P=Object.values(t).find(i.guardFormField.isModifier);P&&(o.some(i.guardFormField.isModifier)||o.push(P));const j=Object.values(t).find(i.guardFormField.isUpdatedTime);return j&&(o.some(i.guardFormField.isUpdatedTime)||o.push(j)),{fields:o,spacers:c}},q={get: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 Y(y,T)},...W};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.5.9",
7
+ "version": "0.7.0",
8
8
  "description": "Get kintone form fields in a pretty format.",
9
9
  "repository": {
10
10
  "type": "git",