@maxax/ui 1.1.14 → 1.1.16

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/index.mjs CHANGED
@@ -7347,6 +7347,38 @@ const basicCheckboxGroupProps = {
7347
7347
  type: Number,
7348
7348
  required: false
7349
7349
  },
7350
+ /**
7351
+ * @zh 值变更回调(受控、非受控通用)
7352
+ * @en Value change callback
7353
+ */
7354
+ onChange: {
7355
+ type: Function,
7356
+ default: void 0
7357
+ },
7358
+ /**
7359
+ * @zh 受控更新回调(等价于 onUpdate:value)
7360
+ * @en Controlled update callback
7361
+ */
7362
+ onUpdateValue: {
7363
+ type: Function,
7364
+ default: void 0
7365
+ },
7366
+ /**
7367
+ * @zh v-model 语法糖事件
7368
+ * @en v-model syntax sugar event
7369
+ */
7370
+ "onUpdate:value": {
7371
+ type: Function,
7372
+ default: void 0
7373
+ },
7374
+ /**
7375
+ * @zh 全选时触发(回调新值与事件)
7376
+ * @en Triggered on select all
7377
+ */
7378
+ onAllChange: {
7379
+ type: Function,
7380
+ default: void 0
7381
+ },
7350
7382
  /**
7351
7383
  * @zh 选项
7352
7384
  * @en Options
@@ -7438,15 +7470,7 @@ const BasicCheckboxGroup = /* @__PURE__ */ defineComponent({
7438
7470
  name: "XBasicCheckboxGroup",
7439
7471
  props: basicCheckboxGroupProps,
7440
7472
  emits: {
7441
- "update:value": (_value) => true,
7442
- "all-change": (_value, _ev) => true,
7443
- /**
7444
- * @zh 值改变时触发
7445
- * @en Trigger when the value changes
7446
- * @param {(string | number | boolean)[]} _value
7447
- * @param {Event} _ev
7448
- */
7449
- change: (_value, _ev) => true
7473
+ "update:value": (_value) => true
7450
7474
  },
7451
7475
  setup(props, {
7452
7476
  emit,
@@ -7502,16 +7526,27 @@ const BasicCheckboxGroup = /* @__PURE__ */ defineComponent({
7502
7526
  indeterminate.value = checkedOptions > 0 && checkedOptions < totalOptions;
7503
7527
  };
7504
7528
  const handleChange = (value, e) => {
7529
+ if (props.disabled) return;
7505
7530
  $value.value = value;
7506
7531
  updateAllChecked();
7532
+ const {
7533
+ onChange,
7534
+ onUpdateValue,
7535
+ "onUpdate:value": _onUpdateValue
7536
+ } = props;
7537
+ if (onChange) call(onChange, value, e);
7538
+ if (onUpdateValue) call(onUpdateValue, value, e);
7539
+ if (_onUpdateValue) call(_onUpdateValue, value, e);
7507
7540
  emit("update:value", value);
7508
- emit("change", value, e);
7509
7541
  };
7510
7542
  const handleSelectAll = (value, e) => {
7511
7543
  allChecked.value = value;
7512
7544
  const newValue = allChecked.value ? options.value.map((option) => option.value) : [];
7513
7545
  handleChange(newValue, e);
7514
- emit("all-change", newValue, e);
7546
+ const {
7547
+ onAllChange
7548
+ } = props;
7549
+ if (onAllChange) call(onAllChange, newValue, e);
7515
7550
  };
7516
7551
  const cls = computed(() => [b(), is(`direction-${props.direction}`)]);
7517
7552
  watch(() => props.searchInfo, () => {
@@ -7615,8 +7650,11 @@ const BasicCheckboxGroup = /* @__PURE__ */ defineComponent({
7615
7650
  async function reload(opt) {
7616
7651
  return await fetch2(opt);
7617
7652
  }
7618
- expose({
7653
+ const checkboxGroupActionType = {
7619
7654
  reload
7655
+ };
7656
+ expose({
7657
+ ...checkboxGroupActionType
7620
7658
  });
7621
7659
  return () => {
7622
7660
  var _a;
@@ -8993,8 +9031,11 @@ const BasicRadioGroup = /* @__PURE__ */ defineComponent({
8993
9031
  async function reload(opt) {
8994
9032
  return await fetch2(opt);
8995
9033
  }
8996
- expose({
9034
+ const radioGroupActionType = {
8997
9035
  reload
9036
+ };
9037
+ expose({
9038
+ ...radioGroupActionType
8998
9039
  });
8999
9040
  return () => {
9000
9041
  var _a;
@@ -9110,9 +9151,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
9110
9151
  function getSearchInfo() {
9111
9152
  return searchInfoRef.value;
9112
9153
  }
9113
- __expose({
9154
+ const selectActionType = {
9114
9155
  reload,
9115
9156
  getSearchInfo
9157
+ };
9158
+ __expose({
9159
+ ...selectActionType
9116
9160
  });
9117
9161
  return (_ctx, _cache) => {
9118
9162
  return openBlock(), createBlock(unref(NSelect), mergeProps(computedProps.value, {
@@ -10856,6 +10900,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
10856
10900
  setFormModel: props.setFormModel,
10857
10901
  formActionType: props.formActionType
10858
10902
  };
10903
+ if (props.schema.ref) {
10904
+ compAttr.ref = props.schema.ref;
10905
+ }
10859
10906
  if (customRenderComponent && isFunction(customRenderComponent)) {
10860
10907
  return createVNode(customRenderComponent, compAttr, null);
10861
10908
  }