kintone-pretty-fields 0.10.4 → 0.10.6
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/exportTypes/formField.d.ts +1 -1
- package/dist/exportTypes/formField.d.ts.map +1 -1
- package/dist/functions/formField.d.ts.map +1 -1
- package/dist/functions/utility.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +139 -128
- package/dist/index.umd.cjs +1 -1
- package/package.json +10 -10
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { Calc, Category, CheckBox, CreatedTime, Creator, Date, DateTime, Dropdown, File, Group, GroupSelect, InGroup, InSubtable, Link, Lookup, Modifier, MultiLineText, MultiSelect, Number, OneOf, OrganizationSelect, RadioButton, RecordNumber, ReferenceTable, RichText, SingleLineText, Spacer, Status, StatusAssignee, Subtable, Time, UpdatedTime, UserSelect, } from "../types/type";
|
|
2
2
|
//# sourceMappingURL=formField.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formField.d.ts","sourceRoot":"","sources":["../../src/exportTypes/formField.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,
|
|
1
|
+
{"version":3,"file":"formField.d.ts","sourceRoot":"","sources":["../../src/exportTypes/formField.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,WAAW,EACX,OAAO,EACP,UAAU,EACV,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,aAAa,EACb,WAAW,EACX,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,cAAc,EACd,MAAM,EACN,MAAM,EACN,cAAc,EACd,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,UAAU,GACV,MAAM,eAAe,CAAC"}
|
|
@@ -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,
|
|
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,GAC1B,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,YAA8C,CAAC;AAC7E,eAAO,MAAM,SAAS,GACrB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,OAAmC,CAAC;AAClE,eAAO,MAAM,aAAa,GACzB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAqC,CAAC;AACpE,eAAO,MAAM,aAAa,GACzB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,GAC5B,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,cACI,CAAC;AACnC,eAAO,MAAM,eAAe,GAC3B,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,aAAiD,CAAC;AAChF,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAsC,CAAC;AACrE,eAAO,MAAM,QAAQ,GACpB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,MAAiC,CAAC;AAChE,eAAO,MAAM,MAAM,GAClB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,IAA6B,CAAC;AAC5D,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAsC,CAAC;AACrE,eAAO,MAAM,aAAa,GACzB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,aAAa,GACzB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAsC,CAAC;AACrE,eAAO,MAAM,YAAY,GACxB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,UAA0C,CAAC;AACzE,eAAO,MAAM,oBAAoB,GAChC,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,kBACO,CAAC;AACtC,eAAO,MAAM,aAAa,GACzB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,WAA4C,CAAC;AAC3E,eAAO,MAAM,MAAM,GAClB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,IAA6B,CAAC;AAC5D,eAAO,MAAM,MAAM,GAClB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,IAA6B,CAAC;AAC5D,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAqC,CAAC;AACpE,eAAO,MAAM,MAAM,GAClB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,IAA6B,CAAC;AAC5D,eAAO,MAAM,MAAM,GAClB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,IAA6B,CAAC;AAC5D,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC;IACtC,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC;CAClD,CAA8B,CAAC;AAChC,eAAO,MAAM,OAAO,GACnB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,KAAK,CAAC;IACnC,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC;CAC/C,CAA2B,CAAC;AAC7B,eAAO,MAAM,gBAAgB,GAC5B,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,cACG,CAAC;AAClC,eAAO,MAAM,UAAU,GACtB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,QAAqC,CAAC;AACpE,eAAO,MAAM,QAAQ,GACpB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,MAAiC,CAAC;AAChE,eAAO,MAAM,gBAAgB,GAC5B,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,cACG,CAAC;AAElC,eAAO,MAAM,QAAQ,GACpB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IAAI,iBAAiB,CAAC,MAO7B,CAAC;AACF,eAAO,MAAM,YAAY,GACxB,OAAO,iBAAiB,CAAC,KAAK,KAC5B,KAAK,IACL,iBAAiB,CAAC,cAAc,GAChC,iBAAiB,CAAC,aAAa,GAC/B,iBAAiB,CAAC,QAAQ,GAC1B,iBAAiB,CAAC,MAAM,GACxB,iBAAiB,CAAC,IAAI,GACtB,iBAAiB,CAAC,QAAQ,GAC1B,iBAAiB,CAAC,WAAW,GAC7B,iBAAiB,CAAC,WAAW,GAC7B,iBAAiB,CAAC,QAAQ,GAC1B,iBAAiB,CAAC,UAAU,GAC5B,iBAAiB,CAAC,kBAAkB,GACpC,iBAAiB,CAAC,WAAW,GAC7B,iBAAiB,CAAC,IAAI,GACtB,iBAAiB,CAAC,IAAI,GACtB,iBAAiB,CAAC,QAAQ,GAC1B,iBAAiB,CAAC,IAkBpB,CAAC;AACF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,iBAAiB,CAAC,KAAK,EAC1D,OAAO,CAAC,KACN,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,OAAO,CAAqB,CAAC;AACtE,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,iBAAiB,CAAC,KAAK,EAC7D,OAAO,CAAC,KACN,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAqB,CAAC;AACzE,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,iBAAiB,CAAC,KAAK,EAChE,OAAO,CAAC,KACN,KAAK,IAAI,CAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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,
|
|
1
|
+
{"version":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,GACnB,YAAY;IACX,CAAC,SAAS,EAAE,MAAM,GAAG,wBAAwB,CAAC,KAAK,CAAC;CACpD,EACD,aAAa,iBAAiB,CAAC,KAAK,EAAE;;;CAgOtC,CAAC;AAEF,QAAA,MAAM,GAAG,GAAU,iCAKhB;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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAIlE,QAAA,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,iBAAiB,MAAM,yBAAyB,CAAC;AAIlE,QAAA,MAAM,mBAAmB;qBAHQ,8BACjC;gBAE4B,8BAEH;oBAMV,8BAEC;iBAEsC,8BAAgC;oBAAqG,8BAAgC;uBAA+G,8BAAgC;sBAAsH,8BAAgC;iBAA8G,8BAAgC;eAAiG,8BAAgC;aAA0F,8BAAgC;iBAA0F,8BAAgC;oBAAsG,8BAAgC;oBAA4G,8BAAgC;iBAAyG,8BAAgC;mBAAqG,8BAAgC;2BAAiH,8BAAgC;oBAA2H,8BAAgC;aAAqG,8BAAgC;aAAsF,8BAAgC;iBAA0F,8BAAgC;aAA8F,8BAAgC;aAAsF,8BAAgC;iBAA0F,8BAAgC;;;cAAwJ,8BAAgC;;;uBAAwJ,8BAAgC;iBAAgH,8BAAgC;eAAgG,8BAAgC;uBAAoG,8BAAgC;eAA+G,8BAAgC;mBAA6X,8BAAgC;gBAA2jD,iCAAiC,EAAE,QAAU;mBAAsG,iCAAiC,EAAE,QAAU;sBAA4G,iCAAiC,EAAE,QAAU;IAXrvL;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;CAKH,CAAC;AACF,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,177 +1,188 @@
|
|
|
1
|
-
const
|
|
1
|
+
const oe = (t) => t.type === "RECORD_NUMBER", ae = (t) => t.type === "CREATOR", ce = (t) => t.type === "CREATED_TIME", de = (t) => t.type === "MODIFIER", ye = (t) => t.type === "UPDATED_TIME", I = (t) => t.type === "SINGLE_LINE_TEXT", D = (t) => t.type === "MULTI_LINE_TEXT", N = (t) => t.type === "RICH_TEXT", O = (t) => t.type === "NUMBER", M = (t) => t.type === "CALC", U = (t) => t.type === "CHECK_BOX", B = (t) => t.type === "RADIO_BUTTON", k = (t) => t.type === "MULTI_SELECT", G = (t) => t.type === "DROP_DOWN", x = (t) => t.type === "USER_SELECT", h = (t) => t.type === "ORGANIZATION_SELECT", P = (t) => t.type === "GROUP_SELECT", v = (t) => t.type === "DATE", j = (t) => t.type === "TIME", X = (t) => t.type === "DATETIME", b = (t) => t.type === "LINK", Ee = (t) => t.type === "FILE", Te = (t) => t.type === "SUBTABLE", le = (t) => t.type === "GROUP", Fe = (t) => t.type === "REFERENCE_TABLE", Le = (t) => t.type === "CATEGORY", Se = (t) => t.type === "STATUS", me = (t) => t.type === "STATUS_ASSIGNEE", Ce = (t) => !!(I(t) && "lookup" in t || O(t) && "lookup" in t || M(t) && "lookup" in t || b(t) && "lookup" in t || oe(t) && "lookup" in t), _e = (t) => !!(I(t) && "isLookupCopy" in t || D(t) && "isLookupCopy" in t || N(t) && "isLookupCopy" in t || O(t) && "isLookupCopy" in t || M(t) && "isLookupCopy" in t || U(t) && "isLookupCopy" in t || B(t) && "isLookupCopy" in t || k(t) && "isLookupCopy" in t || G(t) && "isLookupCopy" in t || x(t) && "isLookupCopy" in t || h(t) && "isLookupCopy" in t || P(t) && "isLookupCopy" in t || v(t) && "isLookupCopy" in t || j(t) && "isLookupCopy" in t || X(t) && "isLookupCopy" in t || b(t) && "isLookupCopy" in t), Re = (t) => "group" in t, ge = (t) => "table" in t, Ie = (t) => !("table" in t), Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2
2
|
__proto__: null,
|
|
3
|
-
isCalc:
|
|
4
|
-
isCategory:
|
|
5
|
-
isCheckBox:
|
|
6
|
-
isCreatedTime:
|
|
7
|
-
isCreator:
|
|
8
|
-
isDate:
|
|
9
|
-
isDatetime:
|
|
10
|
-
isDropDown:
|
|
11
|
-
isFile:
|
|
12
|
-
isGroup:
|
|
13
|
-
isGroupSelect:
|
|
14
|
-
isInGroup:
|
|
15
|
-
isInSubtable:
|
|
16
|
-
isLink:
|
|
17
|
-
isLookup:
|
|
18
|
-
isLookupCopy:
|
|
19
|
-
isModifier:
|
|
20
|
-
isMultiLineText:
|
|
21
|
-
isMultiSelect:
|
|
22
|
-
isNotInSubtable:
|
|
23
|
-
isNumber:
|
|
24
|
-
isOrganizationSelect:
|
|
25
|
-
isRadioButton:
|
|
26
|
-
isRecordNumber:
|
|
27
|
-
isReferenceTable:
|
|
28
|
-
isRichText:
|
|
29
|
-
isSingleLineText:
|
|
30
|
-
isStatus:
|
|
31
|
-
isStatusAssignee:
|
|
32
|
-
isSubtable:
|
|
33
|
-
isTime:
|
|
34
|
-
isUpdatedTime:
|
|
35
|
-
isUserSelect:
|
|
3
|
+
isCalc: M,
|
|
4
|
+
isCategory: Le,
|
|
5
|
+
isCheckBox: U,
|
|
6
|
+
isCreatedTime: ce,
|
|
7
|
+
isCreator: ae,
|
|
8
|
+
isDate: v,
|
|
9
|
+
isDatetime: X,
|
|
10
|
+
isDropDown: G,
|
|
11
|
+
isFile: Ee,
|
|
12
|
+
isGroup: le,
|
|
13
|
+
isGroupSelect: P,
|
|
14
|
+
isInGroup: Re,
|
|
15
|
+
isInSubtable: ge,
|
|
16
|
+
isLink: b,
|
|
17
|
+
isLookup: Ce,
|
|
18
|
+
isLookupCopy: _e,
|
|
19
|
+
isModifier: de,
|
|
20
|
+
isMultiLineText: D,
|
|
21
|
+
isMultiSelect: k,
|
|
22
|
+
isNotInSubtable: Ie,
|
|
23
|
+
isNumber: O,
|
|
24
|
+
isOrganizationSelect: h,
|
|
25
|
+
isRadioButton: B,
|
|
26
|
+
isRecordNumber: oe,
|
|
27
|
+
isReferenceTable: Fe,
|
|
28
|
+
isRichText: N,
|
|
29
|
+
isSingleLineText: I,
|
|
30
|
+
isStatus: Se,
|
|
31
|
+
isStatusAssignee: me,
|
|
32
|
+
isSubtable: Te,
|
|
33
|
+
isTime: j,
|
|
34
|
+
isUpdatedTime: ye,
|
|
35
|
+
isUserSelect: x
|
|
36
36
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
(function(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
var g = { exports: {} }, be = g.exports, te;
|
|
38
|
+
function Ae() {
|
|
39
|
+
return te || (te = 1, (function(t, d) {
|
|
40
|
+
(function(o, y) {
|
|
41
|
+
y(d);
|
|
42
|
+
})(be, (function(o) {
|
|
43
|
+
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" })), T = 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" })), E = (e) => e.type === "RECORD_NUMBER", F = (e) => e.type === "CREATOR", L = (e) => e.type === "CREATED_TIME", S = (e) => e.type === "MODIFIER", m = (e) => e.type === "UPDATED_TIME", C = (e) => e.type === "SINGLE_LINE_TEXT", _ = (e) => e.type === "MULTI_LINE_TEXT", a = (e) => e.type === "RICH_TEXT", u = (e) => e.type === "NUMBER", n = (e) => e.type === "CALC", s = (e) => e.type === "CHECK_BOX", l = (e) => e.type === "RADIO_BUTTON", c = (e) => e.type === "MULTI_SELECT", p = (e) => e.type === "DROP_DOWN", R = (e) => e.type === "USER_SELECT", H = (e) => e.type === "ORGANIZATION_SELECT", w = (e) => e.type === "GROUP_SELECT", K = (e) => e.type === "DATE", z = (e) => e.type === "TIME", W = (e) => e.type === "DATETIME", Z = (e) => e.type === "LINK", re = (e) => e.type === "FILE", Y = (e) => e.type === "SUBTABLE", q = (e) => e.type === "CATEGORY", $ = (e) => e.type === "STATUS", V = (e) => e.type === "STATUS_ASSIGNEE", J = (e) => e.type === "__ID__", Q = (e) => e.type === "__REVISION__", ue = Object.freeze(Object.defineProperty({ __proto__: null, isCalc: n, isCategory: q, isCheckBox: s, isCreatedTime: L, isCreator: F, isDate: K, isDatetime: W, isDropDown: p, isFile: re, isGroupSelect: w, isID: J, isLink: Z, isModifier: S, isMultiLineText: _, isMultiSelect: c, isNumber: u, isOrganizationSelect: H, isRadioButton: l, isRecordNumber: E, isRevision: Q, isRichText: a, isSingleLineText: C, isStatus: $, isStatusAssignee: V, isSubtable: Y, isTime: z, isUpdatedTime: m, isUserSelect: R }, Symbol.toStringTag, { value: "Module" })), ne = Object.freeze(Object.defineProperty({ __proto__: null, converterGetToSet: (e) => {
|
|
44
|
+
const A = {};
|
|
45
|
+
for (const [ee, r] of Object.entries(e)) if (!(J(r) || Q(r) || E(r) || F(r) || L(r) || S(r) || m(r) || q(r) || $(r) || V(r))) {
|
|
46
|
+
if (r.type === "FILE") {
|
|
47
|
+
A[ee] = { type: "FILE", value: r.value.map((pe) => ({ fileKey: pe.fileKey })) };
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
(C(r) || u(r) || n(r) || _(r) || a(r) || Z(r) || s(r) || l(r) || p(r) || c(r) || K(r) || z(r) || W(r) || R(r) || H(r) || w(r) || Y(r)) && (A[ee] = r);
|
|
51
|
+
}
|
|
52
|
+
return A;
|
|
53
|
+
} }, Symbol.toStringTag, { value: "Module" }));
|
|
54
|
+
o.guardFormField = y, o.guardFormLayout = T, o.guardRecord = ue, o.guardUtils = ne, Object.defineProperty(o, Symbol.toStringTag, { value: "Module" });
|
|
55
|
+
}));
|
|
56
|
+
})(g, g.exports)), g.exports;
|
|
57
|
+
}
|
|
58
|
+
var i = Ae();
|
|
59
|
+
const f = (t) => Object.values(t).sort((d, o) => Number(d.index) - Number(o.index)).map(({ label: d }) => d), se = (t, d) => {
|
|
60
|
+
const o = [], y = [], T = Object.values(t).find(
|
|
50
61
|
i.guardFormField.isStatus
|
|
51
62
|
);
|
|
52
|
-
|
|
53
|
-
const
|
|
63
|
+
T?.enabled && o.push(T);
|
|
64
|
+
const E = Object.values(t).find(
|
|
54
65
|
i.guardFormField.isStatusAssignee
|
|
55
66
|
);
|
|
56
|
-
|
|
57
|
-
const
|
|
67
|
+
E?.enabled && o.push(E);
|
|
68
|
+
const F = Object.values(t).find(
|
|
58
69
|
i.guardFormField.isCategory
|
|
59
70
|
);
|
|
60
|
-
|
|
61
|
-
for (const
|
|
62
|
-
if (i.guardFormLayout.isRow(
|
|
63
|
-
for (const
|
|
64
|
-
if (i.guardFormLayout.isLabel(
|
|
71
|
+
F?.enabled && o.push(F);
|
|
72
|
+
for (const a of d)
|
|
73
|
+
if (i.guardFormLayout.isRow(a))
|
|
74
|
+
for (const u of a.fields) {
|
|
75
|
+
if (i.guardFormLayout.isLabel(u) || i.guardFormLayout.isHr(u))
|
|
65
76
|
continue;
|
|
66
|
-
if (i.guardFormLayout.isSpacer(
|
|
67
|
-
|
|
77
|
+
if (i.guardFormLayout.isSpacer(u)) {
|
|
78
|
+
y.push(u);
|
|
68
79
|
continue;
|
|
69
80
|
}
|
|
70
|
-
const
|
|
71
|
-
if (!i.guardFormField.isSubtable(
|
|
72
|
-
if (i.guardFormField.isCheckBox(
|
|
73
|
-
const s =
|
|
74
|
-
o.push({ ...
|
|
81
|
+
const n = t[u.code];
|
|
82
|
+
if (!i.guardFormField.isSubtable(n) && !i.guardFormField.isGroup(n)) {
|
|
83
|
+
if (i.guardFormField.isCheckBox(n) || i.guardFormField.isDropDown(n) || i.guardFormField.isMultiSelect(n) || i.guardFormField.isRadioButton(n)) {
|
|
84
|
+
const s = f(n.options);
|
|
85
|
+
o.push({ ...n, sortedOptions: s });
|
|
75
86
|
continue;
|
|
76
87
|
}
|
|
77
|
-
o.push(
|
|
88
|
+
o.push(n);
|
|
78
89
|
}
|
|
79
90
|
}
|
|
80
|
-
else if (i.guardFormLayout.isSubtable(
|
|
81
|
-
const
|
|
82
|
-
if (!i.guardFormField.isSubtable(
|
|
91
|
+
else if (i.guardFormLayout.isSubtable(a)) {
|
|
92
|
+
const u = a.code, n = t[u];
|
|
93
|
+
if (!i.guardFormField.isSubtable(n)) continue;
|
|
83
94
|
const s = {};
|
|
84
|
-
for (const { code:
|
|
85
|
-
const
|
|
86
|
-
if (i.guardFormField.isCheckBox(
|
|
87
|
-
const
|
|
88
|
-
s[
|
|
89
|
-
...
|
|
90
|
-
table:
|
|
91
|
-
sortedOptions:
|
|
92
|
-
}, o.push({ ...
|
|
95
|
+
for (const { code: l } of a.fields) {
|
|
96
|
+
const c = n.fields[l];
|
|
97
|
+
if (i.guardFormField.isCheckBox(c) || i.guardFormField.isDropDown(c) || i.guardFormField.isMultiSelect(c) || i.guardFormField.isRadioButton(c)) {
|
|
98
|
+
const p = f(c.options);
|
|
99
|
+
s[c.code] = {
|
|
100
|
+
...c,
|
|
101
|
+
table: u,
|
|
102
|
+
sortedOptions: p
|
|
103
|
+
}, o.push({ ...c, table: u, sortedOptions: p });
|
|
93
104
|
continue;
|
|
94
105
|
}
|
|
95
|
-
s[
|
|
106
|
+
s[c.code] = { ...c, table: u }, o.push({ ...c, table: u });
|
|
96
107
|
}
|
|
97
|
-
o.push({ ...
|
|
98
|
-
} else if (i.guardFormLayout.isGroup(
|
|
99
|
-
const
|
|
100
|
-
if (!i.guardFormField.isGroup(
|
|
108
|
+
o.push({ ...n, fields: s });
|
|
109
|
+
} else if (i.guardFormLayout.isGroup(a)) {
|
|
110
|
+
const u = a.code, n = t[u];
|
|
111
|
+
if (!i.guardFormField.isGroup(n)) continue;
|
|
101
112
|
const s = {};
|
|
102
|
-
for (const
|
|
103
|
-
for (const
|
|
104
|
-
if (i.guardFormLayout.isLabel(
|
|
113
|
+
for (const l of a.layout)
|
|
114
|
+
for (const c of l.fields) {
|
|
115
|
+
if (i.guardFormLayout.isLabel(c) || i.guardFormLayout.isHr(c))
|
|
105
116
|
continue;
|
|
106
|
-
if (i.guardFormLayout.isSpacer(
|
|
107
|
-
|
|
117
|
+
if (i.guardFormLayout.isSpacer(c)) {
|
|
118
|
+
y.push({ ...c, group: u });
|
|
108
119
|
continue;
|
|
109
120
|
}
|
|
110
|
-
const
|
|
111
|
-
if (!i.guardFormField.isCategory(
|
|
112
|
-
if (i.guardFormField.isCheckBox(
|
|
113
|
-
const
|
|
114
|
-
s[
|
|
115
|
-
...
|
|
116
|
-
group:
|
|
117
|
-
sortedOptions:
|
|
118
|
-
}, o.push({ ...
|
|
121
|
+
const p = t[c.code];
|
|
122
|
+
if (!i.guardFormField.isCategory(p) && !i.guardFormField.isStatus(p) && !i.guardFormField.isStatusAssignee(p) && !i.guardFormField.isSubtable(p) && !i.guardFormField.isGroup(p)) {
|
|
123
|
+
if (i.guardFormField.isCheckBox(p) || i.guardFormField.isDropDown(p) || i.guardFormField.isMultiSelect(p) || i.guardFormField.isRadioButton(p)) {
|
|
124
|
+
const R = f(p.options);
|
|
125
|
+
s[p.code] = {
|
|
126
|
+
...p,
|
|
127
|
+
group: u,
|
|
128
|
+
sortedOptions: R
|
|
129
|
+
}, o.push({ ...p, group: u, sortedOptions: R });
|
|
119
130
|
continue;
|
|
120
131
|
}
|
|
121
|
-
s[
|
|
132
|
+
s[p.code] = { ...p, group: u }, o.push({ ...p, group: u });
|
|
122
133
|
}
|
|
123
134
|
}
|
|
124
|
-
o.push({ ...
|
|
135
|
+
o.push({ ...n, fields: s });
|
|
125
136
|
}
|
|
126
|
-
for (const
|
|
127
|
-
if (i.guardFormField.isLookup(
|
|
128
|
-
if (
|
|
129
|
-
for (const
|
|
130
|
-
const
|
|
131
|
-
(s) =>
|
|
132
|
-
)
|
|
133
|
-
|
|
137
|
+
for (const a of Object.values(o))
|
|
138
|
+
if (i.guardFormField.isLookup(a)) {
|
|
139
|
+
if (a.lookup === null) continue;
|
|
140
|
+
for (const u of a.lookup.fieldMappings) {
|
|
141
|
+
const n = o.filter(
|
|
142
|
+
(s) => I(s) || O(s) || D(s) || N(s) || b(s) || U(s) || B(s) || G(s) || k(s) || v(s) || j(s) || X(s) || x(s) || h(s) || P(s)
|
|
143
|
+
)?.find((s) => s.code === u.field);
|
|
144
|
+
n && (n.isLookupCopy = !0);
|
|
134
145
|
}
|
|
135
146
|
}
|
|
136
|
-
const
|
|
147
|
+
const L = Object.values(t).find(
|
|
137
148
|
i.guardFormField.isRecordNumber
|
|
138
149
|
);
|
|
139
|
-
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
const
|
|
150
|
+
L && (o.some(i.guardFormField.isRecordNumber) || o.push(L));
|
|
151
|
+
const S = Object.values(t).find(i.guardFormField.isCreator);
|
|
152
|
+
S && (o.some(i.guardFormField.isCreator) || o.push(S));
|
|
153
|
+
const m = Object.values(t).find(
|
|
143
154
|
i.guardFormField.isCreatedTime
|
|
144
155
|
);
|
|
145
|
-
|
|
146
|
-
const
|
|
156
|
+
m && (o.some(i.guardFormField.isCreatedTime) || o.push(m));
|
|
157
|
+
const C = Object.values(t).find(
|
|
147
158
|
i.guardFormField.isModifier
|
|
148
159
|
);
|
|
149
|
-
|
|
150
|
-
const
|
|
160
|
+
C && (o.some(i.guardFormField.isModifier) || o.push(C));
|
|
161
|
+
const _ = Object.values(t).find(
|
|
151
162
|
i.guardFormField.isUpdatedTime
|
|
152
163
|
);
|
|
153
|
-
return
|
|
154
|
-
},
|
|
164
|
+
return _ && (o.some(i.guardFormField.isUpdatedTime) || o.push(_)), { fields: o, spacers: y };
|
|
165
|
+
}, ie = async ({
|
|
155
166
|
client: t,
|
|
156
|
-
app:
|
|
167
|
+
app: d,
|
|
157
168
|
lang: o,
|
|
158
|
-
preview:
|
|
169
|
+
preview: y
|
|
159
170
|
}) => {
|
|
160
|
-
const [{ properties:
|
|
161
|
-
t.app.getFormFields({ app:
|
|
162
|
-
t.app.getFormLayout({ app:
|
|
171
|
+
const [{ properties: T }, { layout: E }] = await Promise.all([
|
|
172
|
+
t.app.getFormFields({ app: d, lang: o, preview: y }),
|
|
173
|
+
t.app.getFormLayout({ app: d, preview: y })
|
|
163
174
|
]);
|
|
164
|
-
return
|
|
165
|
-
},
|
|
175
|
+
return se(T, E);
|
|
176
|
+
}, fe = {
|
|
166
177
|
/**
|
|
167
178
|
* kintone アプリのフィールドを取得します。
|
|
168
179
|
* @deprecated getFields関数を利用してください。
|
|
169
180
|
*/
|
|
170
|
-
get:
|
|
171
|
-
getFields:
|
|
172
|
-
generateFields:
|
|
173
|
-
...
|
|
181
|
+
get: ie,
|
|
182
|
+
getFields: ie,
|
|
183
|
+
generateFields: se,
|
|
184
|
+
...Oe
|
|
174
185
|
};
|
|
175
186
|
export {
|
|
176
|
-
|
|
187
|
+
fe as kintonePrettyFields
|
|
177
188
|
};
|
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",
|
|
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",ue=t=>t.type==="CREATOR",ne=t=>t.type==="CREATED_TIME",pe=t=>t.type==="MODIFIER",ae=t=>t.type==="UPDATED_TIME",O=t=>t.type==="SINGLE_LINE_TEXT",N=t=>t.type==="MULTI_LINE_TEXT",D=t=>t.type==="RICH_TEXT",f=t=>t.type==="NUMBER",M=t=>t.type==="CALC",U=t=>t.type==="CHECK_BOX",k=t=>t.type==="RADIO_BUTTON",B=t=>t.type==="MULTI_SELECT",G=t=>t.type==="DROP_DOWN",x=t=>t.type==="USER_SELECT",h=t=>t.type==="ORGANIZATION_SELECT",P=t=>t.type==="GROUP_SELECT",j=t=>t.type==="DATE",v=t=>t.type==="TIME",X=t=>t.type==="DATETIME",A=t=>t.type==="LINK",de=Object.freeze(Object.defineProperty({__proto__:null,isCalc:M,isCategory:t=>t.type==="CATEGORY",isCheckBox:U,isCreatedTime:ne,isCreator:ue,isDate:j,isDatetime:X,isDropDown:G,isFile:t=>t.type==="FILE",isGroup:t=>t.type==="GROUP",isGroupSelect:P,isInGroup:t=>"group"in t,isInSubtable:t=>"table"in t,isLink:A,isLookup:t=>!!(O(t)&&"lookup"in t||f(t)&&"lookup"in t||M(t)&&"lookup"in t||A(t)&&"lookup"in t||l(t)&&"lookup"in t),isLookupCopy:t=>!!(O(t)&&"isLookupCopy"in t||N(t)&&"isLookupCopy"in t||D(t)&&"isLookupCopy"in t||f(t)&&"isLookupCopy"in t||M(t)&&"isLookupCopy"in t||U(t)&&"isLookupCopy"in t||k(t)&&"isLookupCopy"in t||B(t)&&"isLookupCopy"in t||G(t)&&"isLookupCopy"in t||x(t)&&"isLookupCopy"in t||h(t)&&"isLookupCopy"in t||P(t)&&"isLookupCopy"in t||j(t)&&"isLookupCopy"in t||v(t)&&"isLookupCopy"in t||X(t)&&"isLookupCopy"in t||A(t)&&"isLookupCopy"in t),isModifier:pe,isMultiLineText:N,isMultiSelect:B,isNotInSubtable:t=>!("table"in t),isNumber:f,isOrganizationSelect:h,isRadioButton:k,isRecordNumber:l,isReferenceTable:t=>t.type==="REFERENCE_TABLE",isRichText:D,isSingleLineText:O,isStatus:t=>t.type==="STATUS",isStatusAssignee:t=>t.type==="STATUS_ASSIGNEE",isSubtable:t=>t.type==="SUBTABLE",isTime:v,isUpdatedTime:ae,isUserSelect:x},Symbol.toStringTag,{value:"Module"}));var L={exports:{}},ce=L.exports,w;function ye(){return w||(w=1,(function(t,c){(function(o,y){y(c)})(ce,(function(o){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"})),F=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=e=>e.type==="RECORD_NUMBER",m=e=>e.type==="CREATOR",C=e=>e.type==="CREATED_TIME",_=e=>e.type==="MODIFIER",R=e=>e.type==="UPDATED_TIME",g=e=>e.type==="SINGLE_LINE_TEXT",b=e=>e.type==="MULTI_LINE_TEXT",a=e=>e.type==="RICH_TEXT",u=e=>e.type==="NUMBER",n=e=>e.type==="CALC",s=e=>e.type==="CHECK_BOX",S=e=>e.type==="RADIO_BUTTON",d=e=>e.type==="MULTI_SELECT",p=e=>e.type==="DROP_DOWN",I=e=>e.type==="USER_SELECT",Z=e=>e.type==="ORGANIZATION_SELECT",Y=e=>e.type==="GROUP_SELECT",q=e=>e.type==="DATE",$=e=>e.type==="TIME",V=e=>e.type==="DATETIME",J=e=>e.type==="LINK",Ee=e=>e.type==="FILE",Q=e=>e.type==="SUBTABLE",ee=e=>e.type==="CATEGORY",te=e=>e.type==="STATUS",ie=e=>e.type==="STATUS_ASSIGNEE",oe=e=>e.type==="__ID__",se=e=>e.type==="__REVISION__",le=Object.freeze(Object.defineProperty({__proto__:null,isCalc:n,isCategory:ee,isCheckBox:s,isCreatedTime:C,isCreator:m,isDate:q,isDatetime:V,isDropDown:p,isFile:Ee,isGroupSelect:Y,isID:oe,isLink:J,isModifier:_,isMultiLineText:b,isMultiSelect:d,isNumber:u,isOrganizationSelect:Z,isRadioButton:S,isRecordNumber:T,isRevision:se,isRichText:a,isSingleLineText:g,isStatus:te,isStatusAssignee:ie,isSubtable:Q,isTime:$,isUpdatedTime:R,isUserSelect:I},Symbol.toStringTag,{value:"Module"})),Fe=Object.freeze(Object.defineProperty({__proto__:null,converterGetToSet:e=>{const K={};for(const[re,r]of Object.entries(e))if(!(oe(r)||se(r)||T(r)||m(r)||C(r)||_(r)||R(r)||ee(r)||te(r)||ie(r))){if(r.type==="FILE"){K[re]={type:"FILE",value:r.value.map(Se=>({fileKey:Se.fileKey}))};continue}(g(r)||u(r)||n(r)||b(r)||a(r)||J(r)||s(r)||S(r)||p(r)||d(r)||q(r)||$(r)||V(r)||I(r)||Z(r)||Y(r)||Q(r))&&(K[re]=r)}return K}},Symbol.toStringTag,{value:"Module"}));o.guardFormField=y,o.guardFormLayout=F,o.guardRecord=le,o.guardUtils=Fe,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})}))})(L,L.exports)),L.exports}var i=ye();const H=t=>Object.values(t).sort((c,o)=>Number(c.index)-Number(o.index)).map(({label:c})=>c),z=(t,c)=>{const o=[],y=[],F=Object.values(t).find(i.guardFormField.isStatus);F?.enabled&&o.push(F);const T=Object.values(t).find(i.guardFormField.isStatusAssignee);T?.enabled&&o.push(T);const m=Object.values(t).find(i.guardFormField.isCategory);m?.enabled&&o.push(m);for(const a of c)if(i.guardFormLayout.isRow(a))for(const u of a.fields){if(i.guardFormLayout.isLabel(u)||i.guardFormLayout.isHr(u))continue;if(i.guardFormLayout.isSpacer(u)){y.push(u);continue}const n=t[u.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=H(n.options);o.push({...n,sortedOptions:s});continue}o.push(n)}}else if(i.guardFormLayout.isSubtable(a)){const u=a.code,n=t[u];if(!i.guardFormField.isSubtable(n))continue;const s={};for(const{code:S}of a.fields){const d=n.fields[S];if(i.guardFormField.isCheckBox(d)||i.guardFormField.isDropDown(d)||i.guardFormField.isMultiSelect(d)||i.guardFormField.isRadioButton(d)){const p=H(d.options);s[d.code]={...d,table:u,sortedOptions:p},o.push({...d,table:u,sortedOptions:p});continue}s[d.code]={...d,table:u},o.push({...d,table:u})}o.push({...n,fields:s})}else if(i.guardFormLayout.isGroup(a)){const u=a.code,n=t[u];if(!i.guardFormField.isGroup(n))continue;const s={};for(const S of a.layout)for(const d of S.fields){if(i.guardFormLayout.isLabel(d)||i.guardFormLayout.isHr(d))continue;if(i.guardFormLayout.isSpacer(d)){y.push({...d,group:u});continue}const p=t[d.code];if(!i.guardFormField.isCategory(p)&&!i.guardFormField.isStatus(p)&&!i.guardFormField.isStatusAssignee(p)&&!i.guardFormField.isSubtable(p)&&!i.guardFormField.isGroup(p)){if(i.guardFormField.isCheckBox(p)||i.guardFormField.isDropDown(p)||i.guardFormField.isMultiSelect(p)||i.guardFormField.isRadioButton(p)){const I=H(p.options);s[p.code]={...p,group:u,sortedOptions:I},o.push({...p,group:u,sortedOptions:I});continue}s[p.code]={...p,group:u},o.push({...p,group:u})}}o.push({...n,fields:s})}for(const a of Object.values(o))if(i.guardFormField.isLookup(a)){if(a.lookup===null)continue;for(const u of a.lookup.fieldMappings){const n=o.filter(s=>O(s)||f(s)||N(s)||D(s)||A(s)||U(s)||k(s)||G(s)||B(s)||j(s)||v(s)||X(s)||x(s)||h(s)||P(s))?.find(s=>s.code===u.field);n&&(n.isLookupCopy=!0)}}const C=Object.values(t).find(i.guardFormField.isRecordNumber);C&&(o.some(i.guardFormField.isRecordNumber)||o.push(C));const _=Object.values(t).find(i.guardFormField.isCreator);_&&(o.some(i.guardFormField.isCreator)||o.push(_));const R=Object.values(t).find(i.guardFormField.isCreatedTime);R&&(o.some(i.guardFormField.isCreatedTime)||o.push(R));const g=Object.values(t).find(i.guardFormField.isModifier);g&&(o.some(i.guardFormField.isModifier)||o.push(g));const b=Object.values(t).find(i.guardFormField.isUpdatedTime);return b&&(o.some(i.guardFormField.isUpdatedTime)||o.push(b)),{fields:o,spacers:y}},W=async({client:t,app:c,lang:o,preview:y})=>{const[{properties:F},{layout:T}]=await Promise.all([t.app.getFormFields({app:c,lang:o,preview:y}),t.app.getFormLayout({app:c,preview:y})]);return z(F,T)},Te={get:W,getFields:W,generateFields:z,...de};E.kintonePrettyFields=Te,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.6",
|
|
8
8
|
"description": "Get kintone form fields in a pretty format.",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"watch": "tsc && vite build --watch",
|
|
40
40
|
"prepare": "npm run build",
|
|
41
41
|
"test": "vitest",
|
|
42
|
-
"check": "biome check --
|
|
42
|
+
"check": "biome check --write ./src ./tests"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@kintone/rest-api-client": "^
|
|
46
|
-
"kintone-typeguard": "^0.
|
|
45
|
+
"@kintone/rest-api-client": "^6.0.0",
|
|
46
|
+
"kintone-typeguard": "^0.17.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@biomejs/biome": "
|
|
50
|
-
"@types/node": "^
|
|
51
|
-
"rimraf": "^
|
|
52
|
-
"typescript": "^5.
|
|
53
|
-
"vite": "^
|
|
54
|
-
"vitest": "^
|
|
49
|
+
"@biomejs/biome": "2.3.6",
|
|
50
|
+
"@types/node": "^24.10.1",
|
|
51
|
+
"rimraf": "^6.1.0",
|
|
52
|
+
"typescript": "^5.9.3",
|
|
53
|
+
"vite": "^7.2.2",
|
|
54
|
+
"vitest": "^4.0.10"
|
|
55
55
|
}
|
|
56
56
|
}
|