@next-shared/form 0.5.6 → 0.6.1
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/cjs/FormItemElement.js +56 -88
- package/dist/cjs/FormItemElement.js.map +1 -1
- package/dist/cjs/FormStore.js +38 -53
- package/dist/cjs/FormStore.js.map +1 -1
- package/dist/esm/FormItemElement.js +56 -88
- package/dist/esm/FormItemElement.js.map +1 -1
- package/dist/esm/FormStore.js +38 -53
- package/dist/esm/FormStore.js.map +1 -1
- package/dist/esm/PubSub.js +14 -19
- package/dist/esm/PubSub.js.map +1 -1
- package/dist/types/FormStore.d.ts +1 -1
- package/package.json +9 -7
package/dist/esm/PubSub.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PubSub.js","names":["remove","_topics","WeakMap","_subUid","PubSub","constructor","_classPrivateFieldInitSpec","
|
|
1
|
+
{"version":3,"file":"PubSub.js","names":["remove","_topics","WeakMap","_subUid","PubSub","constructor","_classPrivateFieldInitSpec","publish","topic","body","_classPrivateFieldGet","subscribers","len","length","func","subscribe","fn","_this$subUid","token","_classPrivateFieldSet","toString","push","unsubscribe","m","item"],"sources":["../../src/PubSub.ts"],"sourcesContent":["import { remove } from \"lodash\";\n\nexport class PubSub {\n #topics: Record<string, { token: string; func: Function }[]> = {};\n #subUid = 0;\n\n publish(topic: string, body: any): void {\n if (!this.#topics[topic]) {\n return;\n }\n const subscribers = this.#topics[topic];\n let len = subscribers ? subscribers.length : 0;\n while (len--) {\n subscribers[len].func(topic, body);\n }\n }\n\n subscribe(topic: string, fn: (topic: string, detail: any) => void): string {\n if (!this.#topics[topic]) {\n this.#topics[topic] = [];\n }\n const token = (++this.#subUid).toString();\n this.#topics[topic].push({\n token: token,\n func: fn,\n });\n return token;\n }\n\n unsubscribe(token: string): void {\n for (const m in this.#topics) {\n if (this.#topics[m]) {\n remove(this.#topics[m], (item) => item.token === token);\n }\n }\n }\n}\n"],"mapp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AI,IAAI,GAAU;MAC5B,IAAIS,qBAAA,CAAAT,OAAA,MAAI,EAASsB,CAAC,CAAC,EAAE;QACnBvB,MAAM,CAACU,qBAAA,CAAAT,OAAA,MAAI,EAASsB,CAAC,CAAC,EAAGC,IAAI,IAAKA,IAAI,CAACN,KAAK,KAAKA,KAAK,CAAC;MACzD;IACF;EACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-shared/form",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"homepage": "https://github.com/easyops-cn/next-bricks/tree/master/shared/form",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,17 +29,19 @@
|
|
|
29
29
|
"prebuild": "npm run clean",
|
|
30
30
|
"build": "npm run build:types && npm run build:main",
|
|
31
31
|
"build:main": "cross-env NODE_ENV=production build-next-libs",
|
|
32
|
-
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types --project tsconfig.build.json"
|
|
32
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types --project tsconfig.build.json",
|
|
33
|
+
"test": "cross-env NODE_ENV='test' test-next",
|
|
34
|
+
"test:ci": "cross-env NODE_ENV='test' CI=true test-next"
|
|
33
35
|
},
|
|
34
36
|
"dependencies": {
|
|
35
|
-
"@next-core/element": "^1.2.
|
|
36
|
-
"@next-core/react-element": "^1.0.
|
|
37
|
+
"@next-core/element": "^1.2.3",
|
|
38
|
+
"@next-core/react-element": "^1.0.22",
|
|
37
39
|
"lodash": "^4.17.21"
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|
|
40
|
-
"@next-core/build-next-libs": "^1.0.
|
|
41
|
-
"@next-core/test-next": "^1.0.
|
|
42
|
+
"@next-core/build-next-libs": "^1.0.13",
|
|
43
|
+
"@next-core/test-next": "^1.0.16",
|
|
42
44
|
"concurrently": "^8.2.2"
|
|
43
45
|
},
|
|
44
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "7343ace49c820beb63ab821c4ae92b9b84b60f31"
|
|
45
47
|
}
|