@funcho/ui 1.1.2 → 1.1.4

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.
@@ -99,7 +99,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
99
99
  actions: { default: () => [] },
100
100
  tools: { default: () => [] }
101
101
  },
102
- setup(__props) {
102
+ setup(__props, { expose: __expose }) {
103
103
  const ns = useNamespace.useNamespace("data-table");
104
104
  const formRef = vue.ref();
105
105
  const { height: formHeight } = core.useElementSize(formRef);
@@ -158,7 +158,9 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
158
158
  const params = formRef.value?.model || {};
159
159
  try {
160
160
  tableLoading.value = true;
161
- const { data } = await props.request(params);
161
+ const { data } = await props.request(
162
+ props.isPagination ? { ...params, page: pagination.value.currentPage, size: pagination.value.pageSize } : params
163
+ );
162
164
  tableData.value = Array.isArray(data) ? data : data.list || [];
163
165
  pagination.value.total = Array.isArray(data) ? data.length : data.total || 0;
164
166
  } catch (error) {
@@ -185,6 +187,10 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
185
187
  pagination.value.pageSize = pageSize;
186
188
  loadData();
187
189
  };
190
+ __expose({
191
+ loadData,
192
+ tableData
193
+ });
188
194
  return (_ctx, _cache) => {
189
195
  const _directive_loading = vue.resolveDirective("loading");
190
196
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -206,7 +212,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
206
212
  fields: searchFormFields.value,
207
213
  class: vue.normalizeClass(vue.unref(ns).e("query-form")),
208
214
  "label-position": "right",
209
- "label-width": hasMoreContent.value && !isExpanded.value ? "fit-content" : "auto"
215
+ "label-width": hasMoreContent.value && isExpanded.value ? "auto" : "fit-content"
210
216
  }, null, 8, ["fields", "class", "label-width"]),
211
217
  vue.createElementVNode("div", {
212
218
  class: vue.normalizeClass(vue.unref(ns).e("tools"))
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
 
5
- const version = "1.1.2";
5
+ const version = "1.1.4";
6
6
 
7
7
  exports.version = version;
@@ -95,7 +95,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
95
95
  actions: { default: () => [] },
96
96
  tools: { default: () => [] }
97
97
  },
98
- setup(__props) {
98
+ setup(__props, { expose: __expose }) {
99
99
  const ns = useNamespace("data-table");
100
100
  const formRef = ref();
101
101
  const { height: formHeight } = useElementSize(formRef);
@@ -154,7 +154,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
154
154
  const params = formRef.value?.model || {};
155
155
  try {
156
156
  tableLoading.value = true;
157
- const { data } = await props.request(params);
157
+ const { data } = await props.request(
158
+ props.isPagination ? { ...params, page: pagination.value.currentPage, size: pagination.value.pageSize } : params
159
+ );
158
160
  tableData.value = Array.isArray(data) ? data : data.list || [];
159
161
  pagination.value.total = Array.isArray(data) ? data.length : data.total || 0;
160
162
  } catch (error) {
@@ -181,6 +183,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
181
183
  pagination.value.pageSize = pageSize;
182
184
  loadData();
183
185
  };
186
+ __expose({
187
+ loadData,
188
+ tableData
189
+ });
184
190
  return (_ctx, _cache) => {
185
191
  const _directive_loading = resolveDirective("loading");
186
192
  return openBlock(), createElementBlock("div", {
@@ -202,7 +208,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
202
208
  fields: searchFormFields.value,
203
209
  class: normalizeClass(unref(ns).e("query-form")),
204
210
  "label-position": "right",
205
- "label-width": hasMoreContent.value && !isExpanded.value ? "fit-content" : "auto"
211
+ "label-width": hasMoreContent.value && isExpanded.value ? "auto" : "fit-content"
206
212
  }, null, 8, ["fields", "class", "label-width"]),
207
213
  createElementVNode("div", {
208
214
  class: normalizeClass(unref(ns).e("tools"))
@@ -1,3 +1,3 @@
1
- const version = "1.1.2";
1
+ const version = "1.1.4";
2
2
 
3
3
  export { version };
@@ -29,7 +29,10 @@ type __VLS_Props = {
29
29
  hidden?: boolean | (() => boolean);
30
30
  }>;
31
31
  };
32
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
32
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
33
+ loadData: () => Promise<void>;
34
+ tableData: import('vue').Ref<any[], any[]>;
35
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
33
36
  height: number;
34
37
  fields: Array<TProFormField>;
35
38
  tools: Array<{
@@ -25,7 +25,10 @@ export declare const FcProDataTable: {
25
25
  disabled?: boolean | (() => boolean);
26
26
  hidden?: boolean | (() => boolean);
27
27
  }>;
28
- }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
28
+ }> & Readonly<{}>, {
29
+ loadData: () => Promise<void>;
30
+ tableData: import('vue').Ref<any[], any[]>;
31
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
29
32
  height: number;
30
33
  fields: Array<import('..').TProFormField>;
31
34
  tools: Array<{
@@ -1826,7 +1829,10 @@ export declare const FcProDataTable: {
1826
1829
  disabled?: boolean | (() => boolean);
1827
1830
  hidden?: boolean | (() => boolean);
1828
1831
  }>;
1829
- }> & Readonly<{}>, {}, {}, {}, {}, {
1832
+ }> & Readonly<{}>, {
1833
+ loadData: () => Promise<void>;
1834
+ tableData: import('vue').Ref<any[], any[]>;
1835
+ }, {}, {}, {}, {
1830
1836
  height: number;
1831
1837
  fields: Array<import('..').TProFormField>;
1832
1838
  tools: Array<{
@@ -1882,7 +1888,10 @@ export declare const FcProDataTable: {
1882
1888
  disabled?: boolean | (() => boolean);
1883
1889
  hidden?: boolean | (() => boolean);
1884
1890
  }>;
1885
- }> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
1891
+ }> & Readonly<{}>, {
1892
+ loadData: () => Promise<void>;
1893
+ tableData: import('vue').Ref<any[], any[]>;
1894
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
1886
1895
  height: number;
1887
1896
  fields: Array<import('..').TProFormField>;
1888
1897
  tools: Array<{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@funcho/ui",
3
3
  "description": "@funcho ui library",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
5
5
  "type": "module",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.mjs",