clickgo 3.11.27 → 3.11.28

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
@@ -28,7 +28,7 @@ Load the module loader first, and then load it using the module loader.
28
28
  **index.html**
29
29
 
30
30
  ```html
31
- <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.27'}"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@litert/loader@3.5.1/dist/loader.min.js?path=index&npm={'clickgo':'3.11.28'}"></script>
32
32
  ```
33
33
 
34
34
  **index.js**
@@ -40,7 +40,7 @@
40
40
  <!-- button list -->
41
41
  <layout gutter="10">
42
42
  <select v-model="lineValue" :data="[10, 50, 500, 5000]" style="flex: 1; width: 0;"></select>
43
- <button @click="lineCount += parseInt(lineValue[0])" style="height: 30px;padding: 0 10px;">Add lines</button>
43
+ <button @click="lineCount += parseInt(lineValue[0])" style="height: 30px; padding: 0 10px;">Add lines</button>
44
44
  <button @click="lineCount -= parseInt(lineValue[0]);if(lineCount < 0) {lineCount = 0;}" style="height: 30px; padding: 0 10px;">Remove lines</button>
45
45
  </layout>
46
46
  <layout gutter="10">
@@ -27,6 +27,7 @@ const clickgo = __importStar(require("clickgo"));
27
27
  class default_1 extends clickgo.form.AbstractForm {
28
28
  constructor() {
29
29
  super(...arguments);
30
+ this.adaptation = false;
30
31
  this.htmlIndex = 0;
31
32
  this.html = [
32
33
  `<h1>Hello world!</h1>
@@ -1,13 +1,18 @@
1
1
  <form title="Html" width="450" height="500" padding="10">
2
2
  <layout gutter="10" direction="v" style="flex: 1; width: 0;">
3
- <layout gutter="10" style="flex: 1; height: 0;">
4
- <html :html="html[htmlIndex]" :css="lcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
5
- <html :html="html[htmlIndex]" :css="rcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px; flex: 1; width: 0;"></html>
6
- </layout>
7
3
  <layout gutter="10">
8
4
  <button style="flex: 1;" @click="lcss = lcss ? '' : css">Left {{lcss ? 'remove' : 'add'}} css</button>
9
5
  <button style="flex: 1;" @click="htmlIndex = htmlIndex ? 0 : 1">Toogle html</button>
6
+ <button style="flex: 1;" @click="adaptation = !adaptation">{{adaptation ? '' : '!'}}Adaptation</button>
10
7
  <button style="flex: 1;" @click="rcss = rcss ? '' : css">Right {{rcss ? 'remove' : 'add'}} css</button>
11
8
  </layout>
9
+ <layout gutter="10" style="flex: 1; height: 0;">
10
+ <flow direction="v" style="flex: 1;">
11
+ <html :html="html[htmlIndex]" :css="lcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px;" :style="{'flex': adaptation ? undefined : '1'}"></html>
12
+ </flow>
13
+ <flow direction="v" style="flex: 1;">
14
+ <html :html="html[htmlIndex]" :css="rcss" style="background: var(--g-plain-background); border: solid 1px var(--g-plain-border-color); padding: 10px;" :style="{'flex': adaptation ? undefined : '1'}"></html>
15
+ </flow>
16
+ </layout>
12
17
  </layout>
13
18
  </form>
package/dist/clickgo.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- const version = '3.11.27';
16
+ const version = '3.11.28';
17
17
  export function getVersion(): string {
18
18
  return version;
19
19
  }
Binary file
package/dist/lib/tool.ts CHANGED
@@ -802,6 +802,23 @@ export function post(url: string, data: Record<string, any> | FormData, opt?: {
802
802
  return loader.post(url, data, opt);
803
803
  }
804
804
 
805
+ /** --- 发送响应为 json 的网络数据,无需 try,失败返回 null --- */
806
+ export async function postResponseJson(url: string, data: Record<string, any> | FormData, opt?: {
807
+ 'credentials'?: 'include' | 'same-origin' | 'omit';
808
+ 'headers'?: HeadersInit;
809
+ }): Promise<any | null> {
810
+ const res = await loader.post(url, data, opt);
811
+ if (!res) {
812
+ return null;
813
+ }
814
+ try {
815
+ return await res.json();
816
+ }
817
+ catch {
818
+ return null;
819
+ }
820
+ }
821
+
805
822
  export function parseUrl(url: string): ILoaderUrl {
806
823
  return loader.parseUrl(url);
807
824
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "3.11.27",
3
+ "version": "3.11.28",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "keywords": [
6
6
  "deskrt",