@g1cloud/open-bluesea-grid 1.0.0-alpha.1 → 1.0.0-alpha.2

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.
@@ -1116,7 +1116,7 @@
1116
1116
  };
1117
1117
  const BSGridHeaderCellResizeHandle = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-3bda3a20"]]);
1118
1118
  const _hoisted_1$d = ["data-property-id"];
1119
- const _hoisted_2$8 = { class: "bs-layout-horizontal align-items-center" };
1119
+ const _hoisted_2$8 = { class: "flex align-items-center" };
1120
1120
  const _hoisted_3$4 = ["textContent"];
1121
1121
  const _hoisted_4$4 = ["textContent"];
1122
1122
  const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
@@ -1224,7 +1224,7 @@
1224
1224
  };
1225
1225
  }
1226
1226
  });
1227
- const BSGridHeaderCell = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-e140e95e"]]);
1227
+ const BSGridHeaderCell = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-fbb8ef01"]]);
1228
1228
  const _hoisted_1$c = { class: "checkbox bs-clickable" };
1229
1229
  const _hoisted_2$7 = { class: "font-icon" };
1230
1230
  const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
@@ -2099,8 +2099,8 @@
2099
2099
  });
2100
2100
  const _hoisted_1$4 = { class: "text-center" };
2101
2101
  const _hoisted_2$4 = { class: "text-center" };
2102
- const _hoisted_3$2 = { class: "bs-layout-horizontal" };
2103
- const _hoisted_4$2 = { class: "bs-layout-horizontal grow justify-content-end gap-8" };
2102
+ const _hoisted_3$2 = { class: "flex" };
2103
+ const _hoisted_4$2 = { class: "flex grow justify-content-end gap-8" };
2104
2104
  const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
2105
2105
  __name: "BSGridColumnSettingModal",
2106
2106
  props: {
@@ -2413,15 +2413,31 @@
2413
2413
  setup(__props, { emit: __emit }) {
2414
2414
  const props = __props;
2415
2415
  const emit = __emit;
2416
- const likeTextFilterItems = vue.computed(() => props.textFilterItems);
2417
- const inTextFilterItems = vue.computed(() => props.textFilterItems.filter((filter) => filter.allowMultiLineFilter));
2418
- const hasTextAreaFilterItem = vue.computed(() => inTextFilterItems.value.length > 0);
2416
+ const likeTextFilterItems = vue.computed(
2417
+ () => props.textFilterItems
2418
+ );
2419
+ const inTextFilterItems = vue.computed(
2420
+ () => props.textFilterItems.filter((filter) => filter.allowMultiLineFilter)
2421
+ );
2422
+ const hasTextAreaFilterItem = vue.computed(
2423
+ () => inTextFilterItems.value.length > 0
2424
+ );
2419
2425
  const filterMode = vue.ref("INPUT");
2420
2426
  const changeFilterMode = (mode) => filterMode.value = mode;
2421
- const likeFilterItems = vue.computed(() => likeTextFilterItems.value.filter((item) => !item.filterCreator && item.filterType !== "NUMBER"));
2422
- const equalFilterItemPropertyIds = vue.computed(() => likeTextFilterItems.value.filter((item) => !item.filterCreator && item.filterType === "NUMBER").map((item) => item.propertyId));
2423
- const customFilterItems = vue.computed(() => likeTextFilterItems.value.filter((item) => item.filterCreator));
2424
- const inFilterItemPropertyIds = vue.computed(() => inTextFilterItems.value.map((filter) => filter.propertyId));
2427
+ const likeFilterItems = vue.computed(
2428
+ () => likeTextFilterItems.value.filter(
2429
+ (item) => !item.filterCreator && item.filterType !== "NUMBER"
2430
+ )
2431
+ );
2432
+ const equalFilterItemPropertyIds = vue.computed(
2433
+ () => likeTextFilterItems.value.filter((item) => !item.filterCreator && item.filterType === "NUMBER").map((item) => item.propertyId)
2434
+ );
2435
+ const customFilterItems = vue.computed(
2436
+ () => likeTextFilterItems.value.filter((item) => item.filterCreator)
2437
+ );
2438
+ const inFilterItemPropertyIds = vue.computed(
2439
+ () => inTextFilterItems.value.map((filter) => filter.propertyId)
2440
+ );
2425
2441
  const getFilterKeyword = (filter) => {
2426
2442
  const actualFilter = filter instanceof OrFilter ? filter.filters[0] : filter;
2427
2443
  if (actualFilter && "getFilterValueString" in actualFilter) {
@@ -2452,13 +2468,31 @@
2452
2468
  };
2453
2469
  const makeLikeFilters = (items, keyword) => {
2454
2470
  if (items.length === 0) return [];
2455
- const prefixSuffix = items.map((item) => (item.prefix === false ? "f" : "t") + (item.suffix === false ? "f" : "t"));
2471
+ const prefixSuffix = items.map(
2472
+ (item) => (item.prefix === false ? "f" : "t") + (item.suffix === false ? "f" : "t")
2473
+ );
2456
2474
  if (prefixSuffix.every((val) => val === prefixSuffix[0])) {
2457
2475
  const likeNames = likeFilterItems.value.map((item) => item.propertyId);
2458
2476
  const first = items[0];
2459
- return [likeFilter(likeNames, keyword, first.prefix !== false, first.suffix !== false, true)];
2477
+ return [
2478
+ likeFilter(
2479
+ likeNames,
2480
+ keyword,
2481
+ first.prefix !== false,
2482
+ first.suffix !== false,
2483
+ true
2484
+ )
2485
+ ];
2460
2486
  } else {
2461
- return items.map((item) => likeFilter([item.propertyId], keyword, item.prefix !== false, item.suffix !== false, true));
2487
+ return items.map(
2488
+ (item) => likeFilter(
2489
+ [item.propertyId],
2490
+ keyword,
2491
+ item.prefix !== false,
2492
+ item.suffix !== false,
2493
+ true
2494
+ )
2495
+ );
2462
2496
  }
2463
2497
  };
2464
2498
  const createFilter = async (text) => {
@@ -2468,13 +2502,15 @@
2468
2502
  const like = makeLikeFilters(likeFilterItems.value, keyword);
2469
2503
  const equalNames = equalFilterItemPropertyIds.value;
2470
2504
  const equal = equalNames.length > 0 && !Number.isNaN(Number(keyword)) ? equalFilter(equalNames, Number(keyword), true) : void 0;
2471
- const customFilters = (await Promise.all(customFilterItems.value.map(async (item) => {
2472
- let created = item.filterCreator?.(item.propertyId, keyword);
2473
- if (created && created instanceof Promise) {
2474
- created = await created;
2475
- }
2476
- return created || [];
2477
- }))).flatMap((item) => item);
2505
+ const customFilters = (await Promise.all(
2506
+ customFilterItems.value.map(async (item) => {
2507
+ let created = item.filterCreator?.(item.propertyId, keyword);
2508
+ if (created && created instanceof Promise) {
2509
+ created = await created;
2510
+ }
2511
+ return created || [];
2512
+ })
2513
+ )).flatMap((item) => item);
2478
2514
  const allFilters = [...like, equal, ...customFilters].filter(openBlueseaCore.notNull);
2479
2515
  if (allFilters.length >= 2) return orFilter(allFilters);
2480
2516
  else return allFilters[0];
@@ -2507,7 +2543,7 @@
2507
2543
  ]),
2508
2544
  hasTextAreaFilterItem.value ? (vue.openBlock(), vue.createElementBlock("span", {
2509
2545
  key: 0,
2510
- class: "filter-mode-btn font-icon bs-clickable mr-4 mt-5",
2546
+ class: "filter-mode-btn font-icon bs-clickable pr-2 pt-1",
2511
2547
  onClick: _cache[2] || (_cache[2] = ($event) => changeFilterMode("TEXTAREA"))
2512
2548
  }, "south")) : vue.createCommentVNode("", true)
2513
2549
  ], 512), [
@@ -2522,7 +2558,7 @@
2522
2558
  [vue.vModelText, textareaText.value]
2523
2559
  ]),
2524
2560
  vue.createElementVNode("span", {
2525
- class: "font-icon bs-clickable mr-4 mt-5",
2561
+ class: "filter-mode-btn font-icon bs-clickable pr-2 pt-1",
2526
2562
  onClick: _cache[4] || (_cache[4] = ($event) => changeFilterMode("INPUT"))
2527
2563
  }, "north")
2528
2564
  ], 512), [
@@ -2849,12 +2885,81 @@
2849
2885
  };
2850
2886
  }
2851
2887
  });
2888
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
2889
+ __name: "BSDateRangeFilter",
2890
+ props: {
2891
+ idFrom: {},
2892
+ idTo: {},
2893
+ nameFrom: {},
2894
+ nameTo: {},
2895
+ modelValue: {},
2896
+ disabled: { type: Boolean },
2897
+ width: { default: "300px" },
2898
+ resolution: { default: "DAY" },
2899
+ displayFormat: {},
2900
+ popupDisplayFormat: {},
2901
+ popupStartYear: {},
2902
+ popupEndYear: {},
2903
+ timeZone: {}
2904
+ },
2905
+ emits: ["update:modelValue"],
2906
+ setup(__props, { emit: __emit }) {
2907
+ const props = __props;
2908
+ const emit = __emit;
2909
+ const fromValue = vue.ref();
2910
+ const toValue = vue.ref();
2911
+ vue.watch(
2912
+ () => props.modelValue,
2913
+ () => {
2914
+ fromValue.value = props.modelValue?.from;
2915
+ toValue.value = props.modelValue?.to;
2916
+ },
2917
+ { immediate: true }
2918
+ );
2919
+ const emitValue = () => {
2920
+ const value = {
2921
+ from: fromValue.value,
2922
+ to: toValue.value
2923
+ };
2924
+ emit("update:modelValue", value);
2925
+ };
2926
+ return (_ctx, _cache) => {
2927
+ return vue.openBlock(), vue.createBlock(vue.unref(openBlueseaCore.BSDateRange), {
2928
+ "from-value": fromValue.value,
2929
+ "onUpdate:fromValue": [
2930
+ _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
2931
+ emitValue
2932
+ ],
2933
+ "to-value": toValue.value,
2934
+ "onUpdate:toValue": [
2935
+ _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
2936
+ emitValue
2937
+ ],
2938
+ "disabled-from": __props.disabled,
2939
+ "disabled-to": __props.disabled,
2940
+ "display-format": __props.displayFormat,
2941
+ "id-from": __props.idFrom,
2942
+ "id-to": __props.idTo,
2943
+ "name-from": __props.nameFrom,
2944
+ "name-to": __props.nameTo,
2945
+ "popup-display-format": __props.popupDisplayFormat,
2946
+ "popup-end-year": __props.popupEndYear,
2947
+ "popup-start-year": __props.popupStartYear,
2948
+ resolution: __props.resolution,
2949
+ "time-zone": __props.timeZone,
2950
+ "validate-date-order": false,
2951
+ width: __props.width,
2952
+ "hide-extra-date": ""
2953
+ }, null, 8, ["from-value", "to-value", "disabled-from", "disabled-to", "display-format", "id-from", "id-to", "name-from", "name-to", "popup-display-format", "popup-end-year", "popup-start-year", "resolution", "time-zone", "width"]);
2954
+ };
2955
+ }
2956
+ });
2852
2957
  const _hoisted_1$1 = {
2853
2958
  key: 0,
2854
- class: "date-filters .bs-layout-vertical mr-16"
2959
+ class: "date-filters flex flex-col"
2855
2960
  };
2856
2961
  const _hoisted_2$1 = ["onClick"];
2857
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
2962
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
2858
2963
  __name: "BSDateRangeFilters",
2859
2964
  props: {
2860
2965
  dateFilter: {},
@@ -2970,23 +3075,22 @@
2970
3075
  return props.dateFilter.filterItems.find((item) => item.propertyId === propertyId)?.filterWidth || props.filterWidth;
2971
3076
  };
2972
3077
  return (_ctx, _cache) => {
2973
- const _component_BSDateRangeFilter = vue.resolveComponent("BSDateRangeFilter");
2974
3078
  return __props.dateFilter.filterItems ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
2975
3079
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(dateFilterValues.value, (item, index) => {
2976
3080
  return vue.openBlock(), vue.createElementBlock("div", {
2977
3081
  key: index,
2978
- class: "bs-layout-horizontal mb-4 flex-align-center"
3082
+ class: "flex gap-1 mb-1 flex-align-center"
2979
3083
  }, [
2980
3084
  index === 0 ? (vue.openBlock(), vue.createElementBlock("span", {
2981
3085
  key: 0,
2982
3086
  class: vue.normalizeClass([{
2983
3087
  disabled: dateFilterValues.value.length >= __props.dateFilter.filterItems.length
2984
- }, "font-icon bs-clickable mr-4"]),
3088
+ }, "font-icon bs-clickable"]),
2985
3089
  "data-id": "addDateFilterBtn",
2986
3090
  onClick: addDateFilter
2987
3091
  }, "add", 2)) : (vue.openBlock(), vue.createElementBlock("span", {
2988
3092
  key: 1,
2989
- class: "font-icon bs-clickable mr-4",
3093
+ class: "font-icon bs-clickable",
2990
3094
  "data-id": "removeDateFilterBtn",
2991
3095
  onClick: ($event) => removeDateFilter(index)
2992
3096
  }, "remove", 8, _hoisted_2$1)),
@@ -2996,11 +3100,10 @@
2996
3100
  "model-value": item.propertyId,
2997
3101
  style: vue.normalizeStyle({ minWidth: __props.captionMinWidth }),
2998
3102
  "value-provider": (filter) => filter.propertyId,
2999
- class: "mr-4",
3000
3103
  "data-id": "filterItemSelect",
3001
3104
  "onUpdate:modelValue": ($event) => setDateFilterPropertyId(index, $event)
3002
3105
  }, null, 8, ["items", "label-provider", "model-value", "style", "value-provider", "onUpdate:modelValue"]),
3003
- vue.createVNode(_component_BSDateRangeFilter, {
3106
+ vue.createVNode(_sfc_main$2, {
3004
3107
  "display-format": dateFormatOfFilterItem(item.propertyId),
3005
3108
  "from-id": `${item.propertyId}From`,
3006
3109
  "model-value": item.value,
@@ -3022,8 +3125,7 @@
3022
3125
  (value, preset) => setDateFilterValue(index, value, preset)
3023
3126
  ],
3024
3127
  presets: __props.presets,
3025
- "time-zone": timeZoneOfFilterItem(item.propertyId),
3026
- class: "ml-4"
3128
+ "time-zone": timeZoneOfFilterItem(item.propertyId)
3027
3129
  }, null, 8, ["modelValue", "onUpdate:modelValue", "presets", "time-zone"])
3028
3130
  ]);
3029
3131
  }), 128))
@@ -3031,9 +3133,9 @@
3031
3133
  };
3032
3134
  }
3033
3135
  });
3034
- const _hoisted_1 = { class: "bs-grid-lookup bs-layout-horizontal flex-align-start" };
3035
- const _hoisted_2 = { class: "text-nowrap" };
3036
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
3136
+ const _hoisted_1 = { class: "bs-grid-lookup flex flex-align-start" };
3137
+ const _hoisted_2 = { class: "text-nowrap flex gap-1" };
3138
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3037
3139
  __name: "BSGridLookup",
3038
3140
  props: {
3039
3141
  gridId: {},
@@ -3131,10 +3233,9 @@
3131
3233
  emitUpdateModelValueAndSearch
3132
3234
  ],
3133
3235
  keyword: __props.keyword,
3134
- "text-filter-items": __props.config.textFilter.filterItems,
3135
- class: "mr-16"
3236
+ "text-filter-items": __props.config.textFilter.filterItems
3136
3237
  }, null, 8, ["modelValue", "keyword", "text-filter-items"])) : vue.createCommentVNode("", true),
3137
- __props.config?.dateFilter ? (vue.openBlock(), vue.createBlock(_sfc_main$2, {
3238
+ __props.config?.dateFilter ? (vue.openBlock(), vue.createBlock(_sfc_main$1, {
3138
3239
  key: 1,
3139
3240
  modelValue: dateFilterValue.value,
3140
3241
  "onUpdate:modelValue": [
@@ -3161,12 +3262,10 @@
3161
3262
  __props.config?.dateFilter ? (vue.openBlock(), vue.createBlock(vue.unref(openBlueseaCore.BSButton), {
3162
3263
  key: 0,
3163
3264
  caption: "Save",
3164
- class: "ml-4",
3165
3265
  onClick: saveSearchCondition
3166
3266
  })) : vue.createCommentVNode("", true),
3167
3267
  vue.createVNode(vue.unref(openBlueseaCore.BSButton), {
3168
3268
  caption: "Reset",
3169
- class: "ml-4",
3170
3269
  onClick: resetSearchCondition
3171
3270
  })
3172
3271
  ])
@@ -3174,79 +3273,10 @@
3174
3273
  };
3175
3274
  }
3176
3275
  });
3177
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
3178
- __name: "BSDateRangeFilter",
3179
- props: {
3180
- idFrom: {},
3181
- idTo: {},
3182
- nameFrom: {},
3183
- nameTo: {},
3184
- modelValue: {},
3185
- disabled: { type: Boolean },
3186
- width: { default: "300px" },
3187
- resolution: { default: "DAY" },
3188
- displayFormat: {},
3189
- popupDisplayFormat: {},
3190
- popupStartYear: {},
3191
- popupEndYear: {},
3192
- timeZone: {}
3193
- },
3194
- emits: ["update:modelValue"],
3195
- setup(__props, { emit: __emit }) {
3196
- const props = __props;
3197
- const emit = __emit;
3198
- const fromValue = vue.ref();
3199
- const toValue = vue.ref();
3200
- vue.watch(
3201
- () => props.modelValue,
3202
- () => {
3203
- fromValue.value = props.modelValue?.from;
3204
- toValue.value = props.modelValue?.to;
3205
- },
3206
- { immediate: true }
3207
- );
3208
- const emitValue = () => {
3209
- const value = {
3210
- from: fromValue.value,
3211
- to: toValue.value
3212
- };
3213
- emit("update:modelValue", value);
3214
- };
3215
- return (_ctx, _cache) => {
3216
- return vue.openBlock(), vue.createBlock(vue.unref(openBlueseaCore.BSDateRange), {
3217
- "from-value": fromValue.value,
3218
- "onUpdate:fromValue": [
3219
- _cache[0] || (_cache[0] = ($event) => fromValue.value = $event),
3220
- emitValue
3221
- ],
3222
- "to-value": toValue.value,
3223
- "onUpdate:toValue": [
3224
- _cache[1] || (_cache[1] = ($event) => toValue.value = $event),
3225
- emitValue
3226
- ],
3227
- "disabled-from": __props.disabled,
3228
- "disabled-to": __props.disabled,
3229
- "display-format": __props.displayFormat,
3230
- "id-from": __props.idFrom,
3231
- "id-to": __props.idTo,
3232
- "name-from": __props.nameFrom,
3233
- "name-to": __props.nameTo,
3234
- "popup-display-format": __props.popupDisplayFormat,
3235
- "popup-end-year": __props.popupEndYear,
3236
- "popup-start-year": __props.popupStartYear,
3237
- resolution: __props.resolution,
3238
- "time-zone": __props.timeZone,
3239
- "validate-date-order": false,
3240
- width: __props.width,
3241
- "hide-extra-date": ""
3242
- }, null, 8, ["from-value", "to-value", "disabled-from", "disabled-to", "display-format", "id-from", "id-to", "name-from", "name-to", "popup-display-format", "popup-end-year", "popup-start-year", "resolution", "time-zone", "width"]);
3243
- };
3244
- }
3245
- });
3246
3276
  exports2.AbstractFilter = AbstractFilter;
3247
3277
  exports2.AndFilter = AndFilter;
3248
- exports2.BSDateRangeFilter = _sfc_main;
3249
- exports2.BSDateRangeFilters = _sfc_main$2;
3278
+ exports2.BSDateRangeFilter = _sfc_main$2;
3279
+ exports2.BSDateRangeFilters = _sfc_main$1;
3250
3280
  exports2.BSDateRangePresets = _sfc_main$3;
3251
3281
  exports2.BSGrid = _sfc_main$7;
3252
3282
  exports2.BSGridCell = _sfc_main$d;
@@ -3260,7 +3290,7 @@
3260
3290
  exports2.BSGridHeaderCellCheckbox = _sfc_main$f;
3261
3291
  exports2.BSGridHeaderCellResizeHandle = BSGridHeaderCellResizeHandle;
3262
3292
  exports2.BSGridHeaderCellSerialNo = BSGridHeaderCellSerialNo;
3263
- exports2.BSGridLookup = _sfc_main$1;
3293
+ exports2.BSGridLookup = _sfc_main;
3264
3294
  exports2.BSGridRow = _sfc_main$8;
3265
3295
  exports2.BSTextFilter = _sfc_main$4;
3266
3296
  exports2.BetweenDateFilter = BetweenDateFilter;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Vue Data Grid Component for Management Console.",
4
4
  "license": "Proprietary",
5
5
  "private": false,
6
- "version": "1.0.0-alpha.1",
6
+ "version": "1.0.0-alpha.2",
7
7
  "type": "module",
8
8
  "engines": {
9
9
  "node": ">= 24.3.0"
@@ -39,7 +39,7 @@
39
39
  "dayjs": "^1.11.19",
40
40
  "tslib": "^2.8.1",
41
41
  "vue": "^3.5.22",
42
- "@g1cloud/open-bluesea-core": "1.0.0-alpha.6"
42
+ "@g1cloud/open-bluesea-core": "1.0.0-alpha.8"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@g1cloud/open-bluesea-core": "^1.0.0",